/* SnapCSV marketing — styles.css
 * Tokens copied verbatim from DESIGN.md §12 (Deep Ocean v1.4).
 * Marketing extensions to the spacing scale only.
 * Single source of truth: do not introduce hex values outside :root.
 */

:root {
  /* Base — Deep Ocean */
  --color-bg:                #090d12;
  --color-surface:           #0c1824;
  --color-surface-raised:    #132535;
  --color-border:            #142030;

  /* Text */
  --color-text:              #d8eaf0;
  --color-text-muted:        #6da8c0;
  --color-text-disabled:     #507a95;

  /* Accent — Aqua Teal */
  --color-accent:            #0ea5b8;
  --color-accent-hover:      #12bcd0;
  --color-accent-active:     #0a96aa;
  --color-accent-muted:      #082030;
  --color-accent-text:       #ffffff;

  /* Upgrade — Green (go register) */
  --color-upgrade:           #1adb72;
  --color-upgrade-hover:     #16c466;
  --color-upgrade-bg:        #0a1a08;
  --color-upgrade-border:    #1a3a15;
  --color-upgrade-muted:     #6aaa7a;
  --color-upgrade-text:      #000000;

  /* Success / Error */
  --color-success:           #22c55e;
  --color-success-bg:        #071a0a;
  --color-success-border:    #0f3015;
  --color-error:             #ef4444;
  --color-error-bg:          #1f0808;

  /* Type — system stack only on the marketing page (no bundled fonts) */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

  /* Spacing — popup tokens preserved, marketing extensions added */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* Radii */
  --radius-1: 4px;
  --radius-2: 6px;
  --radius-3: 8px;

  /* Motion */
  --motion-fast: 150ms ease;

  /* Layout */
  --max-width: 1140px;
  --prose-width: 640px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  /* Vertical gradient bg + fixed-attachment so the page reads as one
     atmospheric surface, not a flat dark rectangle that reveals seams
     between sections. Goes from --color-bg to --color-surface (both
     already in :root — token discipline preserved). */
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.prose { max-width: var(--prose-width); margin: 0 auto; }

.muted { color: var(--color-text-muted); }
.mono { font-family: var(--font-mono); }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  padding: 14px 22px;
  border: none;
  border-radius: var(--radius-2);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--motion-fast), color var(--motion-fast), transform var(--motion-fast);
  white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-accent-text); }
.btn-primary:hover { background: var(--color-accent-hover); color: var(--color-accent-text); }
.btn-upgrade { background: var(--color-upgrade); color: var(--color-upgrade-text); font-weight: 600; }
.btn-upgrade:hover { background: var(--color-upgrade-hover); color: var(--color-upgrade-text); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-raised); color: var(--color-text); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.link-upgrade { color: var(--color-upgrade); font-weight: 500; }
.link-upgrade:hover { color: var(--color-upgrade-hover); }

/* ─── Top Nav ─────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.nav-brand .brand-mark { width: 18px; height: 18px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-links a:not(.btn) {
  color: var(--color-text-muted);
  font-size: 14px;
}
.nav-links a:not(.btn):hover { color: var(--color-text); }

@media (max-width: 768px) {
  .nav-links a:not(.btn) { display: none; }
  .nav-links { gap: 0; }
}

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

.hero {
  padding: var(--space-16) 0 var(--space-24);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.hero-headline {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: var(--space-4) 0 var(--space-5);
  /* Subtle vertical gradient on the H1 — top stays full --color-text,
     bottom fades 30% toward --color-text-muted. Adds dimensional
     depth without changing the typeface or feeling decorative. */
  background: linear-gradient(180deg, var(--color-text) 0%, color-mix(in srgb, var(--color-text) 70%, var(--color-text-muted)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 540px;
  margin-bottom: var(--space-8);
}
.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.hero-trust {
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .hero { padding: var(--space-8) 0 var(--space-16); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-12); }
  .hero-sub { font-size: 16px; }
}

/* ─── Hero popup recreation (the demo IS the product) ─────────────── */

