/* ============================================================
   Type for Me — Landing Page
   Font: Outfit  ·  Accent: mint/teal · Dark #4cfbcb · Light #1f7a66
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------- Spring easings ---------- */
:root {
  --spring-swap: linear(
    0, 0.218 3.6%, 0.752 9.8%, 0.939, 1.04 16.6%, 1.107, 1.131 21.1%,
    1.132, 1.117, 1.094 27.9%, 1.005 35.4%, 0.972, 0.958 42.9%, 0.957,
    0.966 51.3%, 1.003 67.2%, 1.007 78%, 1 100%
  );
  --spring-hover: linear(
    0, 0.293 8.9%, 0.802 22.4%, 0.99, 1.064 35.9%, 1.083, 1.085, 1.073,
    1.04 56.6%, 1.011 67.5%, 0.996, 0.992, 0.997 91.7%, 1
  );
  --bg: #0a0f0e;
  --bg-alt: #0f1614;
  --surface: #131c1a;
  --surface-2: #1b2724;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eafdf7;
  --text-2: #8fb3aa;
  --text-3: #5f7a73;
  --accent: #4cfbcb;
  --accent-hover: #74fdd6;
  --accent-dim: rgba(76, 251, 203, 0.12);
  --accent-glow: rgba(76, 251, 203, 0.22);
  --on-accent: #06241f;
  --danger: #ff6b6b;
  --shadow-window:
    0 0 0 1px rgba(76, 251, 203, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.35),
    0 40px 80px rgba(0, 0, 0, 0.45);
  --shadow-nav:
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 10px 30px -10px rgba(0, 0, 0, 0.3);
  --max: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #fafbfa;
  --bg-alt: #eef3f1;
  --surface: #ffffff;
  --surface-2: #e6efec;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text: #0a1513;
  --text-2: #46615b;
  --text-3: #7a938c;
  --accent: #1f7a66;
  --accent-hover: #176255;
  --accent-dim: rgba(31, 122, 102, 0.10);
  --accent-glow: rgba(31, 122, 102, 0.18);
  --on-accent: #ffffff;
  --danger: #c0392b;
  --shadow-window:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.10),
    0 40px 80px rgba(0, 0, 0, 0.14);
  --shadow-nav:
    0 1px 2px rgba(0, 0, 0, 0.02),
    0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

/* ---------- Base ---------- */
body {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
em { font-style: italic; color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; border-radius: 999px;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 20px; font-size: 0.9rem; border-radius: 999px; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; border-radius: 999px; }
.btn-xl { padding: 18px 40px; font-size: 1.15rem; border-radius: 999px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 16px;
  z-index: 50;
  width: calc(100% - 48px);
  max-width: var(--max);
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo,
.nav-actions {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-nav);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav-logo { gap: 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.nav-icon { border-radius: 0; }
.nav-actions { gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
  border: 1px solid var(--border); transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-delay { transition-delay: 0.15s; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 120px; }

.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 44px; align-items: center;
}
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.82rem; font-weight: 500; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--accent-dim);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 28px;
}
.hero h1 { font-size: clamp(3rem, 7vw, 5.4rem); font-weight: 900; margin-bottom: 24px; }
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--text-2);
  max-width: 30ch; margin-bottom: 36px;
  min-height: 5.2em; /* reserve space for longest phrase (3 lines max), no layout shift */
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-meta { font-size: 0.85rem; color: var(--text-3); }

/* ---------- Animated subtitle ---------- */
.hero-swap { color: var(--accent); font-weight: 600; white-space: nowrap; }
.hero-swap.active::after {
  content: ''; display: inline-block; width: 2px; height: 1em;
  background: var(--accent); margin-left: 2px; vertical-align: -0.12em;
  animation: blink 1s steps(1) infinite;
}
.hero-end { white-space: nowrap; }
.end-verb { position: relative; }
.end-verb::after {
  content: ''; position: absolute; left: 0; top: 55%; width: 100%; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left center;
  transition: transform 0.28s ease;
}
.end-verb.striking::after { transform: scaleX(1); }

/* ---------- Hero visual: two-window deck layout ---------- */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: flex-start; }
.window-glow {
  position: absolute; bottom: -10%; left: 50%; transform: translateX(-50%);
  width: 80%; height: 60%; background: var(--accent-glow);
  filter: blur(80px); border-radius: 50%; z-index: 0; opacity: 0.6;
  pointer-events: none;
}

/* Stage — contains both slots */
.hero-stage {
  position: relative; width: 420px; height: 520px;
  flex-shrink: 0;
  transform: scale(1.18); transform-origin: center center;
}

