/* Action - editorial pages (privacy, support). Self-contained, system fonts. */

/* Brand palette taken from the Action app icon: deep navy base, record-red dot,
   silver/white panels. */
:root {
  --paper: #f5f7fa;
  --ink: #0f1a2e;
  --ink-soft: #5b6678;
  --rule: #e0e5ee;
  --accent: #f5184a;
  --card: #ecf0f6;
  --measure: 42rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1322;
    --ink: #e9eef6;
    --ink-soft: #97a3b7;
    --rule: #1e293b;
    --accent: #ff5d79;
    --card: #121d31;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 6rem) clamp(1.25rem, 5vw, 2rem) 4rem;
}

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 23%;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.brand .dot { color: var(--accent); }

.masthead nav a {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 1.4rem;
}

.masthead nav a:hover { color: var(--accent); }

/* Title block */
.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.lede {
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}

.dateline {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2.75rem;
}

/* Sections */
h2 {
  font-size: 1.05rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 3rem 0 0.4rem;
  color: var(--ink);
}

h2 .num {
  color: var(--accent);
  margin-right: 0.6rem;
  font-variant-numeric: tabular-nums;
}

h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.6rem 0 0.3rem;
}

p { margin: 0.7rem 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

strong { font-weight: 700; }

ul, ol { margin: 0.7rem 0; padding-left: 1.3rem; }
li { margin: 0.35rem 0; padding-left: 0.2rem; }
li::marker { color: var(--accent); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* Callout card (the short version / contact) */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  margin: 2rem 0;
}

.card h2 { margin-top: 0; }

.card.tight p:last-child { margin-bottom: 0; }

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  margin-bottom: 0.9rem;
}

/* Definition list for permissions / shortcuts */
.deflist { margin: 1rem 0; }
.deflist div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.4rem 1.4rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.97rem;
  line-height: 1.5;
}
.deflist div:last-child { border-bottom: 1px solid var(--rule); }
.deflist dt { font-weight: 700; }
.deflist dd { margin: 0; color: var(--ink-soft); }

@media (max-width: 33rem) {
  .deflist div { grid-template-columns: 1fr; gap: 0.1rem; }
}

kbd {
  font-family: var(--sans);
  font-size: 0.85em;
  background: var(--card);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
}

footer a { color: var(--ink-soft); }
footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------------------------
   Landing page (index.html) - scroll story. Stays within the same narrow
   measure as the rest of the site.
   --------------------------------------------------------------------------- */

/* Scroll progress bar */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), #ff8aa0);
  z-index: 50;
}

/* Hero */
.hero { padding: 1rem 0 1.5rem; }

.hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 23%;
  display: block;
  margin-bottom: 1.6rem;
  box-shadow: 0 10px 30px rgba(15, 26, 46, 0.22);
}

.hero h1 {
  font-size: clamp(2.7rem, 9vw, 4.3rem);
  margin-bottom: 1.1rem;
}

.hero .lede { margin-bottom: 2rem; }

/* Faux floating control bar, echoing the app */
.barmock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #14203a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.6rem 0.7rem;
  box-shadow: 0 12px 34px rgba(15, 26, 46, 0.28);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.barmock .b {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #243352;
  flex: none;
}

.barmock .b.lit { background: #33456b; }

.barmock .rec {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
  border-radius: 999px;
  margin-left: 0.3rem;
}

.barmock .rec .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
}

