/* ThinkAloud site — glassmorphic, dark + light.
   Brand tokens from the app: primary #C0C1FF, container #8083FF,
   inverse #494BD6, secondary #DDB7FF.

   Theme cascade: light is the base; dark applies via prefers-color-scheme
   unless the user forced light; an explicit [data-theme] (set by theme.js,
   persisted in localStorage) always wins. */

:root {
  --bg: #f4f3fc;
  --text: #1b1a30;
  --text-dim: #5b5878;
  --primary: #494bd6;
  --primary-soft: #8083ff;
  --accent: #8d4fd3;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(73, 75, 214, 0.16);
  --shadow: 0 8px 32px rgba(73, 75, 214, 0.10);
  --aurora-a: rgba(128, 131, 255, 0.28);
  --aurora-b: rgba(221, 183, 255, 0.30);
  --aurora-c: rgba(73, 75, 214, 0.14);
  --icon-glow: rgba(73, 75, 214, 0.25);
  --sun-display: none;
  --moon-display: inline;
  --radius: 18px;
  --max-w: 960px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100e1d;
    --text: #e7e5f4;
    --text-dim: #a5a1c2;
    --primary: #c0c1ff;
    --primary-soft: #8083ff;
    --accent: #ddb7ff;
    --glass: rgba(30, 27, 52, 0.45);
    --glass-strong: rgba(24, 21, 42, 0.66);
    --glass-border: rgba(192, 193, 255, 0.13);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --aurora-a: rgba(128, 131, 255, 0.20);
    --aurora-b: rgba(221, 183, 255, 0.10);
    --aurora-c: rgba(73, 75, 214, 0.22);
    --icon-glow: rgba(128, 131, 255, 0.40);
    --sun-display: inline;
    --moon-display: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #100e1d;
  --text: #e7e5f4;
  --text-dim: #a5a1c2;
  --primary: #c0c1ff;
  --primary-soft: #8083ff;
  --accent: #ddb7ff;
  --glass: rgba(30, 27, 52, 0.45);
  --glass-strong: rgba(24, 21, 42, 0.66);
  --glass-border: rgba(192, 193, 255, 0.13);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --aurora-a: rgba(128, 131, 255, 0.20);
  --aurora-b: rgba(221, 183, 255, 0.10);
  --aurora-c: rgba(73, 75, 214, 0.22);
  --icon-glow: rgba(128, 131, 255, 0.40);
  --sun-display: inline;
  --moon-display: none;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  min-height: 100vh;
  position: relative;
}

/* ── Aurora backdrop ──────────────────────────────────────── */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(ellipse 55% 45% at 18% 8%, var(--aurora-a), transparent 70%),
    radial-gradient(ellipse 45% 40% at 85% 18%, var(--aurora-b), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 105%, var(--aurora-c), transparent 70%);
  animation: aurora-drift 26s ease-in-out infinite alternate;
}
body::after {
  background:
    radial-gradient(ellipse 35% 30% at 70% 75%, var(--aurora-a), transparent 70%);
  opacity: 0.7;
  animation: aurora-drift 34s ease-in-out infinite alternate-reverse;
}
@keyframes aurora-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── Header / nav (glass bar) ─────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  position: sticky; top: 0; z-index: 10;
}
header.site .wrap {
  display: flex; align-items: center; gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
}
header.site img { width: 32px; height: 32px; border-radius: 8px; }
header.site .name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
header.site nav { margin-left: auto; display: flex; gap: 12px; align-items: center; }
/* Padding keeps each link at a ≥24px target (WCAG 2.5.8). */
header.site nav a { color: var(--text-dim); font-size: 0.95rem; padding: 6px 4px; }
header.site nav a:hover { color: var(--primary); text-decoration: none; }
/* You-are-here state (WCAG 4.1.2 via aria-current; NN/g visibility of status). */
header.site nav a[aria-current="page"] { color: var(--primary); font-weight: 600; }

/* ── Skip link (WCAG 2.4.1 Bypass Blocks) ─────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: var(--bg);
  padding: 10px 18px; border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ── Visible keyboard focus (WCAG 2.4.7) ──────────────────── */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle:hover { transform: scale(1.08); box-shadow: var(--shadow); }
