:root {
    --bg: #fcfbf8;
    --surface: #ffffff;
    --ink: #1c1a19;
    --muted: #77706b;
    --line: #ece8e1;
    --red: #d3202b;
    --red-soft: #fdeceb;
    --gold: #e9b72e;
    --gold-soft: #fbf3d9;
    --radius: 18px;
}

* { box-sizing: border-box; margin: 0; }
:root { --gutter: max(40px, calc((100vw - 1120px) / 2)); }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Sans', system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px var(--gutter);
    background: rgba(252, 251, 248, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}


.topbar nav {
    display: flex;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.topbar nav a {
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--muted);
    font-size: .92rem;
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.topbar nav a:hover { background: var(--red-soft); color: var(--red); }

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding: 52px var(--gutter) 44px;
}

.hexes {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 36px);
    width: auto;
    max-width: 90vw;
}

.hexes polygon { fill: var(--red); }
.hexes .l1 { opacity: .07; }
.hexes .l2 { opacity: .13; }
.hexes .l3 { opacity: .22; }
.hexes .l4 { opacity: .34; }
.hexes .gold { fill: var(--gold); opacity: .55; }

.hero-text { position: relative; max-width: 1120px; }
.hero.dragging { user-select: none; }

.eyebrow {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--gold-soft);
    color: #7a5b00;
    font-weight: 700;
    font-size: .8rem;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    margin: 14px 0 14px;
    max-width: 13ch;
}

.hero .sub { max-width: 50ch; font-size: 1.2rem; color: var(--muted); }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    text-decoration: none;
    font-weight: 500;
    transition: transform .15s, border-color .2s;
}

.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #b9141e; border-color: #b9141e; }

/* Sections */
main { padding: 0 var(--gutter) 56px; }

.category { padding-top: 88px; }

.sec-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 32px; }

.sec-head .num {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--red-soft);
    color: var(--red);
    font-size: .85rem;
    font-weight: 700;
}

.sec-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.sec-head p { color: var(--muted); margin-top: 8px; max-width: 58ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.grid.projects { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(28, 26, 25, .07); border-color: #e0dad0; }

/* Map cards */
.map-card .thumb {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: #fff;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.map-card .thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s; }
.map-card .thumb:hover img { transform: scale(1.03); }

.tag {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 3px 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    color: var(--red);
    font-size: .75rem;
    font-weight: 700;
}

.map-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.map-card h3 { font-size: 1.05rem; line-height: 1.3; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .85rem; }
.meta i { margin-right: 4px; }

.link {
    margin-top: auto;
    color: var(--red);
    font-weight: 700;
    text-decoration: none;
    font-size: .9rem;
}

.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Work cards */
.work-card { padding: 24px 24px 22px; gap: 10px; }
.work-card h3 { font-size: 1.15rem; }
.work-card p { font-size: .95rem; color: #4a4541; }

.kind {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--red-soft);
    color: var(--red) !important;
    font-size: .72rem !important;
    font-weight: 700;
}

.work-card:nth-child(even) .kind { background: var(--gold-soft); color: #7a5b00 !important; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.chips li { padding: 2px 10px; border-radius: 12px; border: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

.ctx { margin-top: auto; padding-top: 10px; color: var(--muted) !important; font-size: .83rem !important; }

/* About */
.about-grid { display: grid; gap: 36px; }

.lead { font-size: clamp(1.4rem, 2.8vw, 2rem); line-height: 1.35; letter-spacing: -0.02em; font-weight: 500; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.facts div { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.facts b { display: block; margin-bottom: 4px; }
.facts span { color: var(--muted); font-size: .92rem; }
.chips.big li { font-size: .88rem; padding: 5px 14px; color: var(--ink); }


footer {
    padding: 40px var(--gutter) 56px;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

footer a { color: var(--red); text-decoration: none; }

a:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px 16px; }
    .topbar nav { order: 3; flex-basis: 100%; }
    .hero { padding: 40px 20px 36px; }
    .hexes { right: -240px; opacity: .6; }
    main { padding: 0 20px 32px; }
    :root { --gutter: 20px; }
    .category { padding-top: 60px; }
    .grid, .grid.projects { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .btn, .map-card .thumb img { transition: none; }
    .card:hover, .btn:hover { transform: none; }
}

/* CHAMP interactive map */
.champ-card { grid-column: 1 / -1; padding: 24px; gap: 16px; }
.champ-card .champ-head p:not(.kind) { color: #4a4541; max-width: 70ch; margin-top: 6px; }
.champ-card h3 { font-size: 1.4rem; margin-top: 6px; }

.champ-controls { display: flex; flex-wrap: wrap; gap: 10px 24px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }

.seg button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: .88rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.seg button:hover:not(:disabled) { border-color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.champ-stage { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
#champ-leaflet { height: 520px; background: #eceae5; z-index: 0; }
.champ-canvas { position: absolute; inset: 0; z-index: 450; pointer-events: none; }

.champ-tip {
    position: absolute;
    z-index: 700;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(28, 26, 25, .92);
    color: #fff;
    font-size: .82rem;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
}

.champ-legend {
    position: absolute;
    left: 12px;
    bottom: 28px;
    z-index: 600;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    font-size: .78rem;
}

.champ-legend .legend-title { font-weight: 700; margin-bottom: 2px; font-size: .8rem; color: var(--ink); }
.champ-legend span { display: flex; align-items: center; gap: 8px; }
.champ-legend i { width: 16px; height: 12px; border-radius: 3px; }

.champ-status { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 700; font-size: .85rem; color: var(--muted); background: rgba(255,255,255,.9); padding: 2px 12px; border-radius: 12px; }
.champ-status:empty { display: none; }

@media (max-width: 760px) {
    #champ-leaflet { height: 420px; }
    .champ-card { padding: 16px; }
}

@media (max-width: 760px) {
    .champ-legend { grid-template-columns: repeat(2, auto); column-gap: 14px; padding: 8px 10px; }
    .champ-legend .legend-title { grid-column: 1 / -1; }
}

/* Sub-groups inside a section */
.subgroup { margin-bottom: 56px; }
.subgroup:last-child { margin-bottom: 0; }
.subhead { font-size: 1.25rem; }
.subdesc { color: var(--muted); margin: 4px 0 20px; }

/* Interactive hero hexagons */
.hexes { pointer-events: none; }
.hexes polygon { transition: opacity .25s, fill .25s; }
.hexes g g polygon { transition: none; }

@media (prefers-reduced-motion: reduce) {
    .hexes polygon { transition: none; }
}



@media (max-width: 760px) {
    .topbar { padding-left: 20px; padding-right: 20px; }
}

.links { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.links .link {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: border-color .2s, background .2s;
}
.links .link:hover { border-color: var(--red); background: var(--red-soft); text-decoration: none; }
