:root {
  color-scheme: light dark;
  --bg: #f5f0e7; --bg-soft: #e9e1d4; --panel: #fffaf2;
  --text: #241f1c; --muted: #665b52; --line: #4b39282b;
  --accent: #82482e; --accent-2: #246a68; --gold: #b9873d;
  --shadow: 0 12px 36px #38271514;
}
:root[data-theme="dark"] {
  --bg: #14191d; --bg-soft: #1b2329; --panel: #20292f;
  --text: #f2e9db; --muted: #bdb5aa; --line: #e5d0b22e;
  --accent: #e0a573; --accent-2: #8ac4bd; --gold: #d2a259;
  --shadow: 0 12px 36px #0003;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #14191d; --bg-soft: #1b2329; --panel: #20292f;
    --text: #f2e9db; --muted: #bdb5aa; --line: #e5d0b22e;
    --accent: #e0a573; --accent-2: #8ac4bd; --gold: #d2a259;
    --shadow: 0 12px 36px #0003;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 110px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.75 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { min-height: 55vh; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1,h2,h3 { line-height: 1.2; text-wrap: balance; font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.7rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.1rem; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 50; padding: 12px; background: var(--panel); }
.skip-link:focus { top: 10px; }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav { width: min(1180px, calc(100% - 32px)); min-height: 80px; margin: auto; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; }
.brand { grid-column: 1; grid-row: 1; }
.brand img { width: 144px; height: 72px; object-fit: contain; }
.nav-links { grid-column: 2; grid-row: 1; display: flex; justify-content: center; align-items: center; gap: 2px; min-width: 0; }
.nav-links a,.control { border: 1px solid transparent; border-radius: 7px; padding: 9px 10px; font: 600 14px/1.3 system-ui,sans-serif; white-space: nowrap; }
.nav-links a:hover,.control:hover { background: var(--bg-soft); }
.nav-links a[aria-current] { color: var(--accent); background: var(--bg-soft); border-color: var(--line); }
.controls { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 3px; }
.control { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; color: var(--text); background: transparent; cursor: pointer; }
.nav-toggle,.nav-toggle[hidden] { display: none; }
.breadcrumbs { display: flex; gap: 10px; flex-wrap: wrap; width: min(1180px, calc(100% - 32px)); margin: 18px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.breadcrumbs a:hover { color: var(--accent-2); text-decoration: underline; }
.hero { position: relative; isolation: isolate; background: #17242a var(--hero-image) center/cover no-repeat; color: #fff8ec; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#101820e8,#10182093 65%,#10182040); }
.hero-inner { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 65px 0; max-width: 1180px; }
.hero-inner h1,.hero-inner .lead { max-width: 760px; }
.hero h1 { font-size: clamp(2.4rem,5.4vw,4.8rem); }
.lead { font-size: clamp(1.05rem,1.8vw,1.25rem); line-height: 1.7; }
.eyebrow { display: block; color: var(--gold); font: 700 12px/1.5 system-ui,sans-serif; text-transform: uppercase; letter-spacing: .13em; margin-bottom: 15px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 12px 20px; border: 1px solid var(--line); border-radius: 7px; font: 700 15px/1.4 system-ui,sans-serif; cursor: pointer; }
.button.primary { color: #fff9ed; background: #8b4c2c; border-color: #ba8354; }
.button.primary:hover { background: #a05d35; }
.button.ghost { color: #fff9ed; background: #10182055; border-color: #fff7; }
.section { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 48px 0 64px; }
.section-head { max-width: 920px; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 1.1rem; max-width: 780px; }
.section-head h2 { margin-top: 0; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 24px; align-items: stretch; }
.portal-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.portal-card:hover { border-color: var(--gold); }
.portal-card > img { flex: none; width: 100%; height: auto; aspect-ratio: 3/2; object-fit: cover; }
.portal-card.portrait-card > img { aspect-ratio: 3/2; object-position: center 25%; }
.portal-card > div { padding: 24px; display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.portal-card .card-action { margin-top: auto; padding-top: 12px; }
.portal-card h2 { margin: 0 0 14px; font-size: 1.65rem; }
.portal-card p { color: var(--muted); font-size: 1rem; }
.card-action { display: block; margin-top: 18px; color: var(--accent-2); font-size: 15px; font-weight: 700; }
.story-panel { max-width: 880px; margin: 0 auto; padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.story-panel a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 4px; }
.story-panel p { line-height: 1.9; }
.story-panel section + section { margin-top: 40px; }
.quote { margin: 0 0 24px; padding-left: 20px; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; }
.grid { display: grid; gap: 24px; }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.card { padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.card h2,.card h3 { margin-top: 0; }
.race-entry { display: grid; grid-template-columns: minmax(170px,.65fr) minmax(0,1.35fr); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 28px; }
.race-entry > img { width: 100%; height: 340px; object-fit: contain; align-self: center; }
.race-entry > div { padding: 28px; }
.race-entry h2 { margin-top: 0; }
.muted { color: var(--muted); }
.world-entries { display: grid; gap: 32px; }
.world-card { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.world-card figure { margin: 0; align-self: start; }
.world-card img { width: 100%; height: auto; }
.world-card.feature-card { grid-template-columns: 1fr; }
.feature-card .world-copy { max-width: 85ch; }
.world-copy { padding: 28px; min-width: 0; }
.world-copy h2 { margin-top: 0; }
.world-table { overflow-x: auto; }
.world-table table { border-collapse: collapse; width: 100%; }
.world-table th,.world-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.world-map { margin: 0; position: relative; }
.world-map img { width: 100%; height: auto; }
.map-label { position: absolute; transform: translate(-50%,-50%); padding: .15rem .4rem; background: #f9edcddd; color: #181b24; border-radius: 4px; font-size: clamp(.6rem,1.1vw,1rem); font-weight: 700; white-space: nowrap; }
.map-city { z-index: 1; min-height: 32px; display: inline-flex; align-items: center; padding: .3rem .55rem; border: 2px solid #735393; text-decoration: underline; background: #fff5df; }
.map-city:hover,.map-city:focus-visible { z-index: 3; background: #efe0ff; outline: 3px solid #8056b0; outline-offset: 2px; }
.map-destinations { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin: 1rem 0; }
.map-regions { display: none; }
.related-reading { margin: 38px 0 0; padding: 24px; border-top: 1px solid var(--line); }
.related-reading h2 { margin-top: 0; font-size: 1.4rem; }
.text-link { display: inline-block; color: var(--accent-2); padding: 8px 0; margin-right: 24px; font-weight: 650; }
.text-link:hover { text-decoration: underline; }
.search-page { max-width: 900px; }
.search-form label { display: block; font-weight: 650; margin: 24px 0 8px; }
.search-form > div { display: flex; gap: 12px; }
.search-form input { width: 100%; min-width: 0; padding: 12px 16px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.search-form button { flex-shrink: 0; }
[data-search-status] { margin: 22px 0; color: var(--muted); }
.search-result { padding: 24px 0; border-bottom: 1px solid var(--line); }
.search-result h2 { margin: 8px 0; font-size: 1.7rem; }
.search-result a { color: var(--accent-2); }
.search-result p { margin-bottom: 0; }
.footer { display: flex; gap: 14px 26px; flex-wrap: wrap; justify-content: center; padding: 30px 24px; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }
.footer a { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width:900px) {
  .nav { width: calc(100% - 24px); min-height: 70px; gap: 6px; grid-template-columns: auto 1fr auto; padding: 6px 0; }
  .brand img { width: 112px; height: 56px; }
  .nav-toggle { display: inline-flex; grid-column: 2; grid-row: 1; justify-self: end; }
  .nav-links { grid-column: 1/-1; grid-row: 2; flex-direction: column; align-items: stretch; padding: 8px 0; gap: 4px; }
  .nav-links a { padding: 13px 16px; }
  .site-header[data-nav-ready] .nav-links { display: none; }
  .site-header[data-nav-open="true"] .nav-links { display: flex; }
  .controls { gap: 0; }
  .controls .control { padding: 8px; min-height: 44px; }
  .grid.three { grid-template-columns: 1fr; }
  .world-card { grid-template-columns: 1fr; }
}
@media (max-width:620px) {
  .world-map > span.map-label { display: none; }
  .map-regions { display: block; font-size: .95rem; }
  .map-regions h2 { font-size: 1.15rem; margin: 0 0 8px; }
  .map-regions ul { columns: 2; padding-left: 20px; margin: 0; }
  body { font-size: 16px; }
  .section { padding: 32px 0 40px; }
  .hero-inner { padding: 40px 0; }
  .hero h1 { font-size: 2.5rem; }
  .breadcrumbs { margin-top: 14px; font-size: 13px; }
  .portal-grid,.grid.two { grid-template-columns: 1fr; }
  .portal-card > div,.world-copy,.story-panel { padding: 22px; }
  .race-entry { grid-template-columns: 1fr; }
  .race-entry > img { height: 270px; }
  .race-entry > div { padding: 22px; }
  .search-form > div { gap: 8px; }
  .search-form button { padding: 12px 14px; }
  .related-reading { padding: 22px 0; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
