:root {
  --ink: #171613;
  --paper: #f4f0e7;
  --cream: #ebe4d5;
  --muted: #6e695f;
  --line: rgba(23, 22, 19, .16);
  --red: #ba4a35;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --reader-size: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { color-scheme: dark; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
video { max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; padding: .7rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.site-header { height: 88px; padding: 0 clamp(1.25rem, 5vw, 5rem); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: .75rem; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; text-decoration: none; }
.wordmark-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .75rem; }
.site-header nav { display: flex; align-items: center; gap: 2rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.site-header nav a:hover { color: var(--ink); }
.nav-contact { padding: .65rem 1rem; border: 1px solid var(--line); border-radius: 99px; }
.theme-toggle { width: 42px; height: 42px; padding: 0; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.035); color: var(--ink); cursor: pointer; transition: transform .28s cubic-bezier(.22,1,.36,1), background-color .28s ease, border-color .28s ease; }
.theme-toggle:hover { transform: translate3d(0,-2px,0); background: rgba(255,255,255,.09); }
.theme-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.popular-strip { padding: 1.15rem clamp(1.25rem, 5vw, 5rem); display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); border-bottom: 1px solid var(--line); background: rgba(12,9,22,.42); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.popular-heading { min-width: max-content; }.popular-heading .eyebrow { margin: 0 0 .25rem; font-size: .6rem; }.popular-heading h2 { margin: 0; font: 500 1.15rem/1.1 var(--serif); }
.popular-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; list-style: none; }
.popular-list li { min-width: 0; padding: .7rem .85rem; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.018)); box-shadow: inset 3px 0 0 var(--accent); }
.popular-rank { color: var(--red); font: 600 .64rem/1 var(--sans); letter-spacing: .08em; }
.popular-list a { min-width: 0; display: grid; gap: .15rem; text-decoration: none; }.popular-list a strong { overflow: hidden; font: 500 .95rem/1.15 var(--serif); text-overflow: ellipsis; white-space: nowrap; }.popular-list a span { color: var(--muted); font-size: .62rem; }.popular-like { min-height: 30px; padding: .25rem .5rem; white-space: nowrap; }
.hero { min-height: calc(100vh - 88px); padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 7vw, 8rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .6fr); align-items: center; gap: clamp(3rem, 8vw, 9rem); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; z-index: 0; width: 430px; height: 430px; left: -260px; top: 9%; border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 0 0 60px rgba(23,22,19,.02), 0 0 0 120px rgba(23,22,19,.015); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 1.25rem; color: var(--red); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 600; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(3.5rem, 7.5vw, 8rem); line-height: .91; letter-spacing: -.055em; font-weight: 500; }
.hero h1 em { color: var(--red); font-weight: 400; }
.hero-intro { max-width: 620px; margin: 2.1rem 0 0; color: var(--muted); font-family: var(--serif); font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 2rem; margin-top: 2.3rem; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .95rem 1.35rem; border-radius: 2px; text-decoration: none; font-size: .87rem; font-weight: 600; transition: transform .28s cubic-bezier(.22,1,.36,1), background-color .28s ease, border-color .28s ease, box-shadow .28s ease; backface-visibility: hidden; transform: translate3d(0,0,0); }
.button:hover { transform: translate3d(0,-2px,0); }
.button-primary { background: var(--ink); color: var(--paper); }
.button-outline { border: 1px solid var(--ink); }
.text-link, .read-link { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: .25rem; font-size: .86rem; font-weight: 600; }
.featured-card { --accent: var(--red); min-height: 530px; padding: 2rem; display: flex; flex-direction: column; background: var(--ink); color: var(--paper); text-decoration: none; position: relative; box-shadow: 28px 28px 0 var(--cream); transition: transform .38s cubic-bezier(.22,1,.36,1), box-shadow .38s cubic-bezier(.22,1,.36,1), border-color .3s ease; overflow: hidden; backface-visibility: hidden; transform: translate3d(0,0,0); will-change: transform; }
.featured-card:hover { transform: translate3d(-4px,-4px,0); box-shadow: 36px 36px 0 var(--cream); }
.featured-label { width: fit-content; padding: .42rem .65rem; border: 1px solid rgba(255,255,255,.35); border-radius: 99px; font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; }
.cover-art { flex: 1; position: relative; display: block; }
.cover-art::before, .cover-art::after, .cover-art i { content: ""; position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 80%, white); }
.cover-art::before { width: 190px; height: 190px; top: 45%; left: 50%; transform: translate(-50%,-50%); background: var(--accent); box-shadow: 0 0 70px color-mix(in srgb, var(--accent) 55%, transparent); }
.cover-art::after { width: 280px; height: 90px; top: 45%; left: 50%; transform: translate(-50%,-50%) rotate(-18deg); }
.cover-art i:nth-child(1) { width: 12px; height: 12px; background: var(--paper); left: 15%; top: 25%; border: 0; }
.cover-art i:nth-child(2) { width: 6px; height: 6px; background: var(--paper); right: 13%; top: 40%; border: 0; }
.cover-art i:nth-child(3) { width: 4px; height: 4px; background: var(--paper); left: 30%; bottom: 15%; border: 0; }
.cover-art-image { min-height: 220px; margin: 1.25rem -2rem 1rem; overflow: hidden; contain: layout paint; }
.cover-art-image::before, .cover-art-image::after { display: none; }
.cover-art-image img, .cover-art-image video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.featured-meta { color: rgba(255,255,255,.62); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; }
.featured-card strong { margin: .5rem 0 .6rem; font-family: var(--serif); font-size: clamp(2rem, 3vw, 3rem); line-height: 1.03; font-weight: 500; }
.featured-card > span:last-child { color: rgba(255,255,255,.7); font-family: var(--serif); line-height: 1.5; }
.library { padding: clamp(5rem, 10vw, 10rem) clamp(1.25rem, 7vw, 8rem); background: #eee8dc; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.section-heading h2, .about h2 { margin: 0; font: 500 clamp(2.6rem, 5vw, 5.4rem)/1 var(--serif); letter-spacing: -.045em; }
.search-box { width: min(320px, 100%); display: flex; align-items: center; gap: .65rem; padding: .75rem .9rem; border-bottom: 1px solid var(--ink); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 3rem 0 4rem; }
.filter { padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: .78rem; }
.filter:hover, .filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5rem 3rem; }
.story-card { min-width: 0; display: grid; grid-template-columns: minmax(150px, .55fr) minmax(0, 1fr); gap: 2rem; align-items: center; overflow: hidden; transition-delay: var(--delay); }
.story-card[hidden] { display: none; }
.story-cover { aspect-ratio: 3/4; padding: 1.4rem; display: flex; flex-direction: column; background: var(--accent); color: white; text-decoration: none; box-shadow: 13px 13px 0 rgba(23,22,19,.09); position: relative; overflow: hidden; transition: transform .34s cubic-bezier(.22,1,.36,1), box-shadow .34s cubic-bezier(.22,1,.36,1); backface-visibility: hidden; transform: translate3d(0,0,0); will-change: transform; }
.story-cover:hover { transform: translate3d(0,-4px,0); box-shadow: 13px 17px 0 rgba(23,22,19,.09); }
.story-cover span { font-size: .65rem; text-transform: uppercase; letter-spacing: .13em; opacity: .8; }
.story-cover strong { margin-top: auto; font: 500 clamp(1.4rem, 2.2vw, 2.2rem)/1.05 var(--serif); position: relative; z-index: 1; }
.story-cover i { position: absolute; width: 170px; height: 170px; right: -65px; top: 22%; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.07), 0 0 0 55px rgba(255,255,255,.04); }
.story-cover > img, .story-cover > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-info { min-width: 0; overflow-wrap: anywhere; }
.story-info > p:first-child { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .1em; }
.story-info h3 { margin: .8rem 0 1rem; font: 500 clamp(1.65rem, 2.4vw, 2.5rem)/1.05 var(--serif); }
.story-info h3 a { text-decoration: none; }
.story-info > p:not(:first-child) { color: var(--muted); font-family: var(--serif); line-height: 1.6; }
.read-link { display: inline-block; margin-top: .8rem; }
.story-actions { margin-top: 1.1rem; display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; }
.like-button { min-height: 34px; padding: .35rem .65rem; display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.035); color: var(--muted); cursor: pointer; }
.like-button [data-like-icon] { color: var(--red); font-size: 1.05rem; line-height: 1; }.like-button [data-like-count] { color: var(--ink); font-weight: 600; }.like-button .like-label { font-size: .68rem; }.like-button.is-liked { border-color: color-mix(in srgb, var(--red) 55%, transparent); background: color-mix(in srgb, var(--red) 12%, transparent); }.like-button:disabled { cursor: wait; opacity: .58; }
.share-links { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }.share-links > span { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; }.share-links button { min-height: 30px; padding: .25rem .5rem; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: .66rem; }.share-links button:hover, .like-button:hover { border-color: var(--red); color: var(--ink); }
.story-header-actions { margin-top: 1.5rem; }.story-header-actions .like-button, .story-header-actions .share-links button { background: rgba(255,255,255,.04); }
.site-toast { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; max-width: min(380px, calc(100% - 2rem)); padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--ink); box-shadow: 0 18px 45px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transform: translate3d(0,12px,0); transition: opacity .25s ease, transform .25s ease; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); font-size: .78rem; }.site-toast.is-visible { opacity: 1; transform: translate3d(0,0,0); }
.empty-state { padding: 4rem; text-align: center; border: 1px dashed var(--line); color: var(--muted); }
.about { padding: clamp(6rem, 11vw, 11rem) clamp(1.25rem, 7vw, 8rem); display: grid; grid-template-columns: .6fr 1fr .65fr; gap: clamp(2.5rem, 6vw, 7rem); align-items: center; }
.about-portrait { aspect-ratio: 4/5; display: grid; place-items: center; background: var(--ink); position: relative; overflow: hidden; }
.about-portrait::before { content: ""; position: absolute; width: 75%; height: 75%; border: 1px solid rgba(255,255,255,.35); border-radius: 50% 50% 43% 57%; transform: rotate(14deg); }
.about-portrait span { color: var(--paper); font: 400 clamp(4rem, 8vw, 8rem)/1 var(--serif); z-index: 1; }
.about-copy > p:not(.eyebrow) { color: var(--muted); font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; }
.about-copy .button { margin-top: 1rem; }
.about-quote { margin: 0; color: var(--red); font: italic 400 clamp(1.8rem, 3vw, 3rem)/1.25 var(--serif); }
.site-footer { min-height: 130px; padding: 2rem clamp(1.25rem, 5vw, 5rem); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.site-footer a { text-decoration: none; }
.reveal { opacity: 0; transform: translate3d(0,18px,0); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); backface-visibility: hidden; }
.reveal.is-visible { opacity: 1; transform: translate3d(0,0,0); }

