/* ══ Timberline — foundation ═══════════════════════════════════════════════
   Tokens, reset, ambient backdrop, typography, rail, page frame.
   Accent colour is driven by a single --hue per surface so every gradient in
   the product is generated from the same formula instead of hand-picked.
   ════════════════════════════════════════════════════════════════════════ */

@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --sweep { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
/* registering the hue lets the whole palette cross-fade when a view changes */
@property --hue { syntax: '<number>'; inherits: true; initial-value: 44; }

html { transition: --hue .9s cubic-bezier(.22, .78, .3, 1); }

:root {
  --void:      #050806;
  --bark-900:  #090e0b;
  --bark-800:  #0d1410;
  --bark-700:  #121b16;
  --bark-600:  #18231d;
  --bark-500:  #21302a;

  --bone:      #eaf3ec;
  --fog:       #93a89b;
  --fog-dim:   #667a6e;

  --line:      color-mix(in oklab, var(--bone) 10%, transparent);
  --line-soft: color-mix(in oklab, var(--bone) 6%, transparent);

  --hue: 44;
  --up:   oklch(78% .17 152);
  --down: oklch(68% .19 22);

  --shell: min(1520px, 100%);
  --rail: 74px;
  --pad: clamp(18px, 3.4vw, 48px);

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --r-xl: 34px;

  --ease: cubic-bezier(.22, .78, .3, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: linear(0,.36 5.4%,.65 11%,.87 16.9%,1.02 23.2%,1.08 29.9%,1.09 37.2%,1.05 45.4%,1 61.3%,.99 77%,1);

  --t-fast: .18s;
  --t: .38s;
  --t-slow: .72s;

  --shadow-card: 0 1px 0 color-mix(in oklab, var(--bone) 7%, transparent) inset,
                 0 22px 48px -28px #000, 0 3px 12px -6px #000;

  --font-display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}

/* The accent ramp is re-derived on every element rather than once on :root, so
   that any surface can set its own --hue and have the whole ramp follow it.
   Declared at :root the value would be substituted a single time and inherited
   as a fixed colour, ignoring child overrides. */
*, *::before, *::after {
  box-sizing: border-box;
  --accent:      oklch(80% .15 var(--hue));
  --accent-2:    oklch(72% .17 calc(var(--hue) + 46));
  --accent-3:    oklch(66% .14 calc(var(--hue) - 38));
  --accent-ink:  oklch(96% .04 var(--hue));
  --accent-wash: oklch(80% .15 var(--hue) / .12);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--void);
  color: var(--bone);
  font: 400 16px/1.6 var(--font-ui);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.06; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
svg { display: block; }

::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); color: #fff; }

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

/* ── custom scrollbar ─────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--bark-500) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--bark-500), var(--bark-600));
  border: 3px solid var(--void);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--accent-3), var(--bark-500)); }

/* ══ ambient backdrop ════════════════════════════════════════════════════ */
.aurora, .motes, .grain, .beam { position: fixed; inset: 0; pointer-events: none; }
.aurora { z-index: -4; filter: blur(0px); }
.aurora i {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--s); aspect-ratio: 1;
  margin: calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    oklch(62% .17 var(--h) / .34), oklch(58% .16 var(--h) / .12) 42%, transparent 68%);
  filter: blur(46px);
  animation: drift var(--d) var(--ease) infinite alternate;
  will-change: transform;
}
.aurora i:nth-child(even) { animation-direction: alternate-reverse; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  33%  { transform: translate3d(6vw, -5vh, 0) scale(1.14); }
  66%  { transform: translate3d(-5vw, 4vh, 0) scale(.92); }
  100% { transform: translate3d(3vw, 6vh, 0) scale(1.08); }
}

.motes { z-index: -3; width: 100%; height: 100%; opacity: .5; }

