/* ==========================================================================
   ChampPay — DAY AND NIGHT
   The page is a light institutional document, punctuated by full-bleed
   floodlit night photography. The floodlight idea is carried by real
   pictures rather than drawn furniture. See DESIGN.md.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Day */
  --paper: #fbfcfb;
  --paper-alt: #eff3f0;
  --ink: #08130f;
  --ink-soft: #4c5f58;
  --rule: #d9e1dc;
  --accent: #0a6b49;
  --accent-hi: #08573b;

  /* Night */
  --night: #05100c;
  --night-alt: #0a1a13;
  --halide: #e9f5ef;
  --halide-soft: #9fb8ae;
  --beam: #7fe3be;
  --sodium: #ffb347;
  --rule-night: #22453a;

  /* Semantic — flipped inside .on-night */
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --bg: var(--paper);
  --line: var(--rule);
  --acc: var(--accent);

  /* Type */
  --f-display: "Archivo", "Arial Black", sans-serif;
  --f-text: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Space */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1440px;
  --measure: 62ch;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.on-night {
  --fg: var(--halide);
  --fg-soft: var(--halide-soft);
  --bg: var(--night);
  --line: var(--rule-night);
  --acc: var(--beam);
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.62;
  font-variation-settings: "wdth" 100, "wght" 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--f-display);
  font-variation-settings: "wdth" 110, "wght" 700;
  line-height: 1.0;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
p { margin: 0; }
a { color: inherit; }

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.on-night :focus-visible { outline-color: var(--beam); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: var(--s3) var(--s5);
  font-family: var(--f-mono); font-size: 12px;
}
.skip:focus { left: var(--s4); top: var(--s4); }

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.band { position: relative; background: var(--bg); }
.band--alt { background: var(--paper-alt); }
.band--night { background: var(--night); }

.sec { padding-block: clamp(64px, 8.5vw, 132px); }
.sec--tight { padding-block: clamp(48px, 6vw, 88px); }

hr.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   4. Type scale
   -------------------------------------------------------------------------- */
.t-display { font-size: clamp(2.5rem, 5.6vw, 5rem); font-variation-settings: "wdth" 112, "wght" 700; letter-spacing: -0.045em; }
.t-h2      { font-size: clamp(1.875rem, 3.6vw, 3.125rem); font-variation-settings: "wdth" 108, "wght" 700; letter-spacing: -0.038em; }
.t-h3      { font-size: clamp(1.1875rem, 1.7vw, 1.4375rem); font-variation-settings: "wdth" 104, "wght" 600; letter-spacing: -0.022em; line-height: 1.18; }

.t-lead { font-size: clamp(1.0625rem, 1.35vw, 1.25rem); line-height: 1.55; color: var(--fg-soft); max-width: var(--measure); }
.t-body { font-size: 1rem; line-height: 1.66; color: var(--fg-soft); max-width: var(--measure); }

.code {
  font-family: var(--f-mono); font-size: 0.6875rem;
  font-variation-settings: "wght" 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-soft);
}
.figure-mono {
  font-family: var(--f-mono); font-variation-settings: "wght" 600;
  font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.kicker {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-family: var(--f-mono); font-size: 0.6875rem;
  font-variation-settings: "wght" 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--fg-soft);
}
.kicker::before { content: ""; width: 7px; height: 7px; background: var(--acc); flex: none; }

/* --------------------------------------------------------------------------
   5. Masthead
   -------------------------------------------------------------------------- */
.masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}
.masthead__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); height: 72px; }

/* Over the photographic hero the bar is transparent and reversed */
.masthead.is-over { color: var(--halide); }
.masthead.is-stuck { background: var(--paper); border-bottom-color: var(--rule); color: var(--ink); }

.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; flex: none; color: inherit; }
.brand__mark { width: 26px; height: 26px; flex: none; color: var(--accent); transition: color 0.35s var(--ease-out); }
.masthead.is-over .brand__mark { color: var(--beam); }
.brand__word { font-family: var(--f-display); font-variation-settings: "wdth" 112, "wght" 700; font-size: 1.0625rem; letter-spacing: -0.03em; }

