/* Moonpenny — "the page is a bedtime": dusk at the top, night at the bottom. */
:root {
  --paper: #F4F3FD; --mist: #E9E7FB; --lilac: #C9C6F2; --peri: #9C98E0; --violet: #6F6BC0;
  --evening: #3A3C85; --late: #2B2E6B; --night: #1C1F4A; --deep: #12143A;
  --butter: #FFD66B; --butter-2: #FFE59E; --ink: #1C1F4A; --ink-2: #4A4D7E; --muted: #6B6E9C;
  --ok: #2F7D5B; --err: #A3324A;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 12px; --r: 20px; --r-lg: 28px; --pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 104px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--deep); }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.mt { margin-top: var(--s5); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--butter); padding: 8px 14px; border-radius: var(--pill); z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; border-radius: 6px; }
.paper :focus-visible, .dusk :focus-visible, .twilight :focus-visible, .auth-card :focus-visible { outline-color: var(--violet); }

h1, h2, h3 { font-family: var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 0; font-weight: 560; line-height: 1.08; letter-spacing: -0.012em; margin: 0 0 var(--s4); }
h1 { font-size: clamp(2.2rem, 4.8vw + .6rem, 4.1rem); }
h2 { font-size: clamp(1.7rem, 2.4vw + .7rem, 2.6rem); }
h3 { font-size: 1.35rem; }
h1 em, h2 em { font-style: italic; font-weight: 480; color: var(--violet); }
.night h1 em, .night h2 em, .deep h2 em, .evening h2 em, .dusk-2 h2 em, .reader h1 em { color: var(--butter); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--violet); margin: 0 0 var(--s4); }
.eyebrow a { text-decoration: none; }
.night .eyebrow, .evening .eyebrow, .deep .eyebrow { color: var(--butter-2); }
.dingbat { width: 14px; height: 14px; fill: var(--butter); flex: none; }
.dusk .dingbat, .paper .dingbat, .twilight .dingbat { fill: #E9B33A; }
.lede { font-size: 1.16rem; color: var(--ink-2); max-width: 60ch; }
.hint { font-size: .9rem; color: var(--muted); margin: 6px 0 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: var(--pill); border: 2px solid var(--night);
  background: var(--butter); color: var(--night); font: 700 1rem/1.1 var(--body); text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.btn:hover { background: var(--butter-2); transform: translateY(-1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: progress; transform: none; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.35); }
.night .btn-ghost, .evening .btn-ghost, .reader .btn-ghost, .deep .btn-ghost { color: var(--paper); border-color: var(--lilac); }
.night .btn-ghost:hover, .reader .btn-ghost:hover { background: rgba(255,255,255,.08); }
.night .btn, .evening .btn, .reader .btn { border-color: var(--butter); }
.btn-big { min-height: 56px; padding: 14px 30px; font-size: 1.08rem; }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: .92rem; }
.link { font-weight: 700; text-underline-offset: 4px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--err); text-decoration: underline; cursor: pointer; }

