/* Reframed — shared stylesheet
   Dark-first, mirrors the app design system (constants/reframeTheme.ts):
   Gambarino states the headline, Switzer labels, Inconsolata is the body. */

@import url('https://api.fontshare.com/v2/css?f[]=gambarino@400&f[]=switzer@400,500,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap');

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --paper:       #131210;
  --paper2:      #1D1B18;
  --paper3:      #272420;
  --ink:         #F5F1E8;
  --ink-soft:    #E8E4DA;
  --ink60:       rgba(245,241,232,0.65);
  --ink40:       rgba(245,241,232,0.52);
  --ink20:       rgba(245,241,232,0.20);
  --ink10:       rgba(245,241,232,0.10);
  --ink06:       rgba(245,241,232,0.06);
  --rule:        rgba(245,241,232,0.18);
  --rule-soft:   rgba(245,241,232,0.08);
  --indigo:      #7B8FD4;
  --indigo-soft: #9FAEE0;
  --vermillion:  #E06B5A;
  --ochre:       #C9A44E;
  --strike:      #C14432;
  --green:       #7BD48F;

  --font-serif: 'Gambarino', Georgia, 'Times New Roman', serif;
  --font-label: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:  'Inconsolata', ui-monospace, 'SF Mono', Menlo, monospace;
  /* Legacy aliases — quiz.html inline styles reference these */
  --font-title: var(--font-label);
  --font-sans:  var(--font-mono);

  --max-w: 860px;
  --radius: 14px;      /* cards */
  --radius-btn: 3px;   /* primary buttons, terminal chrome */
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Grain — desaturated fractal noise over the whole page, like the app's Skia noise */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(123,143,212,0.35); }

/* Brand mark — the strikethrough through the old thought */
s, del {
  text-decoration: line-through;
  text-decoration-color: var(--strike);
  text-decoration-thickness: 2px;
  color: var(--ink40);
}

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

/* ─── Nav ────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19,18,16,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  perspective: 300px;
}

.nav-logo .lg {
  display: inline-block;
  min-width: 0.62em;
  text-align: center;
  backface-visibility: visible;
}

.nav-logo .lg.glitch {
  animation: logo-flip 0.56s cubic-bezier(0.3, 0.7, 0.4, 1);
}

@keyframes logo-flip {
  0% {
    transform: rotateX(0) translateY(0);
    color: inherit;
    text-shadow: none;
  }
  20% {
    transform: rotateX(80deg) translateY(1px) skewX(-4deg);
    color: var(--vermillion);
    text-shadow: 2px 0 rgba(123,143,212,0.8), -2px 0 rgba(224,107,90,0.8);
  }
  45% {
    transform: rotateX(180deg);
    color: var(--ochre);
    text-shadow: -1px 0 rgba(123,143,212,0.8), 1px 0 rgba(224,107,90,0.8);
  }
  70% {
    transform: rotateX(280deg) skewX(3deg);
    color: var(--indigo-soft);
    text-shadow: 1px 0 rgba(224,107,90,0.6);
  }
  100% {
    transform: rotateX(360deg) translateY(0);
    color: inherit;
    text-shadow: none;
  }
}

.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink40);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
  text-align: center;
}

/* Top wash — warm, two colors only */
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(224,107,90,0.13) 0%,
    rgba(201,164,78,0.07) 38%,
    transparent 75%);
  pointer-events: none;
}

/* Ambient ASCII field — dim glyphs drifting around the hero */
.ascii-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: var(--font-mono);
  z-index: 0;
}

.ascii-field span {
  position: absolute;
  font-size: 14px;
  color: var(--ink20);
  animation: glyph-float 14s ease-in-out infinite;
}

.ascii-field span.small { font-size: 11px; }
.ascii-field span.big { font-size: 18px; }
.ascii-field span.warm { color: rgba(224,107,90,0.32); }
.ascii-field span.gold { color: rgba(201,164,78,0.32); }
.ascii-field span.cool { color: rgba(123,143,212,0.30); }

@keyframes glyph-float {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-14px); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .ascii-field span, .cursor { animation: none; }
}

@media (max-width: 700px) {
  .ascii-field { display: none; }
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.06;
  letter-spacing: 0;
  color: var(--ink);
  max-width: 680px;
  margin: 0 auto 20px;
}

.hero-sub {
  font-family: var(--font-label);
  font-size: 17px;
  color: var(--ink60);
  max-width: 500px;
  margin: 0 auto 44px;
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px 26px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--ink60);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.btn-ghost:hover { color: var(--ink); border-color: var(--ink40); }

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* App store badge — primary button treatment: filled ink, sharp corners */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: var(--radius-btn);
  transition: opacity 0.15s, transform 0.15s;
  text-decoration: none;
}

.appstore-badge:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }

.appstore-badge svg { flex-shrink: 0; }

/* ─── Terminal window (hero) ─────────────────────────────── */
.terminal {
  max-width: 520px;
  margin: 60px auto 0;
  text-align: left;
  background: rgba(29,27,24,0.72);
  border: 1px solid var(--ink10);
  border-radius: 2px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.terminal-dot {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--vermillion);
  flex-shrink: 0;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink40);
}