.popup-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}
.popup-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, var(--color-surface) 0 28px, transparent 28px 30px),
    repeating-linear-gradient(90deg, var(--color-surface) 0 80px, transparent 80px 82px);
  filter: blur(14px);
  opacity: 0.55;
  pointer-events: none;
  border-radius: var(--radius-3);
}
.popup {
  position: relative;
  width: 360px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 13px;
  line-height: 1.5;
}
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.popup-brand { display: flex; align-items: center; gap: 7px; }
.popup-brand .glyph { color: var(--color-accent); font-size: 16px; }
.popup-brand .name {
  font-size: 14px; font-weight: 700; letter-spacing: 0.3px; color: var(--color-text);
}
.popup-panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--color-text-muted);
  padding: 10px var(--space-4) 6px;
}
.popup-list { list-style: none; }
.popup-list li {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  cursor: default;
}
.popup-list li.is-active {
  background: var(--color-surface-raised);
  border-left: 2px solid var(--color-accent);
  padding-left: 14px;
}
.popup-list .row-title { font-weight: 500; color: var(--color-text); }
.popup-list .row-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.popup-footer {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ─── Section rhythm ──────────────────────────────────────────────── */

section { padding: var(--space-24) 0; }
@media (max-width: 768px) { section { padding: var(--space-16) 0; } }

.section-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
}

/* ─── The Pain ────────────────────────────────────────────────────── */

/* Sub-paragraphs (the "Or you tried..." alternatives) */
.pain p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.pain p:last-of-type { margin-bottom: 0; }

/* The lede — dominant first paragraph */
.pain p.pain-lede {
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

/* Selective color accent on the key phrase in the lede (Browserbase pattern) */
.pain-accent {
  color: var(--color-accent);
}

/* Transition line — confident teaser into next section */
.pain p.pain-transition {
  margin-top: var(--space-12);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .pain p { font-size: 16px; }
}

/* ─── How it works ────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  padding: var(--space-6);
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.step:hover {
  border-color: var(--color-surface-raised);
  background: var(--color-surface-raised);
}
.step-num {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.8px;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-accent);
}
.step h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.step p { font-size: 15px; color: var(--color-text-muted); }

@media (max-width: 768px) { .steps { grid-template-columns: 1fr; } }

/* ─── Demo frame ──────────────────────────────────────────────────── */

.demo {
  text-align: center;
  /* Spreadsheet-cell grid pattern — visually reinforces the product
     domain. Lines are 1px in --color-accent at ~4% opacity, spaced
     40px apart. Reads as ambient texture; not a focal element. */
  background-image:
    linear-gradient(color-mix(in srgb, var(--color-accent) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--color-accent) 4%, transparent) 1px, transparent 1px);
  background-size: 40px 40px;
}
.demo-frame {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  padding: var(--space-3);
  margin: var(--space-8) auto 0;
  max-width: 880px;
}
/* Direct-child only — when the frame holds a real video/image fallback.
   Don't catch nested icons (e.g. .demo-toolbar-icon, popup-header img). */
.demo-frame > video, .demo-frame > img {
  width: 100%;
  border-radius: var(--radius-2);
  display: block;
}

/* Real demo video. Aspect ratio matches the recording's native dims
   (1188x961, screen-recorded on a 13" MacBook with toolbar visible).
   Holds the space before metadata loads to prevent layout shift. */
.demo-video {
  aspect-ratio: 1188 / 961;
  background: var(--color-bg);
  outline: 1px solid var(--color-border);
  outline-offset: -1px;
}
.demo-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

/* ─── Animated demo mock — accurate to the actual extension flow ──── */

.demo-mock {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg);
  border-radius: var(--radius-2);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

