:root {
  color-scheme: dark;
  --ink: #110d20;
  --panel: #1a132c;
  --panel-alt: #211734;
  --line: #443453;
  --cream: #fff0dc;
  --muted: #cabbd3;
  --gold: #f9c77a;
  --heading: Georgia, "Times New Roman", serif;
  --sans: system-ui, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(ellipse at 40% 47%, #201432, transparent 48rem), var(--ink); color: var(--cream); font-family: var(--sans); font-size: 1rem; line-height: 1.6; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 1.5rem; }
.wrap { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: fixed; top: 1rem; left: 1rem; z-index: 10; padding: .6rem 1rem; background: var(--gold); color: var(--ink); transform: translateY(-200%); }
.skip:focus { transform: none; }
.top { border-bottom: 1px solid #ffffff12; background: #130e23; }
.nav, .foot { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .68rem; font: bold 1.55rem/.98 var(--heading); text-decoration: none; }
.brand small { display: block; margin-top: .32rem; font: 650 .73rem/1 var(--sans); letter-spacing: .07em; color: var(--muted); }
.ghost { position: relative; display: grid; place-items: center; color: #302140; background: #dbc2ed; width: 35px; height: 36px; border-radius: 52% 52% 28% 28%; font: bold 1.45rem/1 var(--sans); padding-bottom: .22rem; letter-spacing: .04em; }
.ghost::after { position: absolute; content: ""; bottom: -1px; left: 4px; width: 10px; height: 8px; border-radius: 50%; background: #dbc2ed; box-shadow: 10px 3px #dbc2ed, 19px 0 #dbc2ed; }
.nav nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .8rem 1.5rem; }
.nav nav a { font-size: .93rem; color: var(--muted); text-decoration: none; font-weight: 650; }
.nav nav a:hover, .nav nav a:focus-visible { color: var(--cream); }
.nav nav .nav-write { color: var(--gold); border: 1px solid #6b4b5b; padding: .42rem .85rem; border-radius: 40px; }
.nav-write span { padding-right: .25rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.1; text-wrap: balance; }
p + p { margin-top: .9em; }
.hero { margin-top: 28px; min-height: 562px; position: relative; display: grid; align-items: center; overflow: hidden; isolation: isolate; border: 1px solid #593955; border-radius: 24px; background: #221737; }
.hero-visual { position: absolute; z-index: -2; inset: 0 0 0 18%; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: right top; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #1b132b 0%, #1b132bf0 20%, #1b132bc1 36%, #1b132b25 60%, transparent 80%), linear-gradient(0deg, #160e2680, transparent 28%); }
.hero-copy { padding: 3.5rem clamp(2rem, 5.7vw, 5.5rem); max-width: 43rem; }
.eyebrow { color: var(--gold); font-size: .77rem; letter-spacing: .18em; font-weight: 750; text-transform: uppercase; }
.eyebrow span { margin-right: .27em; font-size: 1rem; }
.hero h1 { margin: .7rem 0 1.05rem; font-size: clamp(3rem, 5.45vw, 5.2rem); line-height: .99; letter-spacing: -.047em; }
.hero h1 em { color: var(--gold); font-weight: normal; }
.hero-copy > p:not(.eyebrow) { color: #e2d3e8; max-width: 30ch; font-size: 1.075rem; }
.hero-actions, .story-actions, .editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.hero-actions { margin-top: 1.65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 40px; padding: .62rem 1rem; font: 700 .93rem/1.2 var(--sans); border: 1px solid transparent; text-decoration: none; transition: background-color 160ms, color 160ms, border-color 160ms; }
.primary { background: var(--gold); color: #2d1826; }
.primary:hover { background: #ffdb9d; }
.outline { color: var(--gold); border-color: #745364; background: transparent; }
.outline:hover { background: #f9c77a16; border-color: var(--gold); }
.text-button { color: var(--muted); background: transparent; }
.text-button:hover { color: var(--cream); }
.library { padding-top: 2.8rem; padding-bottom: 3rem; }
.section-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.section-heading h2, .workshop h2 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.035em; }
.ornament { line-height: 1; color: var(--gold); font-size: 1.85rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.15rem; }
.library-options { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1rem; margin-bottom: .5rem; }
.library-options .filters { margin-bottom: 0; }
.library-sort { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }
.library-sort select { color: var(--cream); background-color: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .55rem; }
.library > .reaction-note { margin: .4rem 0 1rem; }
.chip { background: #20162f; border: 1px solid var(--line); border-radius: 40px; color: var(--muted); font-size: .875rem; min-height: 40px; padding: .38rem .85rem; }
.chip:hover { border-color: var(--gold); color: var(--cream); }
.chip[aria-pressed="true"] { color: var(--cream); background: #453051; border-color: #9b748d; }
.stories { display: grid; gap: 1rem; }
.story-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); background: var(--panel); border-radius: 20px; }
.story-art { display: block; overflow: hidden; min-height: 100%; position: relative; aspect-ratio: 16 / 9; }
.story-art img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; transition: transform 360ms ease; }
.story-art:hover img { transform: scale(1.035); }
.story-details { padding: clamp(1.2rem, 3.6vw, 3.1rem); align-self: center; }
.story-details h3 { font-size: clamp(1.65rem, 3.4vw, 2.8rem); margin: .4rem 0 .6rem; letter-spacing: -.028em; }
.story-details h3 a { text-decoration: none; }
.story-details h3 a:hover { text-decoration: underline; text-underline-offset: .14em; }
.story-details > p:not(.eyebrow), .workshop-intro > p:not(.eyebrow), .reading-time { color: var(--muted); }
.story-actions { margin-top: 1.25rem; }
.reading-time { font-size: .875rem; }
.workshop { display: grid; grid-template-columns: minmax(0,.74fr) minmax(0,1.26fr); margin-top: 3.6rem; margin-bottom: 4rem; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(135deg, #302042, #191126 66%); padding: clamp(1.15rem, 4vw, 3rem); gap: clamp(1.5rem, 4vw, 4rem); }
.workshop h2 { margin: .55rem 0 .8rem; }
.workshop-intro .button { margin-top: 1.1rem; }
.idea { margin-top: .85rem; padding: .75rem 1rem; background: #190f29; border-inline-start: 3px solid var(--gold); border-radius: .25rem .55rem .55rem .25rem; }
#draft-list { margin-top: 1.65rem; }
#drafts { list-style: none; padding: 0; margin: .75rem 0 0; }
#drafts button { width: 100%; text-align: left; overflow-wrap: anywhere; color: var(--cream); border: 0; background: transparent; border-bottom: 1px solid var(--line); padding: .55rem 0; }
#drafts button:hover { color: var(--gold); }
.editor { display: grid; gap: .8rem; }
.editor-top { display: grid; grid-template-columns: 1fr minmax(145px,.55fr); gap: .75rem; }
.editor label { display: grid; gap: .27rem; font-size: .9rem; color: #e4d6ec; font-weight: 650; }
.editor :is(input, textarea, select) { background: #150f22; color: var(--cream); border: 1px solid #584465; border-radius: 9px; padding: .65rem .75rem; min-width: 0; width: 100%; font-size: 1rem; font-weight: 400; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),linear-gradient(135deg,var(--gold) 50%,transparent 50%) !important; background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55% !important; background-size: 5px 5px,5px 5px !important; background-repeat: no-repeat !important; padding-right: 1.8em !important; }
.editor ::placeholder { color: #aa97b4; }
.editor textarea { resize: vertical; min-height: 10rem; }
.form-note, .form-status { color: var(--muted); font-size: .875rem; }
.form-status { color: var(--gold); margin-top: -.35rem; }
.form-status:empty { display: none; }
footer { border-top: 1px solid #ffffff17; background: #120d20; }
.foot { color: var(--muted); font-size: .88rem; }
.foot .brand { color: var(--cream); }
.foot-links, .audio-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1.1rem; }
.foot-links { justify-content: flex-end; }
.gold { color: var(--gold); }
.reader { max-width: 1090px; padding-top: 1.45rem; }
.back { display: inline-block; margin-bottom: .85rem; }
.text-link { color: var(--gold); text-underline-offset: .25em; }
.reader-hero { position: relative; isolation: isolate; border-radius: 19px; overflow: hidden; min-height: 345px; display: grid; align-items: end; background: var(--panel); }
.reader-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 53%; z-index: -2; }
.reader-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg,#130c22 2%,#1d0e36bc 43%,transparent 80%); z-index: -1; }
.reader-title { padding: clamp(1.05rem, 4.4vw, 3rem); }
.reader-title h1 { font-size: clamp(2.15rem, 5vw, 4.65rem); max-width: 18ch; letter-spacing: -.045em; margin: .5rem 0; }
.reader-title > p:last-child, .audio-panel p:not(.eyebrow) { color: var(--muted); }
.audio-panel { margin: 1.25rem 0; background: radial-gradient(ellipse at top left, #352145, transparent 65%), var(--panel-alt); border: 1px solid #5c4268; border-radius: 19px; padding: clamp(.85rem, 3vw, 2rem); display: grid; gap: .9rem; }
.audio-panel h2 { margin: .3rem 0; font-size: clamp(1.65rem, 4vw, 2.55rem); }
.audio-panel audio { width: 100%; }
.reader-nav { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.story-player { padding: clamp(.65rem, 2.7vw, 1.3rem); background: #160e24b8; border: 1px solid #594167; border-radius: 14px; }
.player-transport { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: .5rem .65rem; align-items: center; }
.player-toggle { min-width: 7.8rem; gap: .55rem; }
.player-play-icon { width: .85rem; height: .92rem; background: currentColor; clip-path: polygon(12% 0, 100% 50%, 12% 100%); }
.player-toggle[data-playing="true"] .player-play-icon { clip-path: none; background: linear-gradient(90deg, currentColor 36%, transparent 36% 64%, currentColor 64%); }
.player-stop { width: 44px; padding: 0; }
.player-stop span { width: .72rem; height: .72rem; border-radius: 2px; background: currentColor; }
.player-now { min-width: 0; padding-inline: .15rem; line-height: 1.3; overflow-wrap: anywhere; }
.audio-panel .player-now p:first-child { color: var(--cream); font-weight: 700; }
.player-now p + p { margin-top: .22rem; font-size: .88rem; }
.player-settings { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem .85rem; }
.player-tempo { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .875rem; }
.player-tempo select { min-height: 44px; padding-inline: .55rem; border: 1px solid #73546a; border-radius: .65rem; background: var(--panel); color: var(--gold); cursor: pointer; }
.player-volume { display: flex; align-items: center; gap: .55rem; }
.player-volume input { width: clamp(3.25rem, 8vw, 6rem); accent-color: var(--gold); }
.player-volume .button { min-width: 5.4rem; }
.player-timeline { position: relative; margin: .85rem .72rem 0; }
#audio-seek { display: block; width: 100%; height: 28px; margin: 0; padding: 0; border-radius: 4px; appearance: none; background: transparent; cursor: pointer; }
#audio-seek:focus { outline: none; }
#audio-seek:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #bf9bd2; }
#audio-seek:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #bf9bd2; }
#audio-seek::-webkit-slider-runnable-track { height: .47rem; border-radius: 99px; background: linear-gradient(90deg, var(--gold) var(--progress, 0%), #654b77 var(--progress, 0%)); }
#audio-seek::-moz-range-track { height: .47rem; border-radius: 99px; background: linear-gradient(90deg, var(--gold) var(--progress, 0%), #654b77 var(--progress, 0%)); }
#audio-seek::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; margin-top: -5px; background: var(--gold); border: 2px solid #fff0dc; border-radius: 50%; }
#audio-seek::-moz-range-thumb { width: 14px; height: 14px; background: var(--gold); border: 2px solid #fff0dc; border-radius: 50%; }
.player-markers { position: relative; height: 34px; margin-inline: .5rem; font-variant-numeric: tabular-nums; }
.player-marker { position: absolute; left: var(--at); transform: translateX(-50%); display: grid; place-items: center; width: 28px; height: 30px; padding: 0; border: 1px solid #5c456c; border-radius: 9px; background: #2b1c3b; color: var(--muted); font-size: .875rem; font-weight: 700; }
.player-marker::before { content: ""; position: absolute; left: 50%; bottom: 100%; height: 5px; border-left: 1px solid #8f709f; }
.player-marker:hover, .player-marker[aria-current="true"] { border-color: var(--gold); color: var(--ink); background: var(--gold); }
.player-time { display: flex; justify-content: space-between; gap: .5rem; margin: .15rem .25rem 0; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.player-time span:first-child { color: var(--cream); font-weight: 650; }
.player-chapters { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.player-chapters summary { cursor: pointer; color: var(--gold); font-size: .95rem; }
.player-chapters ol { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem; margin: .65rem 0 0; padding: 0; list-style: none; }
.player-chapters button { display: flex; width: 100%; gap: .4rem; justify-content: space-between; align-items: center; text-align: left; padding: .4rem .55rem; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--cream); font-size: .9rem; }
.player-chapters button:hover, .player-chapters button[aria-current="true"] { background: #38264a; border-color: #604a72; }
#audio-status { margin-top: .5rem; font-size: .9rem; }
.book { display: grid; grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr); gap: clamp(1rem, 4vw, 3.5rem); margin: 2rem 0 4rem; }
.book-aside { align-self: start; position: sticky; top: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--panel); padding: .95rem; }
.book-aside h2 { font-size: 1.35rem; }
.book-aside ol { margin: .7rem 0 1rem; padding-inline-start: 1.35rem; }
.book-aside li { margin: .23rem 0; color: var(--muted); font-size: .925rem; }
.book-aside li a { text-decoration: none; display: flex; justify-content: space-between; gap: .35rem; align-items: baseline; border-radius: 4px; padding: .2em .3em; }
.book-aside a:hover, .book-aside a[aria-current] { color: var(--gold); background: #f9c77a0e; }
.text-size { display: flex; gap: .35rem; margin-top: .7rem; }
.book-text { font: 1.225rem/1.72 var(--heading); color: #f6e7db; max-width: 64ch; overflow-wrap: break-word; }
.book-text[data-size="large"] { font-size: 1.55rem; }
.chapter + .chapter { margin-top: 2.6rem; border-top: 1px solid var(--line); padding-top: 2.2rem; }
.chapter-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; margin-bottom: 1.1rem; }
.chapter h2 { font-size: 1.56em; color: #ffddab; }
.chapter-art { width: 100%; height: auto; border-radius: .75rem; border: 1px solid var(--line); margin-bottom: 1.35rem; }
.chapter-listen { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.chapter-duration { color: var(--muted); white-space: nowrap; font: 700 .875rem/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.chapter-listen .chapter-duration { color: var(--gold); border: 1px solid #604a72; border-radius: 8px; padding: .3rem .5rem; }
.chapter-play[aria-pressed="true"] { background: #f9c77a20; border-color: var(--gold); }
.button.chapter-download { width: 44px; padding: 0; font-size: 1.2rem; }
.book-end { text-align: center; color: var(--gold); margin-top: 2rem; font-size: 1.6rem; }
.story-heart { display: inline-flex; gap: .48rem; min-width: 4.1rem; font-variant-numeric: tabular-nums; }
.story-heart[aria-pressed="true"] { background: #78394f; color: #ffe0e8; border-color: #c86d89; }
.heart-icon { font: 700 1.36rem/1 var(--sans); }
.story-reactions { display: grid; gap: .8rem; margin: 0 0 3rem; padding: clamp(1rem, 3.5vw, 2rem); border: 1px solid #5c4268; border-radius: 19px; background: radial-gradient(ellipse at top right, #392244, transparent 70%), var(--panel); }
.reaction-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.reaction-heading h2 { font-size: clamp(1.7rem, 4vw, 2.45rem); }
.reaction-heading p { margin-top: .3rem; }
.reaction-note { color: var(--muted); font-size: .9rem; }
.reaction-list { display: grid; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.reaction-list li { background: #211632; border: 1px solid #49365b; padding: .65rem .8rem; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: grid; gap: .45rem; }
.comment-form label { font-size: .95rem; font-weight: 650; }
.comment-form textarea { resize: vertical; min-height: 5.1rem; width: 100%; padding: .6rem .7rem; border: 1px solid #624c75; border-radius: 8px; background: var(--ink); color: var(--cream); }
.comment-form div, .comment-moderation li div { display: flex; align-items: center; gap: .55rem 1rem; flex-wrap: wrap; }
.comment-moderation summary { color: var(--gold); cursor: pointer; font-size: .9rem; }
.comment-moderation ul, .comment-moderation li div { margin-top: .5rem; }
@media (max-width: 850px) {
  .wrap { width: calc(100% - 36px); }
  .hero { min-height: 510px; }
  .hero-visual { left: 4%; }
  .book { grid-template-columns: minmax(10rem, 13rem) minmax(0,1fr); gap: 1.5rem; }
  .workshop { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .nav, .foot { min-height: 66px; }
  .nav nav { gap: .3rem .65rem; }
  .nav nav .nav-write { border: 0; padding: .35rem 0; }
  .nav nav a { font-size: .85rem; }
  .brand { font-size: 1.26rem; gap: .45rem; }
  .brand small { font-size: .58rem; }
  .ghost { transform: scale(.82); transform-origin: left; width: 31px; }
  .hero { margin-top: 14px; min-height: auto; align-items: end; border-radius: 16px; }
  .hero-visual { inset: 0 0 auto; height: clamp(245px, 68vw, 370px); }
  .hero::after { background: linear-gradient(0deg,#1b132b 47%,#1b132bf5 52%,#1b132b00 76%); }
  .hero-copy { padding: clamp(175px, 52vw, 285px) 1rem 1.25rem; }
  .hero h1 { font-size: clamp(2.4rem,10vw,3.75rem); }
  .hero-copy > p:not(.eyebrow) { font-size: 1rem; }
  .hero-actions { margin-top: 1rem; }
  .button { font-size: .875rem; padding-inline: .82rem; }
  .library { padding-top: 1.9rem; }
  .story-card, .book { grid-template-columns: minmax(0,1fr); }
  .story-details { padding: 1rem; }
  .workshop { margin-top: 2rem; margin-bottom: 2rem; }
  .editor-top { grid-template-columns: minmax(0,1fr); }
  .reader-hero { min-height: 280px; }
  .player-transport { grid-template-columns: auto auto minmax(0, 1fr); }
  .player-toggle { min-width: 6.6rem; }
  .player-settings { grid-column: 1 / -1; }
  .player-volume input { width: 5rem; }
  .player-chapters ol { grid-template-columns: 1fr; }
  .player-marker { width: clamp(21px, 5.6vw, 28px); font-size: .8rem; }
  .book-aside { position: static; }
  .book-text { font-size: 1.18rem; }
  .foot-links { gap: .15rem .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
