:root {
  --paper: #f7f8f5;
  --white: #ffffff;
  --ink: #11252b;
  --muted: #5d7074;
  --line: #dfe6e2;
  --dark: #102b34;
  --teal: #286f70;
  --sun: #f9ce6c;
  --radius: 16px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid #e6a72e; outline-offset: 4px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.skip-link { position: absolute; left: 12px; top: -90px; padding: 12px; z-index: 30; background: white; }
.skip-link:focus { top: 12px; }

/* Site header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 86px; gap: 28px; }
.site-brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-symbol { display: grid; place-items: center; color: var(--white); font-size: 29px; line-height: 1; background: var(--dark); border-radius: 12px; width: 44px; height: 44px; }
.brand-words { display: flex; flex-direction: column; }
.brand-words strong { font-size: 22px; font-weight: 800; letter-spacing: -1.1px; line-height: 1.14; }
.brand-words small { color: var(--muted); font-size: 9px; letter-spacing: 2px; margin-top: 5px; font-weight: 800; }
.header-nav { display: flex; gap: clamp(17px, 3vw, 38px); align-items: center; }
.header-nav a { color: #40545a; font-size: 13px; font-weight: 700; }
.header-nav a:hover { color: #147a80; }

/* Introduction */
.intro { padding: clamp(46px, 6vw, 82px) 0 44px; max-width: 850px; }
.section-label { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.label-dot { height: 8px; width: 8px; border-radius: 50%; background: #e2a641; }
.intro h1 { font-size: clamp(42px, 6vw, 78px); line-height: 1.045; letter-spacing: -0.065em; margin: 20px 0 20px; font-weight: 850; }
.intro h1 em { font-style: normal; color: #327d7c; }
.intro > p { max-width: 610px; color: var(--muted); font-size: clamp(16px, 1.55vw, 19px); line-height: 1.68; margin: 0; }

/* Featured story */
.featured { display: grid; grid-template-columns: 1.07fr 0.93fr; background: var(--dark); border-radius: 20px; overflow: hidden; min-height: 485px; box-shadow: 0 22px 60px -45px #17343b70; }
.featured-copy { padding: clamp(30px, 5vw, 67px); color: var(--white); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.light-label { background: #ffffff15; border: 1px solid #ffffff2d; padding: 9px 12px; border-radius: 50px; color: var(--sun); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; }
.featured-topic { margin: 38px 0 10px; color: #8dd3c6; font-size: 12px; font-weight: 750; letter-spacing: 0.7px; }
.featured h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.08; margin: 0; letter-spacing: -0.055em; max-width: 520px; }
.featured-copy > p:not(.featured-topic) { color: #bfd2d4; font-size: 16px; line-height: 1.65; max-width: 410px; margin: 19px 0 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 47px; padding: 12px 18px; border-radius: 8px; font-weight: 780; font-size: 13px; transition: transform 0.15s ease, background 0.15s ease; }
.button:hover { transform: translateY(-2px); }
.button-light { color: #13303a; background: var(--sun); }
.button-light:hover { background: #ffe09a; }
.button-dark { background: var(--dark); color: white; }
.featured-footnote { display: block; color: #b0c5c8; font-size: 11px; margin-top: 20px; }
.featured-art { display: flex; justify-content: center; align-items: center; padding: 28px 34px 28px 12px; background: radial-gradient(ellipse at center, #2e5360 0%, #163c47 58%, #102b34 88%); }
.featured-art .artwork { width: min(100%, 360px); max-height: 470px; box-shadow: 0 20px 50px #04151e80; transform: rotate(2deg); }
.featured-art:hover .artwork { transform: rotate(0deg) translateY(-4px); }

/* Artwork: placeholders are visible until real pictures are added. */
.artwork { width: 100%; aspect-ratio: 4 / 5; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 9px; transition: transform .2s ease; }
.artwork img { width: 100%; height: 100%; object-fit: contain; }
.artwork--green { background: radial-gradient(circle at 28% 23%, #bfe4b1, transparent 35%), linear-gradient(135deg, #224d55, #69a783 65%, #d7d49a); }
.artwork--violet { background: radial-gradient(circle at 74% 29%, #eeaf68, transparent 27%), linear-gradient(135deg, #101b48, #4c4c9e 58%, #bd7e9b); }
.artwork--blue { background: radial-gradient(circle at 20% 80%, #bbd4ef, transparent 40%), linear-gradient(130deg, #103f62, #1d91ad 62%, #8de1df); }
.artwork--coral { background: radial-gradient(circle at 75% 25%, #ffd2a4, transparent 40%), linear-gradient(135deg, #523657, #bc667e 64%, #e8b583); }
.artwork-symbol { font-size: clamp(76px, 10vw, 145px); filter: drop-shadow(0 18px 26px #1b243440); transform: rotate(-9deg); }
.artwork-placeholder { position: absolute; left: 15px; right: 15px; bottom: 16px; border-radius: 8px; padding: 11px 8px; text-align: center; background: #071721b3; color: #fff; font-weight: 750; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }

/* Story archive */
.stories { padding: 76px 0 80px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 29px; }
.section-heading h2 { font-size: clamp(31px, 3.6vw, 43px); letter-spacing: -0.055em; margin: 10px 0 0; }
.section-heading > p { color: var(--muted); max-width: 300px; line-height: 1.6; font-size: 13px; margin: 0 0 5px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 27px; scroll-margin-top: 24px; }
.filter { padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 30px; color: #4e6367; font-size: 12px; font-weight: 750; }
.filter span { opacity: .75; padding-left: 5px; }
.filter:hover { border-color: #7a9b98; }
.filter.is-active { color: #fff; background: var(--dark); border-color: var(--dark); }
.story-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.story-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 13px; background: #fff; overflow: hidden; box-shadow: 0 8px 25px -26px #082b30; }
.card-art-link { display: block; padding: 12px 12px 0; }
.card-art-link:hover .artwork { transform: translateY(-2px); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 19px 16px 17px; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .25px; }
.story-card h3 { font-size: 20px; line-height: 1.18; letter-spacing: -.035em; margin: 10px 0 10px; }
.story-card h3 a:hover { color: #167c85; }
.story-card p { margin: 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.card-bottom { border-top: 1px solid #edf0ed; padding-top: 15px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 10px; color: var(--muted); }
.card-bottom a { color: var(--teal); font-weight: 800; white-space: nowrap; }
.card-bottom a:hover { text-decoration: underline; }
.empty-state { color: var(--muted); }

.future-note { border-top: 1px solid var(--line); padding: 42px 0 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 35px; }
.future-note h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.045em; margin: 10px 0 0; max-width: 430px; }
.future-note p { color: var(--muted); font-size: 14px; line-height: 1.8; max-width: 490px; margin: 4px 0; }

/* Reader: portrait artwork is NEVER cropped. */
.reader { padding-bottom: 75px; }
.reader-back { margin-top: 28px; font-size: 13px; color: var(--teal); font-weight: 760; }
.reader-back a:hover { text-decoration: underline; }
.reader-header { max-width: 760px; text-align: center; margin: 48px auto 32px; }
.reader-header h1 { font-size: clamp(34px, 6vw, 65px); letter-spacing: -.065em; line-height: 1.09; margin: 15px 0 15px; }
.reader-header > p { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 17px; }
.reader-meta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.reading-advice { max-width: 735px; text-align: center; margin: 0 auto 26px; padding: 12px 20px; border: 1px solid #dfebe4; background: #edf3ee; border-radius: 8px; font-size: 12px; color: #45635e; line-height: 1.6; }
.reader-pages { display: grid; justify-items: center; gap: 28px; }
.reader-page { width: min(100%, 735px); }
.page-counter { display: flex; align-items: baseline; gap: 9px; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; color: var(--teal); margin: 0 0 9px; }
.page-counter span { opacity: .5; }
.page-image { aspect-ratio: 4 / 5; display: block; width: 100%; height: auto; background: #e2e6e4; border: 1px solid #dce4e0; border-radius: 7px; box-shadow: 0 14px 40px -34px #0f252d70; }
.page-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; gap: 16px; padding: 28px; }
.page-giant { font-size: clamp(74px, 15vw, 160px); }
.page-placeholder-title { font-size: clamp(18px, 4vw, 33px); font-weight: 850; letter-spacing: 1.2px; }
.page-empty p { margin: 0; max-width: 270px; line-height: 1.6; font-size: 13px; }
.full-page-link > span { display: inline-block; color: var(--teal); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; margin-top: 8px; }
.article-text, .article-sources { width: min(100%, 735px); margin: 35px auto; line-height: 1.8; }
.article-text h2, .article-sources h2 { font-size: 22px; }
.article-sources a { text-decoration: underline; color: var(--teal); }
.reader-bottom { width: min(100%, 735px); margin: 36px auto 0; border-top: 1px solid var(--line); padding-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.reader-bottom > a:last-child { font-size: 13px; font-weight: 760; color: var(--teal); text-align: right; }
.reader-bottom > a:last-child:hover { text-decoration: underline; }
.loading-state { padding: 130px 0; text-align: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #edf2ee; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; padding: 37px 0; }
.footer-inner strong { font-size: 18px; }
.footer-inner p { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; max-width: 400px; }
.footer-inner > span { align-self: center; color: var(--muted); font-size: 11px; text-align: right; }

@media (max-width: 1020px) {
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { min-height: 415px; }
  .featured-copy { padding: 34px; }
  .featured-art { padding: 24px; }
  .featured-topic { margin-top: 28px; }
}
@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 520px); }
  .header-inner { min-height: 78px; flex-wrap: wrap; padding: 15px 0; gap: 15px; }
  .brand-symbol { width: 39px; height: 39px; }
  .brand-words strong { font-size: 20px; }
  .header-nav { gap: 20px; width: 100%; padding: 2px 0 4px; }
  .header-nav a { font-size: 12px; }
  .intro { padding: 42px 0 32px; }
  .intro h1 { margin: 16px 0; }
  .featured { grid-template-columns: 1fr; }
  .featured-copy { padding: 30px 27px 25px; }
  .featured-topic { margin-top: 25px; }
  .featured-art { padding: 8px 25px 32px; }
  .featured-art .artwork { max-width: 300px; max-height: none; }
  .section-heading { display: block; }
  .section-heading > p { max-width: unset; margin-top: 13px; }
  .stories { padding: 62px 0; }
  .future-note { grid-template-columns: 1fr; gap: 8px; padding: 32px 0 55px; }
  .footer-inner { display: block; }
  .footer-inner > span { display: block; margin-top: 15px; text-align: left; }
  .reader-header { margin: 37px auto 25px; }
  .reader-bottom { flex-direction: column; align-items: stretch; }
  .reader-bottom > a:last-child { text-align: left; }
}
@media (max-width: 450px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-card { max-width: 390px; width: 100%; margin: 0 auto; }
  .card-body { padding: 17px; }
  .story-card h3 { font-size: 23px; }
  .story-card p { font-size: 13px; }
  .featured h2 { font-size: 35px; }
  .intro h1 { font-size: 44px; }
  .page-empty p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}


/* Theme switch in the main navigation */
.header-inner { justify-content: space-between; }
.header-nav { margin-left: auto; }
.theme-toggle { flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); padding: 10px 16px; font-size: 12px; font-weight: 760; }
.theme-toggle:hover { border-color: var(--teal); }

/* Reader controls and one-page-at-a-time viewer */
.reader-toolbar { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 0 auto 24px; }
.toolbar-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.mode-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--switch-surface, #edf3ee); border-radius: 12px; }
.mode-button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; padding: 8px 16px; font-weight: 750; }
.mode-button.is-active { background: var(--switch-selected, white); color: var(--ink); box-shadow: 0 2px 8px #00000012; }
.reader-pages { scroll-margin-top: 18px; }
.paged-viewer { width: 100%; padding: 0 0 15px; }
.viewer-counter { font-weight: 850; font-size: 12px; letter-spacing: 1.8px; text-align: center; margin-bottom: 14px; color: var(--teal); }
.viewer-counter span { color: var(--muted); }
.viewer-stage { position: relative; width: min(100% - 100px, 740px); margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.viewer-image-button { display: flex; justify-content: center; align-items: center; width: 100%; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.viewer-image-button:disabled { cursor: default; }
/* Reserve the full 1122x1402 page area before each new image loads. This prevents scroll jumps on first visit to pages 2 and 3. */
.viewer-image-button .page-image { width: min(100%, 66.4dvh, 880px); height: auto; max-width: 100%; max-height: min(83dvh, 1100px); aspect-ratio: 1122 / 1402; object-fit: contain; box-shadow: 0 19px 48px #0000003b; }
.viewer-image-button .page-empty { width: min(100%, 735px); aspect-ratio: 4 / 5; }
.viewer-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 46px; height: 46px; background: var(--control-bg, white); border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 25px; box-shadow: 0 4px 20px #0000001a; }
.viewer-arrow-prev { left: -60px; }
.viewer-arrow-next { right: -60px; }
.viewer-arrow:disabled, .viewer-mobile-button:disabled { opacity: .25; cursor: default; }
.viewer-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: min(100%, 740px); margin: 16px auto 0; color: var(--muted); font-size: 12px; }
.viewer-actions a { color: var(--teal); font-weight: 780; text-decoration: underline; text-underline-offset: 3px; }
.viewer-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 19px 0 0; }
.viewer-dot { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--dot-bg, #b6c5c7); padding: 0; }
.viewer-dot.is-active { background: var(--teal); outline: 2px solid var(--teal); outline-offset: 3px; }
.viewer-mobile-nav { display: none; }
.is-scroll-mode { gap: 30px; }

/* Calm, low-glare dark mode: default on first visit */
html[data-theme="dark"] { color-scheme: dark; --paper: #0d141b; --ink: #eaf2f5; --muted: #a8b8c3; --line: #33424e; --dark: #173740; --teal: #88d5cd; --switch-surface: #172630; --switch-selected: #314652; --control-bg: #1d2e39; --dot-bg: #526773; }
html[data-theme="dark"] .site-header { background: #121d27; }
html[data-theme="dark"] .header-nav a { color: #b9cad4; }
html[data-theme="dark"] .header-nav a:hover { color: var(--teal); }
html[data-theme="dark"] .intro h1 em { color: #8bd6c7; }
html[data-theme="dark"] .featured { background: #173441; box-shadow: 0 22px 60px -45px #000000aa; }
html[data-theme="dark"] .filter { background: #17242f; color: #c1cfd7; }
html[data-theme="dark"] .filter.is-active { background: #426d70; color: #fff; border-color: #6da5a5; }
html[data-theme="dark"] .filter:hover { border-color: var(--teal); }
html[data-theme="dark"] .story-card { background: #17232e; box-shadow: 0 15px 40px -26px #000000aa; }
html[data-theme="dark"] .card-bottom { border-color: #364550; }
html[data-theme="dark"] .story-card h3 a:hover { color: var(--teal); }
html[data-theme="dark"] .site-footer { background: #111d27; }
html[data-theme="dark"] .page-image { background: #192631; border-color: #394955; }
html[data-theme="dark"] .reading-advice { border-color: #3b545c; background: #1d3338; color: #c1d9d9; }
html[data-theme="dark"] .brand-symbol { background: #375764; }
html[data-theme="dark"] .button-dark { background: #2a505d; }
html[data-theme="dark"] .section-label { color: #83d4c9; }
html[data-theme="dark"] .skip-link { background: #121d27; }

@media (max-width: 700px) {
  .header-nav { margin-left: 0; order: 3; width: 100%; }
  .theme-toggle { margin-left: auto; padding: 10px 13px; }
  .reader-toolbar { flex-wrap: wrap; gap: 9px; }
  .viewer-stage { width: 100%; }
  .viewer-arrow { display: none; }
  .viewer-mobile-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 13px 0; }
  .viewer-mobile-button { background: var(--control-bg, white); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; min-width: 105px; min-height: 42px; font-size: 13px; font-weight: 750; padding: 9px 14px; }
  .viewer-actions { margin-top: 10px; }
  .viewer-image-button .page-image { max-height: 82dvh; }
}
@media (max-width: 400px) {
  .theme-toggle { padding: 9px 11px; font-size: 11px; }
  .brand-words small { font-size: 8px; letter-spacing: 1.2px; }
  .viewer-actions { flex-direction: column; align-items: center; gap: 9px; }
}


/* Compact article layout: the illustration is the first thing readers see. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.is-reading .header-inner { min-height: 58px; padding-top: 7px; padding-bottom: 7px; }
body.is-reading .header-nav { display: none; }
body.is-reading .brand-symbol { width: 36px; height: 36px; font-size: 24px; }
body.is-reading .brand-words strong { font-size: 19px; }
body.is-reading .brand-words small { font-size: 8px; }
body.is-reading .reader { padding-bottom: 56px; }
.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 65px;
  padding: 10px 0;
}
.reader-topbar .reader-back { margin: 0; font-size: 13px; }
.reader-topbar .reader-toolbar { margin: 0; gap: 12px; }
.reader-topbar .mode-button { min-height: 34px; padding: 7px 12px; }
.is-page-mode .viewer-counter { margin-bottom: 9px; }
.is-page-mode .viewer-image-button .page-image {
  /* Reserve the image size before loading, without making visitors scroll to read. */
  width: min(100%, 62dvh, 880px);
  height: auto;
  max-height: min(78dvh, 1100px);
  aspect-ratio: 1122 / 1402;
  object-fit: contain;
}
.is-page-mode .viewer-actions { margin-top: 10px; }
.is-page-mode .viewer-pagination { margin-top: 13px; }
@media (max-width: 700px) {
  body.is-reading .header-inner { flex-wrap: nowrap; min-height: 56px; padding-top: 7px; padding-bottom: 7px; }
  body.is-reading .header-nav { display: none; }
  body.is-reading .theme-toggle { padding: 8px 11px; }
  .reader-topbar { min-height: 55px; gap: 8px; }
  .reader-topbar .reader-toolbar { flex-wrap: nowrap; gap: 5px; }
  .reader-topbar .toolbar-label { display: none; }
  .reader-topbar .mode-button { padding: 7px 10px; font-size: 11px; }
  .is-page-mode .viewer-image-button .page-image { width: min(100%, 62dvh, 880px); max-height: 78dvh; }
  .is-page-mode .viewer-mobile-nav { margin: 10px 0 7px; }
  .is-page-mode .viewer-actions { margin-top: 6px; }
  .is-page-mode .viewer-pagination { margin-top: 10px; }
}
@media (max-width: 350px) {
  .reader-topbar .reader-back { font-size: 11px; }
  .reader-topbar .mode-button { padding: 6px 7px; }
  body.is-reading .brand-words small { display: none; }
}

/* ============================================================
   BENTO HOME + DISCOVERY ARCHIVE
   Only one editorial carousel; navigation is manual, never auto-played.
   Reader styles above are intentionally preserved.
   ============================================================ */
:root {
  --panel: #ffffff;
  --panel-soft: #eaf0ed;
  --tile: #f3f5f2;
  --tile-hover: #e7f0ed;
  --pill: #e7eeeb;
  --accent-strong: #256f6d;
  --shadow-soft: 0 15px 50px -38px #182a3040;
}
html[data-theme="dark"] {
  --panel: #14222c;
  --panel-soft: #192933;
  --tile: #192a36;
  --tile-hover: #203642;
  --pill: #1a2934;
  --accent-strong: #9fddd3;
  --shadow-soft: 0 16px 60px -35px #030a10aa;
}
body { min-height: 100vh; }
.site-header { background: var(--paper); }
html[data-theme="dark"] .site-header { background: #0d141b; }
.header-inner { min-height: 76px; }
.brand-symbol { border-radius: 13px; }
html[data-theme="dark"] .brand-symbol { background: #25424b; }
.header-nav a { color: var(--muted); }
html[data-theme="dark"] .header-nav a { color: var(--muted); }
.header-nav a:hover { color: var(--accent-strong); }
html[data-theme="dark"] .header-nav a:hover { color: var(--accent-strong); }
.theme-toggle { border-color: var(--line); }
.theme-toggle:hover { background: var(--panel); }
.kicker { display: inline-flex; align-items: center; gap: 9px; color: var(--accent-strong); letter-spacing: 1.65px; font-size: 10px; font-weight: 850; text-transform: uppercase; }

/* A small introduction leaves the artwork to do most of the talking. */
.home-intro { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 51px 0 38px; }
.home-intro h1 { margin: 15px 0 12px; letter-spacing: -0.07em; font-size: clamp(44px, 5.15vw, 70px); font-weight: 810; line-height: 1.06; }
.home-intro h1 em { font-style: normal; color: var(--accent-strong); }
.home-intro p { font-size: clamp(13px, 1.35vw, 16px); line-height: 1.7; color: var(--muted); margin: 0; }
.intro-explore { display: inline-flex; flex-shrink: 0; gap: 18px; align-items: center; border-bottom: 1px solid var(--accent-strong); color: var(--accent-strong); font-weight: 780; font-size: 13px; padding: 8px 0; margin-bottom: 5px; }
.intro-explore:hover { gap: 24px; }

/* One single carousel: a row of topic tabs, one Bento at a time. */
.carousel-section { padding: 5px 0 72px; }
.carousel-tabs { display: flex; flex-wrap: nowrap; gap: 6px; padding: 0 0 16px; margin-bottom: 22px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.carousel-tab { flex-shrink: 0; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 11px 15px; border-radius: 999px; }
.carousel-tab:hover { color: var(--ink); background: var(--pill); }
.carousel-tab.is-active { border-color: var(--line); background: var(--panel-soft); color: var(--ink); }
.carousel-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 23px; padding: clamp(16px, 2.2vw, 28px); box-shadow: var(--shadow-soft); }
.slide-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 2px 24px; }
.slide-heading-copy h2 { margin: 9px 0 6px; font-size: clamp(28px, 3.7vw, 42px); line-height: 1.12; letter-spacing: -0.053em; }
.slide-heading-copy h2 a span { color: var(--accent-strong); font-size: .56em; vertical-align: 18%; }
.slide-heading-copy h2 a:hover { color: var(--accent-strong); }
.slide-heading-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.slide-fraction { color: var(--muted); opacity: .7; margin-left: 9px; }
.slide-arrows { display: flex; gap: 10px; flex-shrink: 0; }
.slide-arrow { display: grid; place-items: center; width: 44px; height: 44px; background: var(--panel-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 50%; font-size: 23px; transition: background .17s ease, transform .17s ease; }
.slide-arrow:hover { background: var(--tile-hover); transform: translateY(-2px); }

.bento-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .52fr) minmax(0, .52fr); grid-template-rows: 296px 170px; gap: 13px; }
.bento-tile { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--tile); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.bento-tile:hover { border-color: var(--accent-strong); background: var(--tile-hover); transform: translateY(-2px); }
.bento-tile--lead { grid-column: 1; grid-row: 1 / 3; background: radial-gradient(circle at 50% 28%, #78bda212, transparent 50%), var(--tile); }
.bento-tile--small:nth-child(2) { grid-column: 2; grid-row: 1; }
.bento-tile--small:nth-child(3) { grid-column: 3; grid-row: 1; }
.bento-image { min-height: 0; flex: 1; display: flex; justify-content: center; align-items: center; padding: 19px 14px 5px; }
.bento-image .artwork { width: auto; height: 100%; max-width: 100%; max-height: 100%; aspect-ratio: 1122 / 1402; border-radius: 6px; box-shadow: 0 15px 28px -20px #0009; }
.bento-image .artwork img { width: 100%; height: 100%; object-fit: contain; }
.bento-image .artwork-symbol { font-size: clamp(46px, 6vw, 95px); }
.bento-image .artwork-placeholder { bottom: 8px; font-size: 9px; padding: 8px 4px; }
.bento-tile-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 16px; }
.bento-tile-caption > div { min-width: 0; }
.bento-tile-kicker { display: block; margin-bottom: 6px; color: var(--accent-strong); font-weight: 750; font-size: 9px; letter-spacing: .6px; text-transform: uppercase; }
.bento-tile-caption strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: clamp(12px, 1.2vw, 16px); font-weight: 760; line-height: 1.3; letter-spacing: -.025em; }
.bento-tile--lead .bento-tile-caption { padding: 16px 22px 19px; }
.bento-tile--lead .bento-tile-caption strong { font-size: clamp(17px, 1.9vw, 23px); }
.bento-open { color: var(--accent-strong); font-size: 23px; flex-shrink: 0; }
.bento-tile--small .bento-image { padding: 12px 10px 2px; }
.bento-tile--small .bento-tile-caption { padding: 10px 12px 13px; }
.bento-tile--small .bento-tile-kicker { font-size: 8px; }
.bento-tile--small .bento-open { font-size: 16px; }

.bento-all { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; padding: 25px 27px; background: linear-gradient(120deg, var(--panel-soft), var(--tile)); grid-column: 2 / 4; grid-row: 2; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.bento-all:hover { border-color: var(--accent-strong); background: var(--tile-hover); transform: translateY(-2px); }
.all-kicker { color: var(--accent-strong); font-size: 10px; letter-spacing: 1.45px; font-weight: 850; }
.all-title { display: inline-flex; align-items: center; gap: 20px; font-size: clamp(25px, 3vw, 39px); font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.all-title span { color: var(--accent-strong); font-size: 23px; }
.all-meta { color: var(--muted); font-size: 11px; }
.all-watermark { position: absolute; right: 15px; top: -41px; font-size: 200px; font-weight: 900; opacity: .045; z-index: -1; }
.bento-grid--2 .bento-tile--small { grid-column: 2 / 4; grid-row: 1; }
.bento-grid--1 .bento-tile--lead { grid-column: 1 / 2; }
.bento-grid--1 .bento-all { grid-column: 2 / 4; grid-row: 1 / 3; }
.bento-grid--1 .all-title { font-size: clamp(25px, 3.4vw, 42px); }
.carousel-hint { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 6px 0; color: var(--muted); font-size: 10px; letter-spacing: 1.1px; font-weight: 730; }
.hint-dots { display: flex; align-items: center; gap: 7px; }
.hint-dot { display: inline-block; height: 5px; width: 5px; border-radius: 5px; background: var(--line); }
.hint-dot.is-active { width: 23px; background: var(--accent-strong); }

/* The archive is separate from the discovery carousel: scalable to 500+ stories. */
.archive-head { padding: 42px 0 30px; }
.minor-back { display: block; font-size: 12px; font-weight: 800; color: var(--accent-strong); margin-bottom: 44px; }
.archive-head h1 { font-size: clamp(42px, 5.5vw, 68px); letter-spacing: -.07em; line-height: 1.1; margin: 15px 0 10px; }
.archive-head p { color: var(--muted); line-height: 1.65; font-size: 15px; margin: 0; }
.archive-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.search-wrap { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); padding: 0 15px; border-radius: 12px; min-height: 51px; }
.search-wrap span { color: var(--muted); font-size: 27px; }
.search-wrap input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 14px; }
.search-wrap:focus-within { border-color: var(--accent-strong); outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.search-wrap input::placeholder { color: var(--muted); }
.sort-wrap { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sort-wrap select { appearance: auto; border: 1px solid var(--line); color: var(--ink); background: var(--panel); padding: 15px 13px; border-radius: 12px; font: inherit; }
.archive-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 22px 0 6px; }
.archive-filter { border: 1px solid var(--line); padding: 10px 14px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; border-radius: 999px; }
.archive-filter:hover { color: var(--ink); background: var(--panel-soft); }
.archive-filter.is-active { color: var(--ink); background: var(--panel-soft); border-color: var(--accent-strong); }
.archive-count { margin: 19px 0 17px; font-size: 11px; letter-spacing: .6px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.archive-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px 15px; padding-bottom: 77px; }
.archive-card { min-width: 0; overflow: hidden; }
.archive-cover { display: flex; justify-content: center; padding: 14px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s ease, transform .2s ease; }
.archive-cover:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
.archive-cover .artwork { width: 100%; max-width: 230px; border-radius: 6px; }
.archive-card-text { padding: 13px 2px; }
.archive-category { text-transform: uppercase; letter-spacing: .8px; color: var(--accent-strong); font-size: 9px; font-weight: 850; }
.archive-card h3 { margin: 8px 0 10px; font-size: clamp(14px, 1.5vw, 18px); letter-spacing: -.025em; line-height: 1.35; font-weight: 780; }
.archive-card h3 a:hover { color: var(--accent-strong); }
.archive-pages { color: var(--muted); font-size: 11px; }
.archive-no-results { grid-column: 1/-1; padding: 60px 10px; text-align: center; color: var(--muted); }
.site-footer { background: var(--paper); }
html[data-theme="dark"] .site-footer { background: var(--paper); }
.footer-inner { padding: 24px 0 27px; }
.footer-inner p { margin-top: 4px; }

@media (max-width: 960px) {
  .bento-grid { grid-template-rows: 280px 167px; gap: 10px; }
  .bento-tile--small .bento-tile-caption { padding: 9px; }
  .bento-tile--small .bento-tile-caption strong { font-size: 11px; }
  .bento-tile--small .bento-tile-kicker { font-size: 7px; }
  .archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { width: min(100% - 30px, 520px); }
  .header-inner { min-height: 70px; flex-wrap: nowrap; padding: 11px 0; gap: 10px; }
  .brand-words strong { font-size: 19px; }
  .brand-words small { font-size: 8px; letter-spacing: 1.3px; }
  .header-nav { display: none; }
  .theme-toggle { margin-left: auto; padding: 9px 11px; font-size: 11px; }
  .home-intro { padding: 38px 0 27px; align-items: flex-start; gap: 19px; flex-direction: column; }
  .home-intro h1 { font-size: clamp(42px, 11vw, 61px); }
  .home-intro p { font-size: 13px; }
  .intro-explore { margin: 0; }
  .carousel-section { padding-bottom: 55px; }
  .carousel-tabs { gap: 2px; margin-bottom: 10px; padding-bottom: 10px; }
  .carousel-tab { padding: 9px 12px; font-size: 11px; }
  .carousel-panel { padding: 15px; border-radius: 18px; }
  .slide-heading { padding: 0 0 16px; gap: 8px; }
  .slide-heading-copy h2 { font-size: clamp(24px, 7.2vw, 31px); margin: 7px 0 4px; }
  .slide-heading-copy p { font-size: 11px; }
  .kicker { font-size: 9px; }
  .slide-arrows { gap: 6px; }
  .slide-arrow { width: 37px; height: 37px; font-size: 20px; }
  .bento-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; gap: 10px; }
  .bento-tile--lead, .bento-grid--1 .bento-tile--lead { grid-column: 1 / 3; grid-row: auto; min-height: 425px; }
  .bento-tile--lead .bento-image { min-height: 325px; height: 350px; flex: none; padding: 18px 14px 6px; }
  .bento-tile--lead .bento-tile-caption { padding: 13px 15px 17px; }
  .bento-tile--lead .bento-tile-caption strong { font-size: 18px; }
  .bento-tile--small:nth-child(2), .bento-tile--small:nth-child(3), .bento-grid--2 .bento-tile--small { grid-column: auto; grid-row: auto; min-height: 252px; }
  .bento-tile--small .bento-image { height: 182px; min-height: 182px; flex: none; padding: 11px 8px 3px; }
  .bento-tile--small .bento-tile-caption { padding: 9px 10px 12px; }
  .bento-tile--small .bento-tile-caption strong { font-size: 11px; }
  .bento-tile--small .bento-open { display: none; }
  .bento-all, .bento-grid--1 .bento-all { grid-column: 1 / 3; grid-row: auto; min-height: 130px; padding: 20px; }
  .all-title, .bento-grid--1 .all-title { font-size: 30px; }
  .all-kicker { font-size: 9px; }
  .all-meta { font-size: 11px; }
  .carousel-hint { font-size: 8px; }
  .archive-head { padding: 30px 0 20px; }
  .minor-back { margin-bottom: 27px; }
  .archive-head h1 { font-size: 43px; }
  .archive-tools { flex-wrap: wrap; }
  .sort-wrap { margin-left: auto; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 12px; }
  .archive-cover { padding: 8px; }
  .archive-card h3 { font-size: 13px; }
  .archive-category { font-size: 8px; }
  .footer-inner { display: flex; align-items: center; }
  .footer-inner > span { margin: 0; text-align: right; }
}
@media (max-width: 400px) {
  .brand-words strong { font-size: 17px; }
  .brand-symbol { height: 37px; width: 37px; font-size: 24px; }
  .brand-words small { font-size: 7px; }
  .bento-tile--lead .bento-image { height: 315px; min-height: 315px; }
  .bento-tile--lead { min-height: 390px; }
  .bento-tile--small .bento-image { height: 155px; min-height: 155px; }
  .bento-tile--small:nth-child(2), .bento-tile--small:nth-child(3) { min-height: 226px; }
  .footer-inner { display: block; }
  .footer-inner > span { display: block; text-align: left; margin-top: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .bento-tile, .bento-all, .slide-arrow, .archive-cover { transition: none; }
}
@media (max-width: 700px) {
  .bento-grid--2 .bento-tile--small { grid-column: 1 / 3; }
}

/* ============================================================
   V3 — PERMANENT HEADER + CONTINUOUS, DRAGGABLE BENTO WHEEL
   ============================================================ */

/* One header, identical on homepage, archive, and reader. */
.site-header,
html[data-theme="dark"] .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner,
body.is-reading .header-inner {
  min-height: 66px;
  padding: 8px 0;
  flex-wrap: nowrap;
  gap: 12px;
}
body.is-reading .brand-symbol { width: 44px; height: 44px; font-size: 29px; }
body.is-reading .brand-words strong { font-size: 22px; }
body.is-reading .brand-words small { font-size: 9px; }
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-icon,
.theme-toggle,
body.is-reading .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  transition: color 160ms ease, background-color 160ms ease;
}
.header-icon:hover,
.header-icon:focus-visible { color: var(--ink); background: var(--panel-soft); }
.header-icon svg { pointer-events: none; }
body.is-reading .reader-topbar { justify-content: center; }
body.is-reading .reader-toolbar { margin: 0 auto; }
body.is-reading .reader { padding-top: 0; }
#main-content { min-height: calc(100vh - 160px); }
.archive-head { padding: 35px 0 20px; }
.archive-head h1 { font-size: clamp(29px, 4vw, 44px); margin: 0; }
.archive-tools { margin-top: 3px; }
.site-footer .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

/* The entire homepage consists of a single, restrained carousel. */
.carousel-section { padding: 24px 0 40px; }
.carousel-wheel {
  width: min(calc(100vw - 24px), 1480px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.wheel-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.wheel-viewport.is-dragging { cursor: grabbing; }
.wheel-track {
  --slide-width: min(950px, calc(100vw - 130px));
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: max-content;
  padding: 5px 0 10px;
  will-change: transform;
  perspective: 1450px;
}
.wheel-slide {
  position: relative;
  flex: 0 0 var(--slide-width);
  width: var(--slide-width);
  min-width: 0;
  transform: scale(.965) rotateY(3deg);
  opacity: .48;
  transition: opacity 510ms ease, transform 510ms cubic-bezier(.22,.75,.17,1);
}
.wheel-slide[data-offset="-1"] { transform: scale(.965) rotateY(-4deg); }
.wheel-slide[data-offset="1"] { transform: scale(.965) rotateY(4deg); }
.wheel-slide.is-center { transform: scale(1) rotateY(0); opacity: 1; }
.wheel-slide.is-center .carousel-panel { box-shadow: var(--shadow-soft); }
.wheel-slide:not(.is-center) .carousel-panel { pointer-events: none; }
.wheel-slide .carousel-panel { height: 100%; padding: clamp(15px, 2vw, 25px); }
.wheel-preview {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 0;
  width: 100%;
  background: transparent;
  cursor: pointer;
}
.wheel-preview:hover { background: #ffffff08; }
.wheel-preview:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: -5px; }
.wheel-viewport.is-dragging .wheel-slide { transition: none; }
.wheel-viewport.is-dragging .wheel-preview { cursor: grabbing; }
.slide-heading { min-height: 67px; padding: 0 0 18px; }
.slide-heading-copy h2 { margin: 5px 0 0; font-size: clamp(26px, 3.2vw, 39px); }
.slide-heading-copy .kicker { font-size: 10px; }
.slide-heading-copy h2 a { display: inline-block; }
.slide-heading-copy h2 a span { opacity: .65; }
.carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 38px;
  padding: 9px 2px 0;
}
.carousel-instruction { font-size: 11px; color: var(--muted); }
.wheel-dots { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.wheel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
  background: var(--line);
  border: 0;
  transition: background 160ms ease, width 160ms ease;
}
.wheel-dot:hover { background: var(--muted); }
.wheel-dot.is-active { width: 23px; background: var(--accent-strong); }
.home-empty { padding: 70px 0; }
.home-empty p { color: var(--muted); }

@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .header-inner,
  body.is-reading .header-inner {
    min-height: 62px;
    padding: 8px 0;
    flex-wrap: nowrap;
  }
  .brand-symbol, body.is-reading .brand-symbol { width: 36px; height: 36px; font-size: 24px; }
  .brand-words strong, body.is-reading .brand-words strong { font-size: 18px; }
  .brand-words small, body.is-reading .brand-words small { font-size: 7px; letter-spacing: 1.2px; }
  .header-actions { gap: 0; }
  .header-icon, .theme-toggle, body.is-reading .theme-toggle { width: 39px; min-width: 39px; height: 40px; padding: 0; margin: 0; }
  .carousel-section { padding-top: 12px; }
  .carousel-wheel { width: calc(100vw - 12px); }
  .wheel-track { --slide-width: calc(100vw - 102px); gap: 9px; }
  .wheel-slide { transform: scale(.98); }
  .wheel-slide[data-offset="-1"], .wheel-slide[data-offset="1"] { transform: scale(.98); }
  .wheel-slide .carousel-panel { padding: 12px; border-radius: 16px; }
  .slide-heading { min-height: 57px; padding-bottom: 10px; }
  .slide-heading-copy h2 { font-size: clamp(19px, 5.5vw, 28px); }
  .slide-heading-copy .kicker { font-size: 9px; }
  .bento-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 315px 162px 116px;
    gap: 8px;
  }
  .bento-grid .bento-tile--lead,
  .bento-grid--1 .bento-tile--lead {
    grid-column: 1 / 3;
    grid-row: 1;
    min-height: 0;
    height: 315px;
  }
  .bento-grid .bento-tile--lead .bento-image {
    height: 242px;
    min-height: 0;
    flex: 1;
    padding: 10px 9px 1px;
  }
  .bento-grid .bento-tile--lead .bento-tile-caption { padding: 10px; }
  .bento-grid .bento-tile--lead .bento-tile-caption strong { font-size: 13px; }
  .bento-grid .bento-tile--small:nth-child(2),
  .bento-grid .bento-tile--small:nth-child(3) {
    grid-row: 2;
    min-height: 0;
    height: 162px;
  }
  .bento-grid .bento-tile--small:nth-child(2) { grid-column: 1; }
  .bento-grid .bento-tile--small:nth-child(3) { grid-column: 2; }
  .bento-grid .bento-tile--small .bento-image { height: 116px; min-height: 0; padding: 8px 6px 2px; }
  .bento-grid .bento-tile--small .bento-tile-caption { padding: 6px 7px 9px; }
  .bento-grid .bento-tile--small .bento-tile-caption strong { font-size: 9px; }
  .bento-grid .bento-tile--small .bento-tile-kicker { display: none; }
  .bento-grid--2 .bento-tile--small:nth-child(2) { grid-column: 1 / 3; }
  .bento-grid .bento-all,
  .bento-grid--1 .bento-all {
    min-height: 0;
    height: 116px;
    grid-column: 1 / 3;
    grid-row: 3;
    padding: 13px 15px;
    gap: 5px;
  }
  .bento-grid--1 .bento-all { grid-row: 2 / 4; height: auto; }
  .bento-grid .all-title { font-size: 23px; }
  .bento-grid .all-kicker { font-size: 8px; }
  .bento-grid .all-meta { font-size: 9px; }
  .carousel-controls { gap: 12px; }
  .carousel-instruction { font-size: 9px; max-width: 180px; line-height: 1.4; }
  .footer-inner { font-size: 11px; }
}
@media (max-width: 370px) {
  .brand-words small, body.is-reading .brand-words small { display: none; }
  .brand-words strong, body.is-reading .brand-words strong { font-size: 17px; }
  .header-icon, .theme-toggle, body.is-reading .theme-toggle { width: 35px; min-width: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  .wheel-slide, .wheel-dot, .wheel-track { transition: none !important; }
}

.wheel-viewport img, .wheel-viewport a { -webkit-user-drag: none; }
/* Clip without creating a horizontal scroll container. This also prevents
   programmatic focus from shifting the wheel independently of its animation. */
.wheel-viewport { overflow: clip; }


/* ==========================================================
   V4 — HEADER SEARCH, PERSISTENT TOPIC SHORTCUTS, PAGE SWIPE
   ========================================================== */
.site-header { position: sticky; }
.site-search-panel {
  position: absolute; right: max(14px, calc((100vw - 1180px)/2)); top: calc(100% + 8px);
  z-index: 130; width: min(430px, calc(100vw - 28px)); max-height: min(72vh, 620px);
  overflow: auto; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 20px 70px #0005; padding: 15px; border-radius: 16px;
}
#global-search-input {
  display: block; width: 100%; min-height: 46px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 14px; padding: 0 14px; outline-offset: 2px;
}
#global-search-input:focus { outline: 2px solid var(--accent-strong); }
.site-search-results { padding: 8px 2px 0; }
.search-result { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px;
  border-bottom: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.search-result:hover { background: var(--panel-soft); }
.search-result strong { line-height: 1.35; font-size: 13px; }
.search-result-category { text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-size: 9px; }
.search-result-all { display: block; padding: 15px 12px 5px; color: var(--accent-strong);
  font-size: 12px; font-weight: 750; }
.search-status { padding: 8px 12px; margin: 0; color: var(--muted); font-size: 13px; }
#header-search[aria-expanded="true"] { background: var(--panel-soft); color: var(--ink); }

/* One slim, horizontally scrollable navigation strip, including empty categories. */
.topic-shortcuts {
  display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  gap: 7px; padding: 12px 2px 15px; margin-top: 20px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  overscroll-behavior-x: contain; scroll-snap-type: x proximity;
}
.topic-link { flex: 0 0 auto; scroll-snap-align: start; border: 1px solid var(--line);
  color: var(--muted); background: transparent; border-radius: 999px;
  font-size: 12px; font-weight: 690; line-height: 1.2; padding: 11px 15px;
  white-space: nowrap; transition: background-color .18s ease, color .18s ease; }
.topic-link:hover { background: var(--panel-soft); color: var(--ink); }
.topic-link.is-active { background: var(--panel-soft); border-color: var(--accent-strong); color: var(--ink); }
.topic-link--future { opacity: .45; cursor: not-allowed; }
.topic-link--future small { font-size: 9px; font-weight: normal; }
.carousel-section { padding-bottom: 18px; }
.carousel-section .topic-shortcuts { margin-top: 23px; }
.archive-head { padding-bottom: 5px; }
.archive-head + .topic-shortcuts { margin-top: 8px; padding-bottom: 13px; }
.archive-tools { padding-top: 14px; }
.archive-help { color: var(--muted); font-size: 12px; }
.archive-help a { color: var(--accent-strong); font-weight: 700; padding-left: 5px; }

/* Three-page strip with real drag motion, no wrap-around. Reserve aspect ratio
   before images load to keep the page from jumping vertically. */
.reader-swipe-viewport {
  width: min(100%, 62dvh, 880px); aspect-ratio: 1122 / 1402;
  position: relative; overflow: clip; min-width: 0; flex-shrink: 0;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  cursor: grab; border-radius: 8px;
}
.reader-swipe-viewport.is-dragging { cursor: grabbing; }
.reader-swipe-track { display: flex; width: 300%; height: 100%;
  transform: translate3d(-33.333333%, 0, 0); will-change: transform; }
.reader-swipe-slide { flex: 0 0 33.333333%; width: 33.333333%; height: 100%;
  display: flex; align-items: stretch; justify-content: center; min-width: 0; }
.reader-swipe-slide .viewer-image-button { display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; }
.reader-swipe-slide .viewer-image-button .page-image,
.is-page-mode .reader-swipe-slide .viewer-image-button .page-image {
  width: 100%; height: 100%; max-height: none; max-width: none;
  aspect-ratio: 1122 / 1402; object-fit: contain; pointer-events: none;
}
.reader-swipe-slide .viewer-image-button:disabled { cursor: grab; }
.reader-swipe-slide .page-empty { min-height: 100%; }
.viewer-arrow { display: flex; justify-content: center; align-items: center;
  line-height: 1; font-size: 0; }
.viewer-arrow svg { display: block; width: 22px; height: 22px; flex: none; }
.reader-swipe-viewport img, .reader-swipe-viewport button { -webkit-user-drag: none; }
@media (max-width: 700px) {
  .site-search-panel { right: 14px; }
  .topic-shortcuts { margin-top: 13px; padding-top: 7px; }
  .topic-link { font-size: 11px; padding: 10px 13px; }
  .reader-swipe-viewport { width: min(100%, 62dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .reader-swipe-track, .topic-link { transition: none !important; }
}

.reader-swipe-slide .viewer-image-button.is-last { cursor: grab; }
