/* KeptInFlow landing — single committed dark theme, matches the app's look.
   Register: disciplined indie-software site. Flat surfaces, hairline borders,
   one accent; mint is reserved for AI-inserted text in demos. */
:root {
  --bg: #0c0e13;
  --bg-raise: #11141b;
  --bg-card: #161a22;
  --border: #262b36;
  --border-soft: #1e232e;
  --text: #e9ecf3;
  --dim: #98a2b3;
  --accent: #6c9ef8;
  --accent-soft: rgba(108, 158, 248, 0.12);
  --ins: #7ee2a8; /* AI-inserted text only */
  --radius: 10px;
  --mono: "Cascadia Code", Consolas, ui-monospace, monospace;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
code {
  background: var(--bg-raise);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 0.85em;
}
h1, h2 { font-family: var(--display); }

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(28px, calc((100% - 1044px) / 2));
  background: rgba(12, 14, 19, 0.94);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--border-soft); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 650;
  font-size: 18px;
}
.brand:hover { text-decoration: none; }
.brand svg { color: var(--accent); }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a { color: var(--dim); font-size: 14.5px; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 14px;
  color: var(--accent) !important;
}
.nav-cta:hover { background: var(--accent); color: #0b1020 !important; }

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 28px 96px;
}
.kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
h1 {
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.04;
  font-weight: 750;
  letter-spacing: -0.015em;
}
h1 .hl { color: var(--accent); }
.hero-sub {
  color: var(--dim);
  font-size: 17.5px;
  margin-top: 22px;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 30px;
}
.hero-note { color: var(--dim); font-size: 13.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #0b1020;
  border: 1px solid var(--accent);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--dim);
  cursor: default;
}

/* ---- Hero demo window ---- */
.demo-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.demo-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-raise);
}
.demo-title { color: var(--dim); font-size: 12.5px; font-weight: 600; }
.demo-controls { display: flex; gap: 7px; }
.demo-controls i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
}
.demo-body { padding: 18px 20px 24px; min-height: 190px; }
.demo-meta {
  color: var(--dim);
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.demo-meta span { color: var(--text); }
.demo-text {
  font-size: 15.5px;
  line-height: 1.75;
  min-height: 84px;
  overflow-wrap: break-word;
}
.demo-text .trig {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent);
}
.demo-text .trig.thinking { animation: pulse 0.9s ease-in-out infinite; }
.demo-text .ins {
  color: var(--ins);
  border-bottom: 1px dotted rgba(126, 226, 168, 0.5);
  animation: settle 0.5s ease-out;
}
.demo-caret {
  display: inline-block;
  width: 1.5px;
  height: 1.15em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1.05s steps(1) infinite;
}
.demo-caption {
  color: var(--dim);
  font-size: 13.5px;
  margin-top: 14px;
  text-align: center;
  min-height: 1.6em;
  transition: opacity 0.2s ease;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }

/* ---- Sections ---- */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 28px;
}
.section-alt {
  max-width: none;
  background: var(--bg-raise);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding-left: max(28px, calc((100% - 1044px) / 2));
  padding-right: max(28px, calc((100% - 1044px) / 2));
}
.section-head { max-width: 640px; }
h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-sub {
  color: var(--dim);
  font-size: 16.5px;
  margin-top: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
  margin-top: 44px;
}