/* a slow vertical light shaft, like sun through a canopy */
.beam {
  z-index: -2;
  background:
    linear-gradient(104deg, transparent 34%,
      color-mix(in oklab, var(--accent) 7%, transparent) 46%,
      transparent 58%);
  mask-image: linear-gradient(#000, transparent 78%);
  animation: beam 26s var(--ease) infinite alternate;
}
@keyframes beam { from { transform: translateX(-14%); opacity: .5 } to { transform: translateX(14%); opacity: 1 } }

.grain {
  z-index: -1;
  opacity: .32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  animation: grain 5s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) }
  16% { transform: translate(-3%, 2%) }  33% { transform: translate(2%, -3%) }
  50% { transform: translate(-2%, -2%) } 66% { transform: translate(3%, 1%) }
  83% { transform: translate(1%, 3%) }
}

/* the vignette that keeps the corners honest */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, #000c 100%);
}

.pointer-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 460px; aspect-ratio: 1;
  margin: -230px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-wash), transparent 62%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  will-change: transform;
}
body.pointer-live .pointer-glow { opacity: .75; }

/* ══ boot curtain ════════════════════════════════════════════════════════ */
.boot {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--void);
  transition: opacity .5s var(--ease), visibility .5s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__mark { color: var(--accent); }
.boot__axe { width: 54px; height: 54px; animation: chop 1.5s var(--ease) infinite; transform-origin: 78% 26%; }
@keyframes chop {
  0%, 100% { transform: rotate(-16deg) }
  45% { transform: rotate(14deg) }
  60% { transform: rotate(10deg) }
}
.boot__bar { width: 168px; height: 3px; border-radius: 99px; background: var(--bark-600); overflow: hidden; }
.boot__bar i {
  display: block; height: 100%; width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  animation: slide 1.2s var(--ease) infinite;
}
@keyframes slide { from { transform: translateX(-120%) } to { transform: translateX(320%) } }
.boot__label { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fog-dim); }

/* ══ rail ════════════════════════════════════════════════════════════════ */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
  width: var(--rail);
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0 18px;
  gap: 8px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bark-800) 92%, transparent), color-mix(in oklab, var(--void) 92%, transparent));
  backdrop-filter: blur(14px) saturate(1.3);
  border-right: 1px solid var(--line-soft);
}
.rail__brand {
  display: grid; place-items: center;
  width: 42px; height: 42px; margin-bottom: 12px;
  color: var(--accent);
  border-radius: 13px;
  background: radial-gradient(circle at 30% 25%, var(--accent-wash), transparent 70%);
  transition: transform .55s var(--spring), color var(--t) var(--ease);
}
.rail__brand svg { width: 26px; height: 26px; }
.rail__brand:hover { transform: rotate(-14deg) scale(1.1); }

.rail__group { position: relative; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rail__ind {
  position: absolute; left: -14px; top: 0;
  width: 3px; height: 46px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px 1px var(--accent);
  transition: transform .5s var(--spring), height .4s var(--ease);
}
.rail__btn {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  color: var(--fog-dim);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), transform .5s var(--spring);
}
.rail__btn svg { width: 22px; height: 22px; transition: transform .5s var(--spring); }
.rail__btn:hover { color: var(--bone); background: color-mix(in oklab, var(--bone) 6%, transparent); }
.rail__btn:hover svg { transform: translateY(-2px) scale(1.06); }
.rail__btn.is-on { color: var(--accent-ink); background: var(--accent-wash); }

.rail__out {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 13px;
  color: var(--fog-dim);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), transform .5s var(--spring);
}
.rail__out svg { width: 21px; height: 21px; }
.rail__out:hover { color: #c7d2ff; background: color-mix(in oklab, #7d8cff 14%, transparent); transform: translateY(-2px); }

/* ══ page frame ══════════════════════════════════════════════════════════ */
.stage {
  position: relative; z-index: 1;
  margin-left: var(--rail);
  padding: clamp(26px, 4vw, 56px) var(--pad) 0;
  min-height: 100svh;
  display: flex; flex-direction: column;
}
.view { display: none; width: var(--shell); margin-inline: auto; flex: 1; }
.view.is-live { display: block; animation: viewIn .58s var(--ease-out) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(18px) scale(.994); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.h1 { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.035em; }
.h2 { font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.028em; }
.muted { color: var(--fog); font-size: 14.5px; }
.viewhead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding-bottom: 22px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.viewhead .muted { margin-top: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fog);
}
.eyebrow i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent) }
  70% { box-shadow: 0 0 0 9px transparent }
  100% { box-shadow: 0 0 0 0 transparent }
}