/* Slot = SWAP layer (position + z-index + tilt) */
.hero-slot {
  position: absolute; top: 0; left: 50%;
  width: 290px; margin-left: -145px;
  transition: transform 0.68s var(--spring-swap), opacity 0.5s ease;
  will-change: transform;
}
.hero-slot.is-front {
  transform: translate(46px, 38px) scale(1) rotate(0deg);
  z-index: 2; opacity: 1;
}
.hero-slot.is-back {
  transform: translate(-46px, -8px) scale(0.91) rotate(-3deg);
  z-index: 1; opacity: 0.78;
}
/* Spread state — snappy wind-up, no bounce */
.hero-slot.spread { transition: transform 0.32s cubic-bezier(0.4, 0, 0.6, 1); }
.hero-slot.spread.is-front { transform: translate(132px, 52px) scale(1) rotate(4deg); }
.hero-slot.spread.is-back  { transform: translate(-132px, -22px) scale(0.91) rotate(-6deg); }

/* Card = HOVER layer — gentle spring overshoot */
.hero-card {
  transition: transform 0.55s var(--spring-hover);
  will-change: transform;
}
.hero-stage:hover .is-front .hero-card { transform: translateX(60px); }
.hero-stage:hover .is-back  .hero-card { transform: translateX(-60px); }

/* Fallback for browsers without linear() */
@supports not (transition-timing-function: linear(0, 1)) {
  .hero-slot { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease; }
  .hero-card { transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1); }
}