/* Browser chrome with toolbar + extension icon (popup origin point) */
.demo-chrome {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-3);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  gap: 6px;
}
.demo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-text-disabled);
  opacity: 0.45;
  flex-shrink: 0;
}
.demo-url {
  margin: 0 var(--space-3);
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-toolbar-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-1);
  display: block;
  flex-shrink: 0;
  position: relative;
  /* Pin to the right end of the chrome bar — desktop uses .demo-url's
     flex:1 as the spacer; mobile hides the URL, so this guarantees the
     icon stays at the toolbar position regardless. */
  margin-left: auto;
}
/* Subtle "active" ring on the toolbar icon — implies the popup originates here */
.demo-toolbar-icon::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-2);
  border: 1px solid var(--color-accent);
  opacity: 0.4;
}

/* Stage — the page area below the toolbar */
.demo-stage {
  position: relative;
  height: calc(100% - 36px);
  overflow: hidden;
}

/* Faint page table on the left, simulating the GDP page */
.demo-page-bg {
  position: absolute;
  inset: var(--space-4) 50% var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  opacity: 0.55;
  pointer-events: none;
}
.demo-page-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  padding: 0 var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
}
.demo-row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 0.7fr 1fr;
  padding: 6px var(--space-2);
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-muted);
}
.demo-row-h {
  color: var(--color-text);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.demo-row span:not(:first-child) {
  font-family: var(--font-mono);
  text-align: right;
  padding-right: var(--space-2);
}
.demo-row-h span:not(:first-child) {
  font-family: inherit;
}

/* Popup — positioned top-right, anchored to where the toolbar icon would drop it */
.demo-popup {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 320px;
  height: calc(100% - var(--space-6));
  max-height: 360px;
  background: var(--color-bg);
  border: 1px solid var(--color-surface-raised);
  font-size: 13px;
  display: flex;
  flex-direction: column;
}

.demo-popup-header {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  gap: 7px;
  flex-shrink: 0;
}
.demo-popup-glyph {
  color: var(--color-accent);
  font-size: 16px;
}
.demo-popup-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.3px;
}
.demo-popup-footer {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

/* All three panels stack on top of each other inside the popup body */
.demo-panel {
  position: absolute;
  top: 40px; /* below header */
  left: 0;
  right: 0;
  bottom: 32px; /* above footer */
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── State 1: Tables list ─── */
.demo-panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--color-text-muted);
  padding: 10px var(--space-4) 6px;
}
.demo-list { list-style: none; }
.demo-list-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  border-left: 2px solid transparent;
}
.demo-list-item-title {
  font-weight: 500;
  color: var(--color-text);
  font-size: 13px;
}
.demo-list-item-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ─── State 2: Preview panel ─── */
.demo-panel-preview {
  padding: 0;
}
.demo-preview-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.demo-back {
  font-size: 12px;
  color: var(--color-text-muted);
}
.demo-preview-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
}
.demo-preview-table-wrap {
  flex: 1;
  overflow: hidden;
  padding: 0 var(--space-4);
}
.demo-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: var(--space-2);
}
.demo-preview-table thead th {
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-weight: 600;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  font-size: 10.5px;
}
.demo-preview-table tbody td {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.demo-preview-table tbody td:first-child { font-family: inherit; }
.demo-preview-truncation {
  font-size: 10px;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4) var(--space-2);
  font-style: italic;
}
.demo-preview-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-3);
}
.demo-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-2);
  border: none;
  cursor: pointer;
  transition: background var(--motion-fast);
}
.demo-btn-copy {
  flex: 0 0 35%;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.demo-btn-export {
  flex: 1;
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 500;
}

/* ─── State 3: Success state ─── */
.demo-panel-success {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-5);
}
.demo-success-icon {
  font-size: 36px;
  color: var(--color-success);
  font-weight: 600;
  line-height: 1;
}
.demo-success-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-success);
  margin-top: var(--space-3);
}
.demo-success-filename {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  word-break: break-all;
  padding: 0 var(--space-3);
}

/* ─── Animation cycle (10s total) ───
   0.0 - 3.5s : List panel visible
   3.0 - 3.5s : Table 1 row gets highlighted (suggesting click)
   3.5 - 6.5s : Preview panel visible
   6.0 - 6.4s : Export button briefly highlighted (suggesting click)
   6.5 - 9.0s : Success state visible
   9.0 - 10s  : Reset, brief blank frame
*/