/* Header */
.top { background: var(--mist); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid rgba(28,31,74,.08); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.45rem; font-weight: 600; }
.brand img { border-radius: 10px; background: #fff; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: var(--pill); font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.nav a:hover { background: rgba(111,107,192,.12); }
.nav a[aria-current="page"] { background: var(--night); color: var(--paper); }
.nav .pill-ghost { border: 2px solid var(--night); color: var(--night); margin-left: 6px; }
.reader-body .top { background: var(--deep); border-color: rgba(255,255,255,.06); }
.reader-body .brand, .reader-body .nav a { color: var(--paper); }
.reader-body .nav .pill-ghost { border-color: var(--lilac); }

/* The descent from dusk to night */
section { padding: var(--s8) 0; }
.dusk { background: linear-gradient(180deg, var(--mist) 0%, #DAD7F7 100%); }
.twilight { background: linear-gradient(180deg, #DAD7F7 0%, var(--lilac) 100%); }
.evening { background: linear-gradient(180deg, var(--peri) 0%, var(--violet) 55%, var(--evening) 100%); color: var(--paper); }
.dusk-2 { background: linear-gradient(180deg, var(--evening) 0%, var(--late) 100%); color: var(--paper); }
.night { background: linear-gradient(180deg, var(--late) 0%, var(--night) 100%); color: var(--paper); }
.deep { background: var(--night); color: var(--lilac); padding-bottom: var(--s7); }
.paper { background: var(--paper); }
.evening p, .dusk-2 p, .night p { color: #DCDAF8; }

/* Hero */
.hero { padding: var(--s8) 0 var(--s9); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s7); align-items: center; }
.try { margin-top: var(--s6); background: var(--paper); border-radius: var(--r-lg); padding: var(--s5); border: 2px solid var(--night); max-width: 600px; }
.try label { font-weight: 700; display: block; margin-bottom: 8px; }
.try-row { display: flex; gap: 8px; flex-wrap: wrap; }
.try-row input { flex: 1 1 180px; }
.try-row select { flex: 0 1 150px; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 2px solid #CFCCEE; border-radius: var(--r-sm); padding: 11px 14px; min-height: 48px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(111,107,192,.25); }
textarea { resize: vertical; }
.try-row input, .try-row select { width: auto; }

/* Cover mock (the book as an object) */
.cover-mock { position: relative; aspect-ratio: 4 / 5; width: min(380px, 100%); margin-inline: auto; border-radius: 10px 22px 22px 10px; overflow: hidden; background: var(--night);
  transform: rotate(2.5deg); border: 3px solid var(--night); box-shadow: -10px 0 0 var(--evening) inset; }
.cover-mock.small { width: min(240px, 100%); transform: rotate(-2deg); }
.cover-mock > img { width: 100%; height: 100%; object-fit: cover; }
.cover-art { position: absolute; inset: 0; background: radial-gradient(circle at 70% 25%, #3A3C85 0%, var(--night) 60%); }
.cm-moon { position: absolute; top: 12%; right: 16%; width: 26%; aspect-ratio: 1; border-radius: 50%; box-shadow: -14px 8px 0 0 var(--butter); transform: rotate(-12deg); }
.cm-hill { position: absolute; left: -10%; right: -10%; bottom: -30%; height: 60%; border-radius: 50%; background: var(--evening); }
.cm-star { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--butter-2); }
.s1 { top: 20%; left: 18%; } .s2 { top: 34%; left: 44%; width: 4px; height: 4px; } .s3 { top: 12%; left: 60%; width: 3px; height: 3px; }
.cover-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 18% 8% 9%; background: linear-gradient(180deg, transparent, rgba(18,20,58,.92) 45%); color: var(--butter); }
.cover-title small { display: block; color: var(--lilac); letter-spacing: .14em; text-transform: uppercase; font-size: .7rem; font-weight: 700; }
.cover-title strong { font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 2.2vw + .5rem, 2rem); line-height: 1.08; display: block; margin-top: 4px; }
.cover-mock.small .cover-title strong { font-size: 1.2rem; }
.hero-book .hint { margin-top: var(--s4); }

/* How it works */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.how > div { background: rgba(244,243,253,.72); border-radius: var(--r); padding: var(--s5); }
.num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--night); color: var(--butter); font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin-bottom: var(--s3); }

/* Sample block */
.sample-block { display: grid; grid-template-columns: .8fr 1.2fr; gap: var(--s7); align-items: center; }
.sample-pages { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.sp { margin: 0; background: var(--paper); color: var(--ink); border-radius: var(--r); overflow: hidden; }
.sp:nth-child(2) { transform: translateY(24px); }
.sp img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.sp figcaption { font-size: .86rem; padding: 12px 14px 16px; line-height: 1.45; }
.sp-wait { grid-column: 1 / -1; display: flex; gap: var(--s5); align-items: center; }
.sp-wait p { max-width: 30ch; }

/* Lessons */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; }
.lesson-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.lesson-chip { text-decoration: none; background: rgba(255,255,255,.07); border: 1px solid rgba(201,198,242,.25); border-radius: var(--r); padding: var(--s4); display: flex; flex-direction: column; gap: 6px; transition: background .15s; }
.lesson-chip:hover { background: rgba(255,255,255,.14); }
.lesson-chip strong { font-family: var(--display); font-size: 1.15rem; font-weight: 560; color: var(--butter-2); }
.lesson-chip span { font-size: .9rem; color: #CFCDF3; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s5); max-width: 900px; }
.plan { border: 2px solid rgba(201,198,242,.4); border-radius: var(--r-lg); padding: var(--s6); display: flex; flex-direction: column; }
.plan-hi { background: var(--paper); color: var(--ink); border-color: var(--butter); }
.plan-hi p { color: var(--ink-2); }
.plan-tag { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; margin: 0 0 6px; }
.price { font-family: var(--display); font-size: 3rem; font-weight: 600; margin: 0 0 var(--s3); line-height: 1; }
.plan ul { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 10px; align-items: baseline; }
.plan-hi .dingbat { fill: #E9B33A; }

.promise-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
.promise-row h3 { color: var(--butter-2); }

/* Footer */
.foot { background: var(--deep); color: var(--lilac); padding: var(--s7) 0 var(--s6); position: relative; overflow: hidden; }
.foot-in { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--s6); position: relative; z-index: 1; }
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-brand img { border-radius: 12px; background: #fff; }
.foot-brand strong { font-family: var(--display); font-size: 1.3rem; color: var(--paper); }
.foot-brand p { margin: 4px 0 0; font-size: .95rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-content: flex-start; }
.foot-links a { text-decoration: none; font-weight: 700; color: var(--paper); padding: 4px 0; }
.foot-links a:hover { color: var(--butter); }
.foot-small { grid-column: 1 / -1; font-size: .85rem; color: #9D9BD0; margin: 0; }
.foot-stars { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 12% 30%, #fff8 50%, transparent 51%), radial-gradient(1.5px 1.5px at 40% 70%, #fff6 50%, transparent 51%), radial-gradient(2px 2px at 78% 22%, #FFD66B 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 62%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 60% 40%, #fff9 50%, transparent 51%); }

/* Composer */
.make-head { padding: var(--s7) 0 var(--s6); }
.steps { list-style: none; padding: 0; margin: var(--s5) 0 0; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: st; }
.steps li { counter-increment: st; padding: 8px 16px 8px 10px; border-radius: var(--pill); background: rgba(255,255,255,.55); font-weight: 700; font-size: .92rem; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lilac); color: var(--night); font-size: .8rem; }
.steps li.on { background: var(--night); color: var(--paper); }
.steps li.on::before, .steps li.done::before { background: var(--butter); }
.make-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--s7); align-items: start; }
.composer fieldset { border: 0; padding: 0; margin: 0; }
.composer legend { font-family: var(--display); font-size: 1.9rem; font-weight: 560; margin-bottom: var(--s4); padding: 0; }
.field { display: block; margin-bottom: var(--s4); }
.lbl { display: block; font-weight: 700; margin-bottom: 6px; }
.sub { font-weight: 700; margin: var(--s5) 0 var(--s2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.radios, .animals { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s4); }
.radios .lbl { width: 100%; }
.chip { position: relative; }
.chip input, .lcard input, .scard input, .ecard input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--pill); border: 2px solid #CFCCEE; background: #fff; font-weight: 700; cursor: pointer; }
.chip input:checked + span { background: var(--night); color: var(--butter); border-color: var(--night); }
.chip input:focus-visible + span, .lcard input:focus-visible + span, .scard input:focus-visible ~ strong, .ecard input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; margin: var(--s2) 0 var(--s4); }
.check input { width: 22px; height: 22px; min-height: 0; }
.lesson-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: var(--s4); }
.lcard span, .ecard span { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-sm); border: 2px solid #CFCCEE; background: #fff; cursor: pointer; height: 100%; }
.lcard small, .ecard small { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.lcard input:checked + span, .ecard input:checked + span { border-color: var(--night); background: #FFF6D6; box-shadow: inset 0 0 0 1px var(--night); }
.lcard, .ecard { position: relative; display: block; }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.scard { position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.scard .sw { aspect-ratio: 1; border-radius: var(--r-sm); border: 3px solid transparent; overflow: hidden; display: block; }
.scard .sw img { width: 100%; height: 100%; object-fit: cover; }
.sw-gouache { background: radial-gradient(circle at 70% 30%, #FFD66B 0 12%, transparent 13%), linear-gradient(160deg, #3A3C85, #1C1F4A); }
.sw-watercolour { background: radial-gradient(circle at 30% 30%, #F9D7E3, transparent 50%), radial-gradient(circle at 70% 70%, #CDE7F0, transparent 55%), #F6F4FB; }
.sw-papercut { background: linear-gradient(170deg, transparent 55%, #6F6BC0 56%), linear-gradient(190deg, #9C98E0 0 60%, #2B2E6B 61%); }
.scard input:checked ~ .sw { border-color: var(--night); }
.scard small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.editions { display: grid; gap: 10px; margin-bottom: var(--s4); }
.acct { margin-top: var(--s5); padding: var(--s5); background: var(--mist); border-radius: var(--r); }
.acct .sub { margin-top: 0; }
.signed { background: var(--mist); padding: 12px 16px; border-radius: var(--r-sm); }
.step-nav { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.make-side { position: sticky; top: 90px; }
.side-note { margin-top: var(--s6); background: var(--mist); border-radius: var(--r); padding: var(--s5); }
.side-note ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.side-note li { display: flex; gap: 8px; align-items: baseline; }
.alert { background: #FBE7EC; border: 2px solid var(--err); color: #5E1526; border-radius: var(--r-sm); padding: 12px 16px; margin: 0 0 var(--s4); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.ok { background: #E3F4EC; border: 2px solid var(--ok); color: #1B4D37; border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: var(--s4); }
.field-err input, .field-err select, .field-err textarea { border-color: var(--err); }

/* Book page */
.book-head { padding: var(--s7) 0; }
.book-grid { display: grid; grid-template-columns: 360px 1fr; gap: var(--s7); align-items: center; }
.meta { color: var(--ink-2); }
.night .meta { color: #CFCDF3; }
.status { display: inline-block; padding: 2px 10px; border-radius: var(--pill); font-size: .78rem; letter-spacing: .04em; background: var(--lilac); color: var(--night); text-transform: none; }
.st-ready { background: #CDEFD9; color: #17482F; } .st-failed { background: #F8D5DD; color: #5E1526; } .st-generating, .st-paid { background: var(--butter-2); color: var(--night); }
.progress { margin: var(--s5) 0 var(--s3); }
.bar { height: 18px; background: rgba(28,31,74,.12); border-radius: var(--pill); overflow: hidden; border: 2px solid var(--night); }
.bar span { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--butter) 0 12px, var(--butter-2) 12px 24px); transition: width .8s ease; }
.pnote { font-weight: 700; margin-top: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: var(--s5) 0; }
.inline-actions { display: flex; gap: var(--s5); align-items: center; margin-top: var(--s4); flex-wrap: wrap; }
.inline-actions form { margin: 0; }
.share { background: rgba(255,255,255,.07); border: 1px solid rgba(201,198,242,.3); border-radius: var(--r); padding: var(--s5); margin-top: var(--s5); }
.share h3 { color: var(--butter-2); }
.copy { display: flex; gap: 8px; flex-wrap: wrap; }
.copy input { flex: 1 1 260px; width: auto; font-size: .9rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.thumb { position: relative; border-radius: var(--r-sm); overflow: hidden; display: block; }
.thumb img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.thumb span { position: absolute; bottom: 8px; left: 8px; background: var(--night); color: var(--butter); border-radius: var(--pill); padding: 0 10px; font-weight: 700; font-size: .85rem; }

/* Reader */
.reader-body { background: var(--deep); }
.reader { background: radial-gradient(ellipse at 50% 0%, #2B2E6B 0%, var(--deep) 70%); color: var(--paper); padding: var(--s5) 0 var(--s7); min-height: calc(100vh - 68px); }
.reader-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.rb-title { font-family: var(--display); font-weight: 560; font-size: 1.2rem; color: var(--butter-2); }
.rb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.spread { width: min(1100px, 100% - 32px); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); color: var(--ink); border-radius: 14px 24px 24px 14px; overflow: hidden; min-height: 420px; }
.spread .pic { background: var(--lilac); }
.spread .pic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.spread .words { padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; font-size: clamp(1.1rem, 1.1vw + .8rem, 1.45rem); line-height: 1.65; }
.spread .words h1 { color: var(--night); font-size: clamp(2rem, 3vw + .8rem, 3.2rem); }
.spread .words .pn { margin-top: var(--s5); color: var(--peri); font-weight: 700; font-size: .9rem; }
.spread.end { grid-template-columns: 1fr; background: var(--night); color: var(--paper); text-align: center; place-items: center; }
.spread.end .words { align-items: center; }
.spread.end h1 { color: var(--butter); }
.end-moon { width: 90px; height: 90px; border-radius: 50%; box-shadow: -18px 10px 0 0 var(--butter); transform: rotate(-15deg); margin: 0 auto var(--s5); }
.reader-nav { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s5); }
.pg { font-weight: 700; color: var(--lilac); }
.spread.turn { animation: turn .35s ease; }
@keyframes turn { from { opacity: .3; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* Shelf */
.shelf-head { padding: var(--s7) 0 var(--s6); }
.shelf-wall { background: linear-gradient(180deg, var(--night), var(--deep)); color: var(--paper); padding-top: var(--s4); }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s6) var(--s5); padding-bottom: var(--s6); border-bottom: 10px solid #3A3C85; margin-bottom: var(--s5); }
.book-tile { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.tile-cover { aspect-ratio: 4/5; border-radius: 6px 14px 14px 6px; overflow: hidden; position: relative; border: 2px solid rgba(201,198,242,.25); box-shadow: -7px 0 0 #2B2E6B inset; background: var(--night); transition: transform .2s; }
.book-tile:hover .tile-cover { transform: translateY(-6px) rotate(-1deg); }
.tile-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-tile strong { font-family: var(--display); font-weight: 560; font-size: 1.1rem; color: var(--butter-2); line-height: 1.2; }
.book-tile small { color: #CFCDF3; }
.new-tile { aspect-ratio: 4/5; border: 2px dashed var(--lilac); border-radius: 6px 14px 14px 6px; align-items: center; justify-content: center; text-align: center; padding: var(--s4); }
.new-tile:hover { background: rgba(255,255,255,.06); }
.plus { font-family: var(--display); font-size: 3rem; color: var(--butter); line-height: 1; }
.shelf-wall .link { color: var(--lilac); }

/* Auth, pages */
.auth-wrap { min-height: 70vh; display: grid; place-items: center; }
.auth-card { width: min(480px, 100% - 32px); background: var(--paper); border-radius: var(--r-lg); padding: var(--s6); border: 2px solid var(--night); }
.auth-card h1 { font-size: 2.3rem; }
.auth-card .btn { width: 100%; }
.page-head { padding: var(--s8) 0 var(--s7); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.lesson-card { background: #fff; border-radius: var(--r); padding: var(--s5); border: 2px solid #E1DFF7; display: flex; flex-direction: column; align-items: flex-start; }
.lesson-card h2 { font-size: 1.5rem; } .lesson-card h2 a { text-decoration: none; }
.lesson-card p { flex: 1; color: var(--ink-2); }
.lesson-card.own { background: var(--night); color: var(--paper); border-color: var(--night); }
.lesson-card.own p { color: #CFCDF3; }
.prose h2 { margin-top: var(--s6); }
.nice { padding-left: 22px; display: grid; gap: 12px; }
.faq { border-bottom: 2px solid #E1DFF7; padding: var(--s4) 0; }
.faq summary { font-family: var(--display); font-size: 1.3rem; font-weight: 560; cursor: pointer; }
.faq p { color: var(--ink-2); }

/* Admin */
.admin-nav { display: flex; gap: var(--s5); align-items: center; margin-bottom: var(--s5); flex-wrap: wrap; font-weight: 700; }
.admin-nav form { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stats div { background: #fff; border-radius: var(--r-sm); padding: var(--s4); }
.stats strong { font-family: var(--display); font-size: 2rem; display: block; }
.stats span { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--r-sm); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ECEAF9; vertical-align: top; }
.err { color: var(--err); }
.events { padding-left: 18px; }
.lesson-edit { background: #fff; border-radius: var(--r); padding: var(--s5); margin-bottom: var(--s4); }
.narrow-form { max-width: 420px; }

@media (max-width: 960px) {
  .hero-in, .sample-block, .make-grid, .book-grid, .foot-in { grid-template-columns: 1fr; }
  .make-side { position: static; order: -1; display: none; }
  .lesson-strip { grid-template-columns: repeat(2, 1fr); }
  .promise-row { grid-template-columns: 1fr; gap: var(--s4); }
  .book-grid > div:first-child .cover-mock { width: min(260px, 100%); }
  .hero-book .cover-mock { width: min(280px, 80%); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  section { padding: var(--s7) 0; }
  .top-in { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 0; }
  .nav { flex-wrap: wrap; gap: 2px 0; padding-bottom: 4px; }
  .nav a { white-space: nowrap; padding: 6px 10px; font-size: .88rem; }
  .nav .pill-ghost { margin-left: 2px; padding: 4px 12px; }
  .how, .plans, .row2, .row3, .lesson-pick, .sample-pages { grid-template-columns: 1fr; }
  .styles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sp:nth-child(2) { transform: none; }
  .sample-pages .sp:nth-child(n+2) { display: none; }
  .lesson-strip { grid-template-columns: 1fr; }
  .spread { grid-template-columns: 1fr; border-radius: 16px; }
  .spread .pic img { aspect-ratio: 1 / 1; }
  .reader-bar { justify-content: center; text-align: center; }
  .try-row input, .try-row select, .try-row .btn { flex: 1 1 100%; }
  .sp-wait { flex-direction: column; }
  .plan { padding: var(--s5); }
  .shelf-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s5) var(--s3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