/* Windows — plain boxes, positioning handled by slot */
.app-window {
  position: relative; width: 100%;
  background: var(--surface); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-window); display: flex; flex-direction: column;
}
.notes-window {
  position: relative; width: 100%;
  background: var(--surface); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-window); display: flex; flex-direction: column;
}
.notes-bar {
  display: flex; align-items: center; position: relative;
  height: 34px; padding: 0 12px; flex-shrink: 0;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  border-bottom: 1px solid var(--border);
}
.notes-title-text {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; font-weight: 600; color: var(--text-3);
}
.notes-body {
  padding: 16px; min-height: 180px;
  font-size: 0.78rem; line-height: 1.65; color: var(--text-2);
  font-family: "SF Mono", ui-monospace, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.notes-cursor {
  display: inline-block; width: 2px; height: 0.9em;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
  margin-left: 1px;
}

/* App start button states */
.app-start-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.82rem;
  padding: 11px; border-radius: 10px; margin-top: 2px; width: 100%;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.app-start-btn.state-countdown { background: var(--surface-2); color: var(--accent); font-family: "SF Mono", ui-monospace, monospace; }
.app-start-btn.state-done { background: var(--accent-dim); color: var(--accent); }

/* Pause + Reset row (hidden by default) */
.app-control-row { display: none; gap: 8px; margin-top: 2px; }
.app-control-row.visible { display: flex; }
.app-pause-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.8rem;
  padding: 10px; border-radius: 10px; border: 1px solid var(--border-strong);
  transition: background 0.15s;
}
.app-pause-btn:hover { background: var(--border); }
.app-reset-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 0.8rem;
  padding: 10px; border-radius: 10px; border: 1px solid var(--border-strong);
  transition: background 0.15s;
}
.app-reset-btn:hover { background: var(--border); }
.window-bar {
  display: flex; align-items: center; position: relative;
  height: 36px; padding: 0 14px; flex-shrink: 0;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  border-bottom: 1px solid var(--border);
}
.traffic-lights { display: flex; gap: 8px; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-close { background: #ff5f57; }
.dot-min { background: #febc2e; }
.dot-max { background: #28c840; }
.window-title-text {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.78rem; font-weight: 600; color: var(--text-3);
}
.window-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 13px; overflow: hidden; }
.app-header-row { display: flex; align-items: center; gap: 9px; }
.app-icon-sm { border-radius: 7px; }
.app-name-label { font-weight: 700; font-size: 0.95rem; }
.app-section { display: flex; flex-direction: column; gap: 7px; }
.app-label { font-size: 0.72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.app-textarea {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 11px; font-size: 0.72rem; line-height: 1.5; color: var(--text-2);
  height: 92px; overflow: hidden;
}
.speed-row { display: flex; align-items: center; justify-content: space-between; }
.speed-val { font-size: 0.78rem; font-weight: 700; color: var(--accent); }
.slider-track { position: relative; height: 5px; background: var(--surface-2); border-radius: 3px; }
.slider-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s var(--ease); }
.slider-thumb { position: absolute; top: 50%; width: 13px; height: 13px; background: #fff; border-radius: 50%; transform: translateY(-50%); box-shadow: 0 1px 4px rgba(0,0,0,0.3); transition: left 0.3s var(--ease); }
.presets-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.preset-btn {
  font-size: 0.66rem; font-weight: 600; padding: 6px 2px; border-radius: 7px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent;
}
.preset-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.app-setting-row { flex-direction: row; align-items: center; justify-content: space-between; }
.setting-val { font-size: 0.78rem; font-weight: 600; color: var(--text-2); }
.app-progress-section { display: flex; flex-direction: column; gap: 6px; }
.progress-track { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0%; }
.progress-meta { font-size: 0.7rem; color: var(--text-3); display: flex; gap: 4px; }
.progress-pct { margin-left: auto; font-weight: 700; color: var(--accent); }

/* ---------- Scroll-reveal karaoke text ---------- */
.scroll-reveal-text { cursor: default; }
.scroll-reveal-text .word { display: inline; }
.scroll-reveal-text .char {
  display: inline;
  color: var(--text-3);
  transition: color 0.12s ease;
}
.scroll-reveal-text .char.lit { color: var(--text); }
/* "Twice." keeps accent color when lit */
.scroll-reveal-text .char.accent-char.lit { color: var(--accent); }
.problem { background: var(--bg-alt); padding: 96px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.problem-quote {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 700; line-height: 1.3;
  letter-spacing: -0.02em; max-width: 22ch; margin: 0 auto 64px; text-align: center;
}
/* suspects list */
.suspects { list-style: none; max-width: none; margin: 0; }
.problem-suspects { max-width: 820px; margin: 0 auto; }
.suspect {
  display: grid; grid-template-columns: 3ch 46px 1fr; align-items: center; gap: 24px;
  padding: 26px 18px; border-top: 1px solid var(--border);
  transition: background 0.22s ease, padding-left 0.22s ease; border-radius: 4px;
}
.suspect:first-child { border-top: none; }
.suspect:last-child { border-bottom: 1px solid var(--border); }
.suspect:hover { background: var(--accent-dim); padding-left: 28px; }
.suspect-num { font-size: 1rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.suspect-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--text-2); transition: color 0.22s, transform 0.22s; }
.suspect:hover .suspect-icon { color: var(--accent); transform: scale(1.12); }
.suspect-text h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 5px; }
.suspect-text p { font-size: 0.96rem; color: var(--text-2); line-height: 1.55; }

/* ---------- How it works: numbered-circle stepper ---------- */
.how { padding: 110px 0; }
.how h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 72px; }
.stepper { position: relative; }
.stepper-track { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
/* rail sits at vertical center of the 56px node (28px from top) */
.stepper-rail { position: absolute; top: 28px; left: 16.66%; right: 16.66%; height: 2px; background: var(--border); transform: translateY(-1px); z-index: 0; }
.stepper-rail-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.08s linear; border-radius: 1px; }
.stepstage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
/* numbered circle node */
.stepnode {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--border-strong);
  margin-bottom: 28px; position: relative; z-index: 2;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.stepnode-num { font-size: 1.25rem; font-weight: 800; color: var(--text-2); transition: color 0.35s ease; }
.stepstage.active .stepnode { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-dim); }
.stepstage.active .stepnode-num { color: var(--on-accent); }
.stepstage-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); margin-bottom: 16px; }
.stepstage-body { max-width: 30ch; }
.stepstage-body h3 { font-size: 1.22rem; font-weight: 700; margin-bottom: 8px; }
.stepstage-body p { font-size: 0.96rem; color: var(--text-2); line-height: 1.55; }

