/* caspyr.app (docs/website-redesign-plan.md). The app's own colors and type,
   its navy-to-cream band, and full-screen panels; phones first. Light only.
   Red only for a call to action, never small red text, never red on navy.
   The home page's one script, /footage.js, only gives the video its file; its
   still, the pause switch, Reduce Motion, and the scroll effects are CSS. */

@font-face {
  font-family: 'DM Serif Display';
  src: url('/fonts/DMSerifDisplay_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --cream: #fceea8;
  --tint: #fefbe9; /* the app's page background */
  --navy: #293f76; /* text on the tints: 9.3 to 9.8 */
  --navy-deep: #1f305b; /* the top of the app's band (B5) */
  --muted: #58688f; /* secondary text on the tints only (5.1+) */
  --red: #d62e2f; /* a page's one red call to action: never small text, never on navy */
  --cream-soft: rgba(252, 238, 168, 0.86); /* secondary text on navy: 7+ */
  --display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --gutter: max(1.5rem, env(safe-area-inset-left), env(safe-area-inset-right));
  --screen: 100vh; /* a full panel; lvh below, where the browser knows it */
  --on-photo: 0 1px 2px rgba(0, 0, 0, 0.28), 0 2px 18px rgba(0, 0, 0, 0.32);
  /* The app's band (src/theme/colors.ts, B5's BAND_LOWER from caspyr navy and
     BAND_FADE): navy, then a clearing-sky blue, onto the cream, never grey. */
  --band-down: linear-gradient(
    to bottom,
    #293f76 0%, #2f457d 4%, #364d85 8%, #3d558d 12%, #465e96 16%, #5068a0 20%,
    #5971a9 24.5%, #637bb2 29%, #6e86bb 33.5%, #7a91c5 38%, #859ccd 42%, #93a8d6 46.5%,
    #a0b4de 51%, #aec0e5 55.5%, #bccced 60%, #cbd7f2 64.5%, #d9e3f8 69%, #e6edfc 73.5%,
    #edf2f8 78%, #f2f5f3 82%, #f7f7ef 86.5%, #fbf9ec 91%, #fdfbea 95.5%, #fefbe9 100%
  );
}
/* The large viewport: the screen with the browser's bars at their smallest,
   so the footage never stops short with a strip under it when iPhone
   Safari's bottom bar shrinks on scroll (its glass bar floats over the foot,
   where only the darkening is; "See how it works" sits at 80%, above it). */
@supports (height: 100lvh) {
  :root {
    --screen: 100lvh;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--navy-deep);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--navy-deep);
  color: var(--cream);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

main:focus {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
p,
figure {
  margin: 0;
}

ul[role='list'] {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--cream);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

/* ---------- The footage ---------- */

/* The still is the video's exact first frame, so the swap doesn't jump. It
   shows first, and stays whenever the video can't play: Reduce Motion
   (/footage.js gives it no file, so nothing downloads), Low Power Mode, a
   browser without scripts, or the pause switch. */
.footage {
  position: absolute;
  inset: 0;
  z-index: 0; /* its own layer: the darkening and fades never cover the words */
  overflow: hidden;
  background: #1b2338;
}
.footage img,
.footage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The pause switch takes taps through its layer (.reel-controls), which
   takes none, so the panels' links stay tappable under it. */
.pause {
  pointer-events: auto;
}
/* iPhone Safari's big play button, shown when it won't autoplay (Low Power
   Mode): hidden, so the still simply stays. */
.footage video::-webkit-media-controls,
.footage video::-webkit-media-controls-start-playback-button,
.footage video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
}
/* Lightly darkened: a little all over, a soft shade behind the words, and
   more toward the foot where "See how it works" sits. No extra shade at the
   top (Eric, 2026-11-24: no links up there; Safari draws its own bar behind
   the clock, and the pause switch has its own dark circle). Measured over
   every quarter second of both copies of the footage (README, The footage):
   at the brightest 5% of each frame, the wordmark stays above 3:1 (large
   text) and the tagline, "Coming soon", and "See how it works" above 4.5:1,
   as the Accessibility page's "strong contrast" promises. */
.footage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 46% at 50% 48%, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.36) 76%, rgba(0, 0, 0, 0.56) 100%);
}
/* N2 (Eric, 2026-11-24): iPhone Safari (iOS 26) paints the strip behind its
   clock, and its bottom panel until the page scrolls, in a solid color taken
   from the page's background; no page can show its video there. So the home
   page's background is black. No fades into it: Eric had both taken out the
   same day (too heavy on Safari, and visible on Chrome and desktop). */
