/* protts.app homepage (spec: design/website/). Colours are the app's (mobile/lib/design_system/tokens.dart):
   page F5F7FC / 101014, ink 141418, accent 3D6FE0 → highlight end 6A8CFF. */

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/Literata-Variable.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --page: #f5f7fc;
  --paper: #ffffff;
  --ink: #141418;
  --muted: #5d6270;
  --faint: #8a8f9c;
  --line: #e3e7f0;
  --accent: #3d6fe0;
  --accent-end: #6a8cff;
  --accent-text: #2f5ec4;
  --accent-soft: #eaf0fd;
  --sheet-shadow: 0 1px 0 rgba(20, 30, 70, 0.04), 0 2px 6px rgba(30, 50, 110, 0.06),
    0 30px 70px -28px rgba(40, 70, 160, 0.35);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  color-scheme: light;
}

[data-theme="dark"] {
  --page: #101014;
  --paper: #1c1d23;
  --ink: rgba(255, 255, 255, 0.95);
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.1);
  --accent-text: #94b5ff;
  --accent-soft: rgba(61, 111, 224, 0.16);
  --sheet-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 70px -28px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(28px, 3.3vw, 40px); line-height: 1.12; }
h3 { font-size: 17px; line-height: 1.3; margin: 0; font-weight: 650; }

