/* Fable — warm storybook theme */
:root {
  --bg: #E8CFA1;          /* warm parchment — matches the art */
  --ink: #160C00;         /* near-black brown */
  --accent: #D56C4F;      /* Claude orange */
  --accent-soft: #e08c72;
  --card: #E8CFA1;        /* same as bg — boxless */
  --card-2: #f8f1e3;
  --line: #d8c6a6;
  --muted: #7a6a52;
  --green: #5f8a5b;
  --red: #c0563f;
  --shadow: none;
  --radius: 8px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--accent); }

/* paper grain — matches the art's texture so image edges blend into the page */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
section, header, footer { position: relative; z-index: 2; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 10px 20px; border: 1px solid var(--accent); border-radius: 0; cursor: pointer;
  font-family: var(--sans); font-size: 15px; letter-spacing: .2px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.big { padding: 13px 26px; font-size: 16px; }

/* icon links (nav + footer) */
.icon-link { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); padding: 2px; transition: color .15s, transform .15s; }
.icon-link:hover { color: var(--accent); transform: translateY(-1px); }

/* ── nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1160px; margin: 0 auto; padding: 20px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 36px; width: auto; object-fit: contain; display: block; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 27px; letter-spacing: .5px; }
.brand-badge {
  font-size: 11px; font-weight: 800; color: var(--accent); background: rgba(213,108,79,0.12);
  border: 1px solid rgba(213,108,79,0.35); border-radius: 999px; padding: 3px 9px;
}
.nav-links { display: flex; align-items: center; gap: 20px; font-weight: 700; }
.nav-links a:not(.btn):hover { color: var(--accent); }
.nav-links .ghost { font-size: 15px; }

/* ── hero ── */
.hero {
  max-width: 1160px; margin: 0 auto; padding: 100px 28px 40px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
}
.kicker { font-family: var(--serif); font-style: italic; color: var(--accent); font-weight: 500; font-size: 19px; letter-spacing: 1px; margin-bottom: 14px; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(36px, 5.2vw, 58px); line-height: 1.08; letter-spacing: 0; }
.lede { font-size: 18px; color: #3a2c1a; margin: 24px 0 26px; max-width: 560px; }
.lede strong { color: var(--ink); }

.ca {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.ca-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 800; }
.ca code { color: var(--accent); font-weight: 700; word-break: break-all; font-family: ui-monospace, monospace; font-size: 14px; }
.ca-copy { background: var(--accent); color: #fff; border: 0; border-radius: 0; padding: 6px 12px; font-weight: 800; cursor: pointer; font-family: var(--sans); }
.ca-copy.done { background: var(--green); }

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

/* hero art — large, no frame, no animation, no shadow */
.hero-art { position: relative; display: grid; place-items: center; min-height: 420px; }

/* vignette layer — fades art/video edges into the page bg so they blend */
.art-frame { position: relative; display: inline-block; line-height: 0; }
.art-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 78% 78% at 50% 50%, transparent 42%, var(--bg) 88%);
}
/* edge blend baked into about.png / about.mp4, plus this vignette melts the rest into the page */
.about-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 84% 84% at 50% 50%, transparent 30%, #e4cb9c 99%);
}
.hero-logo { width: clamp(320px, 36vw, 480px); height: auto; object-fit: contain; display: block;
  -webkit-mask-image: radial-gradient(ellipse 92% 92% at 50% 50%, #000 56%, transparent 96%);
  mask-image: radial-gradient(ellipse 92% 92% at 50% 50%, #000 56%, transparent 96%); }
.live-pill {
  position: absolute; bottom: 6px; right: 0;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-weight: 700; font-size: 13px;
}
.live-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(95,138,91,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95,138,91,.5) } 70% { box-shadow: 0 0 0 10px rgba(95,138,91,0) } 100% { box-shadow: 0 0 0 0 rgba(95,138,91,0) } }

/* ── manifesto (letter-by-letter reveal) ── */
.manifesto { max-width: 920px; margin: 300px auto; padding: 0 28px; text-align: center; }
.manifesto-line { font-family: var(--serif); font-weight: 500; font-style: italic; font-size: clamp(26px, 4vw, 46px); line-height: 1.35; color: var(--ink); }

/* letter-by-letter reveal — used on all large headings */
.fx-letters span {
  display: inline-block; opacity: 0;
  transform: translateY(.95em) scale(.94); filter: blur(4px);
  transition: opacity .55s ease, transform .75s cubic-bezier(.18,.78,.24,1), filter .5s ease;
}
.fx-letters.in span { opacity: 1; transform: none; filter: none; }

/* ── mind (live thinking window) ── */
.mind { max-width: 940px; margin: 300px auto; padding: 0 28px; }
.mind-window { background: transparent; border: 0; border-top: 1px solid var(--line); margin-top: 20px; }
.mind-head { display: flex; align-items: center; gap: 9px; padding: 14px 22px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--muted); font-size: 13px; letter-spacing: .4px; }
.mind-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(95,138,91,.5); animation: pulse 2s infinite; }
.mind-dot.off { background: var(--muted); animation: none; box-shadow: none; }
.mind-feed { padding: 6px 22px 14px; max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: none; -ms-overflow-style: none; }
.mind-feed::-webkit-scrollbar { width: 0; height: 0; display: none; }
.mind-empty { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 19px; padding: 30px 0; text-align: center; }
.thought { padding: 12px 0; border-bottom: 1px dashed var(--line); animation: rise .4s ease both; }
.thought:last-child { border-bottom: 0; }
.th-line { font-size: 15px; color: var(--ink); }
.th-quote { font-family: var(--serif); font-style: italic; font-size: 18px; color: #4a3a26; margin-top: 4px; }
/* Fable's own words — attributed + set off with an accent edge */
.th-says { margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--accent); }
.says-tag { display: block; font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 3px; }
.th-time { color: var(--muted); font-size: 12px; font-weight: 700; }
.th-accent { color: var(--accent); font-weight: 800; }
.th-launch { color: var(--green); font-weight: 800; }
.th-skip { color: var(--muted); font-weight: 800; }

