/* ==========================================================================
   Nocturne — base: tokens, scale, typography, shared components
   Section styles live in css/sections/*.css and only use these tokens.
   ========================================================================== */

:root {
  /* palette */
  --ink: #050505;
  --graphite: #1c1c1b;
  --ash: #c9c6bf;
  --pearl: #efece6;
  --champagne: #e7dcc6;
  --smoke: #7a7772;
  --alert: #e6a28f;      /* form errors */
  --hair: rgba(239, 236, 230, .3);
  --hair-strong: rgba(239, 236, 230, .5);
  --hair-faint: rgba(239, 236, 230, .16);

  /* type */
  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* motion (CSS mirrors of the GSAP eases used in js/core.js) */
  --ease-out: cubic-bezier(.23, 1, .32, 1);      /* ≈ power4.out */
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);   /* ≈ power4.inOut */

  /* layout */
  --gutter: 1.6rem;
  --section-gap: 8rem;

  /* stacking */
  --z-bg: 0;
  --z-page: 1;
  --z-chrome: 50;
  --z-cursor: 9000;
  --z-loader: 10000;
}

/* Root scale: 1rem = 16 / 18 / 20px, then fluid (1.25vw) from 1500px like the reference. */
html { font-size: 16px; }
@media (min-width: 768px)  { html { font-size: 18px; } }
@media (min-width: 1200px) { html { font-size: 20px; } }
@media (min-width: 1500px) { html { font-size: 1.25vw; } }

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

