/* ==========================================================================
   textbox — landing page. "Vellum & Clay" (String Hopper) design system.
   Light = warm cream · Dark = warm clay. Never pure white/black.
   ========================================================================== */

:root {
  /* light — warm cream */
  --page-bg:      #f3ead8;
  --panel:        #fdfaf2;
  --panel-2:      #faf4e8;
  --fg-strong:    #2a2620;
  --fg:           #4a4238;
  --fg-muted:     #7c715f;
  --fg-faint:     #9c927f;
  --accent:       #6f8a4e;
  --accent-deep:  #5a7240;
  --accent-text:  #fdfaf2;
  --accent-soft:  #e4ead2;
  --accent-line:  rgba(111,138,78,0.30);
  --honey:        #e8b658;
  --peach:        #b16a4a;
  --border:       rgba(60,48,30,0.10);
  --border-strong:rgba(60,48,30,0.18);
  --shadow-1:     0 2px 8px -2px rgba(60,48,30,0.14);
  --shadow-2:     0 24px 60px -22px rgba(60,48,30,0.34);
  --shadow-key:   0 1px 0 rgba(60,48,30,0.06), inset 0 1px 0 rgba(255,255,255,0.5);
  --mosaic:       url(assets/pattern-mosaic-tile.svg);
  --glow-honey:   rgba(232,182,88,0.40);
  --glow-peach:   rgba(232,168,139,0.22);
  --glow-sage:    rgba(174,192,136,0.28);
  --card-edge:    rgba(255,255,255,0.55);

  --ease-settle:  cubic-bezier(0.34, 1.2, 0.5, 1);
  --ease-out:     cubic-bezier(0.2, 0.8, 0.2, 1);

  --font-display: 'Fraunces', 'Source Serif Pro', Georgia, serif;
  --font-ui:      'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1140px;
}

html[data-theme="dark"] {
  --page-bg:      #15110b;
  --panel:        #241e15;
  --panel-2:      #1c1710;
  --fg-strong:    #f5edda;
  --fg:           #e2d8c2;
  --fg-muted:     #a99e87;
  --fg-faint:     #7e7560;
  --accent:       #8ea466;
  --accent-deep:  #6f8a4e;
  --accent-text:  #16130d;
  --accent-soft:  rgba(142,164,102,0.16);
  --accent-line:  rgba(142,164,102,0.40);
  --honey:        #e8b658;
  --peach:        #e8a88b;
  --border:       rgba(245,236,214,0.10);
  --border-strong:rgba(245,236,214,0.20);
  --shadow-1:     0 2px 10px -2px rgba(0,0,0,0.5);
  --shadow-2:     0 28px 70px -24px rgba(0,0,0,0.66);
  --shadow-key:   0 1px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  --mosaic:       url(assets/pattern-mosaic-tile-dark.svg);
  --glow-honey:   rgba(232,182,88,0.20);
  --glow-peach:   rgba(232,168,139,0.12);
  --glow-sage:    rgba(142,164,102,0.20);
  --card-edge:    rgba(255,255,255,0.05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--fg);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-out), color 0.5s var(--ease-out);
}

/* ---------- atmosphere (fixed background layers) ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg .mosaic {
  position: absolute; inset: 0;
  background-image: var(--mosaic);
  background-size: 46px 46px;
  opacity: 0.5;
}
.bg .glow {
  position: absolute; border-radius: 50%; filter: blur(20px);
}
.bg .glow.a {
  width: 1000px; height: 1000px; right: -240px; top: -340px;
  background: radial-gradient(circle at 50% 50%, var(--glow-honey) 0%, var(--glow-peach) 42%, transparent 70%);
}
.bg .glow.b {
  width: 820px; height: 820px; left: -260px; bottom: -360px;
  background: radial-gradient(circle at 50% 50%, var(--glow-sage) 0%, transparent 68%);
}
.bg .grain {
  position: absolute; inset: 0; opacity: 0.4; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
section { position: relative; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-deep);
}
html[data-theme="dark"] .eyebrow { color: var(--accent); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--page-bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .tile {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px;
  display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.brand .penmark {
  width: 16px; height: 16px; fill: none; stroke: var(--accent-deep);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
html[data-theme="dark"] .brand .penmark { stroke: var(--accent); }
.brand .name { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--fg-strong); letter-spacing: -0.01em; }
.nav .links { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav .links a.txt { color: var(--fg-muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; transition: color .15s; }
.nav .links a.txt:hover { color: var(--fg-strong); }

/* theme toggle */
.toggle {
  width: 58px; height: 30px; border-radius: 999px; position: relative; cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  transition: background .4s var(--ease-out);
}
.toggle .knob {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); box-shadow: var(--shadow-1);
  display: grid; place-items: center; color: var(--accent-text); font-size: 13px;
  transition: transform .42s var(--ease-settle), background .4s;
}
html[data-theme="dark"] .toggle .knob { transform: translateX(28px); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-ui); font-weight: 800; font-size: 15px;
  border-radius: 999px; padding: 14px 26px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease-settle), box-shadow .2s var(--ease-out), background .2s;
}
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-1); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); background: var(--accent-deep); }
html[data-theme="dark"] .btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { background: color-mix(in srgb, var(--panel) 60%, transparent); color: var(--fg-strong); border-color: var(--border-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.btn.small { padding: 9px 16px; font-size: 13.5px; }

/* ---------- hero ---------- */
.hero { padding: 92px 0 40px; text-align: center; }
.hero .eyebrow { display: inline-block; margin-bottom: 22px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 600; color: var(--fg-strong);
  font-size: clamp(34px, 6.4vw, 78px); line-height: 1.04; letter-spacing: -0.025em;
  max-width: 16ch; margin: 0 auto; overflow-wrap: break-word;
}
.hero h1 .ital { font-style: italic; font-weight: 500; color: var(--accent-deep); }
html[data-theme="dark"] .hero h1 .ital { color: var(--accent); }
.hero .lede {
  font-size: clamp(17px, 2.1vw, 20px); color: var(--fg-muted);
  max-width: 56ch; margin: 26px auto 0; text-wrap: balance;
}
.hero .cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .meta { margin-top: 16px; font-size: 13px; color: var(--fg-faint); font-family: var(--font-mono); letter-spacing: .02em; }

.hero-shot { margin: 56px auto 0; max-width: 900px; position: relative; }
.hero-shot::before {
  content: "FIG. 01 — the editor, suspended";
  position: absolute; top: -26px; left: 4px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-faint);
}

/* ---------- shot frames ---------- */
.shot {
  width: 100%; height: auto; display: block; border-radius: 20px;
  box-shadow: var(--shadow-2);
  background: transparent;
}
.shot.bordered { box-shadow: var(--shadow-2), 0 0 0 1px var(--border); border-radius: 16px; }
.float { animation: floaty 8s ease-in-out infinite; }
@keyframes floaty { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-10px) } }

