/* Additive UI motion and theme layer. Load after landing-v3.css.
   Entrance/reveal/menu timelines are owned by JavaScript; content stays visible. */
:root {
  --motion-quint: cubic-bezier(.23, 1, .32, 1);
  --motion-smooth: cubic-bezier(.32, .72, 0, 1);
  --chrome-primary-hover: #000000cc;
  --chrome-primary-pressed: #000000b3;
  --chrome-ghost-hover: #0000000d;
  --chrome-header: #ffffffcc;
  --wordmark-stroke: #00000080;
  --card-shadow: 0 13px 21px #0000001c, 0 2px 5px #00000012;
  --card-shadow-raised: 0 21px 30px #00000028, 0 4px 8px #00000014;
  --sample-shadow: 0 17px 27px #00000020, 0 2px 6px #00000012;
  --scene-shadow: 0 8px 15px #00000018;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #000000;
  --ink: #ffffff;
  --field: #141414;
  --field-tertiary: #262626;
  --muted: #ffffff99;
  --line: #ffffff1a;
  --border-hover: #ffffff33;
  --text-tertiary: #ffffff4d;
  --focus: #1d9bf0;
  --chrome-primary-hover: #ffffffcc;
  --chrome-primary-pressed: #ffffffb3;
  --chrome-ghost-hover: #ffffff1a;
  --chrome-header: #000000cc;
  --wordmark-stroke: #ffffff80;
  --card-shadow: 0 13px 21px #00000066, 0 0 0 1px #ffffff1a;
  --card-shadow-raised: 0 21px 30px #00000080, 0 0 0 1px #ffffff33;
  --sample-shadow: 0 17px 27px #00000080, 0 0 0 1px #ffffff1a;
  --scene-shadow: 0 8px 15px #00000066, 0 0 0 1px #ffffff1a;
  color-scheme: dark;
}

/* Keep the monochrome page chrome responsive to the resolved theme.
   The original SVG/PNG artwork is never filtered, tinted or recoloured. */
.brand-colours i:nth-child(2) { background: var(--chrome-primary-hover); }
.pill-primary:hover { background: var(--chrome-primary-hover); }
.pill-primary:active { background: var(--chrome-primary-pressed); }
.pill-outline:hover { background: var(--chrome-ghost-hover); }
.face-controls button[aria-pressed="true"] { border-color: var(--line); }
.face-controls button:hover { border-color: var(--border-hover); }
.mobile-header { background: var(--chrome-header); }
.footer-wordmark { -webkit-text-stroke-color: var(--wordmark-stroke); }
.rail-nav a { transition: color 200ms ease; }
.pill, .sample-picker button, .face-controls button {
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

/* Hero words preserve sentence semantics and the approved serif typography. */
.hero h1 { perspective: 1200px; }
.hero h1 > span:not(.hero-ending) { color: inherit; }
.hero h1 .hero-ending { color: var(--muted); }
.hero-word {
  display: inline-block;
  color: inherit;
  transform-origin: 50% 85%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* The existing responsive --card-x/--card-angle values remain authoritative. */
button.hero-card {
  display: block;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  aspect-ratio: 89 / 127;
  line-height: 0;
  box-shadow: var(--card-shadow);
  transform: translateX(var(--card-x)) rotate(var(--card-angle));
  transition: transform 200ms var(--motion-quint), box-shadow 200ms var(--motion-quint);
}
button.hero-card > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
button.hero-card:focus-visible {
  z-index: 6;
  transform: translateX(var(--card-x)) translateY(-10px) rotate(var(--card-angle));
  box-shadow: var(--card-shadow-raised);
}
@media (hover: hover) and (pointer: fine) {
  button.hero-card:hover {
    z-index: 6;
    transform: translateX(var(--card-x)) translateY(-10px) rotate(var(--card-angle));
    box-shadow: var(--card-shadow-raised);
  }
}

/* Two unchanged card faces, with one shared outer tilt and one inner flip. */
button.sample-image-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: auto;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  aspect-ratio: 89 / 127;
  perspective: 1000px;
  perspective-origin: 50% 15%;
  transform: rotate(-4deg) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 200ms var(--motion-quint);
  line-height: 0;
}
.sample-image-wrap .card-rotor {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 650ms var(--motion-quint);
}
.sample-image-wrap[data-face="back"] .card-rotor { transform: rotateY(180deg); }
.sample-image-wrap .card-rotor > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  border-radius: 3px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: none;
  box-shadow: var(--sample-shadow);
}
.sample-image-wrap .card-rotor > #sample-back-image { transform: rotateY(180deg); }
.no-flip .card-rotor, .card-rotor.no-flip { transition: none; }

