/* Caption Flow website.
   One idea carries the design: headings are set the way the app sets subtitles,
   an English line in a black caption box with its translation in a navy box below. */

:root {
  --blue: #1976D2;
  --blue-deep: #0F5BA8;
  --ink: rgba(0, 0, 0, 0.9);
  --ink-stroke: rgba(255, 255, 255, 0.2);
  --navy: rgba(0, 51, 102, 0.92);
  --navy-stroke: rgba(255, 255, 255, 0.4);
  --navy-solid: #003366;
  --yellow: #FFD23F;

  --paper: #EDF3FA;
  --surface: #FFFFFF;
  --text: #0D141C;
  --muted: #3F6489;
  --line: #CFDCEB;
  --link: #1458A6;
  --tick: #1976D2;

  --tint-float: #FFF1D6;
  --tint-live: #E4E9FF;
  --tint-dual: #D8F3EF;
  --tint-quick: #DDE9F8;

  --wrap: 1200px;
  --gutter: 16px;
  --section: 88px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1828;
    --surface: #12233A;
    --text: #E8EFF8;
    --muted: #A3BAD4;
    --line: #23395A;
    --link: #8CC2FF;
    --tick: #6FB1FF;
    --tint-float: #2A2316;
    --tint-live: #1B2141;
    --tint-dual: #0F2E2B;
    --tint-quick: #142942;
    color-scheme: dark;
  }
}

