/* ==========================================================================
   The Emergence Project · shared design system
   Night + paper base, coral signature, phosphor only for screens/CTA,
   amber only for glow. Fraunces (display/editorial), Archivo (body + wide
   labels, a nod to the Druk Wide of the original site), Courier Prime (the
   Familiar's typewriter/TV voice).
   ========================================================================== */

:root {
  /* colour */
  --night: #15121b;
  --night-2: #1f1a26;
  --night-3: #2a2433;
  --paper: #f3eee4;
  --paper-2: #e9e1d3;
  --paper-3: #ddd2bf;
  --ink: #1d1915;
  --ink-soft: #5e554b;        /* 6.3:1 on paper */
  --bone: #f4efe4;
  --bone-soft: #a79f94;       /* 7:1 on night */
  --coral: #f45f5f;           /* signature: on night, nav, fills */
  --coral-ink: #b83a36;       /* coral for text on paper (4.9:1) */
  --oxblood: #7e1a1a;
  --phosphor: #8fe27a;        /* TV text + primary CTA only */
  --amber: #e3a14b;           /* lantern glow, sparingly */
  --hair-paper: rgba(29, 25, 21, 0.16);
  --hair-night: rgba(244, 239, 228, 0.16);

  /* type */
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Courier Prime", "Courier New", monospace;

  --t-hero: clamp(4.25rem, 11.5vw, 11.5rem);
  --t-statement: clamp(2.4rem, 5.4vw, 5rem);
  --t-h2: clamp(2.1rem, 4vw, 3.6rem);
  --t-h3: clamp(1.45rem, 2vw, 1.9rem);
  --t-lede: clamp(1.25rem, 1.6vw, 1.5rem);
  --t-body: clamp(1.0625rem, 1.05vw, 1.1875rem);
  --t-small: 0.9375rem;
  --t-label: 0.75rem;

  /* space + shape */
  --gutter: clamp(20px, 4.4vw, 72px);
  --col-gap: clamp(16px, 2vw, 28px);
  --section-y: clamp(96px, 13vw, 200px);
  --r-img: 26px;
  --r-slab: 36px;
  --r-pill: 999px;
  --max: 1440px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-variation-settings: "wdth" 100;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: var(--coral); color: var(--night); }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: 92px; }

