@font-face { font-family: "Literata"; src: url("/fonts/literata-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ivory: #fefcf6;
  --paper: #ffffff;
  --navy: #14284b;
  --navy-soft: #2c4a6e;
  --ink: #1d2b44;
  --muted: #55657c;
  --teal: #4f7f87;
  --sage: #8fa89a;
  --gold: #e2b04a;
  --gold-deep: #c8912a;
  --line: #e8e2d4;
  --shadow: 0 10px 30px rgba(20, 40, 75, 0.08), 0 2px 6px rgba(20, 40, 75, 0.05);
  --radius: 18px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Literata", Georgia, "Times New Roman", serif;
  font-variant-numeric: lining-nums;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--navy-soft); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { color: var(--navy); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--ivory); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.brand { display: block; flex: none; }
.brand img { height: 52px; width: auto; }
.nav { display: flex; gap: clamp(16px, 3vw, 40px); margin-left: clamp(16px, 6vw, 96px); }
.nav a, .signin { color: var(--navy); text-decoration: none; font-size: 1.05rem; }
.nav a:hover, .signin:hover { text-decoration: underline; }
.signin { margin-left: auto; }
@media (max-width: 760px) {
  .site-header .wrap { min-height: 68px; }
  .brand img { height: 40px; }
  .nav { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--gold); color: var(--navy); text-decoration: none;
  font-size: 1.2rem; font-weight: 500; padding: 15px 32px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(200, 145, 42, 0.25); border: 0; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #e8bb5c; color: var(--navy); }
.btn svg { width: 16px; height: 16px; }
.btn.secondary { background: var(--paper); box-shadow: none; border: 1px solid var(--line); }
.btn.secondary:hover { background: #fbf6ea; }
.link-arrow { color: var(--navy); font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid var(--navy-soft); padding-bottom: 4px; display: inline-flex; gap: 10px; align-items: center; }
.link-arrow svg { width: 12px; height: 12px; }

/* Hero */
.hero { padding: clamp(32px, 6vw, 64px) 0 24px; overflow: hidden; }
.hero .wrap { max-width: 1320px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.25rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.02; }
.hero .lede { margin-top: 22px; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.45; color: var(--navy-soft); max-width: 30ch; }
.hero .lede em { font-style: normal; color: var(--teal); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; margin-top: 34px; }
.hero-art { position: relative; margin-right: calc(-1 * var(--gutter)); }
.hero-art img { width: 100%; height: auto; }
.hero-note { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 48px 0 0; padding: 28px 0 8px; list-style: none; }
.steps li { display: flex; align-items: center; gap: 20px; padding: 6px clamp(12px, 2.4vw, 32px); border-left: 1px solid var(--line); }
.steps li:first-child { border-left: 0; padding-left: 0; }
.steps .num { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.5rem; }
.steps li:nth-child(1) .num { background: #93aaa9; }
.steps li:nth-child(2) .num { background: var(--sage); }
.steps li:nth-child(3) .num { background: var(--gold); }
.steps .icon { flex: none; width: 44px; height: 44px; color: var(--navy); }
.steps li:nth-child(3) .icon { color: var(--gold); }
.steps .label { font-size: 1.15rem; color: var(--navy); border-bottom: 1px solid var(--navy-soft); padding-bottom: 6px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; row-gap: 0; }
  .hero-art { margin: 28px calc(-1 * var(--gutter)) 0; }
  .hero-copy { display: contents; }
  .hero-grid > .hero-art { order: 3; }
  .hero h1 { order: 1; }
  .hero .lede { order: 2; }
  .hero-actions, .hero-note { order: 2; }
  .steps { grid-template-columns: 1fr; gap: 18px; }
  .steps li, .steps li:first-child { border-left: 0; padding: 0; }
}

/* The sample story: the app's player in a frame. book.js sets the height the player reports;
   until then, room for the open book. */
.book { display: block; width: 100%; aspect-ratio: 2 / 1; margin: 40px 0 0; border: 0; background: transparent; }

/* Sections */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section.tint { background: #f6f1e5; }
.eyebrow { color: var(--teal); font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.section h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
.section .intro { margin-top: 16px; font-size: 1.2rem; color: var(--muted); max-width: 60ch; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 44px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h3 { font-size: 1.35rem; margin-bottom: 10px; }
.card p { color: var(--muted); }
.card .tag { display: inline-block; font-size: 0.85rem; color: var(--teal); margin-bottom: 14px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.ticks li { position: relative; padding-left: 40px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin-top: 4px; border-radius: 50%; background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ticks strong { color: var(--navy); font-weight: 500; display: block; }
.ticks span { color: var(--muted); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 44px; align-items: stretch; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; }
.plan.best { border: 2px solid var(--gold); box-shadow: var(--shadow); position: relative; }
.plan .badge { position: absolute; top: -14px; left: 28px; background: var(--gold); color: var(--navy); font-size: 0.85rem; padding: 3px 12px; border-radius: 999px; }
.plan h3 { font-size: 1.3rem; }
.price { margin: 14px 0 4px; color: var(--navy); font-size: 2.8rem; line-height: 1; font-weight: 500; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.plan .sub { color: var(--muted); font-size: 0.95rem; min-height: 1.5em; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; flex: 1; align-content: start; }
.plan li { padding-left: 26px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--sage); }
.plan .btn { justify-content: center; }
.fineprint { margin-top: 22px; color: var(--muted); font-size: 0.95rem; max-width: 70ch; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }

/* FAQ */
.faq { margin-top: 36px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative; font-size: 1.15rem; color: var(--navy); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 18px; font-size: 1.6rem; color: var(--teal); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 70ch; }

/* Closing call to action */
.closing { text-align: center; }
.closing .intro { margin-left: auto; margin-right: auto; }
.closing .btn { margin-top: 30px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.site-footer a { color: var(--muted); }
.site-footer img { height: 34px; width: auto; }

/* Long-form pages (terms, privacy, refunds) */
.doc { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) var(--gutter) 80px; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.doc .updated { color: var(--muted); margin: 12px 0 36px; }
.doc h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.doc p, .doc li { color: var(--ink); }
.doc p + p { margin-top: 14px; }
.doc ul { padding-left: 1.2em; display: grid; gap: 8px; margin: 12px 0; }
.note { background: #f6f1e5; border-left: 4px solid var(--gold); padding: 16px 20px; border-radius: 8px; margin: 24px 0; }

/* Simple centred pages (download, account, 404) */
.center { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 64px var(--gutter); }
.center h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.center p { margin: 16px auto 0; color: var(--muted); max-width: 52ch; font-size: 1.15rem; }
.center .btn { margin-top: 28px; }
.soon { min-height: 100vh; }
.soon img { width: 220px; height: auto; margin: 0 auto 32px; }

/* Early-access form */
.signup { margin: 28px auto 0; max-width: 520px; text-align: left; }
.field-label { display: block; font-size: 0.95rem; color: var(--navy); margin-bottom: 6px; }
.signup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1 1 240px; min-width: 0; font: inherit; padding: 13px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.signup .btn { margin: 18px 0 0; font-size: 1.05rem; padding: 13px 28px; }
.signup input[type="email"] { width: 100%; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; margin-top: 14px; font-size: 0.95rem; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin-top: 12px; color: #a3392b; }
.form-done { margin-top: 20px; color: var(--teal); font-size: 1.15rem; }
.center .signup p { margin: 12px 0 0; }

/* "Still curious?" card in the FAQ */
.ask { margin-top: 48px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); max-width: 760px; }
.ask h3 { font-size: 1.4rem; }
.ask .btn { margin-top: 18px; font-size: 1.05rem; padding: 13px 26px; }
.hint-text { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }

/* Chat widget (chat.js) */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 20px 12px 12px; font: 500 1rem/1 "Literata", Georgia, serif; cursor: pointer;
  box-shadow: 0 10px 28px rgba(20, 40, 75, 0.28);
}
.chat-launcher:hover { background: var(--navy-soft); }
.chat-launcher-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 600; }
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 18px 50px rgba(20, 40, 75, 0.22); overflow: hidden;
}
.chat-panel[hidden], .chat-launcher[hidden], .chat-starters[hidden] { display: none; }
.chat-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px 18px; background: var(--navy); color: #fff; }
.chat-head > div { flex: 1; }
.chat-title { font-size: 1.1rem; font-weight: 500; }
.chat-sub { font-size: 0.82rem; opacity: 0.8; margin-top: 2px; line-height: 1.4; }
.chat-close { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--ivory); }
.chat-msg { padding: 10px 13px; border-radius: 14px; max-width: 88%; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; }
.chat-user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.chat-bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-pending { color: var(--muted); font-style: italic; }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: var(--ivory); }
.chat-chip { font: inherit; font-size: 0.85rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--teal); background: var(--paper); color: var(--teal); cursor: pointer; }
.chat-chip:hover { background: #eef4f3; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 0.95rem; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--ivory); color: var(--ink); }
.chat-send { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--gold); color: var(--navy); font-size: 1.2rem; cursor: pointer; }
.chat-send:disabled { opacity: 0.5; cursor: wait; }
.chat-foot { padding: 0 14px 12px; font-size: 0.8rem; color: var(--muted); background: var(--paper); }
.chat-foot a { color: var(--muted); }
@media (max-width: 520px) {
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .chat-launcher { right: 16px; bottom: 16px; }
}