.demo-panel-list {
  animation: demoListVisible 10s infinite;
}
.demo-panel-preview {
  animation: demoPreviewVisible 10s infinite;
}
.demo-panel-success {
  animation: demoSuccessVisible 10s infinite;
}
.demo-list-item-target {
  animation: demoListItemHover 10s infinite;
}
.demo-btn-export {
  animation: demoExportPress 10s infinite;
}

@keyframes demoListVisible {
  0%, 32% { opacity: 1; visibility: visible; }
  35%, 100% { opacity: 0; visibility: hidden; }
}
@keyframes demoPreviewVisible {
  0%, 33% { opacity: 0; visibility: hidden; }
  36%, 63% { opacity: 1; visibility: visible; }
  66%, 100% { opacity: 0; visibility: hidden; }
}
@keyframes demoSuccessVisible {
  0%, 64% { opacity: 0; visibility: hidden; }
  67%, 90% { opacity: 1; visibility: visible; }
  93%, 100% { opacity: 0; visibility: hidden; }
}
@keyframes demoListItemHover {
  0%, 24% {
    background: transparent;
    border-left-color: transparent;
    padding-left: var(--space-4);
  }
  28%, 33% {
    background: var(--color-surface-raised);
    border-left-color: var(--color-accent);
    padding-left: calc(var(--space-4) - 2px);
  }
  35%, 100% {
    background: transparent;
    border-left-color: transparent;
    padding-left: var(--space-4);
  }
}
@keyframes demoExportPress {
  0%, 58% { background: var(--color-accent); }
  60%, 64% { background: var(--color-accent-active); }
  66%, 100% { background: var(--color-accent); }
}

/* Reduced motion: show the preview state (most representative) without animation */
@media (prefers-reduced-motion: reduce) {
  .demo-panel-list,
  .demo-panel-preview,
  .demo-panel-success,
  .demo-list-item-target,
  .demo-btn-export {
    animation: none;
  }
  .demo-panel-list { opacity: 0; visibility: hidden; }
  .demo-panel-preview { opacity: 1; visibility: visible; }
  .demo-panel-success { opacity: 0; visibility: hidden; }
}

