/* Pavilion site. Layout concept: a walk through a lit gallery; the page
   scrolls over a fixed live render, each chapter holding its text in place
   while the camera moves. */
:root {
  --bg: oklch(17% 0.012 60);
  --ink: oklch(96% 0.012 80);
  --ink-2: oklch(85% 0.02 75);
  --muted: oklch(72% 0.02 70);
  --brass: oklch(80% 0.09 78);
  --brass-ink: oklch(22% 0.02 60);
  --rule: oklch(70% 0.03 70 / 0.35);
  --scrim: oklch(17% 0.012 60 / 0.6);
  --display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --body: 'General Sans', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: max(1rem, 6vw);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: clip; background: var(--bg); }
body { color: var(--ink); font-family: var(--body); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 3px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.grade { position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, oklch(15% 0.02 60 / 0.62) 0%, oklch(15% 0.02 60 / 0.38) 30%, oklch(15% 0.02 60 / 0) 55%),
    radial-gradient(110% 80% at 0% 100%, oklch(16% 0.02 60 / 0.5), oklch(16% 0.02 60 / 0) 62%); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Loader */
.loader { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: grid; place-content: center; gap: 1.5rem; justify-items: center; transition: opacity 900ms var(--ease-out), visibility 0s 900ms; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__name { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.02em; }
.loader__bar { width: 10rem; height: 1px; background: var(--rule); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform 400ms var(--ease-out); }

/* Edge-aligned nav */
.edge { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(1.25rem + env(safe-area-inset-top, 0px)) var(--gutter) 1.25rem; }
.wordmark { font-family: var(--display); font-size: 1.3rem; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.edge nav { display: flex; align-items: center; gap: 1.75rem; font-size: 0.92rem; }
.edge nav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; transition: color 200ms var(--ease-out); }
.edge nav a:hover { color: var(--ink); }
.edge__cta { color: var(--brass-ink) !important; background: var(--brass); padding: 0.55rem 1rem; border-radius: 999px; transition: transform 120ms var(--ease-out); }
.edge__cta:hover { transform: translateY(-1px); }
.edge__cta:active { transform: translateY(0); }

/* Chapters: tall scroll spaces with a sticky panel */
main { position: relative; z-index: 10; }
.chap { height: var(--h, 200vh); position: relative; }
.panel { position: sticky; top: 0; height: 100svh; padding: 7.5rem var(--gutter) 5.5rem; display: flex; flex-direction: column; max-width: 46rem; }
.panel--low { justify-content: flex-end; }
.panel--top { justify-content: flex-start; padding-top: 8.5rem; }
.panel--center { justify-content: center; max-width: none; }
.panel > * { min-width: 0; }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 30px oklch(15% 0.02 60 / 0.5); }
h1 { font-size: clamp(3rem, 6vw + 1rem, 6.6rem); overflow-wrap: normal; }
#top .panel { max-width: 64rem; }
h2 { font-size: clamp(2.3rem, 4.2vw + 0.6rem, 5rem); }
.muted { color: var(--ink-2); }
.accent { color: var(--brass); }
.kicker { font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); margin-bottom: 1.25rem; font-weight: 500; }
.lede { margin-top: 1.5rem; font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 36rem; text-shadow: 0 1px 18px oklch(15% 0.02 60 / 0.6); }
.hint { margin-top: 2.5rem; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.list { list-style: none; margin-top: 2rem; max-width: 30rem; border-top: 1px solid var(--rule); }
.list li { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }

/* Method: the three portal stops, each lit as the camera passes through */
.method { list-style: none; display: grid; gap: 0; text-align: center; place-items: center; height: 100%; position: relative; }
.method li { position: absolute; inset: 0; display: grid; place-content: center; gap: 1rem; opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out); padding-inline: var(--gutter); }
.method li.is-on { opacity: 1; transform: none; }
.method__name { font-family: var(--display); font-size: clamp(4rem, 12vw, 11rem); line-height: 1; letter-spacing: -0.03em; text-shadow: 0 2px 40px oklch(15% 0.02 60 / 0.6); }
.method__step { font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); font-weight: 500; }
.method__line { font-size: clamp(1rem, 0.5vw + 0.9rem, 1.3rem); color: var(--ink-2); max-width: 34rem; margin-inline: auto; text-shadow: 0 1px 18px oklch(15% 0.02 60 / 0.7); }

.clients { list-style: none; margin-top: 2rem; max-width: 32rem; }
.clients li { display: grid; gap: 0.2rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.clients li span:first-child { font-family: var(--display); font-size: 1.4rem; line-height: 1.1; }
.clients li span:last-child { font-size: 0.85rem; color: var(--muted); }

.plan { list-style: none; margin-top: 2rem; display: grid; gap: 1rem; max-width: 36rem; }
.plan li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.plan__days { color: var(--brass); font-size: 0.9rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; white-space: nowrap; }
.plan b { color: var(--ink); font-weight: 500; }
.note { margin-top: 1.25rem; font-size: 0.88rem; color: var(--muted); }


.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 2.5rem; }
#mail { font-family: var(--display); font-size: clamp(1.4rem, 2vw + 0.8rem, 2.2rem); user-select: all; }
#copy { font: 500 0.92rem var(--body); color: var(--brass-ink); background: var(--brass); border: 0; border-radius: 999px; padding: 0.7rem 1.2rem; cursor: pointer; white-space: nowrap; transition: transform 120ms var(--ease-out); }
#copy:hover { transform: translateY(-1px); }
#copy:active { transform: translateY(0); }
#copy[data-state="done"] { background: var(--ink); }

/* Pinned labels */
.tags { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; padding-left: 1.6rem; font-size: 0.85rem; font-weight: 500; white-space: nowrap; opacity: 0; text-shadow: 0 1px 14px oklch(15% 0.02 60 / 0.8); }
.tag::before { content: ''; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 4px oklch(80% 0.09 78 / 0.25); }
.tag::after { content: ''; position: absolute; left: 10px; top: 50%; width: 9px; height: 1px; background: var(--brass); }

/* Headlines reveal word by word from a mask */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1100ms var(--ease-out); transition-delay: calc(var(--wi) * 70ms + 60ms); }
.chap.is-active .split .w > span { transform: none; }

/* Entrance: text settles in when its chapter becomes active */
.chap .panel > * { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
.chap:not(.is-active) .panel > *:not(.split) { opacity: 0; transform: translateY(16px); }
.chap.is-active .panel > *:nth-child(2) { transition-delay: 80ms; }
.chap.is-active .panel > *:nth-child(3) { transition-delay: 160ms; }
.chap.is-active .panel > *:nth-child(4) { transition-delay: 240ms; }

@media (min-width: 47.5rem) { .clients { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 47.5rem) {
  .edge nav a:not(.edge__cta) { display: none; }
  .panel, .panel--top { padding-top: 5.5rem; padding-bottom: 4.5rem; }
  .panel--top { justify-content: flex-end; }
  .panel { background: linear-gradient(to top, var(--scrim) 0%, transparent 65%); max-width: none; }
  .tag { display: none; }
  .plan li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .list { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .chap .panel > *, .method li { transition: opacity 150ms linear; transform: none !important; }
  .split .w > span { transform: none !important; transition: none; }
}