main > section { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
main > section + section { margin-top: clamp(80px, 10vw, 128px); }

.section-head { display: grid; gap: 12px; max-width: 640px; margin-bottom: 40px; }
.section-head p { margin: 0; color: var(--muted); font-size: 18px; }

/* ── Nav ─────────────────────────────────────────────── */
.nav {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-get {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  padding: 9px 16px;
  border-radius: 999px;
}
[data-theme="dark"] .nav-get { background: #fff; color: #141418; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 12fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-top: clamp(28px, 5vw, 64px) !important;
}
.hero h1 { font-size: clamp(40px, 4.6vw, 60px); line-height: 1.05; }
.lede { font-size: 19px; line-height: 1.55; color: var(--muted); margin: 22px 0 30px; max-width: 30em; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 14px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.store svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; opacity: 0.85; }
[data-theme="dark"] .store { background: #fff; color: #000; }
.stores-note { margin: 14px 0 0; font-size: 14px; color: var(--faint); }

/* The reader sheet */
.reader {
  position: relative;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--sheet-shadow);
  padding: 20px 22px 18px;
}
.reader-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.who:hover, .who[aria-expanded="true"] { background: var(--accent-soft); }
.who img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.who-text { display: grid; line-height: 1.2; }
.who-text b { font-size: 15px; }
.who-text span { font-size: 13px; color: var(--muted); }
.chev { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.who[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lang select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a8f9c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 11px;
  color: var(--ink);
  font: 500 14px var(--sans);
  padding: 7px 28px 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.cast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 6px;
  padding: 16px 4px 6px;
  margin: 8px 0 0;
  border-top: 1px solid var(--line);
}
.cast[hidden] { display: none; }
.cast button {
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 13px var(--sans);
  cursor: pointer;
  padding: 2px;
  border-radius: 12px;
}
.cast img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.15s; }
.cast button:hover img { box-shadow: 0 0 0 2px var(--line); }
.cast button[aria-selected="true"] { color: var(--ink); font-weight: 650; }
.cast button[aria-selected="true"] img { box-shadow: 0 0 0 3px var(--accent); }

.page { position: relative; margin: 14px 0 0; }
.page textarea, .spoken {
  display: block;
  width: 100%;
  min-height: 252px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 23px/1.6 var(--serif);
  letter-spacing: -0.003em;
}
.page textarea { resize: none; outline: none; border-radius: 10px; overflow: hidden; }
.page textarea[hidden] { display: none; }
.page textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.spoken { cursor: text; white-space: pre-wrap; overflow-wrap: anywhere; }
.spoken[hidden] { display: none; }
.spoken span { border-radius: 7px; transition: color 0.2s; }
.spoken .done { color: var(--faint); }
.spoken .now {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-end));
  box-shadow: 0 6px 18px -6px rgba(61, 111, 224, 0.55);
  padding: 0.04em 0.14em;
  margin: 0 -0.14em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.reader-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.play {
  position: relative;
  overflow: hidden;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  min-width: 128px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 650 17px var(--sans);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px -8px rgba(61, 111, 224, 0.7);
}
.play:disabled { cursor: progress; }
.play-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(100deg, var(--accent), var(--accent-end));
  transition: width 0.25s linear;
}
.play[data-state="loading"] { background: #9db4ec; }
[data-theme="dark"] .play[data-state="loading"] { background: #2b3f72; }
.bars, .play-label { position: relative; }
.bars { display: flex; align-items: center; gap: 3px; height: 22px; }
.bars i { display: block; width: 4px; border-radius: 2px; background: currentColor; }
.bars i:nth-child(1), .bars i:nth-child(5) { height: 9px; }
.bars i:nth-child(2), .bars i:nth-child(4) { height: 20px; }
.bars i:nth-child(3) { height: 13px; }
.play[data-state="playing"] .bars i { animation: talk 0.9s ease-in-out infinite; }
.play[data-state="playing"] .bars i:nth-child(2) { animation-delay: -0.3s; }
.play[data-state="playing"] .bars i:nth-child(3) { animation-delay: -0.6s; }
.play[data-state="playing"] .bars i:nth-child(4) { animation-delay: -0.15s; }
.play[data-state="playing"] .bars i:nth-child(5) { animation-delay: -0.45s; }
@keyframes talk { 50% { transform: scaleY(0.45); } }

.status { margin: 0; flex: 1; font-size: 14px; line-height: 1.4; color: var(--muted); min-width: 0; }
.status[data-tone="error"] { color: #b3352c; }
[data-theme="dark"] .status[data-tone="error"] { color: #f2867f; }
.count { flex: none; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ── Promises ────────────────────────────────────────── */
.promises h2 { max-width: 16em; margin-bottom: 44px; }
.promises ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; }
.promises svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 16px; }
.promises li:last-child svg { fill: var(--accent); stroke: none; }
.promises p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }

/* ── Sources: the app's glass squares ────────────────── */
.sources h2 { margin-bottom: 40px; }
.sources ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
.sources li { display: grid; gap: 4px; align-content: start; }
.sources li b { font-size: 17px; margin-top: 14px; }
.sources li > span:last-child { color: var(--muted); font-size: 15px; line-height: 1.4; }
.sq {
  width: 68px;
  height: 68px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 14px rgba(0, 0, 0, 0.18), 0 10px 22px -12px var(--pool);
}
.sq svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18)); }
.sq-files { background: linear-gradient(#ff6b5e, #e0383b); --pool: #e0383b; }
.sq-web { background: linear-gradient(#4da3ff, #1f6feb); --pool: #1f6feb; }
.sq-text { background: linear-gradient(#3dd68c, #15a04a); --pool: #15a04a; }
.sq-camera { background: linear-gradient(#555b68, #262931); --pool: #262931; }
[data-theme="dark"] .sq-camera { background: linear-gradient(#70778a, #3e4350); }
.sq-classics { background: linear-gradient(#ffb547, #f0750f); --pool: #f0750f; }
.sources-more { margin: 40px 0 0; color: var(--muted); font-size: 16px; }

/* ── Voices ──────────────────────────────────────────── */
.voice-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 36px 20px; }
.voice {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 16px;
}
.voice-face { position: relative; margin-bottom: 10px; }
.voice-face img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px transparent; transition: box-shadow 0.2s; }
.voice:hover .voice-face img { box-shadow: 0 0 0 3px var(--line); }
.voice[aria-pressed="true"] .voice-face img { box-shadow: 0 0 0 3px var(--accent); }
.voice-face .badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(20, 30, 70, 0.18);
  display: grid;
  place-items: center;
  color: var(--accent);
}
.badge svg { width: 13px; height: 13px; fill: currentColor; margin-left: 2px; }
.badge .bars { height: 14px; gap: 2px; display: none; }
.badge .bars i { width: 2.5px; }
.badge .bars i:nth-child(1), .badge .bars i:nth-child(5) { height: 5px; }
.badge .bars i:nth-child(2), .badge .bars i:nth-child(4) { height: 13px; }
.badge .bars i:nth-child(3) { height: 8px; }
.voice[aria-pressed="true"] .badge svg { display: none; }
.voice[aria-pressed="true"] .badge .bars { display: flex; }
.voice[aria-pressed="true"] .badge .bars i { animation: talk 0.9s ease-in-out infinite; }
.voice[aria-pressed="true"] .badge .bars i:nth-child(2) { animation-delay: -0.3s; }
.voice[aria-pressed="true"] .badge .bars i:nth-child(3) { animation-delay: -0.6s; }
.voice[aria-pressed="true"] .badge .bars i:nth-child(4) { animation-delay: -0.15s; }
.voice b { font-size: 17px; }
.voice .tags { font-size: 14px; color: var(--muted); }
.voice q { quotes: "\201C" "\201D"; font: italic 400 14px/1.45 var(--serif); color: var(--muted); margin-top: 8px; max-width: 15em; text-align: center; }

/* ── Compare ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: 22px; box-shadow: var(--sheet-shadow); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 18px 22px; vertical-align: top; font-size: 16px; }
thead th { font-size: 15px; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); }
thead th.us { color: var(--accent-text); }
tbody th { font-weight: 600; width: 26%; color: var(--ink); }
tbody td { color: var(--muted); }
tbody td.us { color: var(--ink); font-weight: 600; background: var(--accent-soft); }
thead th.us { background: var(--accent-soft); }
tbody tr + tr > * { border-top: 1px solid var(--line); }

/* ── Questions ───────────────────────────────────────── */
.faq > * { max-width: 820px; }
.faq h2 { margin-bottom: 24px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 36px 20px 0;
  position: relative;
  font: 600 19px/1.35 var(--serif);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: -6px 0 22px; color: var(--muted); max-width: 40em; }

/* ── Closing band ────────────────────────────────────── */
.closing {
  max-width: calc(var(--wrap) - 2 * var(--gutter)) !important;
  margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))) !important;
  margin-right: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))) !important;
  padding: clamp(48px, 7vw, 88px) var(--gutter) !important;
  border-radius: 32px;
  background: linear-gradient(160deg, #4a7bea, #3d6fe0 45%, #2f5ec4);
  color: #fff;
  display: grid;
  justify-items: center;
  gap: 28px;
  text-align: center;
}
.closing h2 { font-size: clamp(30px, 4vw, 48px); max-width: 14em; }
.closing .stores { justify-content: center; }
.store-light, [data-theme="dark"] .store-light { background: #fff; color: #000; }

/* ── Footer ──────────────────────────────────────────── */
.foot {
  max-width: var(--wrap);
  margin: 56px auto 0;
  padding: 28px var(--gutter) 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand img { border-radius: 6px; }
.foot nav { display: flex; gap: 22px; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--ink); }

/* ── Smaller screens ─────────────────────────────────── */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 640px; }
  .promises ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sources ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .voice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 16px; }
  .nav-links { display: none; }
  .nav-get { margin-left: auto; }
  .lede { font-size: 17px; }
  /* Phones: the demo comes straight after the headline, before the pitch. */
  .hero { gap: 0; }
  .hero-copy { display: contents; }
  .hero h1 { order: 1; }
  .reader { order: 2; margin-top: 24px !important; }
  .lede { order: 3; margin-top: 32px; }
  .hero .stores { order: 4; }
  .stores-note { order: 5; }
  .reader { padding: 14px 14px 14px; border-radius: 24px; margin: 0 calc(var(--gutter) * -0.5); }
  .page textarea, .spoken { font-size: 20px; min-height: 230px; }
  .cast img { width: 46px; height: 46px; }
  .status { font-size: 13px; }
  .count { display: none; }
  .promises ul { grid-template-columns: 1fr; gap: 26px; }
  .promises li { display: grid; grid-template-columns: 30px 1fr; column-gap: 16px; }
  .promises li svg { grid-row: span 2; margin: 0; }
  .promises li p { margin-top: 4px; }
  .sources ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .voice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .voice-face img { width: 88px; height: 88px; }
  /* Phones: each question becomes a block, both answers under it. */
  table, tbody, tr, th, td { display: block; min-width: 0; }
  thead { display: none; }
  tbody tr { padding: 16px 18px; }
  tbody th { width: auto; padding: 0 0 8px; font-size: 16px; }
  tbody td { padding: 6px 0 0; font-size: 15px; background: none !important; }
  tbody td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--faint); margin-bottom: 1px; }
  tbody td.us::before { color: var(--accent-text); }
  tbody tr + tr > * { border-top: 0; }
  tbody tr + tr { border-top: 1px solid var(--line); }
  .voice q { display: none; }
  .closing { border-radius: 24px; margin-left: 12px !important; margin-right: 12px !important; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bars i { animation: none !important; }
  .play-fill, .chev, .spoken span { transition: none; }
}