html:has(body.page-home),
body.page-home {
  background: #000;
}
@media (prefers-reduced-motion: reduce) {
  .footage video {
    display: none;
  }
}
/* The pause switch: hides every copy of the video, so its still shows (a
   hidden video also stops playing). */
body:has(.pause-input:checked) .footage video {
  display: none;
}

/* One switch for the whole page, held at the top right of the screen while
   the footage plays behind the panels (its own layer in the reel, which takes
   no taps but the switch's). Top right because iPhone Safari's floating
   bottom bar (iOS 26) can cover the foot of the screen. */
.reel-controls {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.pause {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 0.75rem);
  margin-right: calc(var(--gutter) - 0.6rem);
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
}
.pause-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.pause:has(.pause-input:focus-visible) {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}
.pause-icon {
  position: relative;
  width: 0.75rem;
  height: 0.875rem;
}
/* Pause: two bars. */
.pause-icon::before,
.pause-icon::after {
  content: '';
  position: absolute;
  top: 0;
  width: 0.25rem;
  height: 100%;
  border-radius: 1px;
  background: var(--cream);
}
.pause-icon::before {
  left: 0;
}
.pause-icon::after {
  right: 0;
}
/* Play: a triangle, once paused. */
body:has(.pause-input:checked) .pause-icon::before {
  left: 0.1rem;
  width: 0;
  height: 0;
  border-radius: 0;
  background: none;
  border-top: 0.4375rem solid transparent;
  border-bottom: 0.4375rem solid transparent;
  border-left: 0.75rem solid var(--cream);
}
body:has(.pause-input:checked) .pause-icon::after {
  display: none;
}
/* Nothing plays with Reduce Motion on, so there's nothing to pause. */
@media (prefers-reduced-motion: reduce) {
  .pause {
    display: none;
  }
}

/* ---------- Panels ---------- */

.panel {
  position: relative;
  min-height: var(--screen);
}

.panel-open,
.panel-close {
  display: grid;
  place-items: center;
  padding: 5.5rem var(--gutter) 6.5rem;
  text-align: center;
  color: var(--cream);
  text-shadow: var(--on-photo);
}

.hero {
  display: grid;
  justify-items: center;
}
.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 15vw, 6.25rem); /* about the app's welcome screen (68 pt) on a phone */
  line-height: 1;
  letter-spacing: -0.005em;
  padding-bottom: 0.08em; /* the p and y's tails */
}
.tagline {
  margin-top: 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.0625rem, 4.5vw, 1.5rem);
  line-height: 1.2;
}
.store-soon {
  margin-top: 1rem;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}
/* From launch day (Eric's B3): caspyr's own button, frosted dark with a thin
   cream edge. The backing is dark enough for cream text over snow (5:1+). */
.store-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(252, 238, 168, 0.6);
  border-radius: 0.8rem;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-shadow: none;
}
.store-button:hover {
  background: rgba(0, 0, 0, 0.55);
}
.store-button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.cue {
  position: absolute;
  top: calc(var(--screen) * 0.8); /* clear of Safari's floating bottom bar */
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  translate: -50% 0;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}
.cue::after {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  rotate: 45deg;
}