.theme-toggle .sun { display: var(--sun-display); }
.theme-toggle .moon { display: var(--moon-display); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { text-align: center; padding: 92px 0 64px; }
.hero img.icon {
  width: 128px; height: 128px; border-radius: 28px;
  box-shadow: 0 12px 48px var(--icon-glow);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 3.2rem; letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero p.tagline {
  font-size: 1.35rem; color: var(--text-dim);
  max-width: 560px; margin: 14px auto 0;
}
.hero p.tagline strong { color: var(--accent); font-weight: 600; }
/* ── Store / download buttons ─────────────────────────────────
   Two-line app-badge style (small label over store name) with a
   brand glyph. Glass surface so they read as the same family as the
   rest of the site in both themes. min-height keeps the tap target
   well above 44px (WCAG 2.5.8 / Apple HIG / Material). */
.hero .store-buttons {
  margin-top: 36px; display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
}
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 24px; border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.store-btn:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--primary-soft);
  box-shadow: 0 14px 44px var(--icon-glow);
}
.store-btn .store-icon { height: 27px; width: auto; flex: none; fill: currentColor; }
.store-btn .store-txt {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
}
.store-btn .store-small { font-size: 0.72rem; color: var(--text-dim); }
.store-btn .store-large { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }
.hero .store-note {
  margin: 16px auto 0; max-width: 470px;
  font-size: 0.82rem; color: var(--text-dim);
}

/* ── Feature grid (glass cards) ───────────────────────────── */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px; padding: 56px 0;
}
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px var(--icon-glow);
}
.card .emoji { font-size: 1.6rem; }
.card h3 { margin: 10px 0 6px; font-size: 1.05rem; color: var(--primary); }
.card p { color: var(--text-dim); font-size: 0.95rem; }

/* ── Privacy strip ────────────────────────────────────────── */
.strip {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--aurora-a), var(--aurora-b));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 36px; text-align: center; margin-bottom: 72px;
}
.strip h2 { font-size: 1.5rem; margin-bottom: 10px; }
.strip p { color: var(--text-dim); max-width: 640px; margin: 0 auto; }

/* ── Buy-me-a-coffee strip ────────────────────────────────── */
.coffee {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow);
  padding: 40px 36px; text-align: center; margin: -24px 0 72px;
}
.coffee .cup { font-size: 2.6rem; line-height: 1; }
.coffee h2 { font-size: 1.5rem; margin: 12px 0 8px; }
.coffee p { color: var(--text-dim); max-width: 560px; margin: 0 auto; }
.coffee .more-link { display: inline-block; margin-top: 18px; }

