/* ==========================================================================
   Worklow — base layer
   1. Tokens   2. Reset   3. Typography   4. Buttons   5. Utilities
   6. Atmosphere (grain, aurora)   7. Motion primitives
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg:        #0a0a0a;
  --bg-2:      #111111;
  --bg-3:      #161618;
  --bg-card:   #131315;

  /* ink */
  --ink:       #f5f3ee;
  --ink-2:     rgba(245, 243, 238, .58);
  --ink-3:     rgba(245, 243, 238, .34);
  --ink-4:     rgba(245, 243, 238, .16);

  /* lines */
  --line:      rgba(245, 243, 238, .10);
  --line-2:    rgba(245, 243, 238, .18);

  /* accent — one family only */
  --acc:       #5b5fff;
  --acc-2:     #715cff;
  --acc-3:     #3d5afe;
  --acc-soft:  rgba(91, 95, 255, .16);
  --grad:      linear-gradient(120deg, #3d5afe 0%, #5b5fff 48%, #715cff 100%);
  --grad-text: linear-gradient(100deg, #f5f3ee 18%, #a9b0ff 58%, #715cff 100%);

  /* type */
  --display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* rhythm */
  --wrap:  1280px;
  --pad:   clamp(20px, 4vw, 48px);
  --nav-h: 74px;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 40px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* 2. Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}
/* Lenis drives the scrolling; this stays as the no-JS / reduced-motion fallback */
html:not(.lenis) { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

::selection { background: var(--acc); color: #fff; }

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

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 300;
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: var(--r-sm); font-weight: 500;
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 16px; }

/* 3. Typography ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.035em;
  margin: 0;
  text-wrap: balance;
}

.d1 { font-size: clamp(3.1rem, 11vw, 9.5rem); letter-spacing: -.05em; }
.d2 { font-size: clamp(2.5rem, 7.4vw, 6.2rem);  letter-spacing: -.045em; }
.d3 { font-size: clamp(2rem, 4.6vw, 3.6rem);    letter-spacing: -.04em; }
.d4 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); letter-spacing: -.03em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.lead   { font-size: clamp(1.05rem, 1.55vw, 1.28rem); color: var(--ink-2); }
.muted  { color: var(--ink-3); }
.tnum   { font-variant-numeric: tabular-nums; }

/* section label */
.kicker {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--display);
  font-size: .72rem; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-3);
}
.kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc); box-shadow: 0 0 14px 2px rgba(91, 95, 255, .85);
  flex: none;
}
.kicker.no-dot::before { display: none; }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* index numbers used across sections */
.idx {
  font-family: var(--display);
  font-size: .78rem; font-weight: 500;
  letter-spacing: .2em; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* 4. Buttons --------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #0a0a0a;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px;
  font-family: var(--display);
  font-size: .95rem; font-weight: 500; letter-spacing: -.01em;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  cursor: pointer; white-space: nowrap;
  transition: transform .3s var(--ease), background .3s var(--ease),
              color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-bg: var(--grad); --btn-fg: #fff;
  background-image: var(--grad);
  box-shadow: 0 14px 40px -14px rgba(91, 95, 255, .85);
}
.btn-primary:hover { box-shadow: 0 22px 56px -16px rgba(91, 95, 255, 1); }

.btn-light { --btn-bg: var(--ink); --btn-fg: #0a0a0a; }
.btn-light:hover { background: #fff; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(245, 243, 238, .05); }

.btn-sm { padding: 11px 20px; font-size: .87rem; }
.btn-lg { padding: 18px 34px; font-size: 1rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* small arrow that nudges on hover */
.btn .arw { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

/* 5. Utilities ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.wrap-wide { max-width: 1560px; }
.wrap-tight { max-width: 900px; }

.section { position: relative; padding: clamp(88px, 12vh, 160px) 0; }
.section-2 { background: var(--bg-2); }

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

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

/* 6. Atmosphere ------------------------------------------------------------ */
/* film grain — one fixed layer, cheap, gives the whole site a photographic feel */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* soft light that follows the page — set with --ax/--ay from JS, defaults are safe */
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 480px at var(--ax, 22%) var(--ay, 14%), rgba(91, 95, 255, .17), transparent 64%),
    radial-gradient(520px 420px at 84% 78%, rgba(113, 92, 255, .13), transparent 62%);
  transition: background-position .6s linear;
}

/* thin hairline grid, used behind a few sections */
.grid-lines {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 110px 110px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 78%);
  opacity: .6;
}

/* everything above the atmosphere */
.site { position: relative; z-index: 2; }

/* 7. Motion primitives ----------------------------------------------------- */
/* A masked line: the inner span is what moves. i18n writes into the inner span,
   so translating a heading never breaks the animation. */
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line > span { display: block; will-change: transform; }

/* Generic "appear" element driven by GSAP; CSS holds the start state so there
   is no flash before JS runs. .no-js / reduced motion resets it. */
[data-anim] { opacity: 0; }
[data-anim="up"]    { transform: translateY(34px); }
[data-anim="fade"]  { transform: none; }
[data-anim="scale"] { transform: scale(.96); }
[data-anim="left"]  { transform: translateX(-30px); }
[data-anim="right"] { transform: translateX(30px); }

.no-js [data-anim], .reduced [data-anim] { opacity: 1 !important; transform: none !important; }
.no-js .line > span, .reduced .line > span { transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  html:not(.lenis) { scroll-behavior: auto; }
  [data-anim] { opacity: 1 !important; transform: none !important; }
  .line > span { transform: none !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