/* Story reader */
.reading-progress { position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: 3px; }
.reading-progress span { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; }
.reader { padding: 2rem clamp(1.25rem, 7vw, 8rem) 8rem; }
.back-link { display: inline-block; margin: 1rem 0 3rem; color: var(--muted); text-decoration: none; font-size: .82rem; }
.story-header { padding: clamp(3rem, 7vw, 7rem); display: grid; grid-template-columns: 1fr .55fr; align-items: center; gap: 5rem; background: var(--ink); color: var(--paper); }
.story-header h1 { max-width: 850px; margin: 0; font: 500 clamp(3.5rem, 8vw, 8rem)/.92 var(--serif); letter-spacing: -.055em; }
.story-deck { max-width: 600px; color: rgba(255,255,255,.68); font: 400 clamp(1.15rem, 2vw, 1.45rem)/1.5 var(--serif); }
.story-byline { margin-top: 2rem; color: rgba(255,255,255,.5); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.story-byline span { margin: 0 .5rem; }
.reader-cover { aspect-ratio: 1; border-radius: 50%; background: var(--accent); position: relative; box-shadow: 0 0 0 30px rgba(255,255,255,.03), 0 0 80px color-mix(in srgb, var(--accent) 40%, transparent); }
.reader-cover::after { content: ""; position: absolute; width: 135%; height: 40%; left: -18%; top: 30%; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; transform: rotate(-17deg); }
.reader-cover i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: white; }
.reader-cover-image { margin: 0; overflow: hidden; border-radius: 0; background: transparent; box-shadow: 22px 22px 0 rgba(255,255,255,.06); }
.reader-cover-image::after { display: none; }
.reader-cover-image img, .reader-cover-image video { width: 100%; height: 100%; display: block; object-fit: cover; }
.reader-cover i:nth-child(1) { top: 12%; left: 4%; }.reader-cover i:nth-child(2) { bottom: 12%; right: 4%; }.reader-cover i:nth-child(3) { top: 5%; right: 20%; }
.reader-layout { max-width: 970px; margin: 0 auto; display: grid; grid-template-columns: 100px minmax(0, 680px); gap: 4rem; padding-top: 6rem; }
.reader-tools { position: sticky; top: 2rem; align-self: start; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.reader-tools > span { grid-column: 1/-1; margin-bottom: .3rem; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }
.reader-tools button { min-height: 40px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.reader-tools button:hover { background: var(--ink); color: var(--paper); }
.story-body { font: 400 var(--reader-size)/1.9 var(--serif); }
.story-body p { margin: 0 0 1.5em; }
.story-body .opening::first-letter { float: left; margin: .08em .1em 0 0; color: var(--red); font-size: 4.5em; line-height: .78; }
.content-notice { margin: 0 0 3rem; padding: 1rem 1.2rem; display: grid; gap: .35rem; border-left: 3px solid var(--red); background: rgba(255,255,255,.055); font: .78rem/1.5 var(--sans); }
.content-notice span { color: var(--muted); }
.chapter-contents { margin: 0 0 4rem; padding: 1.4rem 1.6rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); font-family: var(--sans); }
.chapter-contents > span { color: var(--red); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.chapter-contents ol { margin: 1rem 0 0; padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
.chapter-contents li { margin: 0 0 .5rem; color: var(--muted); font-size: .78rem; break-inside: avoid; }
.chapter-contents a { color: var(--ink); text-underline-offset: .2em; }
.story-chapter { scroll-margin-top: 2rem; }
.story-chapter + .story-chapter { margin-top: 6rem; padding-top: 5rem; border-top: 1px solid var(--line); }
.story-chapter h2 { margin: 0 0 2.5rem; font: 500 clamp(2.3rem, 5vw, 4.5rem)/1.05 var(--serif); letter-spacing: -.04em; }
.chapter-label { margin: 0 0 .7rem !important; color: var(--red); font: 600 .66rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.chapter-next { display: inline-block; margin-top: 2.5rem; padding-bottom: .25rem; border-bottom: 1px solid currentColor; color: var(--muted); font: 600 .76rem/1.4 var(--sans); text-decoration: none; }
.story-illustration { margin: 3.25rem -4rem; }
.story-illustration img, .story-illustration video { width: 100%; max-height: 780px; display: block; object-fit: contain; }
.story-illustration figcaption { margin-top: .8rem; color: var(--muted); font: .72rem/1.5 var(--sans); text-align: center; }
.story-illustration-image::before, .story-illustration-image::after { display: none; content: none; }
.story-end { margin: 4rem 0; color: var(--red); text-align: center; }
.author-note { padding: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85em; }
.author-note .eyebrow { margin-bottom: .7rem; font-family: var(--sans); font-size: .65rem; }
.author-note p { margin: 0; }
.next-story { max-width: 970px; margin: 7rem auto 0; padding: 2rem 2.5rem; display: grid; grid-template-columns: .5fr 1.2fr .8fr; align-items: center; gap: 2rem; background: var(--accent); color: white; text-decoration: none; }
.next-story > span { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; }
.next-story strong { font: 500 2rem/1.1 var(--serif); }
.next-story span:last-child { text-align: right; opacity: .8; }.next-story b { margin-left: .5rem; font-size: 1.4rem; }
.not-found { min-height: 70vh; padding: 12vh 8vw; text-align: center; }
.not-found h1 { margin: .5rem 0; font: 500 clamp(3rem, 8vw, 7rem)/1 var(--serif); }
.not-found > p:not(.eyebrow) { max-width: 550px; margin: 2rem auto; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; }

/* Private author dashboard */
.admin-shell { width: min(1180px, calc(100% - 2.5rem)); min-height: 70vh; margin: 0 auto; padding: clamp(4rem, 8vw, 7rem) 0; }
.admin-login { width: min(560px, calc(100% - 2.5rem)); }
.admin-shell h1 { margin: 0; font: 500 clamp(3rem, 7vw, 6rem)/.95 var(--serif); letter-spacing: -.05em; }
.admin-shell h2 { margin: 0 0 1.5rem; font: 500 clamp(1.8rem, 3vw, 2.7rem)/1 var(--serif); }
.admin-heading { margin-bottom: 3rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.admin-heading > div > p:last-child { color: var(--muted); }
.admin-panel { margin-top: 2rem; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 80%, white); }
.admin-form { margin-top: 2rem; display: grid; gap: 1.25rem; }
.admin-form label, .admin-upload-grid label { display: grid; gap: .5rem; color: var(--muted); font-size: .76rem; font-weight: 600; }
.admin-form label small { color: var(--muted); font-weight: 400; }
.admin-form input, .admin-upload-grid input, .admin-upload-grid select { width: 100%; min-height: 46px; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); }
.admin-form .button, .admin-upload-grid .button { width: fit-content; border: 0; cursor: pointer; }
.admin-form .button:disabled { cursor: not-allowed; opacity: .45; }
.admin-notice, .admin-error, .admin-success { margin: 1.5rem 0; padding: 1rem 1.2rem; border-left: 3px solid var(--red); background: var(--cream); line-height: 1.5; }
.admin-notice p { margin: .4rem 0 0; color: var(--muted); }.admin-notice code { font-size: .85em; }
.admin-error { color: #8a271d; }.admin-success { border-left-color: #3c7068; }
.admin-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; align-items: end; }
.admin-panel-heading { margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-panel-heading h2 { margin: 0; }
.admin-story-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; align-items: end; }
.admin-story-form label { display: grid; gap: .5rem; color: var(--muted); font-size: .76rem; font-weight: 600; }
.admin-story-form input, .admin-story-form select, .admin-story-form textarea { width: 100%; min-height: 46px; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 7px; background: rgba(6,5,13,.56); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); resize: vertical; }
.admin-story-form input[type="color"] { padding: .35rem; cursor: pointer; }
.admin-story-form label small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.admin-story-form .admin-full { grid-column: 1/-1; }
.admin-story-form .admin-check { grid-column: 1/-1; display: flex; align-items: center; gap: .65rem; }
.admin-story-form .admin-check input { width: 18px; min-height: 18px; accent-color: var(--red); }
.admin-chapter-editor { display: grid; gap: 1rem; }
.admin-chapter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.admin-chapter-heading > div { display: grid; gap: .4rem; }.admin-chapter-heading strong { color: var(--ink); font-family: var(--serif); font-size: 1.25rem; }
#chapter-list { display: grid; gap: 1rem; }
.admin-chapter { padding: 1.25rem; display: grid; gap: 1rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.admin-chapter-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-chapter-bar strong { color: var(--ink); font-family: var(--serif); }
.admin-chapter-bar button { padding: 0 0 .2rem; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--red); cursor: pointer; font-size: .72rem; }
.admin-chapter-bar button:disabled { opacity: .35; cursor: not-allowed; }
.admin-story-list { display: grid; gap: .75rem; }
.admin-story-row { padding: 1rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.035); }
.admin-story-row > div:first-child { min-width: 0; display: grid; gap: .28rem; }
.admin-story-row span, .admin-story-row small { color: var(--muted); font-size: .7rem; }.admin-story-row strong { font-family: var(--serif); font-size: 1.15rem; }
.admin-row-actions { display: flex; align-items: center; gap: .8rem; }.admin-row-actions .button { padding: .6rem .85rem; }
.admin-row-actions form { margin: 0; }.admin-delete { padding: .6rem 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--red); cursor: pointer; font-size: .75rem; }
.admin-upload-grid .admin-file, .admin-upload-grid .button { grid-column: 1/-1; }
.admin-upload-grid input[type="file"] { padding: .58rem; }
.admin-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.5rem; }
.admin-media { min-width: 0; border: 1px solid var(--line); background: var(--paper); }
.admin-media > img, .admin-media > video { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; background: var(--cream); }
.admin-media > div { padding: 1rem; display: grid; gap: .3rem; }
.admin-media strong { font-family: var(--serif); }.admin-media span { color: var(--muted); font-size: .73rem; }
.admin-media form { margin-top: .5rem; }.admin-media button { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--red); cursor: pointer; font-size: .73rem; }
.admin-empty { grid-column: 1/-1; color: var(--muted); }

