/* ---------------------------------------------------------------------------
   Start page.

   Same two surfaces the game itself uses: the deep-green title card (the
   in-game City Desk) for the hero, and the cream "paper" of the 3D HUD
   (css/paper.css) for everything below it.  Ink type, hairline rules, one
   signal colour for the primary action.
   --------------------------------------------------------------------------- */

:root {
    --green-950: #04180f;
    --green-900: #072a1f;
    --green-800: #0b3d2c;
    --green-700: #0f5138;
    --green-500: #187a55;
    --mint: #9fe2bc;
    --mint-soft: rgba(159, 226, 188, .14);

    --paper: #FFFDF8;
    --canvas: #F5F1E8;
    --sand: #EDE8DC;
    --hairline: #E3DDD0;
    --ink: #12233F;
    --ink-soft: #3a4a63;
    --slate: #6B7280;
    --signal: #F2622E;
    --signal-dark: #D9501F;
    --gold: #E8C46B;
    --harbor: #2C6FB0;
    --moss: #2F8F6B;

    --shadow: 0 1px 0 rgba(18, 35, 63, .04), 0 10px 28px -14px rgba(18, 35, 63, .28);
    --lift: 0 22px 50px -22px rgba(18, 35, 63, .45);
    --radius: 18px;

    --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --sans: "Be Vietnam Pro", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--canvas);
    scroll-behavior: smooth;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--slate);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

:focus-visible {
    outline: 3px solid var(--signal);
    outline-offset: 3px;
    border-radius: 6px;
}

/* -- brand mark: the flag as three bars ------------------------------------ */
.brand-mark {
    display: inline-grid;
    grid-template-columns: repeat(3, 1fr);
    width: 26px;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
    flex: none;
}
.brand-mark i { display: block; background: #008751; }
.brand-mark i:nth-child(2) { background: #fff; }

/* -- top bar ---------------------------------------------------------------- */
.topbar {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 32px;
    color: #eaf5ef;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.brand-name {
    font-family: var(--serif);
    font-size: 24px;
    letter-spacing: -.02em;
}
.brand-tag {
    padding: 2px 8px;
    border: 1px solid rgba(232, 196, 107, .45);
    border-radius: 999px;
    color: var(--gold);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.topnav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.topnav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(234, 245, 239, .82);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.topnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lang select {
    appearance: none;
    -webkit-appearance: none;
    margin-left: 6px;
    padding: 8px 30px 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23eaf5ef' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #eaf5ef;
    font: 600 13px var(--sans);
    cursor: pointer;
}
.lang select option { color: var(--ink); }

/* -- hero ------------------------------------------------------------------- */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    padding: 128px max(32px, calc((100vw - 1200px) / 2 + 32px)) 96px;
    overflow: hidden;
    color: #eaf5ef;
    background:
        radial-gradient(60% 70% at 78% 40%, rgba(24, 122, 85, .55), transparent 70%),
        radial-gradient(50% 60% at 0% 0%, rgba(232, 196, 107, .10), transparent 70%),
        linear-gradient(160deg, var(--green-800) 0%, var(--green-900) 55%, var(--green-950) 100%);
}
/* faint isometric grid, the board the game is played on */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(26.565deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 44px),
        repeating-linear-gradient(-26.565deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 44px);
    -webkit-mask-image: radial-gradient(70% 80% at 70% 50%, #000, transparent 75%);
    mask-image: radial-gradient(70% 80% at 70% 50%, #000, transparent 75%);
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 196, 107, .5), transparent);
}
.hero > * { position: relative; }
.hero .eyebrow { color: var(--mint); }
.hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.8rem, 6vw, 5.1rem);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.035em;
    color: #fbf8ef;
}
.hero h1 em {
    font-style: italic;
    color: var(--gold);
}
.lede {
    max-width: 34em;
    margin: 22px 0 0;
    color: rgba(234, 245, 239, .78);
    font-size: 17.5px;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 700 15px var(--sans);
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn-primary {
    background: var(--signal);
    color: #fff;
    box-shadow: 0 10px 24px -10px rgba(242, 98, 46, .8);
}
.btn-primary:hover { background: var(--signal-dark); transform: translateY(-1px); }
.btn-primary svg { transition: transform .15s ease; }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .04);
    color: #eaf5ef;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .09); }