/* Scene hover is decorative; the adjacent link remains the actual action. */
.deck-scene { perspective: 1000px; }
.deck-scene img {
  transform: translateX(-50%) translateY(var(--scene-lift, 0px)) rotate(-5deg) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-origin: 50% 75%;
  box-shadow: var(--scene-shadow);
  transition: transform 200ms var(--motion-quint), box-shadow 200ms var(--motion-quint);
}
.deck-item:focus-within .deck-scene { --scene-lift: -6px; }
@media (hover: hover) and (pointer: fine) {
  .deck-item:hover .deck-scene { --scene-lift: -6px; }
}

/* JS animates the measured answer wrapper; native details semantics remain. */
.faq-list .faq-answer { overflow: hidden; }
.faq-list .faq-answer > p {
  padding-right: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}
.faq-list .faq-answer > p + p { margin-top: 10px; }
.faq-list .faq-answer > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 9px;
  font-size: 12px;
}
.faq-list .faq-answer:focus-within { overflow: visible; }
.faq-list summary::after { transition: color 200ms ease; }

/* Small arrow responses match pointer and keyboard access. */
:is(.pill, .text-link, .hero-secondary, .all-cards-link, .deck-caption a, .footer-top a) > span[aria-hidden="true"] {
  display: inline-block;
  transition: opacity 150ms ease, transform 150ms var(--motion-quint);
}
:is(.pill, .text-link, .hero-secondary, .all-cards-link, .deck-caption a, .footer-top a):is(:hover, :focus-visible) > span[aria-hidden="true"] {
  transform: translateX(3px);
}
.hero-secondary:is(:hover, :focus-visible) > span[aria-hidden="true"] { transform: translateY(3px); }

/* Explicit preference controls; the script resolves System to a root theme. */
.theme-picker {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin-block: 12px 0;
}
.theme-label { margin-right: 8px; color: var(--muted); font-size: 10px; line-height: 18px; }
.theme-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 20px;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.theme-picker button > svg { display: block; width: 16px; height: 16px; flex: 0 0 16px; }
.theme-picker button:hover { background: var(--chrome-ghost-hover); color: var(--ink); }
.theme-picker button[aria-pressed="true"] { background: var(--chrome-ghost-hover); color: var(--ink); }
.theme-picker button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

@media (max-width: 767px) {
  .faq-list .faq-answer > p { font-size: 14px; }
  .theme-picker { gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hero-word { opacity: 1 !important; transform: none !important; backface-visibility: visible; }
  button.hero-card, button.hero-card:hover, button.hero-card:focus-visible {
    transform: translateX(var(--card-x)) rotate(var(--card-angle));
    box-shadow: var(--card-shadow);
  }
  button.sample-image-wrap { transform: rotate(-4deg); }
  .deck-scene img { transform: translateX(-50%) rotate(-5deg); }
  :is(.pill, .text-link, .hero-secondary, .all-cards-link, .deck-caption a, .footer-top a) > span[aria-hidden="true"] { transform: none !important; }
  /* Keep the selected front/back rotor transform; remove its duration only. */
  .sample-image-wrap .card-rotor { transition: none; }
}

@media (forced-colors: active) {
  button.hero-card, button.sample-image-wrap { outline: 1px solid CanvasText; }
  button.hero-card:focus-visible, button.sample-image-wrap:focus-visible { outline: 2px solid Highlight; }
  .theme-picker button { border: 1px solid ButtonText; }
  .theme-picker button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
  .footer-wordmark { -webkit-text-stroke: 0; color: CanvasText; }
}
