/* ============================================================
   Dyslexia Writing Assistant — styles.css
   ============================================================ */

:root {
  --bg: #FAFAF7;
  --bg-alt: #F3F3EE;
  --text: #1F2126;
  --accent: #5B8CFF;
  --success: #4FD18B;
  --error: #FF6B6B;
  --muted: #6B6E7C;
  --border: #E4E4DC;
  --card: #FDFDFB;
  --shadow: 0 2px 10px rgba(31, 33, 38, 0.07);
  --shadow-lift: 0 6px 20px rgba(31, 33, 38, 0.12);
  --radius: 12px;
  --font-body: "Atkinson Hyperlegible", "Lexend", sans-serif;
  --font-head: "Lexend", "Atkinson Hyperlegible", sans-serif;
}

html.font-dyslexic {
  --font-body: "OpenDyslexic", "Atkinson Hyperlegible", sans-serif;
  --font-head: "OpenDyslexic", "Lexend", sans-serif;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  letter-spacing: 0.015em;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.3rem; }

p { max-width: 65ch; }
a { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 18px;
  border-radius: 0 0 8px 0; z-index: 100; font-weight: 700;
}
.skip-link:focus { left: 0; }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: 72px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700;
  color: var(--text); text-decoration: none; font-size: 1.02rem;
}
.logo-mark { width: 30px; height: 30px; color: var(--accent); flex-shrink: 0; }

.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.98rem;
  transition: color 150ms ease;
}
.site-nav a:hover { color: var(--accent); }

/* Auth link - distinct from regular nav links */
.nav-auth-link {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 150ms ease, transform 100ms ease;
}
.nav-auth-link:hover {
  background: var(--accent-hover);
  color: #000000 !important;
  transform: scale(1.02);
}
.nav-auth-link:active { transform: scale(0.98); }

.font-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 2px solid var(--border); background: var(--card);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  color: var(--text); cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.font-toggle:hover { transform: scale(1.02); box-shadow: var(--shadow); }
.font-toggle[aria-pressed="true"] {
  border-color: var(--accent); color: var(--accent);
  background: rgba(91, 140, 255, 0.08);
}
.font-toggle-glyph { font-size: 1.05rem; }

@media (max-width: 860px) { .site-nav { display: none; } .font-toggle { margin-left: auto; } }
@media (max-width: 520px) { .font-toggle-label { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: var(--radius);
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform 150ms ease, box-shadow 150ms ease,
              border-color 150ms ease, background 150ms ease;
}
.btn:hover { transform: scale(1.02); box-shadow: var(--shadow-lift); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4a7df0; }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border-color: var(--border); padding: 10px 18px;
}
.btn-ghost:hover { color: var(--text); }
.btn-small { padding: 10px 18px; font-size: 0.95rem; }
.btn-large { padding: 18px 36px; font-size: 1.2rem; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 88px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 56px; align-items: center;
}
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-sub { font-size: 1.25rem; color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 14px; }
.hero-note { color: var(--muted); font-size: 0.95rem; }

/* ---------- Mock window ---------- */
.mock-window {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-title { margin-left: 8px; font-size: 0.85rem; color: var(--muted); }
.mock-body { padding: 26px 22px; min-height: 110px; }
.mock-field { margin: 0; font-size: 1.08rem; min-height: 1.8em; }

.caret {
  display: inline-block; width: 2px; height: 1.15em;
  background: var(--accent); vertical-align: text-bottom; margin-left: 1px;
}
.caret.blink { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.sel-text.is-selected { background: rgba(91, 140, 255, 0.18); border-radius: 3px; }

/* ---------- Hotkey badge ---------- */
.hotkey-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 13px;
  box-shadow: 0 2px 0 var(--border);
}
.plus { color: var(--muted); }
.hotkey-badge.pulse { animation: keypress 550ms ease-out; }
@keyframes keypress {
  0%   { transform: scale(1); box-shadow: 0 2px 0 var(--border); }
  40%  { transform: scale(0.94); box-shadow: 0 0 0 var(--border); }
  100% { transform: scale(1); box-shadow: 0 2px 0 var(--border); }
}
.hotkey-pill {
  font-family: "Cascadia Code", Consolas, monospace; font-size: 0.82em;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}

/* ---------- Hero animation layout ---------- */
.hero-demo { position: relative; padding-bottom: 20px; }
#heroHotkey {
  position: absolute; top: 54px; right: 26px; z-index: 3;
  opacity: 0; transform: translateY(6px);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}