.hero-facts {
    display: flex;
    gap: 36px;
    margin: 44px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-facts div { display: flex; flex-direction: column-reverse; }
.hero-facts dt {
    color: rgba(234, 245, 239, .58);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hero-facts dd {
    margin: 0;
    font-family: var(--serif);
    font-size: 34px;
    line-height: 1.1;
    color: #fbf8ef;
}

/* the map */
.hero-map { margin: 0; }
.map-plate {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1;
    margin: 0 auto;
}
/* The silhouette itself is only a soft offset shadow; the green land is the
   masked layer above it, so it stays crisp at every size. */
.map-shape {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    filter: brightness(0);
    opacity: .35;
    transform: translate(6px, 10px);
}
.map-plate::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(60% 60% at 35% 70%, rgba(159, 226, 188, .9), transparent 70%),
        linear-gradient(160deg, #3c9a72, #1d6a4b);
    -webkit-mask: url("../assets/nigeria.svg") center / contain no-repeat;
    mask: url("../assets/nigeria.svg") center / contain no-repeat;
    pointer-events: none;
}
.map-plate::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 8%;
    height: 14%;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent);
    filter: blur(6px);
}
.map-links,
.map-pins {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
}
.map-links polyline {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2px;
    stroke-dasharray: 6 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    animation: corridor 18s linear infinite;
}
@keyframes corridor { to { stroke-dashoffset: -220; } }

.map-pins { margin: 0; padding: 0; list-style: none; }
.map-pin {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid #fbf8ef;
    border-radius: 50%;
    background: var(--green-900);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
    animation: pin-in .5s cubic-bezier(.2, .9, .3, 1.3) both;
    animation-delay: var(--d, 0ms);
}
.map-pin span {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(4, 24, 15, .72);
    color: #fbf8ef;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.map-pin.is-start { background: var(--signal); }
.map-pin.is-start::after {
    content: "";
    position: absolute;
    inset: -8px;
    border: 2px solid var(--signal);
    border-radius: 50%;
    animation: pulse 2.2s ease-out infinite;
}
@keyframes pin-in { from { opacity: 0; transform: translateY(-10px) scale(.6); } }
@keyframes pulse {
    from { opacity: .9; transform: scale(.6); }
    to   { opacity: 0;  transform: scale(1.8); }
}
.hero-map figcaption {
    margin-top: 6px;
    color: rgba(234, 245, 239, .55);
    font-size: 13px;
    text-align: center;
}

/* -- sections on paper ------------------------------------------------------- */
main > .section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 32px 0;
}
.section-head { margin-bottom: 28px; }
.section-head h2 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.08;
}

/* scenarios */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.scenario-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.scenario-card:hover,
.scenario-card:focus-visible {
    transform: translateY(-4px);
    border-color: #d6cdb9;
    box-shadow: var(--lift);
}
.scenario-card:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.scenario-art {
    position: relative;
    display: grid;
    place-items: center;
    height: 260px;
    overflow: hidden;
}
.scenario-art > img,
.nigeria-shape { transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.scenario-card:hover .scenario-art > img,
.scenario-card:hover .nigeria-shape { transform: scale(1.04); }
.scenario-art-nigeria {
    background:
        radial-gradient(70% 80% at 50% 45%, rgba(24, 122, 85, .5), transparent 70%),
        linear-gradient(160deg, var(--green-800), var(--green-950));
}
.nigeria-shape {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(50% 50% at 30% 72%, rgba(159, 226, 188, .95), transparent 70%),
        linear-gradient(160deg, #3c9a72, #1d6a4b);
    -webkit-mask: url("../assets/nigeria.svg") center / contain no-repeat;
    mask: url("../assets/nigeria.svg") center / contain no-repeat;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35));
}
.scenario-art-lagos {
    background:
        radial-gradient(70% 70% at 50% 40%, #fffaf0, transparent 75%),
        linear-gradient(180deg, #f6efe0, #e9dfc8);
}
.scenario-art-lagos img { width: 100%; height: 100%; object-fit: contain; padding: 10px 0 4px; }
.scenario-ribbon {
    position: absolute;
    left: 16px;
    bottom: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 253, 248, .94);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow);
}
.scenario-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 24px 24px;
}
.scenario-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: #DDF0E7;
    color: #1f6e50;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.chip-water { background: #DFEBF6; color: #245c93; }
