:root {
  --bg: #f6f0e5; --surface: #fffaf2; --band: #ede3d2; --ink: #2a231c; --muted: #75685a; --line: #e0d4bf;
  --accent: #a44a2a; --accent-ink: #fff; --olive: #5d6b3a; --shadow: 0 1px 2px rgba(60,40,20,.06), 0 6px 20px rgba(60,40,20,.07);
  --serif: "EB Garamond", "Noto Serif", Georgia, serif; --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px; --wrap: 1160px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #181512; --surface: #221d18; --band: #1e1a16; --ink: #efe6d8; --muted: #a8998a; --line: #3a322a;
  --accent: #e08a62; --accent-ink: #1b1410; --olive: #a7b67a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
} }
:root[data-theme="dark"] {
  --bg: #181512; --surface: #221d18; --band: #1e1a16; --ink: #efe6d8; --muted: #a8998a; --line: #3a322a;
  --accent: #e08a62; --accent-ink: #1b1410; --olive: #a7b67a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.005em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
section.wrap { margin-top: 64px; margin-bottom: 64px; }
.kicker { font: 600 .75rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.lede { font-size: 1.18rem; color: var(--ink); }
.greek { font-family: var(--serif); font-style: italic; color: var(--muted); }
.greek.big { font-size: 1.4rem; margin-top: -4px; }
.meta { color: var(--muted); font-size: .9rem; }
.tag { display: inline-block; font: 600 .68rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; background: var(--olive); color: #fff; padding: 4px 7px; border-radius: 4px; vertical-align: middle; }

/* header */
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 24px; padding: 14px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font: 500 1.35rem/1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand .mark { color: var(--accent); }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--ink); text-decoration: none; font-size: .95rem; padding: 4px 0; border-bottom: 2px solid transparent; }
.top nav a:hover, .top nav a[aria-current] { border-color: var(--accent); }
.menu { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; font-size: 1.1rem; padding: 4px 10px; cursor: pointer; }
@media (max-width: 760px) {
  .menu { display: block; }
  .top { flex-wrap: wrap; padding: 12px 16px; }
  .top nav { display: none; width: 100%; flex-direction: column; gap: 4px; margin: 6px 0 4px; }
  body.nav-open .top nav { display: flex; }
}

/* buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .95rem; margin: 0 10px 10px 0; border: 1px solid var(--accent); }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn.ghost.dark { color: var(--ink); border-color: var(--ink); }

/* hero */
.hero { min-height: 78vh; display: flex; align-items: flex-end; background-size: cover; background-position: center; color: #fff; }
.hero.small { min-height: 46vh; }
.hero-in { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 48px 24px; }
.hero h1 { color: #fff; margin-bottom: .1em; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.hero .kicker { color: #f3d7c6; }
.hero-gr { font: italic 1.6rem/1.2 var(--serif); color: #f1e6d6; margin-bottom: 18px; }
.hero .lede { color: #fff; max-width: 620px; }
.hero .crumbs, .hero .crumbs a { color: #f1e6d6; }
.credit { font-size: .78rem; color: var(--muted); margin-top: 8px !important; }
.credit a { color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: -40px !important; position: relative; }
.stats div { background: var(--surface); padding: 22px; text-align: center; }
.stats strong { display: block; font: 500 2.4rem/1 var(--serif); color: var(--accent); }
.stats span { color: var(--muted); font-size: .88rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* layout */
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
.split.rev { grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 900px) { .split, .split.rev { grid-template-columns: 1fr; gap: 28px; } }
.band { background: var(--band); padding: 64px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.page-head { margin-top: 48px !important; margin-bottom: 24px !important; }
.page-head .lede { max-width: 680px; color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }

/* cards */
.craft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 36px; }
.craft-card, .person-card, .village-card, .topic-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.craft-card:hover, .person-card:hover, .village-card:hover, .topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cc-img { aspect-ratio: 4/3; background: var(--band) center/cover; }
.cc-body, .pc-body { padding: 16px 18px 18px; }
.cc-body h3, .pc-body h3 { margin-bottom: 2px; }
.cc-body .greek { font-size: .95rem; margin-bottom: 8px; }
.cc-body p { font-size: .92rem; margin-bottom: 8px; }
.group-h { margin-top: 12px; margin-bottom: 0; }
.group-sub { color: var(--muted); margin-bottom: 18px; }

.village-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 20px; }
.village-card { padding: 14px 16px; }
.village-card h3 { font-size: 1.2rem; margin: 0; }
.village-card h3 .greek { font-size: .95rem; }
.village-card .meta { margin: 0; font-size: .82rem; }
.village-card .count { margin: 6px 0 0; font-size: .85rem; color: var(--olive); font-weight: 500; }

.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.person-card .portrait { aspect-ratio: 1/1; background: var(--band) center/cover; position: relative; }
.person-card .portrait .tag { position: absolute; top: 12px; left: 12px; }
.person-card.is-sample .portrait { filter: sepia(.35) saturate(.8); }
.pc-quote { font: italic 1.05rem/1.4 var(--serif); color: var(--muted); margin: 8px 0 0; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.topic-card { padding: 22px; border-left: 4px solid var(--olive); }
.topic-card .greek { margin-top: -4px; }
.topic-card p:last-child { margin: 0; color: var(--muted); font-size: .95rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .88rem; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* map */
.map { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--band); z-index: 0; }
.split > div:has(> .map) { position: sticky; top: 90px; }
@media (max-width: 900px) { .map { height: 360px !important; } .split > div:has(> .map) { position: static; } }

/* tree */
.tree, .tree ul { list-style: none; padding-left: 0; margin: 0; }
.tree ul { padding-left: 22px; border-left: 1px solid var(--line); margin: 6px 0 10px 6px; }
.tree li { padding: 3px 0; }
.tree .lvl-island > a strong { font-size: 1.5rem; font-family: var(--serif); font-weight: 500; }
.tree .lvl-region > a strong { font-size: 1.25rem; font-family: var(--serif); font-weight: 500; }
.tree .meta { font-size: .8rem; }

/* facts */
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.facts.sticky { position: sticky; top: 90px; }
.facts h3 { font: 600 .74rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
.facts h3:first-child { margin-top: 0; }
.facts dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; }
.facts .map { margin-top: 8px; }
@media (max-width: 900px) { .facts.sticky { position: static; } }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: 8px; }
.months span { text-align: center; font-size: .72rem; padding: 6px 0; border-radius: 4px; background: var(--band); color: var(--muted); }
.months span.on { background: var(--olive); color: #fff; font-weight: 600; }

/* prose */
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose a.ext::after { content: " ↗"; font-size: .8em; }

/* empty */
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px 28px; background: color-mix(in srgb, var(--surface) 60%, transparent); max-width: 720px; }
.empty p:last-child { margin: 0; color: var(--muted); }

/* person page */
.sample-banner { background: var(--olive); color: #fff; text-align: center; padding: 10px 16px; font-size: .92rem; }
.person-head { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: end; margin-top: 48px !important; }
.portrait.big { aspect-ratio: 4/5; border-radius: var(--radius); background: var(--band) center/cover; box-shadow: var(--shadow); }
@media (max-width: 760px) { .person-head { grid-template-columns: 1fr; } .portrait.big { max-width: 260px; } }
blockquote.pull { margin: 22px 0 0; padding: 0 0 0 22px; border-left: 3px solid var(--accent); font: italic 1.5rem/1.35 var(--serif); }
blockquote.pull .greek { display: block; font-size: 1.05rem; margin-top: 8px; }
.video { aspect-ratio: 16/9; background: #14110e; border-radius: var(--radius); overflow: hidden; }
.video iframe { width: 100%; height: 100%; border: 0; }
.video-ph { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #b8a996; }
.video-ph span { font-size: 2.6rem; width: 84px; height: 84px; border-radius: 50%; border: 2px solid #6b5d4e; display: grid; place-items: center; padding-left: 6px; }
.video-ph p { margin: 14px 0 0; font-size: .9rem; }
.chapters { list-style: none; padding: 0; margin: 18px 0 32px; border-top: 1px solid var(--line); }
.chapters li a { display: flex; gap: 16px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.chapters li a:hover { background: var(--surface); }
.chapters .time { font-variant-numeric: tabular-nums; color: var(--accent); min-width: 48px; font-weight: 600; font-size: .9rem; padding-top: 2px; }

/* people table */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { font: inherit; font-size: .95rem; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.filters input { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .95rem; }
table.data th { text-align: left; font: 600 .72rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--band); }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }

/* sources */
.source { padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.source h3 { margin-bottom: 0; }
.source:target { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 36px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; color: var(--muted); font-size: .9rem; max-width: var(--wrap); margin: 40px auto 0; }
.foot strong { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); font-weight: 500; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  section.wrap { margin-top: 44px; margin-bottom: 44px; }
  .hero { min-height: 70vh; }
  .hero-in { padding: 32px 16px; }
}