@media (max-width: 900px) {
  .popular-strip { grid-template-columns: 1fr; gap: .8rem; }.popular-heading { display: flex; align-items: baseline; gap: .75rem; }.popular-heading .eyebrow { margin: 0; }.popular-list { overflow-x: auto; grid-template-columns: repeat(3, minmax(260px, 1fr)); padding-bottom: .35rem; scroll-snap-type: x proximity; }.popular-list li { scroll-snap-align: start; }
  .hero { grid-template-columns: 1fr; }.featured-card { width: min(100%, 520px); justify-self: center; }
  .story-grid { grid-template-columns: 1fr; }.about { grid-template-columns: .7fr 1fr; }.about-quote { grid-column: 1/-1; text-align: center; }
  .story-header { grid-template-columns: 1fr; }.reader-cover { width: min(65vw, 320px); justify-self: center; }
  .admin-media-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .site-header { height: 72px; }.site-header nav { gap: .65rem; }.site-header nav a { display: none; }.wordmark { font-size: 1.05rem; }
  .hero { padding-top: 5rem; }.hero h1 { font-size: clamp(3.4rem, 17vw, 5.3rem); }.hero-actions { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
  .featured-card { min-height: 0; box-shadow: 15px 15px 0 var(--cream); }.featured-card .cover-art-image { width: auto; height: 220px; min-height: 220px; flex: 0 0 220px; }
  .section-heading { align-items: flex-start; flex-direction: column; }.search-box { width: 100%; }
  .story-card { grid-template-columns: 105px minmax(0,1fr); gap: 1rem; align-items: start; }.story-cover { width: 105px; min-height: 0; padding: .8rem; align-self: start; }.story-cover strong { font-size: 1.2rem; }
  .story-info h3 { font-size: 1.65rem; }.story-info > p:not(:first-child) { display: none; }
  .story-actions { grid-column: 1/-1; align-items: flex-start; flex-direction: column; }.share-links { gap: .3rem; }.share-links > span { width: 100%; }
  .about { grid-template-columns: 1fr; }.about-portrait { width: min(80%, 330px); }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: .8rem; }
  .reader { padding-inline: 0; }.back-link { margin-left: 1.25rem; }.story-header { padding: 3.5rem 1.5rem; overflow: hidden; }.story-header > div { min-width: 0; }.story-header h1 { font-size: clamp(2.8rem, 15vw, 3.6rem); overflow-wrap: anywhere; }.reader-cover-image { width: min(100%, 300px); aspect-ratio: 1; }.reader-cover-image video { position: absolute; inset: 0; }
  .reader-layout { display: block; padding: 3.5rem 1.35rem 0; }.reader-tools { position: static; display: flex; align-items: center; margin-bottom: 2.5rem; }.reader-tools > span { margin: 0 auto 0 0; }.reader-tools button { min-width: 42px; }
  .story-illustration { margin-inline: -1.35rem; }
  .chapter-contents ol { columns: 1; }.story-chapter + .story-chapter { margin-top: 4rem; padding-top: 3.5rem; }
  .next-story { margin: 5rem 1.25rem 0; grid-template-columns: 1fr; }.next-story span:last-child { text-align: left; }
  .admin-heading { flex-direction: column; }.admin-upload-grid, .admin-media-grid { grid-template-columns: 1fr; }.admin-upload-grid .admin-file, .admin-upload-grid .button { grid-column: auto; }
  .admin-story-form { grid-template-columns: 1fr; }.admin-story-form .admin-full, .admin-story-form .admin-check { grid-column: auto; }.admin-story-row { align-items: flex-start; flex-direction: column; }.admin-panel-heading, .admin-chapter-heading { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* Dark glass fantasy theme */
:root {
  --ink: #f5f0ff;
  --paper: #080710;
  --cream: #171222;
  --muted: #b8aecb;
  --line: rgba(229, 215, 255, .17);
  --red: #ff84b5;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 10%, rgba(112,68,190,.23), transparent 31%),
    radial-gradient(circle at 12% 47%, rgba(219,70,145,.12), transparent 28%),
    linear-gradient(145deg, #0b0915 0%, #080710 48%, #100b1b 100%);
  background-attachment: fixed;
}
.site-header {
  position: relative;
  z-index: 10;
  background: rgba(12,9,22,.58);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
}
.wordmark-mark {
  background: linear-gradient(135deg, #ff84b5, #8763d6);
  color: #fff9ff;
  box-shadow: 0 0 26px rgba(168,104,236,.34);
}
.nav-contact, .filter, .reader-tools button, .admin-signout {
  background: rgba(255,255,255,.035);
}
.hero { background: linear-gradient(110deg, rgba(11,8,21,.35), rgba(22,14,36,.13)); }
.hero::before { border-color: rgba(210,183,255,.2); box-shadow: 0 0 0 60px rgba(171,112,255,.035), 0 0 0 120px rgba(255,119,183,.025), 0 0 90px rgba(143,84,227,.16); }
.hero h1 { text-shadow: 0 0 45px rgba(207,183,255,.08); }
.button-primary {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: linear-gradient(135deg, #ff84b5, #8763d6);
  color: #fff9ff;
  box-shadow: 0 12px 32px rgba(96,52,166,.24);
}
.button-outline { border-color: var(--line); border-radius: 7px; background: rgba(255,255,255,.035); }
.featured-card {
  border: 1px solid rgba(233,218,255,.25);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.025)), linear-gradient(145deg, #51328a, #18102d);
  box-shadow: 0 28px 65px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.13), 0 0 48px rgba(124,72,205,.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--ink);
}
.featured-card:hover { box-shadow: 0 34px 75px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.15), 0 0 60px rgba(124,72,205,.2); }
.library {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18,14,30,.5), rgba(9,7,16,.73));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.filter:hover, .filter.is-active { background: rgba(232,218,255,.92); border-color: rgba(232,218,255,.92); color: #120e1d; box-shadow: 0 0 22px rgba(150,98,227,.18); }
.story-card { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, rgba(255,255,255,.072), rgba(255,255,255,.016)); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 16px 38px rgba(0,0,0,.16); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.story-cover { border-radius: 7px; box-shadow: 0 13px 28px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.13); }
.about-portrait { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(255,132,181,.65), rgba(83,48,140,.85)); box-shadow: 0 26px 55px rgba(0,0,0,.32); }
.story-header { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.018)); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 28px 60px rgba(0,0,0,.24); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.reader-cover-image { border-radius: 10px; box-shadow: 22px 22px 0 rgba(150,98,227,.11), 0 24px 54px rgba(0,0,0,.35); }
.next-story { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 72%, #171222), rgba(26,19,42,.92)); box-shadow: 0 22px 48px rgba(0,0,0,.3); }
.admin-panel { border-color: var(--line); border-radius: 14px; background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.018)); box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 24px 54px rgba(0,0,0,.2); backdrop-filter: blur(24px) saturate(135%); -webkit-backdrop-filter: blur(24px) saturate(135%); }
.admin-form input, .admin-upload-grid input, .admin-upload-grid select { border-color: var(--line); border-radius: 7px; background: rgba(6,5,13,.56); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.admin-notice, .admin-error, .admin-success { border-radius: 7px; background: rgba(255,255,255,.055); }
.admin-success { background: rgba(68,160,143,.12); color: #d8fff8; }
.admin-media { border-color: var(--line); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.038); box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }

/* Light glass fantasy theme */
html[data-theme="light"] {
  color-scheme: light;
  --ink: #241b2d;
  --paper: #faf7fc;
  --cream: #eee6f3;
  --muted: #6f6378;
  --line: rgba(54, 35, 69, .17);
  --red: #a93670;
}
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 82% 10%, rgba(151,104,214,.16), transparent 31%),
    radial-gradient(circle at 12% 47%, rgba(224,102,162,.12), transparent 28%),
    linear-gradient(145deg, #fffafd 0%, #f8f3fc 48%, #f1e9f7 100%);
  background-attachment: fixed;
}
html[data-theme="light"] .site-header { background: rgba(255,250,253,.72); }
html[data-theme="light"] .popular-strip { background: rgba(255,250,253,.58); }
html[data-theme="light"] .nav-contact,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .filter,
html[data-theme="light"] .reader-tools button,
html[data-theme="light"] .button-outline { background: rgba(255,255,255,.52); }
html[data-theme="light"] .theme-toggle:hover { background: rgba(116,76,146,.1); }
html[data-theme="light"] .hero { background: linear-gradient(110deg, rgba(255,255,255,.24), rgba(228,210,241,.2)); }
html[data-theme="light"] .hero::before { border-color: rgba(102,69,128,.17); box-shadow: 0 0 0 60px rgba(151,104,214,.035), 0 0 0 120px rgba(224,102,162,.025); }
html[data-theme="light"] .featured-card { color: #fff9ff; }
html[data-theme="light"] .library { background: linear-gradient(180deg, rgba(255,255,255,.58), rgba(244,237,248,.76)); }
html[data-theme="light"] .filter:hover,
html[data-theme="light"] .filter.is-active { background: #382747; border-color: #382747; color: #fffaff; }
html[data-theme="light"] .story-card,
html[data-theme="light"] .story-header,
html[data-theme="light"] .admin-panel,
html[data-theme="light"] .popular-list li { background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,.38)); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 20px 44px rgba(70,45,88,.1); }
html[data-theme="light"] .story-deck,
html[data-theme="light"] .story-byline { color: var(--muted); }
html[data-theme="light"] .reader-cover-image { box-shadow: 22px 22px 0 rgba(116,76,146,.09), 0 24px 54px rgba(70,45,88,.13); }
html[data-theme="light"] .content-notice,
html[data-theme="light"] .chapter-contents,
html[data-theme="light"] .admin-chapter,
html[data-theme="light"] .admin-story-row { background: rgba(255,255,255,.54); }
html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-upload-grid input,
html[data-theme="light"] .admin-upload-grid select,
html[data-theme="light"] .admin-story-form input,
html[data-theme="light"] .admin-story-form select,
html[data-theme="light"] .admin-story-form textarea { background: rgba(255,255,255,.72); color: var(--ink); }
html[data-theme="light"] .admin-notice,
html[data-theme="light"] .admin-error,
html[data-theme="light"] .admin-success,
html[data-theme="light"] .admin-media { background: rgba(255,255,255,.62); }
html[data-theme="light"] .admin-success { color: #245f54; }
