:root {
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --accent: #4f7d8a;
  --accent-light: #6b9aa8;
  --accent-dark: #3a5f6a;
  --deep: #2d4a54;
  --deeper: #1e3a42;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --wrap: 1100px;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--font);
  color: var(--slate-700);
  background: var(--slate-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.work, .contact {
  background: linear-gradient(var(--slate-300), var(--slate-300)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Bar */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 10;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.bar--solid {
  background: rgba(248, 250, 252, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .06);
}
.bar__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.mark { font-weight: 600; letter-spacing: -.01em; color: var(--slate-900); text-decoration: none; }
.bar nav { display: flex; gap: 28px; }
.bar nav a { font-size: .875rem; color: var(--slate-500); text-decoration: none; transition: color .2s; }
.bar nav a:hover { color: var(--accent); }

/* Opening */
.opening {
  min-height: 92vh;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center; gap: 32px;
  padding-top: 96px; padding-bottom: 48px;
}
.kicker { font-size: .875rem; color: var(--accent); font-weight: 500; margin-bottom: 20px; }
.opening h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.04; letter-spacing: -.035em; font-weight: 600;
  color: var(--slate-900);
  max-width: 13ch;
}
.lede { margin-top: 28px; font-size: 1.15rem; max-width: 34em; color: var(--slate-500); }

.opening__text > * { animation: settle 1.1s var(--ease) both; }
.opening__text > :nth-child(2) { animation-delay: .08s; }
.opening__text > :nth-child(3) { animation-delay: .16s; }
@keyframes settle { from { opacity: 0; transform: translateY(14px); } }

.sky { width: 100%; height: auto; overflow: visible; }
.sky__nebula { transform-origin: 230px 190px; animation: drift 24s ease-in-out infinite alternate, appear 2.4s var(--ease) both; }
.sky__star { fill: var(--slate-500); opacity: var(--o); animation: twinkle 6s ease-in-out var(--d) infinite; }
.sky__line {
  fill: none; stroke: var(--accent); stroke-width: 1; opacity: .7;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: trace 2.8s var(--ease) .6s forwards;
}
.sky__node { fill: var(--slate-900); }
@keyframes drift { to { transform: scale(1.08) rotate(3deg); } }
@keyframes appear { from { opacity: 0; } }
@keyframes twinkle { 50% { opacity: calc(var(--o) * .35); } }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* Labels */
.label {
  font-size: .8rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate-500); margin-bottom: 40px;
}
.label--dark { color: var(--accent-light); }

/* Work */
.work { padding-top: 96px; padding-bottom: 128px; }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; max-width: 900px; }
.work h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; color: var(--slate-900); margin-bottom: 12px; }
.work p { color: var(--slate-500); }

/* Process */
.process {
  background: linear-gradient(180deg, var(--deeper) 0%, var(--slate-900) 100%);
  color: var(--slate-300);
  padding: 128px 0 64px;
}
.process__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; }
.process__rail { position: sticky; top: 120px; align-self: start; }
.rail { list-style: none; border-left: 1px solid rgba(203, 213, 225, .18); }
.rail li {
  position: relative; padding: 8px 0 8px 20px;
  font-size: 1rem; color: rgba(203, 213, 225, .45);
  transition: color .4s var(--ease);
}
.rail li::before {
  content: attr(data-step); display: inline-block; width: 1.6em;
  font-variant-numeric: tabular-nums; color: inherit;
}
.rail li::after {
  content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px;
  background: var(--accent-light); transform: scaleY(0); transition: transform .4s var(--ease);
}
.rail li.is-current { color: #fff; }
.rail li.is-current::after { transform: scaleY(1); }

.stage { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.stage .stage__num {
  font-size: clamp(4rem, 9vw, 7rem); font-weight: 600; line-height: 1;
  letter-spacing: -.05em; color: rgba(107, 154, 168, .28); margin-bottom: 12px;
}
.stage h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -.025em; color: #fff; margin-bottom: 14px; }
.stage h3 small { font-size: .8rem; font-weight: 500; letter-spacing: .04em; color: var(--accent-light); margin-left: 10px; vertical-align: middle; }
.stage p { max-width: 34em; font-size: 1.08rem; }
.stage__out { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(203, 213, 225, .14); color: #fff; }
.stage__out span { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-light); margin-bottom: 4px; }

/* Rules */
.rules { padding-top: 128px; padding-bottom: 96px; }
.rules__list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; counter-reset: rule; }
.rules__list li {
  counter-increment: rule; padding: 20px 0; border-top: 1px solid var(--slate-300);
  font-size: 1.1rem; color: var(--slate-900);
}
.rules__list li::before {
  content: counter(rule, decimal-leading-zero); display: block;
  font-size: .75rem; color: var(--accent); margin-bottom: 4px; font-variant-numeric: tabular-nums;
}
.fit { margin-top: 64px; max-width: 40em; font-size: 1.1rem; color: var(--slate-500); }

/* Contact */
.contact { padding-top: 96px; padding-bottom: 128px; }
.contact h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 600;
  color: var(--slate-900); max-width: 18ch; margin-bottom: 48px;
}
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; max-width: 760px; }
.form label { display: flex; flex-direction: column; gap: 8px; font-size: .85rem; color: var(--slate-500); }
.form__wide { grid-column: 1 / -1; }
.form input, .form textarea {
  font: inherit; font-size: 1rem; color: var(--slate-900);
  background: transparent; border: 0; border-bottom: 1px solid var(--slate-300);
  padding: 8px 0; border-radius: 0; resize: vertical;
  transition: border-color .25s var(--ease);
}
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.form button {
  justify-self: start; font: inherit; font-weight: 500; cursor: pointer;
  color: #fff; background: var(--slate-900); border: 0; border-radius: 999px; padding: 12px 28px;
  transition: background .25s var(--ease);
}
.form button:hover { background: var(--accent-dark); }
.form__trap { position: absolute; left: -9999px; }

/* Footer */
.foot { border-top: 1px solid var(--slate-300); font-size: .85rem; color: var(--slate-500); }
.foot__inner { display: flex; gap: 24px; padding-top: 24px; padding-bottom: 32px; }

/* Consent */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20;
  max-width: 520px; margin-left: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-radius: 14px;
  background: rgba(15, 23, 42, .92); color: var(--slate-100); font-size: .9rem;
  backdrop-filter: blur(10px);
}
.consent[hidden] { display: none; }
.consent div { display: flex; gap: 8px; flex-shrink: 0; }
.consent button { font: inherit; font-size: .85rem; cursor: pointer; border-radius: 999px; padding: 6px 14px; border: 1px solid rgba(203, 213, 225, .3); background: transparent; color: inherit; }
.consent #cookie-accept { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Scroll reveals */
@supports (animation-timeline: view()) {
  .reveal, .stage > * {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
  @keyframes rise { from { opacity: 0; transform: translateY(28px); } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sky__line { stroke-dashoffset: 0; }
}

@media (max-width: 860px) {
  .opening { grid-template-columns: 1fr; min-height: auto; padding-top: 120px; }
  .sky { max-width: 360px; justify-self: center; }
  .work__grid { grid-template-columns: 1fr; gap: 36px; }
  .process__inner { grid-template-columns: 1fr; gap: 0; }
  .process__rail { position: static; }
  .rail { display: none; }
  .stage { min-height: auto; padding: 40px 0; }
  .rules__list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  :root { --gutter: 16px; }
  .bar nav { gap: 18px; }
  .form { grid-template-columns: 1fr; }
  .consent { flex-direction: column; align-items: stretch; }
}
