/* Onovel marketing — design tokens mirror the iOS app (BookTheme).
   Brand green primary, orange secondary, warm-paper light / charcoal dark,
   sans-serif UI, serif only inside the reader, edged (not pill) corners. */

:root {
  /* Brand accents (stable across modes) */
  --green: #2f9a4f;
  --green-strong: #277f42;
  --orange: #ff7900;
  --purple: #6f4180;

  /* Premium "midnight violet" gradient (from the app paywall) */
  --violet-top: #1a0f38;
  --violet-bottom: #5c2438;
  --hero-scrim: #121116;

  /* Light (warm paper) — default */
  --canvas: #faf5ed;
  --surface: #fdf9f3;
  --elevated: #fefcf7;
  --ink: #1e1915;
  --ink-muted: #61574c;
  --hairline: rgba(0, 0, 0, 0.10);
  --hairline-strong: rgba(0, 0, 0, 0.16);
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgba(30, 25, 21, 0.10);
  --shadow-lg: 0 24px 60px rgba(30, 25, 21, 0.18);

  --max: 1140px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --green: #4daf50;
    --green-strong: #3f9a44;
    --canvas: #141414;
    --surface: #1a1722;
    --elevated: #232029;
    --ink: #f5e9ed;
    --ink-muted: #b8a4b0;
    --hairline: rgba(255, 255, 255, 0.12);
    --hairline-strong: rgba(255, 255, 255, 0.20);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }

::selection { background: var(--green); color: var(--on-accent); }

.skip-link {
  position: fixed; z-index: 50; left: 1rem; top: 1rem;
  transform: translateY(-150%);
  padding: 0.7rem 0.9rem; border-radius: var(--r-md);
  background: var(--ink); color: var(--canvas);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.7rem 1.1rem;
  border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 650; line-height: 1.1; cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, box-shadow 160ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 54px; padding: 0.9rem 1.5rem; font-size: 1.05rem; }

.btn-primary {
  color: var(--on-accent);
  background: var(--green);
  box-shadow: 0 10px 26px rgba(47, 154, 79, 0.30);
}
.btn-primary:hover { background: var(--green-strong); }

.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { background: var(--surface); }