/* Mobile: drop the page-bg and URL, center the popup so it actually fits */
@media (max-width: 768px) {
  .demo-mock {
    aspect-ratio: auto;
    min-height: 460px;
  }
  .demo-url { display: none; }
  /* At 22px the data-grid detail in the icon gets blurred — bump to 28
     so the real shipping icon reads on mobile. */
  .demo-toolbar-icon { width: 28px; height: 28px; }
  .demo-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
  }
  .demo-page-bg { display: none; }
  .demo-popup {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 320px;
    height: auto;
    min-height: 380px;
  }
}
.demo-caption {
  margin-top: var(--space-5);
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ─── Features ────────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.feature {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.feature:hover {
  border-color: color-mix(in srgb, var(--color-accent) 50%, var(--color-border));
  background: var(--color-surface-raised);
  /* Inset glow via outline (DESIGN.md §11 forbids box-shadow). The
     outline lives just inside the existing border for an inner-ring
     accent on hover. Replaces what would normally be a box-shadow. */
  outline: 1px solid color-mix(in srgb, var(--color-accent) 20%, transparent);
  outline-offset: -1px;
}
.feature-icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.feature h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.feature p { font-size: 14px; color: var(--color-text-muted); }

@media (max-width: 768px) { .features { grid-template-columns: 1fr; } }

/* ─── Pricing ─────────────────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-8);
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.price-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  transition: border-color var(--motion-fast);
}
.price-card:hover {
  border-color: color-mix(in srgb, var(--color-accent) 50%, var(--color-border));
  outline: 1px solid color-mix(in srgb, var(--color-accent) 18%, transparent);
  outline-offset: -1px;
}
.price-card.is-pro:hover {
  border-color: var(--color-upgrade);
  outline: 1px solid color-mix(in srgb, var(--color-upgrade) 18%, transparent);
  outline-offset: -1px;
}
.price-card.is-pro {
  border-color: var(--color-upgrade-border);
  background: linear-gradient(180deg, var(--color-upgrade-bg) 0%, var(--color-surface) 60%);
  position: relative;
}
.price-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-upgrade);
  color: var(--color-upgrade-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-1);
  white-space: nowrap;
}
.price-tier {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.price-card.is-pro .price-tier { color: var(--color-upgrade); }
.price-amount { font-size: 44px; font-weight: 700; letter-spacing: -0.01em; }
.price-amount-suffix {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: var(--space-2);
}
.price-list { list-style: none; margin: var(--space-6) 0 var(--space-8); }
.price-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: 15px;
  color: var(--color-text);
}
.price-list .check {
  width: 16px; height: 16px; flex-shrink: 0;
  color: var(--color-accent);
}
.price-card.is-pro .price-list .check { color: var(--color-upgrade); }
.price-card .btn { width: 100%; margin-top: auto; }
.price-footnote {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .price-card { padding: var(--space-6); }
}

/* ─── Story ───────────────────────────────────────────────────────── */

.story {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.story-body p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: var(--space-5);
}
.story-byline {
  margin-top: var(--space-6);
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ─── FAQ ─────────────────────────────────────────────────────────── */

.faq-list {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.faq-list details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  padding: var(--space-5);
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.faq-list details:hover {
  border-color: color-mix(in srgb, var(--color-accent) 50%, var(--color-border));
  outline: 1px solid color-mix(in srgb, var(--color-accent) 18%, transparent);
  outline-offset: -1px;
}
.faq-list details[open] {
  border-color: var(--color-accent-muted);
  background: var(--color-surface-raised);
}
.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: var(--color-text);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--color-text-muted);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  transition: color var(--motion-fast);
}
.faq-list details:hover summary::after { color: var(--color-accent); }
.faq-list details[open] summary::after {
  content: "−";
  color: var(--color-accent);
}
.faq-list .faq-answer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ─── Final CTA strip ─────────────────────────────────────────────── */

.cta-strip {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.cta-strip h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-6);
}

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

.footer {
  padding: var(--space-12) 0 var(--space-8);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-8);
}
.footer-grid h4 {
  color: var(--color-text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.footer-grid ul { list-style: none; }
.footer-grid li { padding: 4px 0; }
.footer-grid a { color: var(--color-text-muted); }
.footer-grid a:hover { color: var(--color-text); }
.footer-tagline { margin: var(--space-2) 0 var(--space-4); }
.footer-copy { font-size: 13px; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ─── Policy pages (privacy, terms) ───────────────────────────────── */

.policy {
  padding: var(--space-12) 0 var(--space-16);
}
.policy h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}
.policy .updated {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: var(--space-12);
}
.policy h2 {
  font-size: 22px;
  font-weight: 600;
  margin: var(--space-8) 0 var(--space-3);
}
.policy p, .policy li {
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.65;
  margin-bottom: var(--space-3);
}
.policy ul { padding-left: var(--space-5); margin-bottom: var(--space-4); }
.policy a {
  color: var(--color-accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size var(--motion-fast);
}
.policy a:hover {
  background-size: 100% 2px;
}
.policy code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: var(--radius-1);
}

/* ─── Changelog ───────────────────────────────────────────────────── */

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.changelog-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
}
.changelog-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.changelog-version {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}
.changelog-date {
  font-size: 14px;
  color: var(--color-text-muted);
}
.changelog-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-1);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
}
.changelog-tag-feature {
  background: var(--color-accent-muted);
  color: var(--color-accent);
}
.changelog-tag-launch {
  background: var(--color-upgrade-bg);
  color: var(--color-upgrade);
}
.changelog-card ul {
  list-style: none;
  padding: 0;
}
.changelog-card li {
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.6;
  padding-left: var(--space-4);
  position: relative;
  margin-bottom: var(--space-2);
}
.changelog-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

