/* ==========================================================================
   Poison Studio Design System — Base / Reset
   Dark-first, bold, experimental
   ========================================================================== */

/* -----------------------------------------------------------------------
   Reset
   ----------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--ps-font-body);
  font-size: var(--ps-font-base);
  font-weight: var(--ps-weight-regular);
  line-height: var(--ps-leading-normal);
  color: var(--ps-text-primary);
  background-color: var(--ps-bg-primary);
  overflow-x: hidden;
}

/* -----------------------------------------------------------------------
   Selection — Sage green accent
   ----------------------------------------------------------------------- */
::selection {
  background-color: var(--ps-accent);
  color: var(--ps-black);
}

::-moz-selection {
  background-color: var(--ps-accent);
  color: var(--ps-black);
}

/* -----------------------------------------------------------------------
   Scrollbar — Custom dark with sage green thumb
   ----------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: var(--ps-scrollbar-width);
}

::-webkit-scrollbar-track {
  background: var(--ps-bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--ps-text-muted);
  border-radius: var(--ps-scrollbar-radius);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ps-accent);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--ps-text-muted) var(--ps-bg-surface);
}

/* -----------------------------------------------------------------------
   Focus
   ----------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--ps-accent);
  outline-offset: 3px;
}

/* -----------------------------------------------------------------------
   Media
   ----------------------------------------------------------------------- */
img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* -----------------------------------------------------------------------
   Links
   ----------------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ps-duration-fast) var(--ps-ease-out);
}

a:hover {
  color: var(--ps-accent);
}

/* -----------------------------------------------------------------------
   Interactive Reset
   ----------------------------------------------------------------------- */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

/* -----------------------------------------------------------------------
   Typography — Headings
   ----------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ps-font-heading);
  font-weight: var(--ps-weight-bold);
  line-height: var(--ps-leading-tight);
  color: var(--ps-text-primary);
  letter-spacing: var(--ps-tracking-tight);
}

h1 {
  font-size: var(--ps-font-4xl);
}

h2 {
  font-size: var(--ps-font-3xl);
}

h3 {
  font-size: var(--ps-font-2xl);
}

h4 {
  font-size: var(--ps-font-xl);
}

h5 {
  font-size: var(--ps-font-lg);
}

h6 {
  font-size: var(--ps-font-md);
  text-transform: uppercase;
  letter-spacing: var(--ps-tracking-wider);
  font-weight: var(--ps-weight-medium);
}

/* -----------------------------------------------------------------------
   Typography — Body
   ----------------------------------------------------------------------- */
p {
  margin-bottom: var(--ps-space-4);
  line-height: var(--ps-leading-relaxed);
  color: var(--ps-text-secondary);
}

small {
  font-size: var(--ps-font-xs);
}

strong {
  font-weight: var(--ps-weight-semibold);
  color: var(--ps-text-primary);
}

em {
  font-style: italic;
}

code {
  font-family: var(--ps-font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background-color: var(--ps-bg-subtle);
  border-radius: var(--ps-radius-sm);
  color: var(--ps-accent);
}

/* -----------------------------------------------------------------------
   Container
   ----------------------------------------------------------------------- */
.ps-container {
  width: 100%;
  max-width: var(--ps-container-max);
  margin-inline: auto;
  padding-inline: var(--ps-container-padding);
}

.ps-container--narrow {
  max-width: var(--ps-container-narrow);
}

/* -----------------------------------------------------------------------
   Scroll-Snap Full-Page Layout
   ----------------------------------------------------------------------- */
.ps-snap-container {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--ps-text-muted) var(--ps-bg-surface);
}

.ps-snap-section {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ps-snap-section:last-child {
  min-height: auto;
  scroll-snap-align: end;
}

/* -----------------------------------------------------------------------
   Animations — Base Keyframes
   ----------------------------------------------------------------------- */

/* Fade in up */
@keyframes ps-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in */
@keyframes ps-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale in */
@keyframes ps-scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide reveal (text) — left to right */
@keyframes ps-reveal-ltr {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Glitch shake */
@keyframes ps-glitch-shake {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-3px, 2px); }
  20% { transform: translate(3px, -1px); }
  30% { transform: translate(-2px, -3px); }
  40% { transform: translate(2px, 3px); }
  50% { transform: translate(-1px, -2px); }
  60% { transform: translate(3px, 1px); }
  70% { transform: translate(-3px, -1px); }
  80% { transform: translate(1px, 2px); }
  90% { transform: translate(-2px, 3px); }
}

/* Glitch skew */
@keyframes ps-glitch-skew {
  0%, 100% { transform: skewX(0); }
  20% { transform: skewX(-4deg); }
  40% { transform: skewX(3deg); }
  60% { transform: skewX(-2deg); }
  80% { transform: skewX(4deg); }
}

/* Line expand */
@keyframes ps-line-expand {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Pulse glow */
@keyframes ps-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--ps-glow-accent); }
  50% { box-shadow: 0 0 20px 4px var(--ps-glow-accent); }
}

/* Marquee horizontal */
@keyframes ps-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Rotate */
@keyframes ps-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------
   Animation Utility Classes
   ----------------------------------------------------------------------- */
.ps-animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--ps-duration-reveal) var(--ps-ease-out),
              transform var(--ps-duration-reveal) var(--ps-ease-out);
}

.ps-animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.ps-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--ps-duration-reveal) var(--ps-ease-out),
              transform var(--ps-duration-reveal) var(--ps-ease-out);
}

.ps-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(2) { transition-delay: 100ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(3) { transition-delay: 200ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(4) { transition-delay: 300ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(5) { transition-delay: 400ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(6) { transition-delay: 500ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(7) { transition-delay: 600ms; opacity: 1; transform: translateY(0); }
.ps-stagger.is-visible > *:nth-child(8) { transition-delay: 700ms; opacity: 1; transform: translateY(0); }

/* Text reveal animation */
.ps-text-reveal {
  overflow: hidden;
  display: inline-block;
}

.ps-text-reveal__inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform var(--ps-duration-reveal) var(--ps-ease-out);
}

.ps-text-reveal.is-visible .ps-text-reveal__inner {
  transform: translateY(0);
}

/* -----------------------------------------------------------------------
   Responsive Utilities
   ----------------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  body::-webkit-scrollbar {
    display: none;
  }

  h1 { font-size: var(--ps-font-3xl); }
  h2 { font-size: var(--ps-font-2xl); }
  h3 { font-size: var(--ps-font-xl); }
}
