/*
 * Subline's website. The color tokens are copied from the app
 * (src/renderer/styles/index.css) so the page looks like the app in both
 * themes; keep them in sync when the app's palette changes. The page follows
 * the system theme, and <html data-theme="light|dark"> forces one, as in the app.
 */
:root {
  --bg: #f7f6f3;
  --panel: #efede8;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --surface-3: #e7e4dd;
  --fg: #1c1b1a;
  --fg-muted: #6b6862;
  --fg-subtle: #9a968e;
  --line: #e4e1da;
  --line-strong: #d3cfc6;
  --accent: #4c5bd4;
  --accent-hover: #3f4dc2;
  --accent-fg: #ffffff;
  --accent-soft: rgb(76 91 212 / 0.1);
  --mark: #ffe27a;
  --success: #2a8c5f;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 24px rgb(0 0 0 / 0.08);
  --spk-0: #2f6fdb;
  --spk-1: #d9480f;
  color-scheme: light;

  /* Site-only: the app icon's gradient, used for the video in the demo (same in both themes). */
  --video-a: #6574f4;
  --video-b: #3b2fb6;
  --video-fg: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: 16px;
  --header-height: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131315;
    --panel: #18181b;
    --surface: #1f1f23;
    --surface-2: #26262b;
    --surface-3: #303036;
    --fg: #ececee;
    --fg-muted: #a09fa6;
    --fg-subtle: #706f77;
    --line: #2b2b30;
    --line-strong: #3a3a41;
    --accent: #8d98ff;
    --accent-hover: #a3acff;
    --accent-fg: #0e1020;
    --accent-soft: rgb(141 152 255 / 0.15);
    --mark: rgb(255 214 102 / 0.34);
    --success: #4cc38a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.45);
    --spk-0: #79a8ff;
    --spk-1: #ff9466;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131315;
  --panel: #18181b;
  --surface: #1f1f23;
  --surface-2: #26262b;
  --surface-3: #303036;
  --fg: #ececee;
  --fg-muted: #a09fa6;
  --fg-subtle: #706f77;
  --line: #2b2b30;
  --line-strong: #3a3a41;
  --accent: #8d98ff;
  --accent-hover: #a3acff;
  --accent-fg: #0e1020;
  --accent-soft: rgb(141 152 255 / 0.15);
  --mark: rgb(255 214 102 / 0.34);
  --success: #4cc38a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.45);
  --spk-0: #79a8ff;
  --spk-1: #ff9466;
  color-scheme: dark;
}

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
}

/* ─── Base ──────────────────────────────────────────────────────────────── */

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

html {
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
}

img {
  display: block;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -48px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 12px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 120ms ease,
    border-color 120ms ease;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.1),
    0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}

.button.primary:hover {
  background: var(--accent-hover);
  color: var(--accent-fg);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--fg);
}

.button.secondary:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.button.small {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
}

.button.large {
  min-height: 58px;
  padding: 0 22px;
  border-radius: 12px;
}

.button.wide {
  width: 100%;
}

.button-label {
  display: grid;
  text-align: left;
}

.button-label small {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.8;
}

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-buttons .button {
  flex: 1 1 200px;
}

.fineprint {
  font-size: 13.5px;
  color: var(--fg-subtle);
}

/* ─── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--fg);
}

.brand img {
  margin: -3px;
}

.header-nav {
  display: none;
  gap: 4px;
  margin-left: auto;
}

.header-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--fg-muted);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}

.header-nav a:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.header-inner > .button {
  margin-left: auto;
}

@media (min-width: 700px) {
  .header-nav {
    display: flex;
  }

  .header-inner > .button {
    margin-left: 0;
  }
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding: 56px 0 8px;
  background: radial-gradient(70% 55% at 50% 0%, var(--accent-soft), transparent 70%);
}

.hero-copy {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.4rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 620px;
  margin: 20px auto 0;
  color: var(--fg-muted);
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.2rem);
}

.hero .download-buttons {
  max-width: 500px;
  margin: 32px auto 14px;
}

.quiet-link {
  color: inherit;
}

.quiet-link:hover {
  color: var(--fg);
}

@media (min-width: 900px) {
  .hero {
    padding: 88px 0 16px;
  }
}

/* ─── Demo: a static copy of the video page ─────────────────────────────── */

.demo {
  max-width: 1000px;
  margin: 52px auto 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor: default;
  user-select: none;
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.demo-lights {
  display: flex;
  gap: 7px;
}

.demo-lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-strong);
}

.demo-title {
  flex: 1;
  min-width: 0;
  padding-right: 47px;
  overflow: hidden;
  color: var(--fg-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-body {
  display: grid;
}

.demo-video {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin: 16px 16px 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 22%, rgb(255 255 255 / 0.2), transparent 55%),
    linear-gradient(135deg, var(--video-a), var(--video-b));
}

.demo-play {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--video-fg) 92%, transparent);
  box-shadow: 0 8px 24px rgb(11 10 51 / 0.3);
}

.demo-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
  fill: var(--video-b);
}

.demo-progress {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, var(--video-fg) 30%, transparent);
}

.demo-progress span {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--video-fg);
}

.demo-transcript {
  padding: 20px 20px 4px 22px;
  font-size: 16px;
  line-height: 1.6;
}

.turn {
  margin-bottom: 16px;
}

.turn-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.speaker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--spk);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.speaker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spk);
}