/* ─── Roadmap ─────────────────────────────────────────────────────── */

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.roadmap-col h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-4);
}
.roadmap-col ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.roadmap-item {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}
.roadmap-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.roadmap-item p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .roadmap-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* ─── Accessibility utility ───────────────────────────────────────── */

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

/* ─── Uninstall feedback form ─────────────────────────────────────── */
/* Container around the embedded Google Form on /uninstall. Google
   Forms iframes don't communicate their content height to the parent,
   so we set a generous fixed minimum. Width fills the prose container. */
.uninstall-form {
  width: 100%;
  max-width: 760px;
  margin: var(--space-8) auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-3);
  overflow: hidden;
  background: var(--color-surface);
}
.uninstall-form iframe {
  width: 100%;
  min-height: 720px;
  border: 0;
  display: block;
}

/* ─── Design refinements pass ─────────────────────────────────────── */
/* Surgical craftsmanship details + atmospheric depth. None of these
   change the layout or content; they signal care in the small things. */

/* Custom text selection — replaces browser-default blue with brand teal.
   Both ::selection and ::-moz-selection for cross-browser coverage. */
::selection {
  background: var(--color-accent);
  color: var(--color-accent-text);
}
::-moz-selection {
  background: var(--color-accent);
  color: var(--color-accent-text);
}

/* Noise overlay — fixed pseudo-element above content (pointer-events
   off) using an inline SVG turbulence as a barely-visible texture.
   Kills the "flat default dark" feel without shifting the palette.
   feColorMatrix forces the noise to white so opacity is the only
   variable; tune via the .05 alpha if it ever feels off. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Button micro-lift on hover — replaces inert hover state. 1px shift
   is intentionally small; the goal is "responds to me," not a UI
   parlor trick. DESIGN.md §11 forbids box-shadow so we skip the
   ghost-shadow that would normally accompany the lift. */
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* Demo mock is decorative — explicitly tell the cursor not to imply
   interactivity (the popup mock is a CSS animation, not clickable). */
.demo-mock {
  cursor: default;
}

/* ─── Motion phase 1 ──────────────────────────────────────────────── */
/* Scroll progress, hero entrance choreography, section-reveal-on-scroll,
   step-number hover. All motion respects prefers-reduced-motion (the
   global reset disables transitions/animations) and JS-no-load fallbacks
   keep content visible if the IntersectionObserver script doesn't run. */

/* Scroll progress bar — 2px teal at the very top, fills as the user
   scrolls. Pure CSS using scroll-driven animations (modern browsers).
   Unsupported browsers see scaleX(0) — invisible, graceful. */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 100;
  animation: scroll-progress linear;
  animation-timeline: scroll(root block);
}
@keyframes scroll-progress {
  to { transform: scaleX(1); }
}

/* Hero entrance choreography — staggered fade + 8px slide on page load.
   Each child of .hero-copy enters in sequence, total ~600ms. One-time. */
.hero-copy > * {
  opacity: 0;
  transform: translateY(8px);
  animation: hero-enter 600ms ease forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: 0ms; }
.hero-copy > *:nth-child(2) { animation-delay: 100ms; }
.hero-copy > *:nth-child(3) { animation-delay: 200ms; }
.hero-copy > *:nth-child(4) { animation-delay: 300ms; }
.hero-copy > *:nth-child(5) { animation-delay: 400ms; }
@keyframes hero-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll-triggered section reveals — sections (other than the hero)
   start invisible, fade in + slide up 12px when they enter the viewport.
   The .js gate means no-JS visitors see all sections immediately;
   only after the inline IntersectionObserver script tags <html> with
   .js do the sections start hidden. */