.btn .icon { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.btn .icon svg { width: 100%; height: 100%; fill: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  min-height: 66px;
  padding: 0.7rem max(1rem, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 26px; width: auto; display: block; }
.footer-brand .brand-logo { height: 30px; }
.nav-links { display: flex; justify-content: center; gap: 1.4rem; color: var(--ink-muted); font-weight: 550; }
.nav-links a:hover { color: var(--ink); }
.header-cta { grid-column: 3; justify-self: end; min-height: 42px; padding: 0.55rem 0.95rem; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center;
  padding: clamp(3rem, 7vw, 6rem) max(1rem, calc((100vw - var(--max)) / 2));
}
.eyebrow {
  margin: 0 0 1rem; color: var(--green);
  font-size: 0.8rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
}
.hero h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(2.4rem, 5.2vw, 3.9rem); line-height: 1.04; font-weight: 800; letter-spacing: -0.02em;
}
.lede { max-width: 34rem; color: var(--ink-muted); font-size: 1.2rem; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1rem; }
.microtrust { color: var(--ink-muted); font-size: 0.92rem; }

.hero-feature {
  position: relative; display: block; aspect-ratio: 5 / 6; overflow: hidden;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, var(--violet-top), var(--violet-bottom));
  isolation: isolate;
}
.hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.hero-feature::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(18, 17, 22, 0.92) 0%, rgba(18, 17, 22, 0.10) 55%, transparent 100%);
}
.hero-feature-tag, .hero-feature-title { position: relative; z-index: 1; color: #fff; }
.hero-feature-tag {
  position: absolute; top: 1rem; left: 1rem;
  padding: 0.35rem 0.6rem; border-radius: var(--r-sm);
  background: var(--orange); color: #1e1915;
  font-size: 0.78rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.03em;
}
.hero-feature-title {
  position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1.1rem;
  font-size: 1.5rem; font-weight: 800; line-height: 1.15;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

/* ---------- Genre strip ---------- */
.genre-strip {
  display: flex; gap: 0.55rem; overflow-x: auto;
  padding: 0.9rem max(1rem, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  scrollbar-width: thin;
}
.genre-strip span {
  flex: 0 0 auto; padding: 0.45rem 0.85rem;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  color: var(--ink-muted); font-size: 0.9rem; font-weight: 600; white-space: nowrap;
}

/* ---------- Sections ---------- */
.section, .band, .related, .finalcta {
  padding: clamp(3rem, 6vw, 5rem) max(1rem, calc((100vw - var(--max)) / 2));
}
.section-head { max-width: 640px; margin-bottom: 2rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2, .band h2, .related h2 {
  margin-bottom: 0.6rem; font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 800; letter-spacing: -0.015em;
}
.section-head p { color: var(--ink-muted); font-size: 1.1rem; }

/* ---------- Novel grid + cards ---------- */
.novel-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem;
}
.novel-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.novel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ribbon {
  position: absolute; z-index: 2; top: 0.7rem; left: 0.7rem;
  padding: 0.3rem 0.55rem; border-radius: var(--r-sm);
  background: var(--orange); color: #1e1915;
  font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.02em;
}
.novel-card .cover { display: block; aspect-ratio: 420 / 620; overflow: hidden; background: var(--violet-top); }
.novel-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms ease; }
.novel-card:hover .cover img { transform: scale(1.04); }
.cover-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; padding: 1rem; text-align: center;
  background: linear-gradient(160deg, var(--violet-top), var(--violet-bottom)); color: #fff;
}
.cover-fallback span { font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.card-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.9rem 1rem 1rem; flex: 1; }
.genre { margin: 0; color: var(--green); font-size: 0.78rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.03em; }
.card-body h3 { font-size: 1.1rem; font-weight: 750; line-height: 1.2; }
.card-body h3 a:hover { color: var(--green); }
.hook { color: var(--ink-muted); font-size: 0.95rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.6rem; }
.meta-chip { font-size: 0.8rem; font-weight: 600; color: var(--ink-muted); }
.read-link { color: var(--green); font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.read-link:hover { color: var(--green-strong); }

/* ---------- How it works band ---------- */
.band { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; max-width: 980px; margin: 0 auto; padding: 0; list-style: none; }
.steps li { padding: 1.4rem; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--canvas); }
.step-n {
  display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 0.8rem;
  border-radius: var(--r-md); background: var(--green); color: var(--on-accent); font-weight: 800;
}
.steps h3 { margin-bottom: 0.4rem; font-size: 1.15rem; font-weight: 750; }
.steps p { margin: 0; color: var(--ink-muted); }
.band-cta { display: flex; justify-content: center; margin-top: 2rem; }

/* ---------- Final CTA ---------- */
.finalcta { padding-inline: 1rem; }
.finalcta-inner {
  max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem; text-align: center;
  border-radius: var(--r-lg); color: #fff;
  background: linear-gradient(150deg, var(--violet-top), var(--violet-bottom));
  box-shadow: var(--shadow-lg);
}
.finalcta-inner h2 { margin-bottom: 0.7rem; font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; }
.finalcta-inner p { max-width: 38rem; margin: 0 auto 1.8rem; color: rgba(255, 255, 255, 0.82); font-size: 1.15rem; }

/* ---------- Footer ---------- */
.site-footer {
  display: grid; grid-template-columns: minmax(240px, 1.4fr) auto auto; gap: 2.5rem; align-items: start;
  padding: 2.5rem max(1rem, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--hairline); background: var(--surface);
}
.footer-brand-col p { margin-top: 0.7rem; max-width: 26rem; color: var(--ink-muted); }
.site-footer nav { display: grid; gap: 0.5rem; }
.site-footer nav strong, .footer-cta-col strong { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.site-footer nav a { color: var(--ink); }
.site-footer nav a:hover { color: var(--green); }
.footer-cta { white-space: nowrap; }

/* ---------- Detail / reader ---------- */
.detail { max-width: var(--max); margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; color: var(--ink-muted); font-size: 0.92rem; }
.crumbs a:hover { color: var(--green); text-decoration: underline; }

.detail-hero {
  display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 2rem; align-items: center;
  padding: 1.5rem; border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow);
}
.detail-cover-wrap { aspect-ratio: 420 / 620; overflow: hidden; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.detail-cover { width: 100%; height: 100%; object-fit: cover; }
.detail-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.detail-sub { color: var(--ink-muted); font-size: 1.05rem; margin-bottom: 0.5rem; }
.detail-promise { color: var(--ink); font-size: 1.15rem; line-height: 1.55; margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.3rem; padding: 0; list-style: none; }
.chips li {
  padding: 0.35rem 0.65rem; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  font-size: 0.85rem; font-weight: 600; color: var(--ink-muted);
}
.detail-head .microtrust { margin-top: 0.8rem; }

.reader { max-width: 760px; margin: 2.5rem auto 0; }
.reader-body {
  position: relative; padding: clamp(1.4rem, 4vw, 2.6rem);
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline);
}
.chapter-eyebrow { color: var(--orange); font-weight: 750; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1rem; }
/* Serif ONLY here — matches the in-app reader body. */
.prose p {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.2rem; line-height: 1.85; color: var(--ink);
  margin-bottom: 1.2rem;
}
.prose p:first-of-type::first-letter {
  float: left; font-size: 3.4rem; line-height: 0.8; padding: 0.1rem 0.6rem 0 0; color: var(--green); font-weight: 700;
}

.gate { position: relative; margin-top: 0.5rem; }
.gate-fade {
  position: absolute; left: 0; right: 0; top: -7rem; height: 7rem; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--surface));
}
.gate-card {
  position: relative; padding: clamp(1.5rem, 4vw, 2.4rem); text-align: center; color: #fff;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--violet-top), var(--violet-bottom));
  box-shadow: var(--shadow-lg);
}
.gate-kicker { color: var(--orange); font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; margin-bottom: 0.5rem; }
.gate-card h2 { font-size: clamp(1.5rem, 3.6vw, 2rem); font-weight: 800; margin-bottom: 0.7rem; }
.gate-card p { max-width: 34rem; margin: 0 auto 1.5rem; color: rgba(255, 255, 255, 0.85); }

.related { max-width: var(--max); margin: 0 auto; padding-inline: 0; }
.related h2 { margin-bottom: 1.2rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }

.notfound { grid-template-columns: 1fr; text-align: center; place-items: center; }
.notfound .hero-actions { justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .hero-feature { max-width: 320px; }
  .novel-grid { grid-template-columns: repeat(2, 1fr); }
  .steps, .related-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-cover-wrap { max-width: 240px; margin: 0 auto; }
  .site-footer { grid-template-columns: 1fr; gap: 1.6rem; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-cta span:not(.icon) { display: none; }
  .novel-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .hero-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