.ts {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
}

.turn-body {
  padding-left: 16px;
  border-left: 2px solid color-mix(in srgb, var(--spk) 35%, transparent);
}

.seg {
  position: relative;
  margin: 0 -0.6em;
  padding: 0.28em 0.6em;
  border-radius: 10px;
}

.seg.is-active {
  background: var(--accent-soft);
}

.seg.is-active::before {
  content: "";
  position: absolute;
  top: 0.45em;
  bottom: 0.45em;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.seg-tr {
  margin-top: 0.1em;
  color: var(--fg-muted);
  font-size: 0.8em;
  line-height: 1.5;
}

/* The spoken word moves through the active sentence, as it does during playback. */
.words span {
  border-radius: 4px;
  animation: spoken 3.85s linear infinite;
}

.words span:nth-child(2) {
  animation-delay: 0.55s;
}
.words span:nth-child(3) {
  animation-delay: 1.1s;
}
.words span:nth-child(4) {
  animation-delay: 1.65s;
}
.words span:nth-child(5) {
  animation-delay: 2.2s;
}
.words span:nth-child(6) {
  animation-delay: 2.75s;
}
.words span:nth-child(7) {
  animation-delay: 3.3s;
}

@keyframes spoken {
  0%,
  13.9% {
    background: var(--mark);
    box-shadow: 0 0 0 2px var(--mark);
  }
  14.3%,
  100% {
    background: transparent;
    box-shadow: 0 0 0 2px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .words span {
    animation: none;
  }

  .words span:nth-child(3) {
    background: var(--mark);
    box-shadow: 0 0 0 2px var(--mark);
  }
}

.words .is-vocab {
  text-decoration: underline dotted 2px var(--accent);
  text-underline-offset: 0.22em;
}

@media (min-width: 760px) {
  .demo-body {
    grid-template-columns: 1.1fr 1fr;
  }

  .demo-video {
    align-self: start;
    margin: 20px 0 20px 20px;
  }

  .demo-transcript {
    padding: 22px 28px 6px 30px;
    font-size: 17px;
  }
}

/* ─── Sections ──────────────────────────────────────────────────────────── */

.section {
  padding: 64px 0;
}

.section.alt {
  background: var(--panel);
  border-block: 1px solid var(--line);
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.section-lede {
  max-width: 640px;
  margin-bottom: 36px;
  color: var(--fg-muted);
  font-size: 1.075rem;
}

.feature,
.steps li,
.install li,
.price-card,
.privacy-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

@media (min-width: 900px) {
  .section {
    padding: 96px 0;
  }
}

/* Features */

.features {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  padding: 22px;
}

.feature h3 {
  margin: 16px 0 6px;
}

.feature p {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.55;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

@media (min-width: 620px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Keyboard shortcuts */

.keys {
  margin-top: 48px;
}

.keys h3 {
  margin-bottom: 16px;
}

.key-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px 24px;
  margin: 0;
}

.key-list div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.key-list dt {
  display: flex;
  gap: 4px;
  min-width: 64px;
}

.key-list dd {
  margin: 0;
  color: var(--fg-muted);
  font-size: 15px;
}

kbd {
  display: inline-block;
  min-width: 28px;
  padding: 2px 7px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

/* Numbered steps (how it works, install) */

.steps,
.install {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li,
.install li {
  padding: 24px;
  counter-increment: step;
}

.steps li::before,
.install li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.steps h3,
.install h3 {
  margin-bottom: 6px;
}

.steps p,
.install p {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.55;
}

.steps {
  margin-top: 36px;
}

@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .install {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Pricing */

.pricing {
  display: grid;
  gap: 32px;
  align-items: center;
}

.pricing-copy .section-lede {
  margin-bottom: 0;
}

.price-card {
  padding: 28px;
  box-shadow: var(--shadow);
}

.price-kind {
  margin: 2px 0 20px;
  color: var(--fg-muted);
}

.checks,
.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checks {
  margin-bottom: 24px;
}

.checks li,
.plain-list li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  line-height: 1.5;
}

.checks li::before,
.plain-list li::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: 5px;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(45deg);
}

.price-card .fineprint {
  margin-top: 12px;
  text-align: center;
}

@media (min-width: 880px) {
  .pricing {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
  }
}

/* Privacy */

.privacy {
  display: grid;
  gap: 32px;
}

.privacy h2 {
  margin-top: 20px;
}

.privacy .section-lede {
  margin-bottom: 20px;
}

.privacy-card {
  padding: 24px 28px;
}

.privacy-card h3 {
  margin-bottom: 8px;
}

.services {
  margin: 0;
}

.services div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.services div:first-child {
  border-top: 0;
}

.services dt {
  font-weight: 600;
}

.services dd {
  margin: 2px 0 0;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.5;
}

@media (min-width: 880px) {
  .privacy {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

/* Download */

.install .download-buttons {
  margin-top: 16px;
}

.install .button.secondary {
  background: var(--surface-2);
}

.install .button.secondary:hover {
  background: var(--surface-3);
}

pre {
  margin: 14px 0 0;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

.note {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 18px 22px;
  background: var(--accent-soft);
  border-radius: 16px;
  font-size: 15px;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-nav a {
  color: var(--fg-muted);
  font-size: 14.5px;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.footer-small {
  width: 100%;
  color: var(--fg-subtle);
  font-size: 13px;
}