#heroHotkey.show { opacity: 1; transform: none; }

.diff-popup {
  position: absolute; right: 14px; bottom: -34px; z-index: 4;
  width: min(340px, 92%);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 14px 16px;
  opacity: 0; transform: translateX(18px);
  transition: opacity 380ms ease-out, transform 380ms ease-out;
}
.diff-popup.visible { opacity: 1; transform: none; }
@media (max-width: 920px) { .diff-popup { bottom: -20px; } }

.popup-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px;
}
.popup-diff { margin: 0 0 10px; font-size: 1rem; }

.diff-del, .diff-ins { opacity: 0; transition: opacity 320ms ease-out; }
.diff-del {
  color: var(--error); text-decoration: line-through;
  text-decoration-thickness: 2px; margin-right: 2px;
}
.diff-ins {
  color: #2AA666; text-decoration: underline;
  text-decoration-color: var(--success); text-decoration-thickness: 2px;
}
.diff-del.on, .diff-ins.on { opacity: 1; }

/* Demo popup diffs are always visible — no animated reveal needed */
.demo-popup .diff-del,
.demo-popup .diff-ins { opacity: 1; }

.popup-btn {
  display: inline-block; background: var(--accent); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 0.9rem;
  padding: 7px 16px; border-radius: 8px;
}
.popup-header .check { width: 20px; height: 20px; }
.check-path { stroke-dasharray: 26; stroke-dashoffset: 26; }
.drawn .check-path { transition: stroke-dashoffset 300ms ease-out; stroke-dashoffset: 0; }

.fixed-word {
  color: #2AA666; text-decoration: underline;
  text-decoration-color: var(--success); text-decoration-thickness: 2px;
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 500ms ease-out, transform 500ms ease-out; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.12rem; }

/* ---------- How it works ---------- */
.two-path { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .two-path { grid-template-columns: 1fr; } }

.path-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 28px;
  box-shadow: var(--shadow);
}
.path-card h3 { display: flex; align-items: center; gap: 12px; }
.icon { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: none; }
.steps p { margin: 0; font-size: 1.02rem; }
.step-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(91, 140, 255, 0.12); color: var(--accent);
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem;
}

/* Voice animation */
.voice-anim { margin-top: 22px; }
.voice-svg { width: 130px; height: 70px; color: var(--accent); display: block; margin-bottom: 6px; }

.va-bar {
  fill: currentColor;
  transform-box: fill-box; transform-origin: center;
  animation: vaBar 0.9s ease-in-out infinite alternate;
}
.va-bar:nth-child(1) { animation-delay: 0s; }
.va-bar:nth-child(2) { animation-delay: 0.12s; }
.va-bar:nth-child(3) { animation-delay: 0.24s; }
.va-bar:nth-child(4) { animation-delay: 0.12s; }
.va-bar:nth-child(5) { animation-delay: 0s; }
@keyframes vaBar { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

.va-wave { animation: vaWave 7s ease-in-out infinite; }
@keyframes vaWave {
  0%, 24%   { opacity: 1; transform: scale(1); }
  32%, 86%  { opacity: 0; transform: scale(0.7); }
  94%, 100% { opacity: 1; transform: scale(1); }
}
.va-bubble { opacity: 0; animation: vaBubble 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes vaBubble {
  0%, 26%   { opacity: 0; transform: scale(0.7); }
  34%, 86%  { opacity: 1; transform: scale(1); }
  94%, 100% { opacity: 0; transform: scale(0.7); }
}

.voice-dialog { display: grid; gap: 10px; }
.bubble {
  margin: 0; padding: 10px 16px; border-radius: 14px;
  font-size: 0.98rem; max-width: 42ch;
}
.bubble-user {
  background: rgba(91, 140, 255, 0.12); color: var(--text);
  border-bottom-left-radius: 4px; justify-self: start;
}
.bubble-ai {
  background: var(--card); border: 1px solid var(--border);
  border-bottom-right-radius: 4px; justify-self: end;
}

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}
.feature-card h3 { font-size: 1.12rem; margin: 14px 0 6px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.99rem; }

.tray-wrap { display: flex; align-items: flex-end; gap: 10px; height: 30px; }
.tray-wrap .icon { width: 24px; height: 24px; }
.tray-icon { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.95; } 50% { opacity: 1; } }

