.gedankin-rules-badge { color: var(--gold-bright); font: .7rem/1.4 var(--sans); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .7rem; white-space: nowrap; }
.gedankin-world .brand-mark { overflow: hidden; background: transparent; }
.gedankin-world .brand-mark img { transform: none; object-fit: contain; width: 100%; height: 100%; }
.gedankin-world .sidebar::before { background: transparent url('sigil.svg') center / contain no-repeat; }
.gedankin-world .gateway-hero { min-height: 440px; background: radial-gradient(ellipse at 50% 20%, #424052 0, #212532 40%, #111319 85%); }
.gedankin-world .gateway-hero::before { background: repeating-linear-gradient(125deg, transparent 0 85px, rgba(212,180,109,.035) 86px 87px, transparent 88px 170px), radial-gradient(ellipse at center, transparent, #111319); }
.gedankin-world .gateway-sigil { background: transparent; box-shadow: 0 0 60px rgba(212,180,109,.12); }
.gedankin-world .gateway-sigil img { transform: none; }
.gedankin-world .gateway-categories { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gedankin-world .gateway-tile { background: linear-gradient(125deg, #272733, #171a22); }
.gedankin-world .gateway-featured { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 3rem; }
.gedankin-world .gedankin-feature { display: flex; flex-direction: column; min-height: 210px; padding: 1.5rem; background: radial-gradient(ellipse at top right, rgba(212,180,109,.1), transparent 75%), #191c25; }
.gedankin-feature > small { color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font: .65rem/1.4 var(--sans); }
.gedankin-feature > strong { margin: auto 0 .5rem; font: 1.5rem/1.3 var(--serif); }
.gedankin-feature > p { margin: 0; color: var(--muted); font: 1.1rem/1.5 var(--text); }
.gedankin-empty { margin: 1.5rem 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: 6px; background: rgba(212,180,109,.035); }
.gedankin-empty p { margin: .6rem 0 0; }
.gedankin-empty strong { color: var(--gold-bright); font: 1rem/1.5 var(--serif); }
.gedankin-records { display: grid; gap: .8rem; margin: 1.2rem 0; }
.gedankin-record { display: block; padding: 1.2rem; border: 1px solid var(--line); border-radius: 5px; text-decoration: none; background: rgba(255,255,255,.02); }
.gedankin-record:hover { border-color: var(--gold); }
.gedankin-record strong { color: var(--gold-bright); }
.gedankin-record p { margin-bottom: 0; }
.gedankin-world .search-result { width: 100%; text-align: left; cursor: pointer; }
.gedankin-world .gateway-index-intro { padding-bottom: 1rem; }
@media (max-width: 1100px) { .gedankin-world .gateway-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .gedankin-world .gateway-hero { min-height: 405px; padding: 3rem 1.2rem 4rem; }
  .gedankin-world .gateway-featured { grid-template-columns: 1fr; }
  .gedankin-world .gedankin-feature { min-height: 180px; }
  .gedankin-rules-badge { display: none; }
}
@media (max-width: 420px) { .gedankin-world .gateway-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gedankin-world .gateway-hero h1 { margin: .45rem 0 .7rem; color: #fff; font: 500 clamp(3.1rem, 8vw, 6.9rem)/1.05 var(--serif); letter-spacing: -.04em; text-shadow: 0 5px 25px rgba(0,0,0,.55); }
.gedankin-search-field { display: block; margin: .8rem 1rem; }
.gedankin-search-field input { width: 100%; min-height: 44px; padding: .65rem .8rem; background: #161b20; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); font: 16px/1.4 var(--sans); }
.gedankin-world .search-panel { background: #191c25; }
@media (max-width: 760px) { .gedankin-world .search-panel { top: 72px; max-height: calc(100dvh - 88px); } }

.gedankin-world .article-hero.portrait-hero video { width: auto; max-width: 100%; height: auto; max-height: min(72svh, 680px); margin: 0 auto; object-fit: contain; }

.gedankin-map { margin: 1.5rem 0; }
.gedankin-map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.gedankin-map-controls button { min-width: 44px; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 5px; background: #24252e; color: var(--gold-bright); cursor: pointer; font: 1rem var(--sans); }
.gedankin-map-controls button:disabled { opacity: .4; cursor: default; }
.gedankin-map-controls output { min-width: 3rem; text-align: center; font: .85rem var(--sans); }
.gedankin-map-controls a { font-size: 1rem; }
.gedankin-map-viewport { max-height: min(72svh, 800px); overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #303434; }
.gedankin-map-stage { position: relative; width: 100%; }
.gedankin-map-stage img { display: block; width: 100%; max-width: none; height: auto; }
.gedankin-map-pin { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%,-50%); border: 0; border-radius: 50%; background: radial-gradient(circle, #17252d 0 13px, #fff2ca 14px 15px, transparent 16px); color: #ffe195; text-decoration: none; font: bold .85rem var(--sans); filter: drop-shadow(0 2px 3px #000a); }
.gedankin-map-pin:hover, .gedankin-map-pin:focus-visible { background: radial-gradient(circle, #71561d 0 13px, #fff2ca 14px 15px, transparent 16px); outline: 2px solid white; z-index: 1; }
.gedankin-map-places { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
.gedankin-map-places a { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .5rem; border: 1px solid var(--line); border-radius: 5px; }
.gedankin-map-places span { color: var(--gold-bright); font: bold .9rem var(--sans); }
.gedankin-map-preview { margin: 2rem 0; }
.gedankin-map-preview a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #303434; text-align: center; }
.gedankin-map-preview img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.gedankin-map-preview span { display: block; padding: .8rem; background: #191c25; }
@media (max-width: 420px) { .gedankin-map-places { grid-template-columns: 1fr; } }

/* Keep the full navigation calm and readable; the desktop home rail stays compact. */
.gedankin-world .sidebar .sidebar-intro { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.gedankin-world .sidebar-intro > .eyebrow { margin: 0 0 .7rem; font: .65rem/1.4 var(--sans); letter-spacing: .15em; }
.gedankin-world .sidebar .featured-link { min-height: 78px; gap: .75rem; padding: .85rem; border-radius: 8px; background: linear-gradient(100deg,rgba(14,17,23,.94),rgba(14,17,23,.7)),url('assets/gedankin-map.png') center 45% / cover; border-color: rgba(212,180,109,.4); }
.gedankin-world .sidebar .featured-link .sigil { flex: 0 0 24px; font-size: 1.5rem; }
.gedankin-world .sidebar .featured-link strong { font: 600 1.05rem/1.3 var(--serif); }
.gedankin-world .sidebar .featured-link small { margin-top: .25rem; font: 1rem/1.3 var(--text); color: var(--muted); }
.gedankin-world .sidebar .browse-link { display: block; box-sizing: border-box; width: 100%; margin-top: .5rem; padding: .7rem .85rem; border-radius: 7px; background: rgba(255,255,255,.025); border-color: var(--line-soft); text-decoration: none; }
.gedankin-world .sidebar .browse-link > span { font: .6rem/1.4 var(--sans); letter-spacing: .1em; color: var(--muted); }
.gedankin-world .sidebar .browse-link strong { display: flex; align-items: center; justify-content: space-between; margin-top: .25rem; font: 600 1.05rem/1.3 var(--text); color: var(--ink); }
.gedankin-world .sidebar .browse-link strong span { font: 1rem/1 var(--sans); color: var(--gold); }
.gedankin-world .sidebar .nav-region { margin: 0 0 .4rem; padding: 0; border: 0; }
.gedankin-world .sidebar .nav-region-link { min-height: 48px; height: auto; grid-template-columns: 24px minmax(0,1fr) 12px; gap: .75rem; padding: .7rem .8rem; border: 1px solid transparent; border-radius: 7px; background: transparent; box-shadow: none; }
.gedankin-world .sidebar .nav-region-link strong { font: 600 1.1rem/1.3 var(--text); text-shadow: none; color: var(--ink); }
.gedankin-world .sidebar .nav-region-glyph { font-size: 1.15rem; text-shadow: none; }
.gedankin-world .sidebar :is(.browse-link,.featured-link,.nav-region-link):hover,
.gedankin-world .sidebar .nav-region-link.active { background: rgba(212,180,109,.08); border-color: rgba(212,180,109,.35); }
.gedankin-world .sidebar :is(.browse-link,.featured-link,.nav-region-link):focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
@media (min-width: 761px) {
  .gedankin-world.home-view .sidebar .nav-region { margin: 0 0 .55rem; padding: 0 0 .55rem; border-bottom: 1px solid rgba(255,255,255,.06); }
  .gedankin-world.home-view .sidebar .nav-region-link { width: 58px; height: 58px; grid-template-columns: 1fr; padding: 0; }
}

body.gedankin-world { isolation: isolate; background: #111319; }
.gedankin-backdrop { position: fixed; z-index: -1; inset: 0; pointer-events: none; background: #111319 url('assets/gedankin-night-sky.jpg') center / cover no-repeat; }
.gedankin-backdrop video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gedankin-backdrop::after { content: ''; position: absolute; inset: 0; background: rgba(12,15,24,.85); transition: background .2s; }
.home-view .gedankin-backdrop::after { background: linear-gradient(rgba(12,15,24,.3),rgba(12,15,24,.6) 65%,rgba(12,15,24,.9)); }
.gedankin-world .gateway-hero { background: transparent; }
.gedankin-world .gateway-hero::before { background: linear-gradient(transparent 55%,rgba(17,19,25,.65)); }
.gedankin-world .gateway-hero-inner { text-shadow: 0 2px 12px #000; }
.gedankin-world .gateway-sigil { background: rgba(13,17,28,.5); }
.background-toggle { display: block; width: 100%; margin: 1rem 0; min-height: 44px; padding: .55rem .9rem; border: 1px solid rgba(212,180,109,.45); border-radius: 999px; background: rgba(14,17,25,.94); color: var(--gold-bright); font: 1rem/1.3 var(--text); cursor: pointer; }
.background-toggle:hover { border-color: var(--gold-bright); }
.background-toggle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
@media (min-width: 761px) { .home-view .background-toggle { width: 58px; padding: .45rem .2rem; font-size: .8rem; } }
@media (prefers-reduced-motion: reduce) { .gedankin-backdrop::after { transition: none; } }
.gedankin-world:is(.characters-background,.timeline-background,.locations-background,.quotes-background,.overview-background,.factions-background) .gedankin-backdrop::after { background: rgba(12,15,24,.4); }
.gedankin-world:is(.characters-background,.timeline-background,.locations-background,.quotes-background,.overview-background,.factions-background) .app-shell { background: rgba(20,21,27,.6); }
.gedankin-world:is(.characters-background,.timeline-background,.locations-background,.quotes-background,.overview-background,.factions-background) .gedankin-record { background: rgba(22,24,31,.88); }

.gedankin-world.quotes-background .quote-card { background: rgba(22,24,31,.9); }

/* Reveal the world backdrop on narrow screens instead of covering it with the shared reading canvas. */
.gedankin-world .gedankin-backdrop { z-index: 0; }
.gedankin-world .app-shell { background: transparent; }
body.gedankin-world main { position: relative; z-index: 1; background: transparent; }
.gedankin-world .article-rail { z-index: 1; }
.gedankin-world:not(.home-view) .article-header { background: linear-gradient(125deg,rgba(28,30,39,.72),rgba(17,20,29,.82)); }
.gedankin-world:not(.home-view) .article-body { padding: clamp(.9rem,2vw,1.5rem); border: 1px solid rgba(212,180,109,.12); border-radius: 8px; background: rgba(16,19,27,.8); }
.gedankin-world:is(.characters-background,.timeline-background,.locations-background,.quotes-background,.overview-background,.factions-background) .app-shell { background: transparent; }
@media (max-width: 760px) { .gedankin-world.panels-open .topbar { z-index: 80; } }

/* Reading links and quotations share the surrounding article's Garamond type. */
.gedankin-world .geography-intro { margin: 0 0 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(18,22,30,.65); }
.gedankin-world .geography-intro h2 { margin-top: 0; }
.gedankin-world .geography-intro a { display: inline-block; margin: .25rem 1rem .25rem 0; }
.gedankin-world .character-words { margin-top: 2rem; }

.gedankin-world .character-words .quote-gallery { grid-template-columns: minmax(0,1fr); }
body.gedankin-world:not(.home-view) .subchannel-card { background: linear-gradient(100deg,rgba(9,10,13,.96),rgba(9,10,13,.7)),url('assets/gedankin-map.png') center / cover; }

/* Keep search previews readable without overwhelming the result title. */
.gedankin-world .search-result p { margin: .4rem 0 0; color: var(--muted); font: 1rem/1.5 var(--text); overflow-wrap: anywhere; }
.gedankin-world .search-result:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: -3px; }

/* Give the world name its own space instead of letting it spill into search. */
body.gedankin-world .topbar .brand > span:last-child { min-width: 0; }
body.gedankin-world .topbar .brand small {
  margin-top: .35rem;
  font: .65rem/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .02em;
  text-transform: none;
  white-space: nowrap;
}
body.gedankin-world .topbar .search-shell input { min-width: 0; font: .9rem/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
@media (min-width: 761px) {
  body.gedankin-world:not(.home-view) .topbar { gap: 1.25rem; padding-inline: 1.5rem; }
  body.gedankin-world:not(.home-view) .topbar .brand { flex: 0 0 310px; }
  body.gedankin-world .topbar .brand-mark { width: 44px; height: 44px; }
  body.gedankin-world .topbar .brand strong { font-size: 1rem; letter-spacing: .015em; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  body.gedankin-world:not(.home-view) .topbar { padding-inline: 1rem; gap: 1rem; }
  body.gedankin-world:not(.home-view) .topbar .brand { flex-basis: 300px; }
}
@media (max-width: 760px) {
  body.gedankin-world .topbar .brand strong { font-size: clamp(.7rem, 2.8vw, .9rem); letter-spacing: 0; }
  body.gedankin-world .topbar .brand-mark { width: 34px; height: 34px; }
}
