
@font-face { font-family: Inter; src: url('/public/fonts/inter-cyrillic-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Inter; src: url('/public/fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap;  }
@font-face {
  font-family: Inter;
  src: url('/public/fonts/inter-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  src: url('/public/fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+20A0-20CF,U+2212,U+2215;
}
@font-face {
  font-family: Inter;
  src: url('/public/fonts/inter-cyrillic-600-normal.woff2') format('woff2');
  font-weight: 600; font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  src: url('/public/fonts/inter-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+20A0-20CF,U+2212,U+2215;
}
@font-face {
  font-family: Inter;
  src: url('/public/fonts/inter-cyrillic-700-normal.woff2') format('woff2');
  font-weight: 700; font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  src: url('/public/fonts/inter-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+20A0-20CF,U+2212,U+2215;
}
@font-face {
  font-family: Literata;
  src: url('/public/fonts/literata-cyrillic-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Literata;
  src: url('/public/fonts/literata-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+20A0-20CF,U+2212,U+2215;
}
@font-face {
  font-family: Literata;
  src: url('/content/fonts/literata-cyrillic-400-normal.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Literata;
  src: url('/content/fonts/literata-latin-400-normal.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+20A0-20CF,U+2212,U+2215;
}
:root {
  --panel: var(--surface);
  --field: var(--surface);
  --hover: var(--surface-hover);
  --line: var(--border);
  --control: var(--border-strong);
  --muted: var(--text-2);
  --accent-text: color-mix(in srgb, var(--accent) 67%, var(--text));
  --accent-panel: var(--accent-soft);
  --danger-panel: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --art-text: #fff;
  --radius: var(--r-lg);
  --pill: var(--r-pill);
  --gutter: clamp(16px, 5vw, 72px);
  --motion: var(--dur) var(--ease);
  --sans: var(--font);
  --serif: var(--font-read);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  isolation: isolate;
  background: var(--bg-glow), var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
}
h1, h2, h3, p, figure, blockquote { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
h1 { font-size: clamp(34px, 5vw, 62px); }
h1, h2 { font-weight: 500; letter-spacing: -.04em; }
h1 em, h2 em { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
a { color: inherit; text-underline-offset: .24em; }
a:hover { color: var(--accent-text); }
img { display: block; max-width: 100%; }
input, select, button { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 51; inset: 12px auto auto 12px; background: var(--field); padding: 12px; }
.wrap { width: min(100%, 1440px); margin-inline: auto; padding-inline: var(--gutter); }
body > main { padding-top: 88px; }
body { min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1; }
:where(main [id]) { scroll-margin-top: 92px; }
.category-links a, .pagination a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px;
  padding: 6px 14px; border: 1px solid transparent; border-radius: var(--pill);
  text-align: center; text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.35;
  transition: background var(--motion), transform var(--motion), border-color var(--motion);
}
.category-links a, .pagination a { background: var(--panel); border-color: var(--line); }
.category-links a:hover, .pagination a:hover { background: var(--hover); }
:where(button, .button, .app-link):active { transform: scale(.98); }
.lead { color: var(--muted); font-size: clamp(16px, 2vw, 18px); max-width: 58ch; overflow-wrap: anywhere; }
.text-action { color: var(--accent-text); font-size: 15px; font-weight: 600; }
.section { padding-block: clamp(28px, 5vw, 64px); border-block-start: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
.notice, .empty { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.story-line { font-size: 15px; overflow-wrap: anywhere; }
.document { min-height: 65vh; padding-block: clamp(28px, 5vw, 60px) clamp(48px, 7vw, 88px); }
.simple .lead { margin-block: 12px 20px; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(34px, 5vw, 62px); max-width: 30ch; }
.page-heading .lead { margin-block: 10px 16px; }
.crumbs { margin-bottom: 20px; color: var(--muted); font-size: 14px; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: 4px 8px; }
.crumbs li + li::before { content: '/'; margin-right: 8px; }
.crumbs li { overflow-wrap: anywhere; }
.category-links, .pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-block: 20px 12px; color: var(--muted); font-size: 14px; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cover-link { display: block; height: 100%; border-radius: var(--radius); }
.cover { position: relative; display: grid; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: radial-gradient(120% 90% at 30% 20%, #4b3c31, #232220 60%); color: var(--art-text); border-radius: var(--radius); }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: 63% 38%; transition: transform var(--motion); }
.cover-link:hover img { transform: scale(1.04); }
.cover-type { align-self: center; margin: 16px; font-size: 24px; font-weight: 600; text-align: center; overflow-wrap: anywhere; text-wrap: balance; }
.rating { background: var(--surface); color: var(--text); border: 1px solid var(--border); backdrop-filter: none; }
.rating[data-rating='16'] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.rating[data-rating='18'] { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.cover .rating { position: absolute; inset: 10px 10px auto auto; z-index: 1; }
.catalog-item { position: relative; min-width: 0; min-height: 255px; border-radius: var(--radius); }
.catalog-item .cover { position: absolute; inset: 0; height: 100%; }
.catalog-item .cover-type { visibility: hidden; }
.catalog-item h2 { font-size: 18px; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.notice, .empty { padding: 16px; margin-block: 16px; }
.empty p { color: var(--muted); margin-block: 6px 12px; }
.pagination { align-items: center; color: var(--muted); font-size: 14px; }
.age-note { margin-top: 14px; color: var(--muted); font-size: 14px; }

.prose { padding-block: 20px; max-width: 68ch; }
.prose p { white-space: pre-line; overflow-wrap: anywhere; }

.choice-list { list-style: none; display: grid; gap: 8px; padding: 0; margin: 12px 0; counter-reset: choice; }
.chapter-nav, .publication-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block: 12px; color: var(--muted); font-size: 14px; }
.publication-actions [role='status'] { flex-basis: 100%; }
.age-confirm { min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--accent-text); font-size: 14px; text-decoration: underline; text-underline-offset: .23em; }

@media (min-width: 640px) {
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story-layout { grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); }
}
@media (min-width: 980px) {
  .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.catalog-grid { gap: var(--s5); }
.catalog-item > .story { min-height: 0; }
.catalog-item .cover-link:focus-visible { outline-offset: -4px; }
.catalog-item .story-top, .catalog-item .story-body { pointer-events: none; }
.catalog-item .story-top { gap: 4px; }
.catalog-item .story-body h2 { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em; }
.catalog-item .story-body span {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.catalog-stats { display: flex; align-items: flex-start; gap: 4px; }
.cover .badge, .story-top > .badge { white-space: nowrap; }
.story-buttons .btn, .chapter-end .btn { white-space: normal; }
.chapter-end > .btn { margin-block-start: 6px; }
.chapter-end .choice { text-decoration: none; }
.chapter-end .choice:hover { color: var(--text); }
@media (min-width: 640px) {
  .catalog-grid { gap: var(--s5); }
}
@media (max-width: 640px) {
  /* 14 fandom chips wrapped into seven rows pushed the first story below the second screen. */
  .category-links { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain; }
  .category-links::-webkit-scrollbar { display: none; }
  .category-links a { flex: none; white-space: nowrap; min-height: 40px; }
  .prose { font-size: 18px; }
  .btn { height: auto; white-space: normal; line-height: 1.25; padding-block: 6px; max-width: 100%; }
  .catalog-grid { gap: 10px; }
  .catalog-item > .story { min-height: 228px; }
  .catalog-item .story-top, .catalog-item .story-body { inset-inline: 8px; }
  .catalog-item .story-top { flex-wrap: wrap; }
  .catalog-item .story-body span { -webkit-line-clamp: 1; }
}

/* A viewport backdrop behind the reader and the navigation. */
.ambient {
  position: fixed; inset: 0; z-index: -1; overflow: clip; pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 5%, #000 0%, rgba(0,0,0,.72) 34%, transparent 80%);
}
.ambient-art {
  position: absolute; inset: -72px; width: calc(100% + 144px); height: calc(100% + 144px);
  max-width: none; object-fit: cover; object-position: center 30%;
  filter: blur(52px); opacity: .32;
}
.catalog-item .cover-link { position: relative; display: block; height: auto; color: inherit; text-decoration: none; }
.catalog-item .cover-link::after { pointer-events: none; }
.catalog-item .cover-link img { transition-duration: var(--dur); }
.catalog-item .cover-link:active { transform: scale(.98); }
.chapter { max-width: 760px; }
.actionbar { position: relative; margin-top: 28px; padding: 16px; border-radius: var(--r-xl); box-shadow: var(--shadow-pop); }
.actionbar .ttl { margin: 2px 4px 12px; font: 600 var(--t-md)/1.25 var(--font); }
.help-document .help { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 32px; }
.help-nav { display: grid; gap: 2px; align-content: start; }
.help-nav a { min-height: 40px; display: flex; align-items: center; padding: 6px 12px; border-radius: 12px; color: var(--text-2); font: 500 var(--t-md)/1.25 var(--font); text-decoration: none; }
.help-nav a:hover { background: var(--surface-2); color: var(--text); }
.help-nav .grp { margin: 14px 12px 6px; font: 600 13px/1 var(--font); color: var(--text-3); }
.help-nav { align-self: start; }
.help-articles article + article { margin-top: 28px; }
.help-articles h3 { margin-top: 14px; }
.help-articles p { margin-top: 8px; }
html[data-theme=light] :is(.notice,.empty,.chapter-end,.faq-nav,.scene-image) { box-shadow: var(--shadow); }
html[data-theme=light] .catalog-item .story { box-shadow: var(--light-card-shadow); }
html[data-theme=light] .ambient-art { opacity: .22; }
html[data-theme=light] .help-nav .grp { color: #756D5F; }
html[data-theme=light] :is(.step .n,.choice .num) { color: #8C5E27; }
.steps3 { display: grid; gap: 16px; margin: 20px 0 28px; padding: 0; list-style: none; }
.faq { margin-top: 24px; }
.faq details { border-top: 1px solid var(--border); padding: 16px 4px; }
.faq summary { cursor: pointer; font: 600 var(--t-base)/1.4 var(--font); list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 20px; }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--text-2); margin: 10px 0 0; font-size: var(--t-md); }
@media (max-width: 760px) {
  .help-document .help { display: block; }
  .help-nav { margin-bottom: 24px; }
}
@media (max-width: 640px) {
}

.site-footer { border-top: 1px solid var(--border); }
.crumbs a, .story-meta a { text-decoration: none; }
.crumbs a:hover, .story-meta a:hover { color: var(--text); }
.story-layout { display: grid; align-items: start; gap: clamp(20px, 4vw, 56px); }
.story-cover { width: min(100%, 320px); }
.story-cover .cover { box-shadow: var(--shadow-pop); }
.story-info { min-width: 0; }
.story-info h1 { margin: 8px 0 16px; font-size: clamp(40px, 4.6vw, 64px); line-height: 1.02; }
.story-meta, .story-author, .story-buttons, .story-reactions, .chapter-nav, .publication-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
}
.story-meta, .story-reactions { color: var(--text-2); font-size: var(--t-sm); }
.story-author { margin-bottom: 16px; font-weight: 600; }
.story-author .avatar { width: 32px; height: 32px; box-shadow: none; }
.story-buttons { margin-block: 20px 12px; }
.story-reactions .stat { display: inline-flex; align-items: center; gap: 6px; }
.publication-actions { margin: 0; }
.publication-actions [role='status']:empty, [data-dialog-error]:empty { display: none; }
.publication-actions [role='status']:not(:empty) { width: 100%; font-size: var(--t-sm); }
.like-button[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent); }
.like-button[aria-pressed="true"] svg { fill: currentColor; }
.story-menu { position: relative; }
.story-menu .popover { position: absolute; inset: calc(100% + 8px) auto auto 0; z-index: 5; }
.story-menu .opt { text-decoration: none; }
.chapter-list { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; }
.chapter-list ol { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chapter-card { min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px; text-decoration: none; }
.chapter-card:is(:hover, [data-current]) { border-color: var(--accent); color: var(--text); }
.chapter-number { min-width: 24px; justify-content: center; padding-inline: 6px; }
.chapter-card-title { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
.chapter-card-meta { display: flex; flex-wrap: wrap; gap: 0 12px; color: var(--text-2); font-size: var(--t-sm); }
.chapter-progress:not([hidden]) { display: inline-flex; }
.chapter-progress[hidden] { display: none; }
.related { margin-top: clamp(32px, 5vw, 72px); }
.related h2 { margin-bottom: 16px; }
.related .story-body h2 { margin-bottom: 0; }
.chapter .meta { margin: 16px 0 4px; align-items: center; }
.chapter-plain h1 { margin-top: 8px; }
.chapter-plain .eyebrow2 { color: var(--text-2); font-size: var(--t-sm); }
.chapter-nav { margin-block: 0 24px; }
.chapter-end { margin: 0 0 20px; box-shadow: var(--shadow); }
.report-reasons { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.report-reasons legend { padding: 0; margin-bottom: 8px; }
.report-reasons .chip, .filters .opt { position: relative; }
.report-reasons input, .filters .opt input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.report-reasons .chip:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-dialog-error] { color: var(--danger); margin-top: 10px; }
.search-field { position: relative; display: flex; align-items: center; flex: 0 1 275px; min-width: min(100%, 220px); }
.search-field > svg { position: absolute; left: 12px; color: var(--text-2); pointer-events: none; }
.search-field .input { height: 44px; min-width: 0; padding-inline-start: 36px; border-radius: var(--r-pill); }
.search-field .input::placeholder { color: var(--text-2); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; }
.filter-menu { min-width: 0; position: relative; }
.filter-menu summary { min-height: 44px; }
.filter-menu summary svg { flex: none; }
.filter-menu .popover { position: absolute; inset: calc(100% + 8px) auto auto 0; z-index: 5; max-height: min(320px, 50dvh); overflow: auto; }
.filter-menu .check { flex: none; visibility: hidden; }
.filter-menu .opt:has(:checked) .check { visibility: visible; }
.catalog-empty { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 24px; align-items: center; }
.catalog-empty img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-md); }
@media (max-width: 640px) {
  .story-cover { width: min(68%, 240px); }
  .story-menu .popover { inset-inline: auto 0; }
  .search-field { flex-basis: 100%; }
  .filter-menu .popover { inset: calc(100% + 4px) auto auto 0; max-width: calc(100vw - 2 * var(--gutter)); }
  .catalog-empty { grid-template-columns: 1fr; }
  .chapter-nav .btn { min-height: 48px; padding-inline: 12px; }
}