.nav { display: flex; align-items: center; gap: var(--s6); }
.nav a { text-decoration: none; font-size: 0.9375rem; font-variation-settings: "wght" 500; color: inherit; opacity: 0.78; position: relative; padding-block: var(--s2); transition: opacity 0.25s var(--ease-out); }
.nav a:not(.btn):hover { opacity: 1; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease-out); }
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.nav a:not(.btn)[aria-current="page"] { opacity: 1; }
.nav a:not(.btn)[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: 1px solid currentColor; color: inherit; width: 40px; height: 40px; cursor: pointer; align-items: center; justify-content: center; padding: 0; }
.nav-toggle span { display: block; width: 16px; height: 1px; background: currentColor; position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 16px; height: 1px; background: currentColor; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s3);
  padding: 14px var(--s5);
  font-family: var(--f-text); font-size: 0.9375rem; font-variation-settings: "wght" 600;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  transition: background 0.28s var(--ease-out), color 0.28s var(--ease-out), border-color 0.28s var(--ease-out);
  opacity: 1;
}
.btn:hover { background: var(--accent); color: #fff; }

.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: #fff; }

/* On night grounds the buttons invert */
.on-night .btn, .masthead.is-over .btn { border-color: var(--beam); color: var(--beam); }
.on-night .btn:hover, .masthead.is-over .btn:hover { background: var(--beam); color: var(--night); }
.on-night .btn--primary, .masthead.is-over .btn--primary { background: var(--beam); border-color: var(--beam); color: var(--night); }
.on-night .btn--primary:hover, .masthead.is-over .btn--primary:hover { background: var(--halide); border-color: var(--halide); color: var(--night); }

/* `.nav a` out-specifies `.btn`, so nav buttons restate their colours */
.nav a.btn { opacity: 1; }
.nav a.btn::after { display: none; }
.nav a.btn--primary { color: #fff; }
.masthead.is-over .nav a.btn--primary { color: var(--night); }

.btn__arrow { width: 14px; height: 14px; flex: none; }

/* --------------------------------------------------------------------------
   7. Photographic hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(92svh, 860px);
  display: flex; align-items: flex-end;
  /* Bottom padding clears the absolutely-positioned audience strip */
  padding-top: 120px; padding-bottom: clamp(104px, 10vw, 148px);
  isolation: isolate; overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* Scrim: strong at the bottom where the type sits, lighter at the top */
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,16,12,.72) 0%, rgba(5,16,12,.34) 34%, rgba(5,16,12,.80) 82%, rgba(5,16,12,.94) 100%);
}
.hero__in { position: relative; width: 100%; }
.hero__title { max-width: 17ch; margin-top: var(--s5); }
.hero__lead { margin-top: var(--s5); max-width: 54ch; color: var(--halide-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s7); }

/* Thin credential strip pinned to the base of the hero */
.hero__strip {
  position: absolute; left: 0; right: 0; bottom: 0;
  border-top: 1px solid rgba(233,245,239,.16);
  background: rgba(5,16,12,.42);
}
.hero__strip .wrap { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s7); padding-block: var(--s4); }
.hero__strip span { color: var(--halide-soft); }

/* --------------------------------------------------------------------------
   8. Statement — scroll-linked value shift
   -------------------------------------------------------------------------- */
