/* Ampersand homepage — "Ribbon" identity: aged paper + faded typewriter ink.
   Light is the default (paper-first); [data-theme='dark'] inverts to ink-dark
   panels with cream paper accents. Structure mirrors the /demo/ style lab. */

/* Headline font: GT Pressura Mono; body: GT Pressura (static/fonts/Pressura). */
@font-face {
  font-family: 'Pressura';
  src: url('../fonts/Pressura/GT%20Pressura%20Regular%20Web.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pressura';
  src: url('../fonts/Pressura/GT%20Pressura%20Bold%20Web.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Pressura Mono';
  src: url('../fonts/Pressura/GT%20Pressura%20Mono%20Regular%20Web.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pressura Mono';
  src: url('../fonts/Pressura/GT%20Pressura%20Mono%20Bold%20Web.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Light (default) — warm paper surfaces from the app's light palette. */
  --bg: #fcf9f7;
  --bg-elevated: #fbfaf8;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f4f2ee;
  --border: #e8e5df;
  --border-light: #f4f2ee;
  --text: #2a2524;
  --text-dim: #6b6258;
  --text-faint: #b5a99a;
  --diff-add: #4a7c3a;
  --diff-del: #b5453a;
  --shadow-card: 0 8px 32px rgba(122, 92, 50, 0.10);

  /* Ribbon primary: faded ink on paper. */
  --primary: #3d352b;
  --primary-hover: #2e2820;
  --primary-subtle: rgba(61, 53, 43, 0.08);
  --on-primary: #f2e9d5;

  --font-mono: 'Pressura Mono', Menlo, Monaco, 'Courier New', Courier, monospace;
  --font-sans: 'Pressura', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: 'Pressura Mono', var(--font-mono);
}

[data-theme='dark'] {
  --bg: #1e1e1e;
  --bg-elevated: #161616;
  --bg-card: #202020;
  --bg-input: #2c2c2c;
  --bg-hover: #2a2a2a;
  --border: #3a3a3a;
  --border-light: #2e2e2e;
  --text: #e4e4e4;
  --text-dim: #a8a8a8;
  --text-faint: #808080;
  --diff-add: #22c55e;
  --diff-del: #ef4444;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);

  /* Ribbon primary, inverted: aged paper on ink. */
  --primary: #e8dcc3;
  --primary-hover: #d5c6a8;
  --primary-subtle: rgba(232, 220, 195, 0.12);
  --on-primary: #2b2419;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { background: var(--bg-input); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-faint); text-decoration: none; }
.btn-large { padding: 14px 28px; font-size: 15px; }

/* --- Nav ------------------------------------------------------------------- */
.nav { padding: 18px 0; }
.nav .wrap { display: flex; align-items: center; gap: 28px; }
.nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.logo-chip {
  width: 32px; height: 32px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}
.nav .links { display: flex; gap: 22px; flex: 1; }
.nav .links a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
.nav .links a:hover { color: var(--text); text-decoration: none; }
.nav .actions { display: flex; gap: 10px; align-items: center; }
.nav .actions .signin { color: var(--text-dim); font-size: 14px; font-weight: 500; margin-right: 4px; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle i { font-size: 18px; }
/* Show moon (to switch TO dark) when in light mode; sun (to switch TO light) when in dark mode */
.theme-toggle .icon-dark { display: none; }
.theme-toggle .icon-light { display: block; }
[data-theme='light'] .theme-toggle .icon-dark { display: block; }
[data-theme='light'] .theme-toggle .icon-light { display: none; }
[data-theme='dark'] .theme-toggle .icon-dark { display: none; }
[data-theme='dark'] .theme-toggle .icon-light { display: block; }

/* --- Hero ------------------------------------------------------------------ */
.hero { padding: 96px 0 80px; text-align: center; }
.hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--primary); }
.hero .sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; }

/* --- Editor mock ----------------------------------------------------------- */
.editor-mock {
  max-width: 720px;
  margin: 72px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-align: left;
}
.editor-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.editor-titlebar .filename {
  margin-left: 10px;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.editor-body {
  padding: 24px 28px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 2;
  color: var(--text);
}
.editor-body .md-h { color: var(--text-dim); }
.editor-body del { color: var(--diff-del); text-decoration: line-through; opacity: 0.8; }
.editor-body ins {
  color: var(--diff-add);
  text-decoration: none;
  background: var(--primary-subtle);
  border-radius: 3px;
  padding: 1px 3px;
}
.editor-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-dim);
}
.editor-hint .kbd {
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}
.editor-hint .hint-accent { color: var(--primary); font-weight: 600; }

/* --- Sections -------------------------------------------------------------- */
.section { padding: 80px 0; }
.section-head { text-align: center; margin-bottom: 52px; }
.section-head h2 { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 16px; max-width: 520px; margin: 0 auto; }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-dim); }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  position: relative;
}
.plan .plan-flag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
}
.plan .plan-name { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 10px; }
.plan.featured .plan-name { color: var(--primary); }
.plan .plan-price { font-size: 36px; font-weight: 700; letter-spacing: -1px; }
.plan .plan-price span { font-size: 14px; font-weight: 500; color: var(--text-faint); }
.plan ul { list-style: none; margin: 20px 0 26px; flex: 1; }
.plan li { font-size: 14px; color: var(--text-dim); padding: 5px 0 5px 24px; position: relative; }
.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg);
}
.plan .btn { width: 100%; }

/* --- Persona feature ------------------------------------------------------- */
.persona-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background:
    linear-gradient(160deg, var(--primary-subtle), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 56px 48px;
  margin-bottom: 80px;
}
.persona-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 4px 14px;
  border-radius: 999px;
}
.persona-copy h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 16px 0 14px;
}
.persona-copy h2 .accent { color: var(--primary); }
.persona-sub { color: var(--text-dim); font-size: 16px; margin-bottom: 24px; }
.persona-points { list-style: none; margin-bottom: 28px; }
.persona-points li {
  font-size: 14px;
  color: var(--text-dim);
  padding: 5px 0 5px 24px;
  position: relative;
}
.persona-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg);
}

.persona-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.persona-tab {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.persona-tab:hover { color: var(--text); border-color: var(--text-faint); }
.persona-tab.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: transparent;
  box-shadow: 0 0 0 1px var(--primary);
}

.profile-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.profile-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-id { flex: 1; min-width: 0; }
.profile-name { font-size: 14px; font-weight: 600; }
.profile-meta { font-size: 12px; color: var(--text-faint); }
.profile-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.profile-row:last-child { border-bottom: none; padding-bottom: 2px; }
.profile-row span { font-size: 13px; color: var(--text-faint); flex-shrink: 0; }
.profile-row strong { font-size: 13px; font-weight: 500; text-align: right; }

/* CTA banner */
.cta-banner {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 16px;
  padding: 64px 48px;
  text-align: center;
  margin-bottom: 80px;
}
.cta-banner h2 { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.cta-banner p { opacity: 0.85; font-size: 16px; margin-bottom: 28px; }
.cta-banner .btn-invert {
  background: var(--bg);
  color: var(--text);
}
.cta-banner .btn-invert:hover { background: var(--bg-card); text-decoration: none; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.footer .wrap { display: flex; justify-content: space-between; align-items: center; }
.footer a { color: var(--text-dim); margin-left: 20px; }

@media (max-width: 1000px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .hero h1 { font-size: 36px; }
  .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
  .persona-card { grid-template-columns: 1fr; padding: 36px 24px; gap: 32px; }
  .nav .links { display: none; }
}