/* ── Article pages (support / privacy) ────────────────────── */
article { padding: 56px 0 80px; }
article h1 { font-size: 2.2rem; letter-spacing: -0.02em; margin-bottom: 6px; }
article p.meta { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 36px; }
article h2 {
  font-size: 1.35rem; margin: 40px 0 12px; color: var(--primary);
  padding-top: 8px;
}
article h3 { font-size: 1.05rem; margin: 24px 0 8px; color: var(--accent); }
article p, article li { color: var(--text); }
article p { margin: 12px 0; }
article ul { margin: 12px 0 12px 26px; }
article li { margin: 6px 0; }
article .note {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--primary-soft);
  border-radius: 10px; padding: 16px 20px; margin: 20px 0;
  color: var(--text-dim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
article code {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 5px; padding: 1px 6px; font-size: 0.9em;
}

/* ── Footer ───────────────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 32px 0 48px; text-align: center;
  color: var(--text-dim); font-size: 0.9rem;
}
footer.site nav { margin-bottom: 10px; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2.3rem; }
  .hero p.tagline { font-size: 1.1rem; }
}

/* ── Small screens: stack the header ──────────────────────────
   Brand on the first row (theme toggle pinned to its right), nav links on
   a full-width second row. The nav strip scroll-overflows on very narrow
   screens instead of clipping links off the edge. */
@media (max-width: 640px) {
  header.site .wrap {
    flex-wrap: wrap;
    position: relative;
    padding-top: 10px; padding-bottom: 8px;
    row-gap: 2px;
  }
  header.site nav {
    margin-left: 0;
    flex-basis: 100%;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a {
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 8px 5px;
  }
  header.site nav a:first-child { padding-left: 0; }
  header.site .theme-toggle {
    position: absolute;
    top: 9px; right: 24px;
    width: 34px; height: 34px;
  }
}

/* ── Hero CTA + screenshot strip ──────────────────────────── */
.hero .sub {
  color: var(--text-dim); font-size: 1.02rem;
  max-width: 600px; margin: 16px auto 0;
}
.shots {
  display: flex; gap: 22px; justify-content: center; align-items: flex-start;
  flex-wrap: wrap; padding: 40px 0 8px;
}
.phone {
  margin: 0; max-width: 250px;
}
.phone img {
  width: 100%; height: auto; display: block;
  border-radius: 26px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 56px var(--icon-glow);
  background: var(--glass-strong);
}
.phone figcaption {
  text-align: center; color: var(--text-dim);
  font-size: 0.85rem; margin-top: 10px;
}
.shots .phone:nth-child(2) { transform: translateY(20px); }

/* ── macOS desktop screenshots ─────────────────────────────── */
.desktop { margin: 36px auto 0; max-width: 920px; padding: 0 12px; }
.desktop img {
  width: 100%; height: auto; display: block;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 70px var(--icon-glow);
  background: var(--glass-strong);
}
.desktop figcaption {
  text-align: center; color: var(--text-dim);
  font-size: 0.85rem; margin-top: 12px;
}
.desktop-section { padding: 28px 0 8px; text-align: center; }
.desktop-section .feature-copy { max-width: 720px; margin: 0 auto; }
.desktop-pair {
  display: flex; gap: 22px; justify-content: center;
  align-items: flex-start; flex-wrap: wrap; margin-top: 24px;
}
.desktop-pair .desktop { max-width: 540px; flex: 1 1 440px; margin: 0; }

@media (max-width: 600px) {
  .shots .phone:nth-child(2) { transform: none; }
  .phone { max-width: 78%; }
}

/* ── Numbered steps ───────────────────────────────────────── */
.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; padding: 12px 0 24px;
  counter-reset: step;
}
.step {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 22px 22px 20px;
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent));
  color: #fff; font-weight: 700; font-size: 0.95rem;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.02rem; margin-bottom: 4px; }
.step p { color: var(--text-dim); font-size: 0.93rem; }

/* ── Section headings on the home page ────────────────────── */
.home-section { padding: 36px 0 8px; }
.home-section .kicker {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem;
  color: var(--accent); font-weight: 700;
}
.home-section h2 { font-size: 1.7rem; letter-spacing: -0.01em; margin: 4px 0 6px; }
.home-section > p { color: var(--text-dim); max-width: 640px; }
.more-link { font-weight: 600; }

/* ── Feature rows (features page) ─────────────────────────── */
.feature-row {
  display: grid; grid-template-columns: 1fr 280px;
  gap: 36px; align-items: center;
  padding: 36px 0; border-bottom: 1px solid var(--glass-border);
}
.feature-row:last-of-type { border-bottom: none; }
.feature-row.flip { grid-template-columns: 280px 1fr; }
.feature-row.flip .feature-copy { order: 2; }
.feature-row .kicker {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.76rem;
  color: var(--accent); font-weight: 700;
}
.feature-row h2 { font-size: 1.45rem; margin: 4px 0 10px; letter-spacing: -0.01em; }
.feature-row p { color: var(--text-dim); margin: 8px 0; }
.feature-row ul { margin: 10px 0 0 20px; color: var(--text-dim); }
.feature-row li { margin: 5px 0; }
.feature-row li strong, .feature-row p strong { color: var(--text); font-weight: 600; }
@media (max-width: 720px) {
  .feature-row, .feature-row.flip { grid-template-columns: 1fr; }
  .feature-row.flip .feature-copy { order: 0; }
  .feature-row .phone { margin: 0 auto; }
}