/* ---------- Use cases: contextual scenes ---------- */
.use-cases { padding: 96px 0; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.use-cases h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 56px; }
.usecases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.usecase h3 { font-size: 1.28rem; font-weight: 700; margin-bottom: 10px; }
.usecase p { font-size: 0.97rem; color: var(--text-2); line-height: 1.6; }
.usecase-scene {
  height: 172px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); overflow: hidden; padding: 14px; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 8px; position: relative;
}
/* scene-slack: bigger typing indicator */
.scene-slack { justify-content: space-between; }
.scene-slack .slack-typing-bubble { padding: 11px 16px; gap: 6px; border-radius: 16px; }
.scene-slack .typing-dot { width: 9px; height: 9px; animation-name: typingBounceBig; }
.scene-slack .slack-typing-avatar { width: 26px; height: 26px; }
@keyframes typingBounceBig { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-8px); opacity: 1; } }
.slack-bar { display: flex; align-items: center; gap: 9px; }
.slack-avatar { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); flex-shrink: 0; }
.slack-meta { display: flex; flex-direction: column; gap: 2px; }
.slack-name { font-size: 0.75rem; font-weight: 700; color: var(--text); }
.slack-time { font-size: 0.65rem; color: var(--text-3); }
.slack-msg-line { height: 8px; background: var(--surface-2); border-radius: 4px; width: 85%; }
.slack-msg-line.short { width: 55%; }
.slack-typing { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.slack-typing-avatar { width: 20px; height: 20px; border-radius: 5px; background: var(--border-strong); flex-shrink: 0; }
.slack-typing-bubble { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 7px 10px; }
/* scene-browser */
.browser-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.browser-dots { display: flex; gap: 5px; }
.browser-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.browser-url { display: flex; align-items: center; gap: 5px; flex: 1; background: var(--surface-2); border-radius: 6px; padding: 5px 9px; font-size: 0.68rem; color: var(--text-3); font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; }
.browser-field { display: flex; flex-direction: column; gap: 6px; }
.browser-label { font-size: 0.72rem; font-weight: 600; color: var(--text-2); }
.browser-input { position: relative; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 7px; padding: 10px 12px; height: 42px; display: flex; align-items: center; }
.browser-caret { display: inline-block; width: 2px; height: 16px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.browser-tooltip { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 3px 8px; font-size: 0.65rem; color: var(--text-3); white-space: nowrap; }
/* scene-code */
.code-header { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.code-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.code-filename { font-size: 0.68rem; color: var(--text-3); font-family: ui-monospace, monospace; margin-left: 4px; }
.code-body { display: flex; flex-direction: column; gap: 3px; font-family: ui-monospace, monospace; font-size: 0.73rem; }
.code-line { display: flex; align-items: center; gap: 14px; color: var(--text-2); padding: 2px 0; }
.code-line.active { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 3px; padding-left: 4px; margin-left: -4px; }
.code-lnum { color: var(--text-3); min-width: 1.2ch; text-align: right; user-select: none; }
.kw { color: var(--accent); } .fn { color: #7dd3fc; } .str { color: #86efac; } .cm { color: var(--text-3); font-style: italic; }
.code-caret { display: inline-block; width: 2px; height: 0.9em; background: var(--accent); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; margin-left: 1px; }
/* scene-chat */
.scene-chat { justify-content: flex-end; gap: 6px; }
.chat-bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 0.78rem; line-height: 1.4; }
.chat-bubble.incoming { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-bubble.outgoing { background: var(--accent-dim); border: 1px solid var(--accent-dim); border-bottom-right-radius: 4px; align-self: flex-end; display: flex; flex-direction: column; gap: 5px; padding: 10px 14px; }
.chat-line { height: 7px; background: var(--accent); opacity: 0.4; border-radius: 3px; width: 90%; }
.chat-line.short { width: 60%; }
.chat-typing { display: flex; align-items: center; gap: 8px; align-self: flex-end; }
.chat-typing-bubble { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 7px 10px; }
.chat-typing-label { font-size: 0.65rem; color: var(--text-3); }
/* shared typing dots */
.typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: typingBounce 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing-dot { animation: none; opacity: 0.6; } .browser-caret, .code-caret { animation: none; } }

/* ---------- Features bento ---------- */
.features { padding: 110px 0; }
.features h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 56px; }
.features-bento {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-areas:
    "wpm natural typo"
    "wpm hotkey pause"
    "progress progress progress";
  gap: 16px;
}
.feat-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px; transition: transform 0.25s var(--ease), border-color 0.25s;
  display: flex; flex-direction: column;
}
.feat-cell:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feat-cell h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; }
.feat-cell p { font-size: 0.92rem; color: var(--text-2); line-height: 1.5; }
.feat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); margin-bottom: 18px; }
.feat-wpm { grid-area: wpm; justify-content: flex-start; background: var(--accent-dim); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.feat-wpm:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.feat-natural { grid-area: natural; }
.feat-typo { grid-area: typo; }
.feat-hotkey { grid-area: hotkey; }
.feat-pause { grid-area: pause; }
.feat-progress { grid-area: progress; background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); }
.feat-wpm-display { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.wpm-number { font-size: 3.6rem; font-weight: 900; color: var(--accent); line-height: 1; letter-spacing: -0.04em; }
.wpm-unit { font-size: 1.1rem; font-weight: 700; color: var(--text-3); }
.feat-wpm-range { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 0.75rem; color: var(--text-3); font-weight: 600; }
.mini-track { flex: 1; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.typo-demo {
  display: inline-flex; align-items: center;
  font-family: "SF Mono", ui-monospace, monospace; font-size: 1.5rem; font-weight: 700; color: var(--accent);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px;
  min-width: 6ch; max-width: 100%;
  transition: width 0.05s;
}
.typo-cursor {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--accent); vertical-align: text-bottom;
  margin-left: 2px; flex-shrink: 0;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.key-display {
  font-family: "SF Mono", ui-monospace, monospace; font-size: 0.85rem; font-weight: 700;
  padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-bottom-width: 3px; border-radius: 8px; color: var(--text);
}
.feat-progress-demo { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.feat-progress-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.feat-progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; }
.feat-progress-label { font-size: 0.95rem; font-weight: 700; color: var(--accent); min-width: 40px; text-align: right; }

/* ---------- Download CTA ---------- */
.download-cta { position: relative; padding: 130px 0; text-align: center; overflow: hidden; }
.download-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 600px; height: 400px; background: var(--accent-glow); filter: blur(120px); border-radius: 50%; opacity: 0.5; z-index: 0; }
.download-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.download-app-icon {
  width: 160px;
  height: 160px;
  margin-bottom: 32px;
  filter:
    drop-shadow(0 0 24px var(--accent-glow))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25))
    drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}