.visually-hidden {
  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; left: 16px; top: -80px; z-index: 100;
  background: var(--phosphor); color: var(--night); padding: 10px 18px;
  border-radius: var(--r-pill); font-weight: 700; text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* --------------------------------------------------------------------------
   type
   -------------------------------------------------------------------------- */
.display, .statement, .h2, .h3, .lede-serif {
  font-family: var(--f-display);
  font-weight: 380;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display {
  font-size: var(--t-hero);
  line-height: 0.9;
  font-weight: 340;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.statement {
  font-size: var(--t-statement);
  line-height: 1.04;
  font-variation-settings: "SOFT" 60, "WONK" 0;
}
.h2 { font-size: var(--t-h2); line-height: 1.06; font-variation-settings: "SOFT" 50; }
.h3 { font-size: var(--t-h3); line-height: 1.15; font-weight: 420; letter-spacing: -0.01em; }
.statement em, .h2 em, .display em, .h3 em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.lede { font-size: var(--t-lede); line-height: 1.45; max-width: 34ch; text-wrap: pretty; }
.lede-serif { font-size: var(--t-lede); line-height: 1.4; font-weight: 400; letter-spacing: -0.005em; }
.body { max-width: 62ch; text-wrap: pretty; }
.body p + p { margin-top: 1em; }
.small { font-size: var(--t-small); line-height: 1.55; }

/* wide uppercase label: the Druk Wide echo */
.label, .kicker {
  font-family: var(--f-body);
  font-size: var(--t-label);
  font-weight: 760;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.3;
}
.kicker { display: inline-flex; align-items: center; gap: 0.75em; color: var(--coral); }
.is-paper .kicker { color: var(--coral-ink); }
.kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
}
.mono { font-family: var(--f-mono); font-size: 0.95em; letter-spacing: 0; }
.caption {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.45;
  font-variation-settings: "SOFT" 100;
  color: var(--bone-soft);
}
.is-paper .caption { color: var(--ink-soft); }
/* small wide-caps lead-in inside captions: <figcaption class="caption"><b>Concept render</b> Day, on the playa</figcaption> */
.caption b {
  font-family: var(--f-body); font-style: normal; font-weight: 760; font-size: 0.6875rem;
  letter-spacing: 0.09em; text-transform: uppercase; font-variation-settings: "wdth" 125; margin-right: 0.5em;
}
.muted { color: var(--bone-soft); }
.is-paper .muted { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   layout
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.section { position: relative; padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.is-paper { background: var(--paper); color: var(--ink); }
.is-paper2 { background: var(--paper-2); color: var(--ink); }
.is-night { background: var(--night); color: var(--bone); }
.is-night2 { background: var(--night-2); color: var(--bone); }

/* rounded slab sections, a cleaner take on the original site's stacked panels */
.slab {
  position: relative;
  border-radius: var(--r-slab);
  overflow: clip;
}
.slab-stack { display: grid; gap: 10px; padding: 10px; }

.rule { height: 1px; border: 0; margin: 0; background: var(--hair-night); }
.is-paper .rule, .is-paper2 .rule { background: var(--hair-paper); }

/* --------------------------------------------------------------------------
   figures
   -------------------------------------------------------------------------- */
.frame {
  position: relative;
  border-radius: var(--r-img);
  overflow: hidden;
  background: var(--night-2);
  isolation: isolate;
}
.is-paper .frame { background: var(--paper-3); }
.frame > img, .frame > video, .frame > picture > img {
  width: 100%; height: 100%; object-fit: cover;
}
.frame-tag {
  position: absolute;
  left: 12px; bottom: 12px; z-index: 2;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(21, 18, 27, 0.72);
  color: rgba(244, 239, 228, 0.86);
  font-family: var(--f-display);
  font-style: italic;
  font-size: 0.8125rem;
  line-height: 1.2;
  font-variation-settings: "SOFT" 100;
  pointer-events: none;
}
figure figcaption { margin-top: 14px; }
.fig-meta { display: flex; gap: 14px; align-items: baseline; justify-content: space-between; }

/* --------------------------------------------------------------------------
   buttons + links
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px; padding: 0 24px;
  border-radius: var(--r-pill);
  border: 1.5px solid currentColor;
  background: transparent;
  font-family: var(--f-body);
  font-size: 0.8125rem; font-weight: 760;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.25s var(--ease-soft), color 0.25s var(--ease-soft),
              border-color 0.25s var(--ease-soft), transform 0.25s var(--ease);
}
.pill:hover { transform: translateY(-1px); }
.pill--phosphor { background: var(--phosphor); border-color: var(--phosphor); color: var(--night); }
.pill--phosphor:hover { background: #a6ec93; border-color: #a6ec93; }
.pill--coral { background: var(--coral); border-color: var(--coral); color: var(--night); }
.pill--night { background: var(--night); border-color: var(--night); color: var(--bone); }
.pill--night:hover { background: var(--night-3); border-color: var(--night-3); }
.pill--disabled {
  background: rgba(21, 18, 27, 0.22);
  border-color: rgba(29, 25, 21, 0.34);
  color: rgba(29, 25, 21, 0.78);
  cursor: not-allowed;
  user-select: none;
  gap: 0.55em;
}
.pill--disabled:hover { transform: none; }
.pill--disabled-night {
  background: rgba(244, 239, 228, 0.06);
  border-color: rgba(244, 239, 228, 0.22);
  color: var(--bone-soft);
}
.pill__soon {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(21, 18, 27, 0.16);
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.1;
}
.pill--disabled-night .pill__soon {
  background: rgba(244, 239, 228, 0.12);
  color: var(--bone);
}
.footer-disabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: rgba(167, 159, 148, 0.58);
  cursor: not-allowed;
}
.footer-disabled small {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(244, 239, 228, 0.18);
  font-family: var(--f-display);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--bone-soft);
}
.pill .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.pill:hover .arrow { transform: translateX(3px); }

.link {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.2s var(--ease-soft);
}
.link:hover { text-decoration-color: currentColor; }

/* --------------------------------------------------------------------------
   site nav: a floating coral pill, the original site's header, cleaned up
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed; z-index: 50;
  top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 10px 0 12px;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--ink);
  transition: transform 0.45s var(--ease), box-shadow 0.3s var(--ease-soft);
}
.site-nav.is-hidden { transform: translateY(calc(-100% - 20px)); }
.site-nav.is-raised { box-shadow: 0 10px 30px -12px rgba(10, 8, 14, 0.45); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 42px; height: 42px; border-radius: 50%; }
.brand span {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  font-variation-settings: "wdth" 125; line-height: 1.1;
}
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 34px); }
.nav-links a:not(.pill) {
  font-size: 0.75rem; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase;
  font-variation-settings: "wdth" 125;
  text-decoration: none; padding: 6px 0;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.3s var(--ease);
}
.nav-links a:not(.pill):hover, .nav-links a[aria-current="page"] { background-size: 100% 2px; }
.nav-links .pill { min-height: 44px; padding: 0 20px; font-size: 0.75rem; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .site-nav { height: 58px; }
  .brand span { display: none; }
  .nav-toggle {
    display: inline-flex; min-height: 42px; padding: 0 18px; border-radius: var(--r-pill);
    border: 0; background: var(--night); color: var(--bone); cursor: pointer;
    font-size: 0.75rem; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase;
    font-variation-settings: "wdth" 125; align-items: center;
  }
  .nav-links {
    position: fixed; top: 78px; left: 12px; right: 12px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 10px; border-radius: 28px; background: var(--coral);
    box-shadow: 0 20px 40px -20px rgba(10, 8, 14, 0.6);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: opacity 0.25s var(--ease-soft), transform 0.3s var(--ease);
  }
  .site-nav.is-open .nav-links { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a:not(.pill) { padding: 16px 14px; font-size: 0.875rem; background-image: none; }
  .nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
  .nav-links .pill { margin-top: 6px; min-height: 52px; }
}

/* --------------------------------------------------------------------------
   footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--night); color: var(--bone); padding: clamp(72px, 9vw, 128px) 0 36px; }
.footer-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 48px; }
.footer-mark { grid-column: 1 / span 5; display: flex; gap: 18px; align-items: flex-start; }
.footer-mark img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.footer-mark p { max-width: 34ch; color: var(--bone-soft); }
.footer-mark strong { display: block; color: var(--bone); font-family: var(--f-display); font-weight: 420; font-size: 1.4rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.footer-col { grid-column: span 2; }
.footer-col:first-of-type { grid-column: 8 / span 2; }
.footer-col h2 { margin-bottom: 14px; color: var(--bone-soft); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-col a { display: inline-block; padding: 4px 0; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-base {
  margin-top: clamp(56px, 7vw, 96px); padding-top: 22px; border-top: 1px solid var(--hair-night);
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between;
  color: var(--bone-soft); font-size: 0.875rem;
}
@media (max-width: 860px) {
  .footer-mark { grid-column: 1 / -1; }
  .footer-col, .footer-col:first-of-type { grid-column: span 6; }
}

/* --------------------------------------------------------------------------
   reveal on scroll (progressive: content is visible without JS)
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