/* ══ hero ════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: clamp(20px, 5vw, 70px) 0 clamp(30px, 5vw, 64px);
}
.hero__title {
  font-size: clamp(58px, 12vw, 152px);
  font-weight: 800;
  letter-spacing: -.055em;
  margin: 18px 0 22px;
  display: flex; flex-wrap: wrap;
}
.hero__title .word { display: block; animation: rise .95s var(--ease-out) both; animation-delay: calc(var(--i) * .09s + .1s); }
@keyframes rise {
  from { opacity: 0; transform: translateY(.34em) rotate(2deg); filter: blur(12px); }
  to { opacity: 1; transform: none; filter: none; }
}
.grad {
  background: linear-gradient(96deg, var(--accent) 8%, var(--accent-2) 52%, var(--accent-3) 96%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: rise .95s var(--ease-out) both, hueSlide 9s var(--ease) infinite alternate;
}
@keyframes hueSlide { from { background-position: 0% 50% } to { background-position: 100% 50% } }

.hero__sub { max-width: 54ch; color: var(--fog); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.68; animation: rise 1s var(--ease-out) .34s both; }
.hero__sub em { color: var(--bone); font-style: normal; font-weight: 600; }
.hero__cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; animation: rise 1s var(--ease-out) .44s both; }

.hero__art { position: relative; aspect-ratio: 1; min-height: 300px; }
.hero__art .orbit {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.hero__art .ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--line-soft);
  inset: var(--in);
  animation: spin var(--sp) linear infinite;
}
.hero__art .ring::before {
  content: ''; position: absolute; top: -3px; left: 50%;
  width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
@keyframes spin { to { transform: rotate(360deg) } }
.hero__art .piece {
  position: absolute;
  width: var(--w); aspect-ratio: 1;
  left: var(--l); top: var(--t);
  translate: -50% -50%;
  animation: float 7s var(--ease) infinite alternate;
  animation-delay: var(--dl);
  filter: drop-shadow(0 12px 24px #000a);
}
.hero__art .piece img { width: 100%; height: 100%; object-fit: contain; }
.hero__art .core {
  width: 42%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--accent-wash), transparent 66%);
  filter: blur(8px);
  animation: breathe 6s var(--ease) infinite alternate;
}
@keyframes breathe { from { transform: scale(.9); opacity: .7 } to { transform: scale(1.14); opacity: 1 } }
@keyframes float { from { translate: -50% -54% } to { translate: -50% -46% } }

/* ══ footer ══════════════════════════════════════════════════════════════ */
.foot {
  width: var(--shell); margin: 72px auto 0;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  color: var(--fog-dim); font-size: 13px;
}
.foot__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--bark-500); }
.foot a { color: var(--fog); border-bottom: 1px solid var(--line); transition: color var(--t) var(--ease), border-color var(--t) var(--ease); }
.foot a:hover { color: var(--accent); border-color: var(--accent); }

/* ══ responsive ══════════════════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { order: -1; min-height: 230px; max-width: 420px; margin-inline: auto; width: 100%; }
}

@media (max-width: 760px) {
  :root { --rail: 0px; }
  .stage { padding-bottom: 96px; }
  .rail {
    inset: auto 0 0 0; top: auto;
    width: auto; height: 68px;
    flex-direction: row; justify-content: space-between;
    padding: 0 12px;
    border-right: 0; border-top: 1px solid var(--line);
  }
  .rail__brand { display: none; }
  .rail__group { flex-direction: row; gap: 2px; justify-content: space-around; }
  .rail__ind { left: 0; top: auto; bottom: 6px; width: 46px; height: 3px; border-radius: 4px; }
  .rail__btn { width: 44px; height: 46px; }
  .foot { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .grain, .beam, .motes { display: none; }
}