.download-cta:hover .download-app-icon {
  transform: scale(1.03);
  filter:
    drop-shadow(0 0 32px var(--accent-glow))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3))
    drop-shadow(0 16px 40px rgba(0, 0, 0, 0.45));
}
.download-cta h2 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 900; margin-bottom: 22px; }
.download-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-2); max-width: 34ch; margin-bottom: 38px; }
.download-meta { font-size: 0.88rem; color: var(--text-3); margin-top: 18px; }
.download-github { display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; font-weight: 600; color: var(--text-2); margin-top: 28px; transition: color 0.2s; }
.download-github:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--text-2); }
.footer-icon { border-radius: 5px; opacity: 0.8; }
.footer-right { display: flex; align-items: center; gap: 20px; }
.footer-link { display: inline-flex; align-items: center; gap: 5px; font-size: 0.88rem; font-weight: 600; color: var(--text-2); transition: color 0.2s; }
.footer-link:hover { color: var(--accent); }
.footer-privacy { font-size: 0.82rem; color: var(--text-3); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-content { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero-sub { max-width: 40ch; }
  .hero-cta { justify-content: center; }
  .hero-visual { justify-content: center; }
  /* Mobile: sheet-presentation mode */
  .hero-stage { width: 320px; height: 500px; transform: none; }
  .hero-slot {
    position: absolute; left: 0; top: 0; width: 100%; margin-left: 0;
    transition: transform 0.5s var(--ease), opacity 0.5s ease, filter 0.5s ease;
    will-change: transform;
  }
  .hero-slot#slotNotes { display: block; }
  .hero-card { transform: none !important; transition: none !important; }
  .hero-slot.is-back {
    transform: translateY(0) scale(0.92);
    z-index: 1; opacity: 1; filter: brightness(0.55);
  }
  .hero-slot.is-front {
    transform: translateY(36px);
    z-index: 2; opacity: 1; filter: none;
  }
  .hero-slot.is-front.sheet-enter { transform: translateY(480px); }
  .features-bento {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "wpm wpm"
      "natural typo"
      "hotkey pause"
      "progress progress";
  }
}
@media (max-width: 760px) {
  .nav-logo { padding: 0 14px; gap: 8px; font-size: 0.95rem; }
  .nav-logo span { white-space: nowrap; }
  .nav-actions { padding: 0 10px; gap: 8px; }
  .hero { padding: 56px 0 64px; }
  .suspect { grid-template-columns: 3ch 1fr; gap: 14px; }
  .suspect-icon { display: none; }
  .stepper-rail { display: none; }
  .stepper-track { grid-template-columns: 1fr; gap: 40px; }
  .stepstage { align-items: flex-start; text-align: left; }
  .stepnode { margin-bottom: 20px; }
  .usecases { grid-template-columns: 1fr; }
  .features-bento {
    grid-template-columns: 1fr;
    grid-template-areas: "wpm" "natural" "typo" "hotkey" "pause" "progress";
  }
  .how, .features { padding: 72px 0; }
  .problem, .use-cases { padding: 64px 0; }
  .download-cta { padding: 90px 0; }
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-slot, .hero-card { transition: none !important; }
  .hero-stage:hover .hero-card { transform: none !important; }
}