.scroll-hint {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.scroll-hint .arrow {
  display: inline-block;
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Story */
.story { margin-top: 1rem; }

.step {
  padding: 3.25rem 0;
  border-top: 1px solid var(--rule);
}

.step .step-num {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.6rem;
}

.step h2 {
  text-transform: none;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.7rem;
}

.step p { color: var(--ink-soft); font-size: 1.12rem; }

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.chip {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.chip.accent {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

/* Mode preview tiles (teleprompter) */
.tiles { display: flex; gap: 0.7rem; margin-top: 1.3rem; flex-wrap: wrap; }
.tile {
  flex: 1 1 7rem;
  min-width: 6.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0.9rem;
}
.tile .ln { height: 0.34rem; border-radius: 999px; background: var(--ink-soft); opacity: 0.55; margin: 0.32rem 0; }
.tile .ln.s { width: 60%; }
.tile .ln.a { background: var(--accent); opacity: 0.9; width: 80%; }
.tile .cap {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.7rem;
}

/* Closing CTA */
.cta {
  margin-top: 3.5rem;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 2.6rem 1.6rem;
}
.cta h2 {
  text-transform: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin: 0 0 0.6rem;
}
.cta p { color: var(--ink-soft); margin: 0 auto 1.4rem; }
.cta-links { display: inline-flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  display: inline-block;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { color: var(--ink); border: 1px solid var(--rule); background: transparent; }
.btn:hover { opacity: 0.9; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint .arrow { animation: none; }
}

/* ---------------------------------------------------------------------------
   Scrollytelling - a pinned HUD that stays while chapters scroll past and the
   bar morphs through each state. Recreated from the Figma HUD frame.
   --------------------------------------------------------------------------- */

.scrolly { position: relative; margin-top: 2rem; }

/* Full-height sticky stage. Chapters scroll over it; the bar rests in the
   lower-middle so each chapter's text reads in the space above it. */
.stage {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 52vh;
  pointer-events: none;
}

/* Bar + Record sit side by side; Record is its own pill outside the bar. */
.rig {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 96vw;
}

/* The HUD bar - frosted white capsule, matching the app's glass material */
.hud {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 20px 50px rgba(20, 28, 45, 0.22), 0 3px 10px rgba(20, 28, 45, 0.1);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
}

.hud-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: none;
  margin: 0 4px;
}

.hud-sep {
  width: 1px;
  height: 30px;
  background: rgba(0, 0, 0, 0.12);
  flex: none;
  margin: 0 5px;
}

.hud-spacer { width: 2px; }

/* Icon buttons - the SVG carries its own look (resting glyph, or a black
   circle with a white glyph when selected). */
.hbtn {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  padding: 0;
  flex: none;
  display: grid;
  place-items: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.hbtn img { width: 44px; height: 44px; display: block; }

/* Record pill (black), standalone */
.hud-rec {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #000;
  color: #fff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 0.62rem 1.35rem 0.62rem 1rem;
  border-radius: 999px;
  flex: none;
  box-shadow: 0 20px 50px rgba(20, 28, 45, 0.22), 0 3px 10px rgba(20, 28, 45, 0.12);
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}
.hud-rec .dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2.5px solid #fff;
  position: relative;
  flex: none;
}
.hud-rec .dot::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: #fff;
}

/* Recording state: dim the tools, press the record button */
.rig[data-state="recording"] .hbtn { opacity: 0.35; }
.rig[data-state="recording"] .hud-rec { transform: scale(0.96); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.12), 0 20px 50px rgba(20, 28, 45, 0.22); }
.rig[data-state="recording"] .hud-rec .dot { animation: recpulse 1.4s ease-in-out infinite; }

@keyframes recpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Pop-out panel below the bar - frosted to match the bar */
.hud-panel {
  margin-top: 0.9rem;
  width: min(23rem, 92vw);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(20, 28, 45, 0.18);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top center;
  max-height: 0;
  overflow: hidden;
  padding: 0 1.15rem;
  transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.45s ease, padding 0.45s ease;
}
.hud-panel.show {
  opacity: 1;
  transform: none;
  max-height: 14rem;
  padding: 1.05rem 1.15rem;
}
.hud-panel .ph {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
.hud-panel .pln {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(20, 28, 45, 0.16);
  margin: 0.42rem 0;
}
.hud-panel .pln.s { width: 55%; }
.hud-panel .pln.cur { background: var(--accent); opacity: 0.9; }

/* Talking points list inside the panel */
.tp { list-style: none; margin: 0; padding: 0; }
.tp li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 0.28rem 0;
}
.tp .box {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 5px;
  border: 1.5px solid rgba(20, 28, 45, 0.28);
  flex: none;
  display: grid;
  place-items: center;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.tp .box svg { width: 0.7rem; height: 0.7rem; opacity: 0; transition: opacity 0.3s ease; color: #fff; }
.tp li.done { color: var(--ink); }
.tp li.done .box { background: #1db954; border-color: #1db954; }
.tp li.done .box svg { opacity: 1; }

/* Scenes (the scrolling chapters) scroll OVER the sticky stage. Their text
   sits in the upper part of the viewport, leaving the bar resting in the
   blank space below the copy. */
.scenes { position: relative; z-index: 2; margin-top: -100vh; }

.scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 9vh 0 2rem;
  opacity: 0.32;
  transition: opacity 0.5s ease;
}
.scene.active { opacity: 1; }

.scene .step-num {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.55rem;
}
.scene h2 {
  text-transform: none;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.6vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.7rem;
}
.scene p { color: var(--ink-soft); font-size: 1.12rem; margin: 0; }

/* The first chapter doubles as the hero: big title with the bar resting below. */
.hero-scene { opacity: 1; }
.hero-scene .kicker { margin: 0 0 1rem; }
.hero-scene h1 {
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 1.1rem;
}
.hero-scene .lede {
  font-size: clamp(1.18rem, 2.5vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}
.hero-scene .scroll-hint { margin-top: 0.4rem; }

@media (prefers-reduced-motion: reduce) {
  .stage { position: static; height: auto; padding-top: 0; }
  .scenes { margin-top: 0; }
  .hud *, .hud-panel, .hbtn, .tp .box, .tp .box svg { transition: none; }
  .scene { opacity: 1; min-height: auto; padding: 3vh 0; }
  .hud-rec .dot { animation: none; }
}

/* Mid sizes - shrink the hero bar so it stays on one line within the page. */
@media (max-width: 880px) {
  .hbtn, .hbtn img { width: 36px; height: 36px; }
  .hud-icon { width: 31px; height: 31px; margin: 0 3px; }
  .hud { gap: 3px; padding: 5px 7px; }
  .hud-sep { height: 26px; margin: 0 4px; }
  .hud-rec { font-size: 0.92rem; padding: 0.52rem 1.1rem 0.52rem 0.85rem; }
  .hud-rec .dot { width: 1rem; height: 1rem; }
  .stage { padding-top: 52vh; }
}

@media (max-width: 640px) {
  .rig { gap: 0.45rem; }
  .hbtn, .hbtn img { width: 30px; height: 30px; }
  .hud-icon { width: 25px; height: 25px; margin: 0 2px; }
  .hud { gap: 1px; padding: 4px 5px; }
  .hud-sep { height: 22px; margin: 0 2px; }
  .hud-rec { font-size: 0.8rem; padding: 0.42rem 0.8rem 0.42rem 0.62rem; }
  .hud-rec .dot { width: 0.85rem; height: 0.85rem; }
}

@media (max-width: 460px) {
  .hbtn, .hbtn img { width: 26px; height: 26px; }
  .hud-icon { width: 22px; height: 22px; }
  .hud-rec .dot { width: 0.78rem; height: 0.78rem; }
  .hud-rec { font-size: 0.72rem; padding: 0.4rem 0.7rem 0.4rem 0.55rem; }
}