.city-list-year {
    color: var(--slate);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
}
.city-list-year::before { content: "Starts "; font-family: var(--sans); font-weight: 500; }
.scenario-card h3 {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.02em;
}
.city-list-descript {
    margin: 2px 0 0;
    color: var(--slate);
    font-size: 14px;
    font-weight: 600;
}
.scenario-blurb {
    margin: 12px 0 18px;
    color: var(--ink-soft);
}
.scenario-go {
    margin-top: auto;
    color: var(--signal-dark);
    font-size: 14px;
    font-weight: 700;
}
.scenario-go span { display: inline-block; transition: transform .15s ease; }
.scenario-card:hover .scenario-go span { transform: translateX(4px); }

/* mandates */
.mandate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--hairline);
    list-style: none;
    box-shadow: var(--shadow);
}
.mandate-grid li {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "num city"
        "num title"
        "num region";
    column-gap: 16px;
    padding: 22px 24px;
    background: var(--paper);
    transition: background .15s ease;
}
.mandate-grid li:hover { background: #fffaf0; }
.m-num {
    grid-area: num;
    color: var(--signal);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    padding-top: 3px;
}
.m-city {
    grid-area: city;
    color: var(--slate);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.m-title {
    grid-area: title;
    margin: 4px 0 6px;
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -.01em;
}
.m-region {
    grid-area: region;
    color: var(--slate);
    font-size: 13px;
}

/* systems */
.system-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.system-grid li {
    padding: 22px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--paper);
}
.system-grid h3 {
    margin: 16px 0 6px;
    font-size: 16px;
    font-weight: 700;
}
.system-grid p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.sys-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}
.sys-icon svg,
.tool-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sys-water  { background: #DFEBF6; color: var(--harbor); }
.sys-season { background: #FBF0D5; color: #9A6A08; }
.sys-health { background: #F8E0DD; color: #C8423B; }
.sys-people { background: #DDF0E7; color: var(--moss); }

/* tools */
.tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    background: var(--paper);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tool-card:hover { border-color: #d6cdb9; box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card strong { display: block; font-size: 15px; }
.tool-card small { display: block; color: var(--slate); font-size: 13.5px; }
.tool-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--paper);
}

/* footer */
.footer {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 28px 32px 40px;
    border-top: 1px solid var(--hairline);
    color: var(--slate);
    font-size: 13.5px;
}
.footer .brand-mark { box-shadow: 0 0 0 1px var(--hairline); }
.footer-license {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
}

/* -- briefing dialog ------------------------------------------------------------ */
#popup-window-back {
    position: fixed;
    inset: 0;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 24, 15, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility 0s linear .18s;
}
#popup-window-back.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .18s ease;
}
#popup-window {
    width: min(100%, 520px);
    padding: 32px;
    border: 1px solid var(--hairline);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 40px 80px -30px rgba(4, 24, 15, .6);
    transform: translateY(10px) scale(.98);
    transition: transform .22s cubic-bezier(.2, .9, .3, 1.1);
}
#popup-window-back.is-open #popup-window { transform: none; }
#popup-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.1;
}
#popup-text {
    margin: 14px 0 28px;
    color: var(--ink-soft);
    font-size: 16.5px;
    white-space: pre-wrap;
}
.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--hairline);
}
.popup-actions .btn-ghost {
    border-color: var(--hairline);
    background: var(--paper);
    color: var(--ink);
}
.popup-actions .btn-ghost:hover { border-color: var(--ink); background: var(--sand); }

/* -- responsive ----------------------------------------------------------------- */
@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 112px;
        padding-bottom: 64px;
    }
    .hero-map { order: -1; }
    .map-plate { width: min(100%, 380px); }
    .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mandate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tools { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar { padding: 16px; }
    .topnav a { display: none; }
    .hero { padding: 88px 16px 52px; }
    .lede { font-size: 16px; }
    .hero-facts { gap: 28px; }
    .map-pin span { font-size: 10.5px; padding: 2px 6px; left: 12px; }
    main > .section { padding: 56px 16px 0; }
    .scenario-grid,
    .mandate-grid,
    .system-grid { grid-template-columns: 1fr; }
    .scenario-art { height: 210px; }
    .footer { flex-wrap: wrap; padding: 24px 16px 32px; margin-top: 56px; }
    .footer-license { margin-left: 0; }
    #popup-window { padding: 24px; }
    .popup-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

main > .load-game-section {
    padding-bottom: 48px;
    border-bottom: 1px solid var(--hairline);
}

/* Keep the starter mission and both city-building scales accessible. */
#mission .scenario-grid {grid-template-columns:repeat(2, minmax(0, 1fr))}
#mission .scenario-feature {grid-column:1 / -1; max-width:none}
@media(max-width:760px) {#mission .scenario-grid {grid-template-columns:minmax(0, 1fr)}}