.statement {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 106, "wght" 600;
  font-size: clamp(1.625rem, 3.3vw, 2.875rem);
  line-height: 1.16; letter-spacing: -0.035em;
  max-width: 24ch;
}
.statement .w { color: #c3cec9; transition: color 0.45s var(--ease-out); }
.statement .w.is-read { color: var(--ink); }

/* --------------------------------------------------------------------------
   9. Split — text beside a photograph
   -------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.split--flip .split__media { order: -1; }
.split__media { position: relative; }
/* height:auto is required — the width/height HTML attributes are presentational
   hints that otherwise beat aspect-ratio and render the image at literal pixels. */
.split__media img { width: 100%; height: auto; aspect-ratio: 4 / 3.1; object-fit: cover; }
.split__cap {
  position: absolute; left: 0; bottom: 0; right: 0;
  padding: var(--s4) var(--s5);
  background: linear-gradient(180deg, transparent, rgba(5,16,12,.86));
  color: var(--halide-soft);
}

/* --------------------------------------------------------------------------
   10. Panels — image-led, not text cards
   -------------------------------------------------------------------------- */
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.panel { position: relative; display: block; overflow: hidden; background: var(--night); isolation: isolate; }
/* Pictures come from three different days and three different skies. The grade
   pulls them into one family and lets the labels sit on them. */
.panel__img {
  width: 100%; height: auto; aspect-ratio: 3 / 3.6; object-fit: cover;
  filter: saturate(0.68) contrast(1.06) brightness(0.76);
  transition: transform 0.9s var(--ease-out), filter 0.6s var(--ease-out);
}
.panel:hover .panel__img { transform: scale(1.045); filter: saturate(0.82) contrast(1.06) brightness(0.86); }
.panel::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,16,12,.26) 0%, rgba(5,16,12,.5) 44%, rgba(5,16,12,.94) 100%),
    linear-gradient(0deg, rgba(10,107,73,.22), rgba(10,107,73,.22));
}
.panel__body { position: absolute; inset: auto 0 0 0; z-index: 1; padding: var(--s6) var(--s5); color: var(--halide); }
.panel__body p { color: var(--halide-soft); font-size: 0.9375rem; margin-top: var(--s3); }

/* --------------------------------------------------------------------------
   11. Corridor strip on night
   -------------------------------------------------------------------------- */
.corridors { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule-night); }
.corridor { padding: var(--s6) var(--s5) var(--s6) 0; border-bottom: 1px solid var(--rule-night); }
.corridor__code { font-family: var(--f-mono); font-size: 1.75rem; font-variation-settings: "wght" 600; letter-spacing: -0.02em; color: var(--beam); line-height: 1; }
.corridor__city { margin-top: var(--s3); font-variation-settings: "wght" 600; }
.corridor__state { margin-top: var(--s2); }

/* --------------------------------------------------------------------------
   12. Ledger
   -------------------------------------------------------------------------- */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ledger__col { background: var(--paper); padding: var(--s7) var(--s6); }
.ledger__col--now { background: var(--paper-alt); }
.ledger__head { display: flex; align-items: center; gap: var(--s3); padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.ledger__list { list-style: none; margin: 0; padding: 0; }
.ledger__list li { position: relative; padding-left: var(--s5); padding-block: var(--s3); font-size: 0.9375rem; line-height: 1.55; color: var(--fg-soft); border-bottom: 1px solid var(--line); }
.ledger__list li:last-child { border-bottom: 0; }
.ledger__list li::before { content: ""; position: absolute; left: 0; top: 19px; width: 9px; height: 1px; background: var(--fg-soft); }
.ledger__col--now .ledger__list li::before { background: var(--accent); height: 2px; }

/* --------------------------------------------------------------------------
   13. Audience rows
   -------------------------------------------------------------------------- */
.aud { border-top: 1px solid var(--line); }
.aud__row { display: grid; grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr); gap: var(--s6); padding-block: var(--s6); border-bottom: 1px solid var(--line); align-items: start; transition: transform 0.4s var(--ease-out); }
.aud__row:hover { transform: translateX(var(--s3)); }

/* --------------------------------------------------------------------------
   14. Closing frame
   -------------------------------------------------------------------------- */
