:root {
  color-scheme: light;
  --ink: #17323a;
  --ink-deep: #0d252c;
  --forest: #123b46;
  --paper: #fffaf0;
  --paper-deep: #f4ead6;
  --white: #fffef9;
  --coral: #d85f49;
  --coral-dark: #a93d2d;
  --saffron: #e7ae42;
  --teal: #1d7d7a;
  --muted: #667479;
  --line: #d9cdb8;
  --focus: #087e8b;
  --shadow: 0 24px 65px rgba(23, 50, 58, .13);
  --display: Georgia, 'Times New Roman', serif;
  --body: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(231, 174, 66, .16), transparent 28rem),
    linear-gradient(rgba(23, 50, 58, .035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 42px, auto;
  color: var(--ink);
  font: 16px/1.65 var(--body);
}
a { color: var(--coral-dark); text-underline-offset: .18em; }
a:hover { color: var(--teal); }

.site-header,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.site-header { min-height: 78px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand {
  color: var(--ink-deep);
  font: 700 1.35rem/1 var(--display);
  text-decoration: none;
  letter-spacing: -.025em;
}
.brand span { display: inline-block; color: var(--coral); margin-right: .25rem; transform: rotate(-8deg); }
.site-header nav { display: flex; align-items: center; gap: .25rem; }
.site-header nav a {
  color: var(--ink);
  padding: .55rem .75rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}
.site-header nav a:hover { background: var(--paper-deep); }

main { width: min(1060px, calc(100% - 40px)); margin: auto; padding: 4.5rem 0 6rem; }
footer { flex-wrap: wrap; padding: 1.6rem 0 2.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
footer span { margin-right: auto; }
footer a { color: var(--muted); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(280px, .83fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
  margin: 0 0 4.2rem;
}

.beta-banner { display:flex; align-items:center; gap:.8rem; max-width:1060px; margin:0 auto 1rem; padding:.75rem 1rem; border:1px solid rgba(190,108,67,.35); border-radius:12px; background:linear-gradient(90deg,rgba(255,239,208,.95),rgba(255,248,229,.82)); color:var(--ink); box-shadow:0 8px 24px rgba(73,46,35,.06); }
.beta-mark { display:grid; place-items:center; flex:0 0 2rem; height:2rem; border-radius:50%; background:var(--coral); color:#fffaf0; font-family:Georgia,serif; font-size:1.25rem; }
.beta-banner div { display:flex; flex-wrap:wrap; align-items:baseline; gap:.35rem .7rem; }
.beta-banner strong { color:var(--coral-dark); font-size:.82rem; letter-spacing:.08em; text-transform:uppercase; }
.beta-banner span:last-child { color:var(--muted); font-size:.84rem; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow,
.card-kicker {
  margin: 0 0 .7rem;
  color: var(--coral-dark);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .16em;
}
h1, h2, h3 { font-family: var(--display); color: var(--ink-deep); }
h1 { max-width: 780px; margin: .2rem 0 1.2rem; font-size: clamp(3.25rem, 7vw, 6.6rem); line-height: .94; letter-spacing: -.055em; }
h1 em { color: var(--coral); font-weight: 400; }
h2 { margin: 0 0 .8rem; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.08; letter-spacing: -.025em; }
h3 { font-size: 1.35rem; }
.lead { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.2rem); }
.muted, .field-hint { color: var(--muted); }
.field-hint { margin: .4rem 0 0; font-size: .84rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.7rem; }
.trust-row span { padding: .42rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 254, 249, .72); font-size: .78rem; font-weight: 700; }

.book-scene {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #c9bea9;
  border-radius: 46% 54% 42% 58% / 50% 39% 61% 50%;
  background: linear-gradient(145deg, #dcebdc 0 48%, #c7dfd8 48% 100%);
  box-shadow: inset 0 0 0 12px rgba(255, 250, 240, .35);
}
.book-scene::before,
.book-scene::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.33); }
.book-scene::before { width: 220px; height: 220px; left: -80px; top: -60px; }
.book-scene::after { width: 110px; height: 110px; right: -25px; bottom: 30px; }
.book-cover {
  position: relative;
  z-index: 1;
  width: 230px;
  height: 300px;
  padding: 54px 28px;
  color: #fff8e7;
  background: var(--forest);
  border: 2px solid var(--ink-deep);
  border-radius: 5px 22px 22px 5px;
  box-shadow: 18px 18px 0 var(--saffron), 22px 22px 0 var(--ink-deep);
  transform: rotate(-7deg);
  font: 700 1.35rem/1.25 var(--display);
}
.book-cover::after { content: '✦'; display: block; margin-top: 42px; color: var(--saffron); font-size: 3rem; }
.moon { position: absolute; top: 46px; right: 60px; color: var(--coral); font-size: 3rem; transform: rotate(12deg); }
.story-spark { position: absolute; color: var(--teal); font: 2rem var(--display); }
.spark-one { left: 45px; bottom: 75px; }.spark-two { right: 42px; top: 150px; }

.story-card {
  position: relative;
  max-width: 820px;
  margin-inline: auto;
  padding: clamp(1.35rem, 5vw, 3.1rem);
  background: rgba(255, 254, 249, .94);
  border: 1px solid var(--line);
  border-radius: 6px 28px 6px 28px;
  box-shadow: var(--shadow);
}
.story-card::before { content: ''; position: absolute; width: 54px; height: 6px; left: 0; top: 0; background: var(--coral); }
form { margin-top: 1.7rem; }
label { display: block; margin: 1rem 0 .38rem; font-weight: 800; font-size: .9rem; }
input, textarea {
  width: 100%;
  padding: .88rem 1rem;
  border: 1px solid #aa9d88;
  border-radius: 7px;
  background: #fffdf7;
  color: var(--ink-deep);
  font: inherit;
}
textarea { resize: vertical; min-height: 9rem; }
input:hover, textarea:hover { border-color: var(--teal); }
button {
  margin-top: 1.3rem;
  padding: .82rem 1.15rem;
  border: 1px solid var(--ink-deep);
  border-radius: 5px 13px 5px 13px;
  background: var(--forest);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--saffron);
  cursor: pointer;
  font: 800 .96rem var(--body);
  transition: transform .16s ease, box-shadow .16s ease;
}
button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--saffron); }
button.secondary { margin-left: .55rem; background: transparent; color: var(--ink); box-shadow: none; border-color: #8c806d; }
button:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.privacy-option { display: grid; grid-template-columns: 1.2rem 1fr; align-items: start; gap: .65rem; }
.privacy-option input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--teal); }
.status, .callout, .draft-notice {
  margin-top: 1.2rem;
  padding: .85rem 1rem;
  border-left: 4px solid var(--coral);
  background: #f8eadf;
}
.result { margin-top: 1.2rem; padding: 1.2rem; border: 1px solid var(--line); background: #f6f0e5; white-space: pre-wrap; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin-bottom: 0; }
.library-card { margin-top: 1.5rem; }
.project-list { display: grid; gap: .7rem; }
.project-item { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; background: #f8f2e7; border: 1px solid var(--line); border-radius: 5px 13px; text-decoration: none; }
.project-item span { color: var(--muted); font-size: .84rem; }
.export-actions { display: flex; flex-wrap: wrap; gap: .5rem; }.export-actions button { margin-top: 0; }
.chapter-card { margin-bottom: 1.5rem; }.chapter-card h2 span { color: var(--coral); }.scene-list { color: var(--muted); }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.metric { padding: 1rem; border: 1px solid var(--line); background: var(--white); border-radius: 5px 15px; }
.metric strong,.metric span { display:block; }.metric strong { color:var(--coral-dark); font:700 2rem var(--display); }.metric span { color:var(--muted); font-size:.82rem; }

.compact-hero { grid-template-columns: 1fr; margin-bottom: 2.5rem; }
.compact-hero h1 { font-size: clamp(3rem, 6vw, 5.4rem); }
.ad-demo-card { max-width: 860px; }
.demo-badge { padding: .35rem .55rem; border: 1px solid var(--coral); color: var(--coral-dark); font-size: .7rem; font-weight: 900; letter-spacing: .15em; }
.consent-panel { max-width: 680px; padding: 1rem 0; }
.ad-frame-wrap { width: fit-content; max-width: 100%; margin: 2rem auto 1rem; padding: 10px; background: #fff; border: 1px dashed #8c806d; overflow: auto; }
.ad-frame-wrap iframe { display: block; border: 0; max-width: 100%; }

.legal-page { max-width: 980px; margin: auto; }
.legal-header { margin-bottom: 3rem; }
.legal-header h1 { font-size: clamp(3rem, 7vw, 5.8rem); }
.draft-notice { display: grid; gap: .25rem; max-width: 790px; border-left-color: var(--saffron); background: #fff1cb; }
.draft-notice span { color: #5d5239; font-size: .9rem; }
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.legal-toc { position: sticky; top: 1rem; display: grid; gap: .65rem; padding: 1rem 0; border-top: 3px solid var(--coral); }
.legal-toc a { color: var(--muted); font-size: .83rem; text-decoration: none; }
.legal-toc a:hover { color: var(--coral-dark); }
.legal-content { min-width: 0; }
.legal-content section { padding: 0 0 2.1rem; margin-bottom: 2.1rem; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.legal-content p, .legal-content li { color: #40565d; }
.legal-content li + li { margin-top: .4rem; }
.legal-back { font-weight: 800; }

#blazor-error-ui { display:none; position:fixed; z-index:1000; inset:auto 0 0; padding:.75rem 1.2rem; background:#fff1cb; box-shadow:0 -2px 10px #0002; }
#blazor-error-ui .dismiss { position:absolute; right:.8rem; cursor:pointer; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: reveal .65s ease-out both; }
  .book-scene { animation: reveal .65s .12s ease-out both; }
  @keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 760px) {
  main { padding-top: 2.8rem; }
  .site-header { align-items: flex-start; padding: 1rem 0; }
  .site-header nav { justify-content: flex-end; flex-wrap: wrap; }
  .site-header nav a { padding: .35rem .5rem; font-size: .76rem; }
  .hero { grid-template-columns: 1fr; }
  .book-scene { min-height: 330px; }
  .book-cover { width: 190px; height: 250px; padding: 42px 22px; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
}
@media (max-width: 480px) {
  .site-header, footer, main { width: min(100% - 24px, 1060px); }
  .site-header nav a:nth-child(2) { display: none; }
  h1 { font-size: 3.15rem; }
  .section-heading { display: block; }
  button.secondary { margin-left: 0; }
  .book-scene { min-height: 285px; }
}

.story-video { display: block; width: 100%; max-width: 760px; margin-top: 1.5rem; border-radius: 1rem; background: #171522; }
