/* LoveWorld Teens Publishing. Tokens from design/02-LoveWorld_Teens_UI_Design_Brief.md §6. */
:root {
  --ink: #0B0D16; --paper: #F3F4F8;
  --bg: var(--ink); --surface: #161A2B; --line: #23283E;
  --text: #EDEFF7; --muted: #B9BFD2;
  --accent: #7C8CFF; --accent-hover: #96A3FF; --on-accent: #0B0D16;
  --solar: #FFC93C; --coral: #FF7D7A;
  --radius: 18px; --gutter: 16px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: Figtree, system-ui, -apple-system, sans-serif;
  --mono: 'Azeret Mono', ui-monospace, monospace;
  color-scheme: dark;
}
/* Dark is the brand default. The header toggle sets data-theme="light" and remembers it. */
:root[data-theme="light"] {
  --bg: var(--paper); --surface: #FFFFFF; --line: #DCDFEA;
  --text: #14172A; --muted: #5A6076;
  --accent: #2340FF; --accent-hover: #1B33D6; --on-accent: #FFFFFF;
  --coral: #C42E2B;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--body); padding-bottom: 72px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 7vw, 4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--solar); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }
.eyebrow, .card-meta, .crumbs, .price, .tag { font: 500 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { color: var(--solar); margin-bottom: .75em; }
:root[data-theme="light"] .eyebrow { color: var(--accent); }

/* Header and navigation */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.05rem var(--display); }
.brand b { color: var(--accent); }
.top-nav { display: none; gap: 24px; align-items: center; }
.top-nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 600; }
.top-nav a.on, .top-nav a:not(.btn):hover { color: var(--text); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; min-height: 56px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600; }
.bottom-nav a.on { color: var(--accent); }
.bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 1rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: .9rem; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Sections */
.band { padding: 40px 0; }
.band-feature, .band-lead { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-head a { font-weight: 600; text-decoration: none; }
.hero { padding: 40px 0 24px; }
.hero-slim { padding: 56px 0 40px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.hero-cover { display: grid; gap: 6px; color: var(--text); text-decoration: none; max-width: 320px; }
.hero-cover .eyebrow { margin: 10px 0 0; }
@media (min-width: 900px) {
  .band { padding: 64px 0; }
  .hero { padding: 72px 0 40px; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; }
  .hero-cover { justify-self: end; max-width: 360px; }
}

/* Covers and cards */
.cover { display: block; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--line); box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cover-text { display: flex; align-items: flex-end; padding: 16px; background: linear-gradient(160deg, var(--accent), #0B0D16); }
.cover-text span { font: 800 1.25rem/1.1 var(--display); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; } }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .rail { grid-auto-columns: 30%; } }
@media (min-width: 900px) { .rail { grid-auto-columns: calc(25% - 12px); } }
.card { display: grid; gap: 6px; align-content: start; color: var(--text); text-decoration: none; }
.card .cover { margin-bottom: 6px; transition: transform .2s; }
.card:hover .cover { transform: translateY(-3px); }
.card-meta { color: var(--muted); }
.card-title { font: 700 1.05rem/1.25 var(--display); }
.card-foot { font-size: .875rem; color: var(--muted); }
.tag { display: inline-block; padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--solar) 18%, transparent); color: var(--solar); }
:root[data-theme="light"] .tag { background: #FFF1C7; color: #6B4E00; }
.tag-lg { font-size: .85rem; padding: 6px 12px; }

.hubs { display: grid; gap: 12px; }
@media (min-width: 640px) { .hubs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hubs { grid-template-columns: repeat(4, 1fr); } }
.hub { display: grid; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.hub:hover { border-color: var(--accent); color: var(--text); }
.hub strong { font: 800 1.35rem var(--display); }
.hub span { color: var(--muted); font-size: .9rem; }

.feature { display: grid; gap: 28px; align-items: center; }
.feature .cover { max-width: 260px; }
@media (min-width: 900px) { .feature { grid-template-columns: 300px 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.chips a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.chips a.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Product page */
.product { display: grid; gap: 28px; }
.product-cover { max-width: 240px; }
.crumbs { color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.price { font-size: 1.1rem; color: var(--text); }
.prose { max-width: 65ch; margin-top: 24px; }
.prose ul { padding-left: 1.2em; }
@media (min-width: 900px) { .product { grid-template-columns: 380px 1fr; gap: 56px; } .product-cover { max-width: none; } }

/* Lead form */
.lead-form { display: grid; gap: 14px; margin-top: 12px; }
.lead-form .fields { display: grid; gap: 12px; }
@media (min-width: 640px) { .lead-form .fields { grid-template-columns: repeat(3, 1fr); } }
.lead-form label span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.lead-form input[type=text], .lead-form input[type=email], .lead-form input[type=tel] { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.lead-form input:focus { border-color: var(--accent); outline: none; }
.lead-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: var(--muted); }
.lead-form .check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.lead-form .check span { font-weight: 400; font-size: .875rem; margin: 0; }
.lead-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.errors { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--coral) 15%, transparent); color: var(--coral); list-style: none; font-size: .9rem; }
.notice { padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 15%, transparent); font-weight: 600; }

.site-footer { padding: 28px 0; font-size: .875rem; color: var(--muted); }
.footer-row { display: grid; gap: 12px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-row a { color: var(--muted); }
@media (min-width: 900px) { .footer-row { grid-template-columns: 1fr auto; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Free sample badge on cards */
.card { position: relative; }
.card-badge { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 3px 8px; border-radius: 6px; background: var(--solar); color: #0B0D16; font: 500 .7rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.sample-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 20px; }

/* Sample reader */
.reader-bar { position: sticky; top: 60px; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.reader-bar-row { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.reader-back { flex: 1; min-width: 0; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-progress { font: 500 .75rem var(--mono); color: var(--muted); white-space: nowrap; }
.reader-fallback { padding: 20px var(--gutter); }
.reader-notify { text-align: left; }
@media (max-width: 899px) { .reader-back span { display: none; } .reader-back::after { content: ' Back'; } }

/* Blog */
.post-grid { display: grid; gap: 28px; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post-card { display: grid; gap: 6px; align-content: start; color: var(--text); text-decoration: none; }
.post-image, .post-hero { display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--line); }
.post-image { margin-bottom: 6px; }
.post-image img, .post-hero img { width: 100%; height: 100%; object-fit: cover; }
.post-title { font: 700 1.2rem/1.25 var(--display); }
.post-card:hover .post-title { color: var(--accent); }
.post-byline { margin-bottom: 20px; }
.post-hero { margin-bottom: 24px; }
.post-body { margin-top: 0; font-size: 1.075rem; }
.post-body h2 { font-size: 1.5rem; margin-top: 1.4em; }
.post-body h3 { font-size: 1.2rem; margin-top: 1.2em; }
.post-body img { border-radius: 8px; }
.post-body blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 3px solid var(--solar); color: var(--muted); font-style: italic; }
.share { margin: 28px 0; }
.post-promo { display: grid; grid-template-columns: 110px 1fr; gap: 20px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.post-promo h2 { font-size: 1.3rem; margin-bottom: .3em; }
.post-promo .actions { margin: 8px 0 0; }
@media (max-width: 479px) { .post-promo { grid-template-columns: 80px 1fr; } }
.bottom-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; } /* 4 or 5 items, depending on Campaigns */

/* Preview passcode screen */
.preview-gate { padding-bottom: 0; }
.login-card { max-width: 420px; margin: 10vh auto 40px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.login-card h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.login-card form { width: 100%; text-align: left; }
.login-card .btn { justify-self: stretch; }
.login-card .eyebrow { margin: 6px 0 0; }

/* Theme toggle */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.header-tools { display: flex; align-items: center; gap: 16px; }

/* Logo: light lettering on dark, original on light */
.logo-for-light, :root[data-theme="light"] .logo-for-dark { display: none; }
:root[data-theme="light"] .logo-for-light { display: block; }

/* Home page hero banners */
.banners { position: relative; }
.banner-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.banner-track::-webkit-scrollbar { display: none; }
.banner { position: relative; flex: 0 0 100%; scroll-snap-align: start; display: block; color: #fff; text-decoration: none; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
@media (min-width: 640px) { .banner { aspect-ratio: 16 / 9; } }
@media (min-width: 900px) { .banner { aspect-ratio: 12 / 5; max-height: 620px; } }
.banner picture, .banner img { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner img { object-fit: cover; }
.banner-text { position: absolute; inset: auto 0 0 0; padding: 72px 0 40px; background: linear-gradient(to top, rgb(11 13 22 / .88), rgb(11 13 22 / .55) 55%, transparent); }
.banner-headline { color: #fff; font-size: clamp(1.7rem, 5.5vw, 3.4rem); max-width: 18ch; margin-bottom: .25em; text-shadow: 0 2px 16px rgb(0 0 0 / .35); }
.banner-sub { color: #E4E7F2; font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 46ch; margin-bottom: 1em; }
.banner .btn { background: #7C8CFF; color: #0B0D16; }
.banner .btn:hover { background: #96A3FF; color: #0B0D16; }
/* Phones: the text rises onto the bottom strip of the image, so it reads as part of the banner with no dark gap.
   12vw is the strip below the template's safe zone (y 780 of 1000 on a 16:9 phone crop), so artwork stays clear. */
@media (max-width: 639.98px) {
  .banner-track { align-items: flex-start; overflow-y: hidden; transition: height .3s; }
  .banner { aspect-ratio: auto; display: flex; flex-direction: column; background: none; }
  .banner picture { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 9; flex: none; background: var(--surface); }
  .banner-text { position: relative; margin-top: -12vw; padding: 0 0 24px; background: linear-gradient(to bottom, rgb(11 13 22 / 0), rgb(11 13 22 / .85) 8vw, #0B0D16 14vw); }
  .banner-headline { text-shadow: 0 2px 12px rgb(0 0 0 / .6); }
  .banner-dots { top: calc(100vw * 9 / 16 - 12vw - 34px); bottom: auto; }
  .banner-dots button::before { box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
}
@media (max-width: 639.98px) and (prefers-reduced-motion: reduce) { .banner-track { transition: none; } }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 4px; }
.banner-dots button { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center; }
.banner-dots button::before { content: ''; width: 9px; height: 9px; border-radius: 999px; background: rgb(255 255 255 / .55); transition: width .2s, background .2s; }
.banner-dots button[aria-selected="true"]::before { width: 24px; background: #fff; }

/* Cookie choice. Sits above the phone bottom menu; a floating card on wider screens. */
.cookie-banner { position: fixed; left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 6; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 32px rgb(0 0 0 / .35); }
.cookie-banner[hidden], .site-footer [hidden] { display: none; }
.cookie-inner { display: grid; gap: 12px; padding: 16px; font-size: .9rem; }
.cookie-inner p { margin: 0; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-actions .btn { flex: 1; }
@media (min-width: 900px) {
  .cookie-banner { left: auto; right: 24px; bottom: 24px; max-width: 420px; }
}
.site-footer .linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* Campaign landing pages */
.campaign-image img { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; border-radius: var(--radius); }
.campaign-body { padding-top: 0; }
.campaign-body .prose { margin-top: 0; }

/* Privacy page */
.privacy h2 { font-size: 1.35rem; margin-top: 1.6em; scroll-margin-top: 80px; }
.table-scroll { overflow-x: auto; margin: 0 0 1em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose th { font: 500 .72rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.reader-buy { white-space: nowrap; }
.reader-end-cover { width: 140px; margin: 0 auto 20px; }
.reader-end-hook { margin-inline: auto; }
.reader-end .price { margin: 0 0 14px; }
.reader-end .btn + .small { margin-top: 12px; }
@media (max-width: 479px) { .reader-progress { display: none; } }

/* Sample reader as a book: one page on phones, a two-page spread on wide screens. */
.flip { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px var(--gutter) 8px; max-width: 1240px; margin: 0 auto; }
.flip[hidden] { display: none; }
.flip-stage { position: relative; flex: 1; min-width: 0; display: flex; justify-content: center; align-items: flex-start; gap: 0; perspective: 2200px; touch-action: pan-y pinch-zoom; user-select: none; cursor: pointer; outline-offset: 6px; }
.flip-page { display: block; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 10px 30px rgb(0 0 0 / .4); }
.flip-spread .flip-page:first-child { border-radius: 4px 0 0 4px; box-shadow: -6px 10px 30px rgb(0 0 0 / .4), inset -18px 0 24px -18px rgb(0 0 0 / .35); }
.flip-spread .flip-page:last-child { border-radius: 0 4px 4px 0; box-shadow: 6px 10px 30px rgb(0 0 0 / .4); }
.flip-turn { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); font: 600 1.8rem/1 var(--body); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }
.flip-turn:hover { background: var(--line); }
.flip-turn:disabled { opacity: .35; cursor: not-allowed; }
.flip-hint { text-align: center; margin: 0 0 12px; }
.flip-leaf { position: absolute; margin: 0; pointer-events: none; backface-visibility: hidden; z-index: 1; }
.flip-count { display: none; }
.flip-leaf-next { transform-origin: left center; animation: flip-next .5s ease-in forwards; }
.flip-leaf-prev { transform-origin: right center; animation: flip-prev .5s ease-in forwards; }
@keyframes flip-next { from { transform: rotateY(0); filter: brightness(1); } to { transform: rotateY(-100deg); filter: brightness(.6); } }
@keyframes flip-prev { from { transform: rotateY(0); filter: brightness(1); } to { transform: rotateY(100deg); filter: brightness(.6); } }
@media (max-width: 599px) {
  /* On phones the arrows sit under the page so the page gets the full width. */
  .flip { flex-wrap: wrap; padding-top: 12px; }
  .flip-stage { order: 1; flex-basis: 100%; }
  .flip-prev { order: 2; }
  .flip-count { display: block; order: 3; flex: 1; text-align: center; font-family: var(--mono); }
  .flip-next { order: 4; }
}

/* Campaigns list */
.campaign-grid { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 700px) { .campaign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.campaign-card { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.campaign-card:hover { border-color: var(--accent); color: var(--text); }
.campaign-card img { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; }
.campaign-card-text { display: grid; gap: 4px; padding: 16px 18px 18px; }
.campaign-card-text strong { font: 800 1.25rem/1.2 var(--display); }
