/* Maple Grove Capital VCC. One page, one film.
   Ink on white paper: navy text, hairlines, no cards, no buttons. */

@font-face {
  font-family: "MG Bodoni";
  src: url("assets/fonts/bodoni-moda-latin-opsz.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("assets/fonts/spectral-latin-300-normal.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("assets/fonts/spectral-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "MG Jost";
  src: url("assets/fonts/jost-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #0d1e3c;
  --ink-soft: #55607a;
  --line: #dde1e8;
  --deep: #0a1730;
  --on-deep: rgba(255, 255, 255, 0.88);
  --on-deep-soft: rgba(255, 255, 255, 0.62);
  --gold: #a48854;
  --gold-on-deep: #bda26d;
  /* the film's paper where it meets the edge of the frame */
  --film-paper: #eeeeef;

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display: "MG Bodoni", "Bodoni 72", Didot, "Times New Roman", serif;
  --label: "MG Jost", "Avenir Next", "Century Gothic", system-ui, sans-serif;

  --gutter: clamp(20px, 5.6vw, 96px);
  --top-h: 76px;
  --step-display: clamp(2.25rem, 1.1rem + 4.6vw, 5.25rem);
  --step-head: clamp(1.75rem, 1.15rem + 2.4vw, 3.25rem);
  --step-body: clamp(1.125rem, 1.07rem + 0.2vw, 1.25rem);
  --step-label: 0.8125rem;
  --space-section: clamp(96px, 15vw, 232px);
  --ease-out: cubic-bezier(0.16, 0.84, 0.24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
/* Safari on iPhone paints the strip behind the status bar and the area around
   its toolbar with the body colour. It starts as the film's paper, and main.js
   changes it to white and to the footer's navy as the page scrolls. Everything
   below the film therefore sets its own background. */
body {
  margin: 0;
  background: var(--film-paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, figure { margin: 0; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }

.skip {
  position: absolute; left: var(--gutter); top: -80px; z-index: 20;
  padding: 10px 14px; background: var(--ink); color: #fff; font-family: var(--label); font-size: var(--step-label);
  letter-spacing: 0.08em; text-decoration: none;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------------------------------------------------------------- top bar */

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--top-h);
  display: flex; align-items: center; gap: clamp(16px, 2vw, 28px);
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
.top.is-solid { background: var(--paper); border-bottom-color: var(--line); }

.brand { display: flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; }
.brand-mark { width: auto; height: 38px; }
.brand-name {
  font-family: var(--display); font-weight: 400; font-size: 1.3125rem; line-height: 1;
  letter-spacing: 0.24em; text-transform: uppercase; white-space: nowrap;
  font-variation-settings: "opsz" 28;
}
.top-rule { width: 1px; height: 34px; background: currentColor; opacity: 0.55; }
.top-fund {
  font-family: var(--label); font-weight: 500; font-size: var(--step-label);
  letter-spacing: 0.28em; text-transform: uppercase; white-space: nowrap; color: var(--ink);
}

/* ---------------------------------------------------------------- film */

/* The largest viewport height: on a phone the film then runs on under the
   browser's toolbar instead of stopping above it. */
.hero {
  position: relative;
  height: 100vh; height: 100lvh; min-height: 400px;
  background: var(--film-paper) url("assets/film/poster-16x9.jpg?v=2") center / cover no-repeat;
  overflow: hidden;
}
.film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* a hairline at the foot of the first screen: there is more below */
.cue {
  position: absolute; left: 50%; top: calc(100vh - 88px); top: calc(100svh - 88px);
  width: 1px; height: 48px; overflow: hidden;
  background: rgba(13, 30, 60, 0.14);
}
.cue::after {
  content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0.6;
  transform: translateY(-101%);
  animation: cue 3.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes cue {
  0% { transform: translateY(-101%); }
  60%, 100% { transform: translateY(101%); }
}

/* the portrait cut, wherever the landscape one would lose the sides of the lockup */
@media (max-aspect-ratio: 6/5) {
  .hero { background-image: url("assets/film/poster-9x16.jpg?v=2"); }
}
@media (prefers-reduced-motion: reduce) {
  .hero { background-image: url("assets/film/still-16x9.jpg?v=2"); }
  .film { display: none; }
  .cue::after { animation: none; }
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: reduce) and (max-aspect-ratio: 6/5) {
  .hero { background-image: url("assets/film/still-9x16.jpg?v=2"); }
}

/* ---------------------------------------------------------------- statement */

.statement {
  background: var(--paper);
  padding: var(--space-section) var(--gutter);
  display: grid; justify-items: center; text-align: center;
}
.statement h1 {
  max-width: 17ch;
  font-weight: 300; font-size: var(--step-display); line-height: 1.08; letter-spacing: -0.022em;
  text-wrap: balance;
}
/* the one gold line of the mark, once on the page */
.statement-rule { display: block; width: 56px; height: 1px; margin-top: clamp(36px, 4.4vw, 64px); background: var(--gold); }
.statement-next {
  margin-top: clamp(28px, 3.2vw, 48px); max-width: 26ch;
  font-weight: 300; font-size: clamp(1.375rem, 1.05rem + 1.25vw, 2.25rem); line-height: 1.25; letter-spacing: -0.012em; color: var(--ink-soft);
  text-wrap: balance;
}

/* Text comes up into place the first time it is scrolled to (main.js adds .js
   and .is-in; without the script nothing is hidden). */
.js [data-reveal] {
  opacity: 0; transform: translate3d(0, 26px, 0);
  transition: opacity 1.3s cubic-bezier(0.3, 0.5, 0.3, 1), transform 1.5s var(--ease-out);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .statement-rule[data-reveal] { opacity: 1; transform: scaleX(0); transition: transform 1.4s var(--ease-out) 0.25s; }
.js .statement-rule[data-reveal].is-in { transform: scaleX(1); }
.js .statement-next[data-reveal] { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------------------------------------------------------------- plate */

/* Two pictures from one camera: the sheet as it lies, and the same sheet with a
   strip light mirrored in its ink and foil. The second shows through a soft band
   that main.js moves across as the page scrolls, so the light passes over the lines. */
.plate { --band: 64; position: relative; overflow: hidden; aspect-ratio: 2400 / 1029; background: var(--film-paper); }
.plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate-lit {
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, #000 44%, #000 56%, transparent 100%);
  mask-image: linear-gradient(100deg, transparent 0%, #000 44%, #000 56%, transparent 100%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  /* the band is --band wide (vw); --glint runs from 0, band off the left edge, to 1, off the right */
  -webkit-mask-size: calc(var(--band) * 1vw) 100%; mask-size: calc(var(--band) * 1vw) 100%;
  -webkit-mask-position: calc((var(--glint, 0) * (100 + var(--band)) - var(--band)) * 1vw) 0;
  mask-position: calc((var(--glint, 0) * (100 + var(--band)) - var(--band)) * 1vw) 0;
}

/* ---------------------------------------------------------------- close */

.close { background: var(--paper); padding: var(--space-section) var(--gutter); display: grid; justify-items: center; text-align: center; }
.close-line {
  max-width: 24ch;
  font-weight: 300; font-size: var(--step-head); line-height: 1.12; letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- foot */

.foot {
  background: var(--deep); color: var(--on-deep);
  padding: clamp(64px, 8vw, 112px) var(--gutter) clamp(40px, 5vw, 64px);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  padding-bottom: max(clamp(40px, 5vw, 64px), calc(env(safe-area-inset-bottom) + 24px));
  display: grid; row-gap: clamp(56px, 7vw, 96px);
}
.foot-brand { display: flex; align-items: flex-end; gap: 22px; }
.foot-mark { width: auto; height: 84px; filter: brightness(0) invert(1); opacity: 0.92; }
.foot-name {
  font-family: var(--display); font-size: 1.75rem; line-height: 1; letter-spacing: 0.24em; text-transform: uppercase;
  font-variation-settings: "opsz" 34; color: #fff;
}
.foot-fund {
  margin-top: 12px;
  font-family: var(--label); font-weight: 500; font-size: var(--step-label); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-on-deep);
}
.foot-legal {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(32px, 6vw, 112px); row-gap: 16px;
  padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.875rem; line-height: 1.55; color: var(--on-deep-soft);
}
.foot-legal p:first-child { max-width: 62ch; }
.foot-legal p:last-child { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- narrow */

/* Safari on iPhone (measured on iOS 27.2) shows the page for another 58 px below
   the largest viewport height, behind its toolbar, and no unit or env() value
   reports it. The film is made that much taller on phones, with a margin, so the
   white section below does not show there. */
@media (hover: none) and (pointer: coarse) and (max-width: 860px) {
  .hero { height: calc(100lvh + 72px); }
}

@media (max-width: 860px) {
  :root { --top-h: 64px; }
  .brand-mark { height: 32px; }
  .brand-name { font-size: 1.0625rem; letter-spacing: 0.22em; }
  .top-rule, .top-fund { display: none; }
  /* On a phone the film's top edge dissolves into its paper colour: the edge then
     meets the browser's status bar without a seam, and whatever the film shows
     behind the name stays faint. */
  .hero::before {
    content: ""; position: absolute; inset: 0 0 auto 0; z-index: 1; height: 128px; pointer-events: none;
    background: linear-gradient(to bottom, rgb(238 238 239) 0%, rgb(238 238 239 / 0.93) 20%, rgb(238 238 239 / 0.7) 44%, rgb(238 238 239 / 0.32) 70%, rgb(238 238 239 / 0.08) 90%, rgb(238 238 239 / 0) 100%);
  }
  .statement, .close { justify-items: start; text-align: left; }
  .js .statement-rule[data-reveal] { transform-origin: left center; }
  .plate { --band: 110; aspect-ratio: 4 / 3; }
  .foot-legal { grid-template-columns: 1fr; }
  .foot-mark { height: 66px; }
  .foot-name { font-size: 1.375rem; }
}