.js section:not(.hero) {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.js section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Step number micro-interaction — "01 / 02 / 03" cards.
   On card hover, the number scales 5% and shifts to accent teal.
   Tiny but resolves the static feel of the step indicators. */
.step-num {
  transition: transform var(--motion-fast), color var(--motion-fast);
}
.step:hover .step-num {
  transform: scale(1.05);
  color: var(--color-accent);
}

/* Reduced-motion overrides — make sure motion-sensitive users still
   see the content. The global reduced-motion block (top of file)
   disables transitions/animations globally, which would leave hero
   children at opacity:0 and post-hero sections at opacity:0 without
   these explicit recoveries. */
@media (prefers-reduced-motion: reduce) {
  .hero-copy > * {
    opacity: 1;
    transform: none;
  }
  .js section:not(.hero) {
    opacity: 1;
    transform: none;
  }
  .scroll-progress { display: none; }
  .demo-cursor { display: none; }
}

/* ─── Motion phase 2 ──────────────────────────────────────────────── */
/* FAQ smooth open/close + demo mock cursor that "clicks" through the
   states. Both fall back gracefully on older browsers. */

/* FAQ smooth open/close — uses interpolate-size: allow-keywords so
   block-size: auto can be transitioned. Modern browsers (Chrome 131+,
   Firefox 134+) animate; older browsers see the snap-toggle, which
   is the current behavior — no regression. */
@supports (interpolate-size: allow-keywords) {
  .faq-list details {
    interpolate-size: allow-keywords;
  }
  .faq-list details::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size 280ms ease, content-visibility 280ms allow-discrete;
  }
  .faq-list details[open]::details-content {
    block-size: auto;
  }
}

/* Demo cursor — absolute-positioned inside .demo-popup. Animates
   in sync with the existing 10s panel-cycle. The cursor moves to
   the active list item, "clicks" via scale-down, lets the panel
   transition, moves to the Export button, clicks again, then
   fades out as the success state appears. */
.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 10;
  /* White cursor pointer with subtle dark outline for visibility on
     the dark popup background. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 3 L5 17 L9 13 L11 19 L13 18 L11 12 L17 12 Z' fill='white' stroke='rgba(0,0,0,0.6)' stroke-width='1' stroke-linejoin='round'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translate(220px, 30px) scale(1);
  animation: demoCursor 10s infinite;
}

/* Cycle: 10s. List visible 0–35%, preview 35–65%, success 65–90%,
   blank 90–100%. Cursor narrative:
   0–18%   invisible (panel just appeared, no cursor yet)
   22%     fade in at top of popup
   28%     arrive at Table 1 row position
   30–33%  click (scale 0.8 then back)
   38–52%  move to Export button area
   58–62%  click Export (scale 0.8 then back)
   68%+    fade out as success state shows */
@keyframes demoCursor {
  /* Coordinates calibrated to actual element centers (measured live):
     Table 1 row center ≈ (160, 108), Export button center ≈ (214, 299).
     Cursor's pointer tip sits ~3px right + 2px down from its top-left,
     so positions are slightly offset back toward upper-left. */
  0%, 18% {
    opacity: 0;
    transform: translate(240px, 28px) scale(1);
  }
  22% {
    opacity: 0.9;
    transform: translate(240px, 28px) scale(1);
  }
  28% {
    opacity: 0.9;
    transform: translate(155px, 100px) scale(1);
  }
  30% {
    opacity: 0.9;
    transform: translate(155px, 100px) scale(0.8);
  }
  33% {
    opacity: 0.9;
    transform: translate(155px, 100px) scale(1);
  }
  38% {
    opacity: 0.9;
    transform: translate(155px, 100px) scale(1);
  }
  52% {
    opacity: 0.9;
    transform: translate(208px, 290px) scale(1);
  }
  58% {
    opacity: 0.9;
    transform: translate(208px, 290px) scale(1);
  }
  60% {
    opacity: 0.9;
    transform: translate(208px, 290px) scale(0.8);
  }
  62% {
    opacity: 0.9;
    transform: translate(208px, 290px) scale(1);
  }
  68% {
    opacity: 0;
    transform: translate(208px, 290px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(208px, 290px) scale(1);
  }
}