/* The three story panels: one big serif line, one short sentence, one screen. */
.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 4.5rem var(--gutter);
  text-align: center;
}
.story-text {
  max-width: 30rem;
}
.story h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.125rem, 9.2vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.story p {
  margin-top: 0.9rem;
  font-size: clamp(1.0625rem, 4.3vw, 1.25rem);
  line-height: 1.5;
  color: var(--cream-soft);
  text-wrap: pretty;
}

/* A plain phone outline round each real screen. */
.phone {
  position: relative;
  flex: none;
  /* Never below 9rem, so it stays readable at 200% zoom and in landscape. */
  --phone-w: max(9rem, min(64vw, calc((var(--screen) - 19rem) * 0.46), 21rem));
  width: var(--phone-w);
  /* The frame is a share of the phone's own width (a percentage padding
     would follow the page's width and grow thick on a desktop; Eric,
     2026-11-24): 3.3%, as it measured on an iPhone. */
  padding: calc(var(--phone-w) * 0.033);
  border-radius: 15% / 7%;
  background: #0f1628;
  box-shadow: 0 1.75rem 3.5rem -1.25rem rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.phone img {
  display: block;
  width: 100%;
  border-radius: 12.6% / 5.8%;
}

@media (min-width: 56rem) {
  .story {
    flex-direction: row;
    gap: clamp(3rem, 8vw, 8rem);
    text-align: left;
  }
  .story-text {
    flex: 0 1 30rem;
  }
  .story:nth-of-type(even) {
    flex-direction: row-reverse;
  }
  .phone {
    --phone-w: max(9rem, min(22rem, calc((var(--screen) - 8rem) * 0.46)));
  }
}

/* ---------- The home page's reel (Eric's F1) ---------- */

/* The footage and the panels share one grid cell, so the footage, pinned to
   the top of the screen, travels with the reel and comes to rest on the
   closing panel, and never covers the footer. */
.reel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* never wider than the screen, at any zoom */
}
.reel-footage,
.reel-controls,
.reel-panels {
  grid-area: 1 / 1;
}
.reel-footage {
  position: sticky;
  top: 0;
  z-index: 0;
  align-self: start;
  height: var(--screen);
}
.reel-panels {
  position: relative;
  z-index: 1;
}
.reel-panels > .panel,
.veil {
  position: relative;
}
/* The sheet: navy at 80%, so the footage shows through a little, with long
   eased edges (smoothstep stops) so it eases in rather than arriving. The
   first line sits where it's 75% navy: cream on it stays above 4.5:1 even
   over snow. */
.veil {
  padding: 34vh 0;
  background: linear-gradient(
    to bottom,
    rgba(31, 48, 91, 0) 0,
    rgba(31, 48, 91, 0.125) 10vh,
    rgba(31, 48, 91, 0.4) 20vh,
    rgba(31, 48, 91, 0.675) 30vh,
    rgba(31, 48, 91, 0.8) 40vh,
    rgba(31, 48, 91, 0.8) calc(100% - 40vh),
    rgba(31, 48, 91, 0.675) calc(100% - 30vh),
    rgba(31, 48, 91, 0.4) calc(100% - 20vh),
    rgba(31, 48, 91, 0.125) calc(100% - 10vh),
    rgba(31, 48, 91, 0) 100%
  );
}
.veil .story {
  min-height: calc(var(--screen) - 8rem);
}
.page-home .panel-close {
  min-height: var(--screen);
}

/* ---------- Every page but home ---------- */

/* The head: navy (the band's top) with the wordmark linking home and the
   page's title in cream serif, then the app's band from navy onto the tint,
   then the text in navy on the tint, one readable column. */
/* The page stays deep navy (Safari 26 colors its bar behind the clock from
   the page, so it matches the head) and the text sits on the cream tint. */