/* ── stats radials (no boxes, smaller) ── */
.stats { max-width: 1040px; margin: 300px auto; padding: 0 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.stat { text-align: center; }
.radial { width: 116px; height: 116px; margin: 0 auto 14px; position: relative; }
.radial svg { transform: rotate(-90deg); display: block; }
.radial .radial-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.radial .rc-main { font-family: var(--serif); font-weight: 800; font-size: 26px; line-height: 1; color: var(--ink); }
.radial .rc-sub { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.stat-name { font-family: var(--serif); font-weight: 700; font-size: 17px; margin-top: 4px; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.counter-card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-counter { font-family: var(--serif); font-weight: 800; font-size: 40px; line-height: 1; margin: 20px 0 14px; }

/* ── section heads ── */
.sec-head { max-width: 1160px; margin: 0 auto 20px; padding: 0 28px; display: flex; align-items: baseline; gap: 14px; }
.sec-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 4vw, 46px); line-height: 1.1; }
.sec-note { font-style: italic; font-family: var(--serif); color: var(--accent); font-size: 19px; }

/* ── about ── */
.about { max-width: 1100px; margin: 300px auto; padding: 0 28px; display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.about-art { position: relative; line-height: 0; }
.about-art img, .about-art video { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.about-text h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 4vw, 46px); line-height: 1.1; margin: 10px 0 18px; }
.about-text p { font-size: 17px; color: #3a2c1a; margin-bottom: 14px; }
.about-quote { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 21px; margin-top: 18px; }
.about.no-art { grid-template-columns: 1fr; max-width: 780px; text-align: center; }

/* ── tales ── */
.tales, .quests, .story { max-width: 1160px; margin: 300px auto; padding: 0 28px; }
.tales-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tale {
  background: transparent; border: 0; padding: 16px 4px;
  transition: transform .2s ease;
  animation: rise .5s ease both;
}
.tale:hover { transform: translateY(-3px); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } }
.tale-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tale-vibe { font-size: 26px; }
.tale-name { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.tale-tic { color: var(--accent); font-weight: 800; }
.tale-quote { color: #4a3a26; font-style: italic; font-family: var(--serif); margin: 6px 0 10px; }
.tale-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; }
.tale-badge { font-weight: 800; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.tale-badge.win { background: rgba(95,138,91,.15); color: var(--green); }
.tale-badge.loss { background: rgba(192,86,63,.15); color: var(--red); }
.tale-badge.live { background: rgba(213,108,79,.15); color: var(--accent); }
.tale a.link { color: var(--accent); font-weight: 800; }
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 40px; border: 1.5px dashed var(--line); border-radius: 18px; font-style: italic; font-family: var(--serif); }

/* ── quests ── */
.quests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.quest-img { width: 100%; height: 160px; object-fit: cover; margin-bottom: 12px; }
.quest-reward { font-weight: 800; color: var(--accent); }

/* ── story steps ── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: transparent; border: 0; border-top: 1px solid var(--line); padding: 18px 16px 0 0; }
.step-n { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }
.step h3 { font-family: var(--serif); font-weight: 600; font-size: 23px; margin: 8px 0 6px; }
.step p { color: #4a3a26; font-size: 15px; }

/* ── footer ── */
/* full-width floral band — flowers stay fully visible, only the top edge melts in */
.foot {
  position: relative; margin: 300px 0 0; padding: 7% 28px 0; text-align: center;
  color: var(--muted); display: flex; flex-direction: column; gap: 12px;
  aspect-ratio: 1774 / 887;
  background: url(/footer.png) top center / 100% 100% no-repeat;
}
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; z-index: 0;
  background: linear-gradient(var(--bg), transparent); pointer-events: none;
}
.foot > * { position: relative; z-index: 1; }
.foot strong { color: var(--ink); }
.foot-links { display: flex; gap: 20px; justify-content: center; font-weight: 800; }
.foot-links a:hover { color: var(--accent); }
.disclaimer { font-size: 12px; color: #9b8a6f; }

/* ── reveal on scroll ── */
.reveal { opacity: 0; transform: translateY(56px) scale(.95); filter: blur(8px);
  transition: opacity 1.1s ease, transform 1.3s cubic-bezier(.16,.84,.3,1), filter 1s ease;
  will-change: opacity, transform, filter; }
.reveal.in { opacity: 1; transform: none; filter: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; min-height: 240px; }
  .hero-logo { width: 180px; height: 180px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 30px; }
  .about-art { order: -1; }
  .manifesto, .stats, .tales, .quests, .story, .about { margin: 90px auto; }
  .nav-links a:not(.btn):not(.ghost) { display: none; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .nav-links .ghost { display: none; }
}

/* ── Fable's voice (toggle + first-visit modal) ── */
.voice-toggle { background: none; border: 0; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; padding: 0; }
.voice-toggle .ico-off { display: none; }
.voice-toggle.off .ico-on { display: none; }
.voice-toggle.off .ico-off { display: inline; color: var(--muted); }

.voice-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: rgba(22,12,0,.42); backdrop-filter: blur(3px); animation: vmfade .5s ease both; }
.voice-modal[hidden] { display: none; }
.vm-card { max-width: 460px; text-align: center; background: var(--bg); border: 1px solid var(--line);
  padding: 40px 36px; box-shadow: 0 30px 80px rgba(22,12,0,.28); animation: vmrise .6s cubic-bezier(.16,.84,.3,1) both; }
.vm-logo { width: 120px; height: auto; margin: 0 auto 8px; display: block;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 92%);
  mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 92%); }
.vm-card h3 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 4px 0 14px; color: var(--ink); }
.vm-card p { font-size: 16px; color: #3a2c1a; margin-bottom: 12px; line-height: 1.6; }
.vm-fine { font-size: 13px; color: var(--muted); }
.vm-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; align-items: center; }
.vm-no { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; text-decoration: underline; }
.vm-no:hover { color: var(--ink); }
@keyframes vmfade { from { opacity: 0 } to { opacity: 1 } }
@keyframes vmrise { from { opacity: 0; transform: translateY(24px) scale(.97) } to { opacity: 1; transform: none } }