/* ---------- feature rows ---------- */
.features { padding: 40px 0 20px; }
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  padding: 56px 0;
}
.feature.flip .copy { order: 2; }
.feature .copy h2 {
  font-family: var(--font-display); font-weight: 600; color: var(--fg-strong);
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.02em; margin: 14px 0 0;
}
.feature .copy p { margin-top: 16px; font-size: 17px; color: var(--fg-muted); max-width: 46ch; }
.feature .copy p strong { color: var(--accent-deep); font-weight: 800; }
html[data-theme="dark"] .feature .copy p strong { color: var(--accent); }
.feature .copy .pills { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--fg);
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
}
.media { position: relative; }

/* ---------- keyboard strip ---------- */
.chords { padding: 40px 0; }
.chords .panel {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border: 1px solid var(--border); border-radius: 28px; padding: 40px 36px;
  box-shadow: var(--shadow-1);
}
.chords h2 {
  font-family: var(--font-display); font-weight: 600; color: var(--fg-strong);
  font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.02em; text-align: center;
}
.chords .grid { margin-top: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.chord { text-align: center; }
.chord .keys { display: inline-flex; gap: 5px; }
.chord .label { margin-top: 12px; font-weight: 700; color: var(--fg-strong); font-size: 15px; }
.chord .sub { margin-top: 2px; font-size: 13px; color: var(--fg-muted); }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 9px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-key); font-family: var(--font-mono); font-size: 13.5px; color: var(--fg);
}
.kbd.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent-deep); }

/* ---------- theme moment ---------- */
.moment { padding: 64px 0; text-align: center; }
.moment h2 {
  font-family: var(--font-display); font-weight: 600; color: var(--fg-strong);
  font-size: clamp(30px, 4vw, 50px); letter-spacing: -0.02em; line-height: 1.05;
}
.moment h2 .ital { font-style: italic; color: var(--accent-deep); }
html[data-theme="dark"] .moment h2 .ital { color: var(--accent); }
.moment p { margin-top: 16px; color: var(--fg-muted); font-size: 17px; }
.moment .hint { margin-top: 22px; font-family: var(--font-mono); font-size: 13px; color: var(--fg-faint); }

/* ---------- download CTA ---------- */
.download { padding: 30px 0 90px; }
.download .panel {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 30px;
  padding: 64px 40px; text-align: center; box-shadow: var(--shadow-2);
}
.download .panel::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--glow-honey) 0%, transparent 68%); filter: blur(12px); pointer-events: none;
}
.download h2 {
  font-family: var(--font-display); font-weight: 600; color: var(--fg-strong);
  font-size: clamp(32px, 4.4vw, 54px); letter-spacing: -0.02em; position: relative;
}
.download p { margin-top: 14px; color: var(--fg-muted); font-size: 17px; position: relative; }
.download .cta { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }
.download .note { margin-top: 18px; font-size: 12.5px; color: var(--fg-faint); font-family: var(--font-mono); position: relative; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 34px 0 50px; }
footer .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
footer .serif { font-family: var(--font-display); font-style: italic; color: var(--fg-muted); }
footer .dot { color: var(--fg-faint); }
footer .right { margin-left: auto; color: var(--fg-faint); font-size: 13px; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease-settle), transform .7s var(--ease-settle); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 26px; padding: 40px 0; }
  .feature.flip .copy { order: 0; }
  .chords .grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .nav .links a.txt { display: none; }
  .hero { padding: 64px 0 20px; }
  .hero h1 { font-size: clamp(30px, 8vw, 50px); max-width: 20ch; }
  .hero-shot::before { display: none; }
  .download .panel { padding: 44px 24px; }
  .chords .panel { padding: 30px 20px; }
}
@media (max-width: 420px) {
  .wrap { padding: 0 18px; }
  .hero h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .float { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