/* ---------- Interactive demo ---------- */
.demo-widget { position: relative; padding-bottom: 34px; }
.demo-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--border); background: var(--bg-alt);
}
.hotkey-btn { cursor: pointer; transition: transform 150ms ease, box-shadow 150ms ease; }
.hotkey-btn:hover { transform: scale(1.03); box-shadow: var(--shadow); }
.hotkey-btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.demo-hint { color: var(--muted); font-size: 0.92rem; }

.demo-popup {
  position: static; width: 100%; margin-top: 20px;
  opacity: 1; transform: none;
  animation: popupIn 380ms ease-out;
}
@keyframes popupIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}
.popup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#demoAccept .check { width: 18px; height: 18px; }
.demo-reset { margin-top: 20px; }

/* ---------- Accessibility section ---------- */
#accessibility p { font-size: 1.08rem; }

/* ---------- Download ---------- */
.download-section { background: var(--bg-alt); }
.download-inner { text-align: left; }
.download-inner > p { font-size: 1.15rem; color: var(--muted); }
.requirements {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
  margin: 26px 0 0; padding: 0;
}
.requirements li {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 16px;
  font-size: 0.95rem; color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0; color: var(--muted); font-size: 0.95rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-inner p { margin: 0; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; transition: color 150ms ease; }
.site-footer a:hover { color: var(--accent); }


/* ---------- Pricing ---------- */
.pricing-grid { 
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  align-items: stretch;
  max-width: 820px;
}
@media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; } }

.price-card { 
  position: relative;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 34px 30px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.price-card:hover { 
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}

/* Premium card gets the accent border treatment */
.price-card-premium { border-color: var(--accent); }
.price-card-premium:hover { border-color: #4a7df0; }

.plan-flag { 
  position: absolute; top: -13px; left: 30px;
  background: var(--accent); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}

.plan-name { font-size: 1.2rem; margin-bottom: 6px; }
.plan-price { 
  font-family: var(--font-head); font-weight: 700;
  font-size: 2.4rem; margin: 0 0 4px; line-height: 1.1;
}
.plan-period { 
  font-size: 1rem; font-weight: 400;
  color: var(--muted);
}
.plan-note { 
  margin: 0 0 8px; font-size: 0.92rem; color: var(--muted);
  min-height: 1.6em; /* keeps layout steady when the text swaps */
}

/* Yearly / monthly toggle */
.billing-toggle { 
  display: inline-flex; margin: 6px 0 14px;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px;
}
.toggle-option { 
  font-family: var(--font-head); font-size: 0.88rem; font-weight: 600;
  color: var(--muted); background: transparent;
  border: none; border-radius: 999px;
  padding: 6px 18px; cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.toggle-option.active { 
  background: var(--card); color: var(--accent);
  box-shadow: var(--shadow);
}

.plan-features { 
  list-style: none; margin: 10px 0 24px; padding: 0;
  display: grid; gap: 12px;
  flex-grow: 1; /* keeps both CTAs aligned at the bottom */
}
.plan-features li { 
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 1rem;
}
.plan-features .icon-sm { 
  width: 20px; height: 20px; flex-shrink: 0;
  color: var(--success); margin-top: 3px;
}

/* Premium pricing CTA - blue filled button like btn-primary but for price cards */
.price-card-premium .plan-cta,
.price-card-premium .plan-cta.btn-secondary {
  background: var(--accent);
  color: #fff;
}
.price-card-premium .plan-cta:hover,
.price-card-premium .plan-cta.btn-secondary:hover {
  background: #fff;
  color: var(--accent);
}

/* Disabled "Coming soon" — honest, not fake */
.btn-disabled { 
  background: var(--bg-alt); color: var(--muted);
  border-color: var(--border); cursor: default;
  justify-content: center;
}
.btn-disabled:hover { 
  transform: none; box-shadow: none; /* no fake affordance */
}

.pricing-fineprint { 
  margin-top: 28px; color: var(--muted); font-size: 0.98rem;
}