@media (min-width: 720px) {
  :root { --gutter: 32px; --section: 112px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

p { margin: 0 0 1em; }

h1, h2, h3 { margin: 0; text-wrap: balance; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 10;
  background: #000; color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--yellow);
  border-radius: 6px;
}

/* ---------- Caption boxes (copied from the app's subtitle drawables) ---------- */

.cap {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink-stroke);
  border-radius: 0.16em;
  padding: 0.04em 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.cap-tr {
  background: var(--navy);
  border-color: var(--navy-stroke);
  font-weight: 500;
}

.dual {
  font-size: clamp(1.75rem, 1.25rem + 1.9vw, 2.6rem);
  font-weight: 700;
  line-height: 1.44;
  letter-spacing: -0.005em;
  margin-bottom: 0.7em;
}
.dual .tr {
  display: block;
  margin-top: 0.4em;
  font-size: 0.5em;
  line-height: 1.6;
}
h3.dual { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem); }
h3.dual .tr { font-size: 0.6em; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 52px;
  padding: 0.75em 1.35em;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-glyph { width: 1.1em; height: 1.1em; flex: none; }

.btn-play {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.btn-play:hover { background: #1b2330; }

.btn-light { background: #fff; color: #000; border: 1px solid transparent; }
.btn-light:hover { background: #E3EEFB; }

.btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.btn-small { min-height: 46px; font-size: 1rem; padding: 0.6em 1.1em; }

/* ---------- Header ---------- */

.top { background: var(--blue); color: #fff; }
.top-in {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo { width: 36px; height: 36px; flex: none; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.nav a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.btn-top {
  min-height: 42px;
  padding: 0.5em 1em;
  background: #fff;
  color: var(--blue-deep);
  font-size: 1rem;
}
.btn-top:hover { background: #E3EEFB; }

@media (max-width: 760px) {
  .nav a:not([href="/blog/"]) { display: none; }
  .top-in { gap: 8px; }
  .brand span { font-size: 1.125rem; }
}
@media (max-width: 380px) {
  .btn-top { display: none; }
}

/* ---------- Screen frame: an illustrated video with live subtitles ---------- */

.screen {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #101a3a;
  aspect-ratio: 16 / 9;
  box-shadow: 0 30px 60px -20px rgba(3, 20, 48, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.screen-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 40%;
}
.screen .captions,
.demo-screen .captions {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 6%;
  text-align: center;
}
.screen .captions .tr { margin: 0.5em 0 0; }

.live {
  position: absolute;
  top: 16px;
  left: 16px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border-radius: 8px;
  background: var(--ink);
  border: 1px solid var(--ink-stroke);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}
.live-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: pulse 1.8s ease-out infinite;
}
button.live { font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; }
button.live:hover { background: #000; }
.live.is-paused .live-dot { animation: none; background: #9AA4B2; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@media (max-width: 700px) {
  .screen { aspect-ratio: 4 / 5; border-radius: 16px; }
  .post-screen { aspect-ratio: 1 / 1; }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--blue);
  color: #fff;
  padding: 8px 0 72px;
}
.hero-cap {
  font-size: clamp(1.65rem, 0.9rem + 3.3vw, 3.75rem);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.01em;
}
.hero .captions .tr {
  font-size: clamp(1rem, 0.75rem + 1.05vw, 1.6rem);
  line-height: 1.5;
}
.hero .cap-tr { transition: opacity 0.35s ease; }
.hero .cap-tr.swap { opacity: 0; }

/* words not yet "heard" by the live caption */
.hero-cap .wd[hidden] { display: none; }

.hero-foot {
  display: grid;
  gap: 24px;
  margin-top: 36px;
  align-items: center;
}
.lede {
  margin: 0;
  max-width: 38rem;
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.55;
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hint { margin: 0; font-size: 1rem; color: rgba(255, 255, 255, 0.9); }

@media (min-width: 900px) {
  .hero-foot { grid-template-columns: minmax(0, 1fr) auto; gap: 48px; }
}

/* ---------- Feature rows ---------- */

.paper { background: var(--paper); }

.row {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-top: var(--section);
}
.row-text > p { max-width: 36rem; }
.row-fig { margin: 0; display: flex; justify-content: center; }
.phone { width: min(340px, 80vw); }

@media (min-width: 900px) {
  .row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 72px; }
  .row-flip .row-text { order: 2; }
  .row-flip { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

.ticks { list-style: none; padding: 0; margin: 1.4em 0 0; max-width: 36rem; }
.ticks li {
  display: grid;
  grid-template-columns: 1.5em 1fr;
  gap: 0.5em;
  margin: 0.65em 0;
}
.ic { width: 1.35em; height: 1.35em; color: var(--tick); margin-top: 0.12em; }

/* ---------- Learning Mode demo ---------- */

.learn {
  margin-top: var(--section);
  background: var(--navy-solid);
  color: #fff;
  padding: var(--section) 0;
}
.learn .cap { border-color: rgba(255, 255, 255, 0.28); }
.learn-in { display: grid; gap: 40px; }
.learn-text > p { max-width: 40rem; color: rgba(255, 255, 255, 0.92); }
.learn-try { font-weight: 700; color: #fff; }

.demo { display: grid; gap: 16px; }
@media (min-width: 1100px) {
  .learn-in { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); align-items: center; gap: 64px; }
}

.demo-screen {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #2b2350;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.demo-screen > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.demo-caps { font-size: clamp(1.05rem, 0.8rem + 1.1vw, 1.5rem); line-height: 1.5; }
.demo-caps p { margin: 0; }
.demo-caps .tr { font-size: 0.8em; }
.demo-line .cap { padding: 0.1em 0.3em; }

.w {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 0.08em;
  margin: 0;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: underline dotted rgba(255, 255, 255, 0.55);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
}
.w:hover { background: rgba(255, 255, 255, 0.16); }
.w.on { background: var(--yellow); color: #000; text-decoration: none; }

.lookup {
  position: absolute;
  left: 50%;
  top: 8%;
  translate: -50% 0;
  width: min(84%, 320px);
  padding: 18px 22px 10px;
  border-radius: 20px;
  background: #F2F6FC;
  color: #0D141C;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  animation: pop 0.18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.lookup p { margin: 0; }
.lookup-word { font-size: 1.9rem; font-weight: 700; line-height: 1.25; }
.lookup-mean { font-size: 1.15rem; margin-top: 4px !important; }
.lookup-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.lk-btn {
  font: inherit;
  font-weight: 700;
  color: #2C6095;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.lk-btn:hover { background: #E1EAF6; }
.lk-btn[disabled] { color: #5f7690; cursor: default; background: none; }

.saved {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  min-height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 1rem;
}
.saved h3 { font-size: 1rem; }
.saved ul { display: contents; list-style: none; }
.saved li { display: inline-flex; gap: 8px; align-items: baseline; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.saved li b { font-size: 1.1rem; }
.saved li span { color: rgba(255, 255, 255, 0.8); }
.saved-empty { margin: 0; color: rgba(255, 255, 255, 0.78); }

/* ---------- More features ---------- */

.more {
  display: grid;
  gap: 24px;
  padding-top: var(--section);
}
@media (min-width: 900px) { .more { grid-template-columns: 1fr 1fr; } }

.tile {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 24px;
  overflow: hidden;
  padding: 32px 28px 0;
}
@media (min-width: 720px) { .tile { padding: 40px 40px 0; } }
.tile p { max-width: 34rem; }
.tile-float { background: var(--tint-float); }
.tile-live { background: var(--tint-live); }
.tile-dual { background: var(--tint-dual); }
.tile-quick { background: var(--tint-quick); }

.tile-fig {
  height: 340px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 8px;
}
.tile-fig .phone { width: 300px; max-width: none; }

.tile-srt {
  height: auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 18px;
  padding-bottom: 40px;
}
.tile-srt pre {
  margin: 0;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text);
}
.srt-n, .srt-t { color: var(--muted); }
.srt-out { text-align: center; font-size: 1.3rem; font-weight: 500; }

/* ---------- Privacy ---------- */

.privacy { padding-top: var(--section); }
.facts {
  display: grid;
  gap: 0 32px;
  margin: 0 0 24px;
  border-top: 2px solid var(--text);
}
@media (min-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts > div { padding: 20px 0 8px; }
.facts dt { font-weight: 700; font-size: 1.15rem; }
.facts dd { margin: 6px 0 0; color: var(--muted); }

.link { color: var(--link); font-weight: 700; text-underline-offset: 0.18em; }

/* ---------- Plans ---------- */

.plans { padding-top: var(--section); }
.plans-lede { max-width: 44rem; }
.table-scroll { overflow-x: auto; margin: 32px 0 20px; }
.compare {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
}
.compare th, .compare td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 1.05rem;
}
.compare thead th { font-size: 1.15rem; padding-top: 20px; }
.compare thead th:first-child { color: var(--muted); font-weight: 500; font-size: 1rem; }
.compare th[scope="row"] { text-align: left; font-weight: 500; }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare td:nth-child(2) { background: color-mix(in srgb, var(--paper) 55%, var(--surface)); }
.compare .ic { display: inline-block; vertical-align: middle; margin: 0; }
.none { color: var(--muted); }
.note { max-width: 48rem; font-size: 1rem; color: var(--muted); }

/* ---------- FAQ ---------- */

.faq { padding-top: var(--section); }
.faq-list { max-width: 52rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 20px 48px 20px 0;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 14px; height: 14px;
  margin-top: -10px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -3px; }
.faq-a p { max-width: 46rem; margin: 0 0 22px; }
.faq-a a { color: var(--link); }
.faq-more { margin-top: 24px; }

/* ---------- Blog lists ---------- */

.posts-teaser { padding: var(--section) var(--gutter) var(--section); }

.post-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 24px;
  display: grid;
  gap: 40px 32px;
}
@media (min-width: 720px) { .post-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .post-list:not(.post-list-2) { grid-template-columns: repeat(3, 1fr); } }

.post-card a { text-decoration: none; display: block; }
.post-card img { border-radius: 14px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-card h3 { font-size: 1.35rem; line-height: 1.3; margin: 16px 0 8px; }
.post-card a:hover h3 { text-decoration: underline; text-underline-offset: 0.15em; }
.post-card p { margin: 0 0 8px; color: var(--muted); }
.post-card .meta { font-size: 0.95rem; }

/* ---------- Closer ---------- */

.closer { background: var(--blue); color: #fff; padding: var(--section) 0; }
.closer-in { text-align: center; }
.closer .dual { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.2rem); margin-bottom: 32px; }

/* ---------- Footer ---------- */

.foot { background: var(--paper); border-top: 1px solid var(--line); font-size: 1rem; }
.foot-in { display: grid; gap: 32px; padding-top: 56px; padding-bottom: 24px; }
@media (min-width: 820px) { .foot-in { grid-template-columns: 2fr 1fr 1fr 1.3fr; } }
.foot-brand p { color: var(--muted); max-width: 22rem; margin: 12px 0 18px; }
.foot .brand .logo rect:first-child { stroke: none; }
.foot-col h2 { font-size: 1rem; margin-bottom: 8px; }
.foot-col a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.foot-col a:hover { color: var(--text); text-decoration: underline; }
.foot-legal { padding-bottom: 32px; color: var(--muted); font-size: 0.9rem; }
.foot-legal p { margin: 0; }

/* ---------- Blue band (blog index, 404) ---------- */

.band { background: var(--blue); color: #fff; padding: 40px 0 72px; }
.band .dual { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem); }
.band-lede { max-width: 40rem; font-size: 1.25rem; }
.band .btn { margin: 8px 8px 0 0; }
.blog-list { padding-top: 64px; padding-bottom: var(--section); }

/* ---------- Post ---------- */

.post-head { background: var(--blue); color: #fff; padding: 4px 0 56px; }
.crumbs { margin-bottom: 16px; }
.crumbs a { color: #fff; font-weight: 700; text-decoration: none; padding: 6px 0; }
.crumbs a::before { content: "‹ "; }
.crumbs a:hover { text-decoration: underline; }
.post-screen { max-width: 1100px; margin-inline: auto; }
.post-cap {
  font-size: clamp(1.4rem, 0.9rem + 2.2vw, 2.7rem);
  line-height: 1.42;
  font-weight: 700;
}
.post-head .captions .tr { font-size: clamp(0.95rem, 0.75rem + 0.8vw, 1.35rem); line-height: 1.5; }

.prose-wrap { max-width: calc(44rem + 2 * var(--gutter)); padding-top: 48px; padding-bottom: 24px; }
.post-meta { color: var(--muted); font-size: 1rem; margin-bottom: 32px; }

.prose { font-size: 1.1875rem; line-height: 1.68; }
.prose > p:first-child { font-size: 1.3rem; line-height: 1.55; }
.prose h2 { font-size: 1.6rem; line-height: 1.3; margin: 1.9em 0 0.55em; }
.prose a { color: var(--link); text-underline-offset: 0.16em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: 0.45em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--muted); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose .table-scroll { margin: 24px 0 28px; }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 1rem; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { border-bottom: 2px solid var(--text); }

.post-cta {
  margin-top: 56px;
  padding: 28px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.post-cta p { margin: 0; max-width: 26rem; font-weight: 500; }

.more-posts { padding-top: 48px; padding-bottom: var(--section); }
.plain-h { font-size: 1.5rem; margin-bottom: 24px; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