.page-plain main {
  background: var(--tint);
}
.site-head,
.page-head {
  background: var(--navy-deep); /* the app's band starts here, as does the browser's bar (theme-color) */
  color: var(--cream);
}
.site-head {
  padding: calc(env(safe-area-inset-top) + 0.75rem) var(--gutter) 0;
}
.site-head-inner,
.page-head-inner,
.page-body {
  max-width: 40rem;
  margin-inline: auto;
}
.site-head .brand {
  display: inline-block;
  padding: 0.5rem 0;
  font-family: var(--display);
  font-size: 1.625rem; /* the app's wordmarkSmall, 26 pt */
  line-height: 1.2;
  text-decoration: none;
}
.page-head {
  padding: clamp(1.75rem, 6vw, 3rem) var(--gutter) 0;
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.125rem, 8vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.page-head .effective {
  margin-top: 0.6rem;
  color: var(--cream-soft);
  font-size: 0.9375rem;
}
.page-band {
  /* The app's band colors (B5) from the head's deep navy to the cream tint,
     spaced so their brightness (OKLab lightness) rises evenly, eased at both
     ends so neither edge shows a line. B5's own spacing hurried through the
     dark blues (a jump when short) and spent its last quarter on near-cream
     (a gap when long). Tight, with the text close under it: Eric's G1
     (2026-11-25, docs/website-redesign-mockups/G-page-head.jpg). */
  height: 6rem;
  background: linear-gradient(
    to bottom,
    #1f305b 0%, #293f76 18.7%, #3d558d 29.4%, #5068a0 36.8%, #637bb2 43.4%, #7a91c5 50.7%,
    #93a8d6 58%, #aec0e5 66%, #cbd7f2 74.6%, #e6edfc 85%, #fefbe9 100%
  );
}
.page-body {
  padding: 1.5rem var(--gutter) clamp(3.5rem, 9vw, 6rem);
  box-sizing: content-box;
  color: var(--navy);
}
.page-plain :focus-visible {
  outline-color: var(--navy);
}
.page-plain .site-head :focus-visible,
.page-plain .page-head :focus-visible,
.page-plain .foot :focus-visible {
  outline-color: var(--cream);
}

/* The text: serif section headings (h2), Inter for the legal pages' many
   smaller ones (h3), links underlined (they're the text's own navy). */
.page-body .lead {
  margin-bottom: 0.5rem;
  font-size: 1.1875rem;
  line-height: 1.5;
}
.page-body p,
.page-body ul,
.page-body ol {
  margin: 0 0 1em;
}
.page-body h2 {
  margin: 2.25rem 0 0.6rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.15;
}
.page-body h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
}
.page-body ul,
.page-body ol {
  padding-left: 1.4rem;
}
.page-body li + li {
  margin-top: 0.35em;
}
.page-body a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.page-body a:hover {
  text-decoration-thickness: 2px;
}
.email {
  font-weight: 600;
}

/* Support's contact section: a plain section between two rules, no card. */
.contact-box {
  margin: 1.5rem 0 0.5rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid rgba(41, 63, 118, 0.18);
  border-bottom: 1px solid rgba(41, 63, 118, 0.18);
}
.contact-box h2 {
  margin-top: 0;
}

/* The one red call to action on a page: the app's primary button (12 pt
   corners, 52 pt tall), its label in the tint (4.7:1). */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 3.25rem;
  padding: 0 1.4rem;
  border-radius: 0.75rem;
  background: var(--red);
  color: var(--tint);
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  background: #bf2627;
}

/* 404 */
.not-found .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

/* ---------- Footer ---------- */

.foot {
  background: var(--navy-deep);
  color: var(--cream-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}
.foot-inner {
  display: grid;
  gap: 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3.5rem var(--gutter) calc(env(safe-area-inset-bottom) + 3rem);
}
.foot-nav ul {
  display: grid;
  gap: 0.15rem;
}
.foot-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--cream);
  text-decoration: none;
}
.foot a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.foot-contact {
  display: grid;
  gap: 1rem;
}
.foot-contact a {
  color: var(--cream);
  overflow-wrap: anywhere; /* the addresses wrap at 200% zoom */
}
.foot-legal {
  display: grid;
  gap: 0.25rem;
}
@media (min-width: 56rem) {
  .foot-inner {
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: start;
  }
}
