/* ============================================================
   WULFRIC STUDIOS — base: reset, typography, utilities, motion
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

html.native-scroll { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, canvas, video { display: block; max-width: 100%; }

[hidden] { display: none !important; }

input, button, textarea, select { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

::selection { background: rgba(139, 124, 246, .35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- scrollbar (subtle) ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
  background: rgba(233, 230, 221, .14);
  border-radius: 99px;
  border: 3px solid var(--void);
}
::-webkit-scrollbar-thumb:hover { background: rgba(233, 230, 221, .26); }

/* ---- fixed atmosphere layers ---- */
#sky,
#nebula {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: .032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress-hairline {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.progress-hairline span {
  display: block;
  height: 100%;
  background: var(--aurora);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: .8;
}

/* ---- smooth-scroll wrapper ----
   JS promotes .smooth to position:fixed and translates it;
   without JS it's a plain block. */
.smooth { position: relative; z-index: 1; }
html.smooth-on .smooth {
  position: fixed;
  top: 0; left: 0; right: 0;
  will-change: transform;
}

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

section { padding-block: var(--section); position: relative; }

.section-label {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-label::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--teal), transparent);
}

.section-head { margin-bottom: clamp(3rem, 7vw, 5.5rem); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

h1 em, h2 em, p em {
  font-style: italic;
  font-weight: 350;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: .75rem; left: .75rem;
  z-index: 200;
  padding: .6rem 1rem;
  background: var(--ink-2);
  border: 1px solid var(--hairline-strong);
  border-radius: .5rem;
  font-size: var(--fs-small);
  transform: translateY(-300%);
  transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ============================================================
   Reveal system — elements hidden only when JS is available
   ============================================================ */

html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition:
    opacity var(--reveal-dur) var(--ease-out) var(--d, 0s),
    transform var(--reveal-dur) var(--ease-out) var(--d, 0s),
    filter var(--reveal-dur) var(--ease-out) var(--d, 0s);
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* masked line reveals (headlines, manifesto) */
.line { display: block; overflow: hidden; padding-block: .06em; }
.line > span { display: block; }
html.js .line > span {
  transform: translateY(115%);
  transition: transform var(--line-dur) var(--ease-out) var(--d, 0s);
}
html.js .line.is-visible > span,
html.js .is-visible .line > span { transform: translateY(0); }

/* ============================================================
   Reduced motion — static, instant, native
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js .line > span {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html.native-scroll { scroll-behavior: auto; }
}