.terminal-body {
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.terminal-body p {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.t-sys { color: var(--ink40); }
.t-quote { color: var(--vermillion); }
.t-em { color: var(--ink); }

.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 6px;
  vertical-align: -1px;
  background: var(--ink60);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ─── Divider ─────────────────────────────────────────────── */
.rule { border: none; border-top: 1px solid var(--rule-soft); margin: 0; }

/* ─── Section ─────────────────────────────────────────────── */
section { padding: 80px 0; }

.section-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink40);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: 0;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 14px;
}

.section-body {
  font-family: var(--font-label);
  font-size: 16px;
  color: var(--ink60);
  max-width: 520px;
  line-height: 1.7;
}

/* ─── Feature grid ────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 52px;
}

.feature-card {
  background: var(--paper2);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.feature-icon.indigo { background: rgba(123,143,212,0.12); color: var(--indigo); }
.feature-icon.vermillion { background: rgba(224,107,90,0.12); color: var(--vermillion); }
.feature-icon.ochre { background: rgba(201,164,78,0.12); color: var(--ochre); }
.feature-icon.ink { background: var(--ink06); color: var(--ink); }

.feature-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
}

.feature-desc {
  font-size: 14px;
  color: var(--ink60);
  line-height: 1.6;
}

/* ─── How it works ───────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 52px;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 32px 28px;
  background: var(--paper2);
  border-bottom: 1px solid var(--rule-soft);
}

.step:last-child { border-bottom: none; }

.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink40);
  width: 32px;
  flex-shrink: 0;
  padding-top: 4px;
}

.step-content { flex: 1; }

.step-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 14px;
  color: var(--ink60);
  line-height: 1.65;
}

/* ─── Privacy summary strip ──────────────────────────────── */
.privacy-strip {
  background: var(--paper2);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  padding: 48px 0;
}

.privacy-strip .section-title { margin-bottom: 32px; }

.privacy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

/* Chips — pill radius, hairline border, terminal register (lowercase mono) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--ink10);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: lowercase;
  color: var(--ink60);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-dot.green { background: var(--green); }
.pill-dot.indigo { background: var(--indigo-soft); }
.pill-dot.ochre { background: var(--ochre); }

/* ─── FAQ ─────────────────────────────────────────────────── */
.faq-list {
  margin-top: 52px;
  border-top: 1px solid var(--rule-soft);
}

.faq-item {
  border-bottom: 1px solid var(--rule-soft);
}

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
  transition: color 0.15s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink40);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
  color: var(--vermillion);
}

.faq-item summary:hover { color: var(--indigo-soft); }

.faq-item p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink60);
  padding: 0 0 24px;
  max-width: 640px;
}

.faq-item p + p { margin-top: -12px; }

.faq-item .faq-quote { color: var(--ink); }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--rule-soft);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink40);
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--ink40);
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--ink); text-decoration: none; }

.footer-copy {
  width: 100%;
  font-size: 12px;
  color: var(--ink40);
  margin-top: 8px;
}

/* ─── Inner pages (privacy, support) ─────────────────────── */
.page-hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--rule-soft);
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 0;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 12px;
}

.page-hero p {
  font-family: var(--font-label);
  font-size: 16px;
  color: var(--ink60);
}

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

.prose h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin: 44px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}

.prose h2:first-of-type { margin-top: 0; }

.prose p {
  font-size: 15px;
  color: var(--ink60);
  line-height: 1.75;
  margin-bottom: 14px;
}

.prose ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.prose li {
  font-size: 15px;
  color: var(--ink60);
  line-height: 1.75;
  margin-bottom: 6px;
}

.prose a { color: var(--indigo); }

.prose strong { color: var(--ink); font-weight: 700; }

.prose h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  margin: 30px 0 8px;
}

.prose .thought {
  display: block;
  background: var(--paper2);
  border-left: 2px solid var(--vermillion);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}

.prose .thought .label {
  display: block;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink40);
  margin-bottom: 5px;
}

.prose .thought.reframe { border-left-color: var(--green); }

/* ─── Article index ──────────────────────────────────────── */
.article-list { border-top: 1px solid var(--rule-soft); }

.article-item {
  display: block;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule-soft);
  color: inherit;
}

.article-item:hover { text-decoration: none; }
.article-item:hover .article-title { color: var(--indigo-soft); }

.article-meta {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink40);
  margin-bottom: 8px;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 6px;
  transition: color 0.15s;
}

.article-excerpt {
  font-size: 14px;
  color: var(--ink60);
  line-height: 1.65;
  max-width: 620px;
}

/* ─── Support card ───────────────────────────────────────── */
.support-card {
  background: var(--paper2);
  border: 1px solid var(--ink10);
  border-radius: var(--radius);
  padding: 32px;
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-card-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
}

.support-card-desc {
  font-size: 14px;
  color: var(--ink60);
  line-height: 1.6;
}

.support-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--indigo);
  margin-top: 6px;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .features-grid { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: 8px; }
  .step-num { width: auto; }
}