html {
  background: var(--ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--pearl);
  font-family: var(--sans);
  font-size: .8rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 400; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
b, strong { font-weight: inherit; color: var(--champagne); }
i, em { font-style: italic; }

::selection { background: var(--champagne); color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--champagne);
  outline-offset: 4px;
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* --------------------------------------------------------------------------
   Typography primitives
   -------------------------------------------------------------------------- */
.serif { font-family: var(--serif); font-weight: 400; }

/* Uppercase micro label: nav, captions, descriptions, marquee */
.micro {
  font-family: var(--sans);
  font-size: .6rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .02em;
  text-transform: uppercase;
}
@media (max-width: 767.98px) {
  .micro { font-size: .75rem; }
}

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

.skip-link {
  position: fixed;
  top: .8rem; left: 50%;
  z-index: calc(var(--z-loader) + 1);
  padding: .6rem 1rem;
  background: var(--pearl);
  color: var(--ink);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  transform: translate(-50%, -200%);
  transition: transform .4s var(--ease-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: var(--z-page);
  overflow-x: clip;
  transition: opacity .4s linear;
}

body.is-loading .page,
body.is-loading .chrome {
  opacity: 0;
  pointer-events: none;
}

.bg-stage {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s linear;
  pointer-events: none;
}
.bg-stage.is-ready { opacity: 1; }
.bg-stage--fallback {
  opacity: 1;
  background:
    radial-gradient(60% 50% at 70% 35%, rgba(231, 220, 198, .06), transparent 70%),
    radial-gradient(40% 40% at 20% 80%, rgba(239, 236, 230, .035), transparent 70%),
    var(--ink);
}

.grain { display: none; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Reveal baseline — js/core.js animates [data-reveal] elements in. */
.js [data-reveal] { opacity: 0; }
.no-motion [data-reveal] { opacity: 1 !important; transform: none !important; }

/* --------------------------------------------------------------------------
   Starburst
   -------------------------------------------------------------------------- */
.burst { display: block; color: var(--champagne); line-height: 0; }
.burst svg { width: 100%; height: auto; fill: currentColor; }
.burst--xs { width: 3rem; }
.burst--sm { width: 5rem; }
.burst--md { width: 10rem; }
.burst--lg { width: 10rem; }
.burst--spin svg { animation: nct-rotate 10s linear infinite; }
.burst--spin-slow svg { animation: nct-rotate 28s linear infinite; }

@keyframes nct-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Marquee (JS clones the track; two copies tile seamlessly)
   -------------------------------------------------------------------------- */
.marquee {
  --marquee-duration: 30s;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: .6rem;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.marquee__track { display: inline-block; will-change: transform; }
.marquee__item { display: inline-block; margin-right: .4em; }
.marquee.is-animating .marquee__track--a { animation: nct-marquee var(--marquee-duration) linear infinite; animation-delay: calc(var(--marquee-duration) / -2); }
.marquee.is-animating .marquee__track--b { animation: nct-marquee-2 var(--marquee-duration) linear infinite; }
.marquee--reverse.is-animating .marquee__track { animation-direction: reverse; }

@keyframes nct-marquee   { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes nct-marquee-2 { from { transform: translateX(-200%); } to { transform: translateX(0); } }

/* --------------------------------------------------------------------------
   Tearing underline links (hover distortion is driven by js/core.js)
   -------------------------------------------------------------------------- */
.distort-link,
.case__link,
.awards__note-link {
  position: relative;
  display: inline-block;
  transition: color .4s linear;
}
.distort-link::after,
.case__link::after,
.awards__note-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.1em;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: left center;
  transition: transform 1s var(--ease-out), opacity 1s var(--ease-out);
  outline: 120px solid transparent; /* grows the filter region so displaced pixels are not clipped */
  pointer-events: none;
}
.is-distorting::after { filter: url(#distort); }

@media (hover: hover) {
  .distort-link:hover,
  .case__link:hover,
  .awards__note-link:hover { color: var(--champagne); }
  .distort-link:hover::after,
  .case__link:hover::after,
  .awards__note-link:hover::after { transform: scaleX(0); opacity: 0; }
}

.icon-arrow { display: inline-block; width: .8em; height: .8em; vertical-align: -.05em; margin-left: .2em; line-height: 0; }
.icon-arrow svg { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   Buttons: hairline pill; champagne rises from below on hover
   -------------------------------------------------------------------------- */
.btn {
  --btn-fg: var(--pearl);
  --btn-bg: transparent;
  --btn-line: var(--hair-strong);
  --btn-fill: var(--champagne);
  --btn-fill-fg: var(--ink);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7em;
  min-height: 2.9rem;
  padding: 0 1.6rem;
  overflow: hidden;
  border: 1px solid var(--btn-line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-size: max(.62rem, 11px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .5s var(--ease-out), border-color .5s var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--btn-fill);
  transform: translateY(101%);
  transition: transform .6s var(--ease-out);
}
.btn .icon-arrow { margin-left: 0; transition: transform .6s var(--ease-out); }
.btn:focus-visible { outline-offset: 3px; }

@media (hover: hover) {
  .btn:hover { color: var(--btn-fill-fg); border-color: var(--btn-fill); }
  .btn:hover::before { transform: translateY(0); }
  .btn:hover .icon-arrow { transform: translate(2px, 2px); }
}

.btn--solid { --btn-bg: var(--pearl); --btn-fg: var(--ink); --btn-line: var(--pearl); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--pearl); --btn-line: var(--ink); }
.btn--sm { min-height: 2.2rem; padding: 0 1.05rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}

@media (max-width: 767.98px) {
  .btn { font-size: .72rem; }
  .btn:not(.btn--sm) { min-height: 3rem; }
}

/* --------------------------------------------------------------------------
   Cursor: short comet trail + ring that appears over case cards
   -------------------------------------------------------------------------- */
.cursor-trail {
  position: fixed;
  inset: 0;
  z-index: var(--z-cursor);
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.cursor-trail polyline {
  fill: none;
  stroke: var(--champagne);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .7;
}
body.is-loading .cursor-trail { opacity: 0; }

.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-cursor);
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  pointer-events: none;
  mix-blend-mode: difference;
}
.cursor__dot { display: none; }
.cursor__ring {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--pearl);
  border-radius: 50%;
  transform: scale(0);
  transition: transform .6s var(--ease-out);
}
.cursor__label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pearl);
}
.cursor.is-active .cursor__ring { transform: scale(1); }
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-trail { display: none; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .burst--spin svg,
  .burst--spin-slow svg,
  .marquee.is-animating .marquee__track { animation: none; }
  .cursor, .cursor-trail { display: none; }
  html { scroll-behavior: auto; }
}