/* ---- The routine comparison ---- */
.routine {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
  max-width: 860px;
}
.routine-col {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.routine-col h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.routine-old h3 { color: var(--dim); }
.routine-new { border-color: var(--accent); background: var(--bg-card); }
.routine-new h3 { color: var(--accent); }
.routine-col ol {
  list-style: none;
  counter-reset: r;
}
.routine-col li {
  counter-increment: r;
  position: relative;
  padding: 4px 0 4px 30px;
  font-size: 14.5px;
  color: var(--dim);
}
.routine-col li::before {
  content: counter(r);
  position: absolute;
  left: 0;
  top: 5px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 5px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.routine-new li { color: var(--text); }
.routine-new li::before { color: var(--accent); border-color: var(--accent); }
.routine-payoff { color: var(--dim); font-size: 14.5px; margin-top: 12px; }

/* ---- Everywhere tools ---- */
.tool {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s ease;
}
.tool:hover { border-color: var(--border); }
.tool:hover .keycap { border-color: var(--accent); color: var(--accent); }
.tool h3 { font-size: 16.5px; margin: 14px 0 6px; }
.tool p { color: var(--dim); font-size: 14.5px; }
.keycap, .cap-inline {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-bottom-width: 2.5px;
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.cap-inline { font-size: 11.5px; padding: 1px 6px; color: var(--dim); }

/* ---- Playground ---- */
.playground { max-width: 720px; margin-top: 44px; }
.playground-input {
  min-height: 120px;
  outline: none;
  cursor: text;
  white-space: pre-wrap;
}
.playground-input:empty::before {
  content: "Click here and type — try  =249*4=  or  <<capital of italy>>";
  color: var(--dim);
  pointer-events: none;
}
.playground .demo-window:focus-within { border-color: var(--accent); }
.playground-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.playground-hint { color: var(--dim); font-size: 13.5px; }
.chip {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.playground .demo-caption { text-align: left; }

/* ---- Capture ---- */
.cap {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s ease;
}
.cap:hover { border-color: var(--border); }
.cap h3 { font-size: 16.5px; margin: 12px 0 6px; }
.cap p { color: var(--dim); font-size: 14.5px; }
.cap-icon {
  display: inline-flex;
  padding: 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---- Deck ---- */
.deck-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.step {
  border-left: 2px solid var(--border);
  padding: 2px 0 2px 20px;
}
.step-n {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.step h3 { font-size: 17.5px; margin: 6px 0; }
.step p { color: var(--dim); font-size: 14.5px; }

.mock {
  position: relative;
  max-width: 780px;
  height: 290px;
  margin: 56px auto 0;
}
.mock-desktop {
  position: absolute;
  inset: 24px 0 0;
  background: var(--bg-raise);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.mock-note {
  position: absolute;
  width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.mock-note-a { left: 4%; top: 0; }
.mock-note-b { left: 38%; top: 78px; width: 234px; }
.mock-note-c { right: 3%; top: 22px; }
.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 600;
}
.mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.mock-line {
  height: 8px;
  border-radius: 4px;
  background: #262c38;
  margin: 10px 12px 0;
}
.w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; }
.w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 92%; }

.deck-more {
  color: var(--dim);
  font-size: 14.5px;
  max-width: 640px;
  margin-top: 44px;
}

/* ---- Trust ---- */
.trust-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.trust-item h3 { font-size: 16.5px; margin-bottom: 8px; }
.trust-item p { color: var(--dim); font-size: 14.5px; }

/* ---- Pricing ---- */
.pricing { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.price-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
}
.price-card-main { border-color: var(--accent); }
.price-card h3 { font-size: 15px; color: var(--dim); font-weight: 600; }
.price {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  margin: 6px 0 16px;
}
.price-note { font-size: 15px; font-weight: 500; color: var(--dim); }
.price-card ul {
  list-style: none;
  margin-bottom: 22px;
  flex: 1;
}
.price-card li {
  color: var(--dim);
  font-size: 14.5px;
  padding: 5px 0 5px 24px;
  position: relative;
}
.price-card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.price-card .btn { justify-content: center; }

/* ---- FAQ ---- */
.faq-list { max-width: 720px; margin-top: 40px; }
.faq-list details { border-bottom: 1px solid var(--border-soft); }
.faq-list summary {
  cursor: pointer;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  color: var(--dim);
  font-size: 20px;
  font-weight: 400;
}
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p {
  color: var(--dim);
  font-size: 15px;
  padding: 0 0 18px;
  max-width: 66ch;
}

/* ---- Final CTA ---- */
.cta-final { text-align: center; padding-top: 40px; }
.cta-final .hero-actions { align-items: center; margin-top: 26px; }

/* ---- Footer ---- */
.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 28px 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--dim);
  font-size: 14px;
  border-top: 1px solid var(--border-soft);
}
.footer nav { display: flex; gap: 20px; }
.footer nav a { color: var(--dim); }
.footer nav a:hover { color: var(--text); }
.footer-copy { width: 100%; font-size: 13px; }

/* ---- Legal pages ---- */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.legal h1 { font-size: 32px; margin-bottom: 8px; }
.legal .updated { color: var(--dim); font-size: 14px; margin-bottom: 32px; }
.legal h2 { font-size: 20px; margin: 32px 0 10px; }
.legal p, .legal li { color: var(--dim); font-size: 15.5px; }
.legal ul { padding-left: 22px; margin: 8px 0; }

/* ---- Scroll reveal (added by JS; static without it) ---- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive & motion ---- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-bottom: 72px; }
  .hero-sub { max-width: none; }
}
@media (max-width: 640px) {
  .nav nav a:not(.nav-cta) { display: none; }
  .section { padding: 64px 20px; }
  .routine { grid-template-columns: 1fr; }
  .mock { height: 350px; }
  .mock-note-b { left: 10%; top: 152px; }
  .mock-note-c { right: 1%; top: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .demo-caret { display: none; }
  .demo-text .ins { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