.close { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding-block: clamp(88px, 12vw, 176px); }
.close__media { position: absolute; inset: 0; z-index: -2; }
.close__media img { width: 100%; height: 100%; object-fit: cover; }
.close__media::after { content: ""; position: absolute; inset: 0; background: rgba(5,16,12,.82); }
.slogan { font-family: var(--f-display); font-variation-settings: "wdth" 116, "wght" 700; font-size: clamp(2.25rem, 7vw, 5.5rem); letter-spacing: -0.05em; line-height: 0.96; }
.close .t-lead { margin-inline: auto; margin-top: var(--s5); }

/* --------------------------------------------------------------------------
   15. Forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: var(--s5); }
.field { display: grid; gap: var(--s2); }
.field label { font-family: var(--f-mono); font-size: 0.625rem; font-variation-settings: "wght" 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--fg-soft); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--rule); border-bottom-width: 2px;
  color: var(--ink); font-family: var(--f-text); font-size: 1rem; padding: 13px var(--s4);
  transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8b9a94; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-bottom-color: var(--accent); }
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea, .field[data-invalid="true"] select { border-bottom-color: #b4451f; }
.field__err { font-family: var(--f-mono); font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: #b4451f; min-height: 14px; }

.form__status { padding: var(--s4) var(--s5); border: 1px solid var(--rule); font-size: 0.9375rem; display: none; }
.form__status.is-shown { display: flex; gap: var(--s3); align-items: baseline; }
.form__status::before { content: ""; width: 7px; height: 7px; flex: none; translate: 0 -1px; }
.form__status--ok::before { background: var(--accent); }
.form__status--err::before { background: #b4451f; }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding-block: var(--s8) var(--s5); background: var(--paper); }
.foot__top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: var(--s7); padding-bottom: var(--s7); }
.foot__nav { display: grid; gap: var(--s3); align-content: start; }
.foot__nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.9375rem; width: fit-content; }
.foot__nav a:hover { color: var(--ink); }
.foot__bottom { border-top: 1px solid var(--rule); padding-top: var(--s5); display: flex; flex-wrap: wrap; gap: var(--s5); justify-content: space-between; align-items: center; }
.foot__legal { font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.6; max-width: 64ch; }

/* --------------------------------------------------------------------------
   17. Reveal — gated on .js so the page renders without scripting
   -------------------------------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal][data-delay="1"] { transition-delay: 0.09s; }
.js [data-reveal][data-delay="2"] { transition-delay: 0.18s; }
.js [data-reveal][data-delay="3"] { transition-delay: 0.27s; }

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .panels { grid-template-columns: 1fr 1fr; }
  .corridors { grid-template-columns: 1fr 1fr; }
  .foot__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: var(--s3) var(--gutter) var(--s6);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out), visibility 0.28s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { color: var(--ink); opacity: 1; padding-block: var(--s4); border-bottom: 1px solid var(--rule); font-size: 1.0625rem; }
  .nav a.btn { margin-top: var(--s5); justify-content: center; border-color: var(--accent); color: #fff; }
  .masthead.is-over .nav a { color: var(--ink); }
  .masthead.is-over .nav a.btn--primary { color: #fff; }

  .split, .split--flip .split__media { grid-template-columns: 1fr; order: 0; }
  .split { gap: var(--s6); }
  .ledger { grid-template-columns: 1fr; }
  .aud__row { grid-template-columns: 1fr; gap: var(--s3); }
  .statement { max-width: 100%; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .panels { grid-template-columns: 1fr; }
  .corridors { grid-template-columns: 1fr; }
  .foot__top { grid-template-columns: 1fr; gap: var(--s6); }
  .hero { min-height: 88svh; padding-top: 104px; }
  .panel__img { aspect-ratio: 3 / 2.4; }
}

/* --------------------------------------------------------------------------
   19. Reduced motion
   -------------------------------------------------------------------------- */
@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; }
  .statement .w { color: var(--ink); }
  .panel:hover .panel__img { transform: none; }
}

@media print {
  .masthead, .hero__media, .close__media { display: none; }
  body { background: #fff; color: #000; }
}
