/* ============================================================
   SIMON ALLMER CENTER — the city guide
   A boxed overview: onyx, champagne hairlines, pearl type.
   Colour belongs to the studios and nowhere else.
   ============================================================ */

@font-face {
    font-family: 'Azonix';
    src: url('assets/Azonix.otf') format('opentype');
    font-display: swap;
}

:root {
    --onyx: #050506;
    --box: #0b0b0d;
    --box-hi: #111114;
    --pearl: #f4efe6;
    --pearl-2: rgba(244, 239, 230, 0.78);
    --champagne: #c8a96a;
    --champagne-soft: rgba(200, 169, 106, 0.3);
    --champagne-faint: rgba(200, 169, 106, 0.1);
    --smoke: #8f8a86;
    --line: rgba(255, 255, 255, 0.075);
    --line-hi: rgba(255, 255, 255, 0.16);

    --serif: 'Didot', 'Bodoni Moda', 'Bodoni MT', 'Hoefler Text', serif;
    --sans: 'Futura', 'Jost', 'Century Gothic', -apple-system, sans-serif;
    --mono: 'Azonix', var(--sans);

    --ease: cubic-bezier(0.22, 0.61, 0.30, 1);
    --top: 64px;
    --gap: 12px;
    --r: 3px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--onyx); }

body {
    min-height: 100vh;
    background:
        radial-gradient(80% 50% at 50% -10%, rgba(200, 169, 106, 0.06), transparent 70%),
        var(--onyx);
    color: var(--pearl);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

:focus-visible { outline: 1px solid var(--champagne); outline-offset: 2px; }

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c, var(--pearl));
    flex: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.55rem 0.22rem 0.45rem;
    border-radius: 2px;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pearl-2);
    background: color-mix(in srgb, var(--c) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
}

.tag .dot { width: 5px; height: 5px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.72rem 1.1rem;
    border-radius: var(--r);
    border: 1px solid var(--line-hi);
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--champagne); color: var(--champagne); }
.btn.solid { background: var(--pearl); color: var(--onyx); border-color: var(--pearl); }
.btn.solid:hover { background: var(--champagne); border-color: var(--champagne); color: var(--onyx); }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--top);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 clamp(16px, 3vw, 40px);
    background: rgba(5, 5, 6, 0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    justify-self: start;
}

.brand-mark { width: 34px; height: 34px; transition: transform 1.6s var(--ease); }
.brand:hover .brand-mark { transform: rotate(45deg); }

.brand-words { display: flex; flex-direction: column; gap: 5px; }
.brand-wordmark { height: 10px; width: auto; display: block; }
.brand-sub { font-size: 0.56rem; letter-spacing: 0.62em; text-transform: uppercase; color: var(--champagne); }

.topbar-context {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.62rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--smoke);
}

.topbar-context b { color: var(--pearl); font-weight: 400; }
.topbar-context .sep { width: 18px; height: 1px; background: var(--champagne-soft); }

.topbar-clock {
    justify-self: end;
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--smoke);
}

.clock-time {
    font-family: var(--mono);
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--pearl);
}

/* ============================================================
   Overview grid
   ============================================================ */
.overview {
    max-width: 1480px;
    margin: 0 auto;
    padding: clamp(16px, 2.4vw, 32px) clamp(16px, 3vw, 40px) 120px;
}

.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas:
        "city city city city city city city city studio studio studio studio"
        "loc  loc  loc  loc  loc  ev   ev   ev   ev   quote quote quote"
        "news news news news news news next next next insta insta insta"
        "map  map  map  map  map  map  map  map  map  map   map   map";
}

.box-city      { grid-area: city; }
.box-studio    { grid-area: studio; }
.box-locations { grid-area: loc; }
.box-events    { grid-area: ev; }
.box-quote     { grid-area: quote; }
.box-news      { grid-area: news; }
.box-next      { grid-area: next; }
.box-insta     { grid-area: insta; }
.box-map       { grid-area: map; }

.box {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 22px 24px 24px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: linear-gradient(170deg, var(--box-hi), var(--box) 60%);
    opacity: 0;
    transform: translateY(10px);
    animation: boxIn 0.9s var(--ease) forwards;
    transition: border-color 0.5s;
}

.box:hover { border-color: var(--line-hi); }

.grid > .box:nth-child(2) { animation-delay: 0.06s; }
.grid > .box:nth-child(3) { animation-delay: 0.12s; }
.grid > .box:nth-child(4) { animation-delay: 0.18s; }
.grid > .box:nth-child(5) { animation-delay: 0.24s; }
.grid > .box:nth-child(6) { animation-delay: 0.30s; }
.grid > .box:nth-child(7) { animation-delay: 0.36s; }
.grid > .box:nth-child(8) { animation-delay: 0.42s; }
.grid > .box:nth-child(9) { animation-delay: 0.48s; }

@keyframes boxIn { to { opacity: 1; transform: none; } }

/* corner tick — the guide's registration mark */
.box::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 14px;
    height: 14px;
    border-top: 1px solid var(--champagne);
    border-left: 1px solid var(--champagne);
    opacity: 0.55;
    pointer-events: none;
}

.box-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.6rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--smoke);
    margin-bottom: 18px;
}

.box-label .no {
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    color: var(--champagne);
}

.label-aside { margin-left: auto; letter-spacing: 0.2em; }

.box-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.58rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--champagne);
    transition: color 0.3s;
}

.box-link svg { width: 13px; height: 13px; transition: transform 0.4s var(--ease); }
.box-link:hover { color: var(--pearl); }
.box-link:hover svg { transform: translateX(3px); }

.empty {
    font-family: var(--serif);
    font-style: italic;
    color: var(--smoke);
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.4rem 0 0.8rem;
}

/* ---------- 01 City ---------- */
.box-city {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    padding: 24px 28px 26px;
    background:
        radial-gradient(70% 90% at 85% 40%, rgba(200, 169, 106, 0.09), transparent 65%),
        linear-gradient(170deg, #121215, #08080a 70%);
}

.city-emblem {
    position: absolute;
    right: -8%;
    top: 50%;
    width: min(64%, 520px);
    transform: translateY(-50%);
    opacity: 0.045;
    pointer-events: none;
    animation: spin 240s linear infinite;
}

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.city-head {
    position: relative;
    margin-top: auto;
    margin-bottom: 26px;
}

.city-coords {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: var(--champagne);
    min-height: 1em;
}

.city-name {
    margin-top: 0.4rem;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(3.4rem, 8vw, 7.4rem);
    line-height: 0.92;
    letter-spacing: -0.01em;
}

.city-name.swap { animation: nameIn 0.8s var(--ease); }

@keyframes nameIn {
    from { opacity: 0; transform: translateY(14px); letter-spacing: 0.04em; }
    to { opacity: 1; transform: none; }
}

.city-tally {
    margin-top: 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--pearl-2);
}

.city-tally i { font-style: normal; color: var(--champagne); margin: 0 0.6em; }

.city-foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.segmented {
    display: inline-flex;
    border: 1px solid var(--line-hi);
    border-radius: var(--r);
    padding: 3px;
    gap: 3px;
}

.segmented button {
    padding: 0.62rem 1.15rem;
    border-radius: 2px;
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--smoke);
    transition: color 0.3s, background 0.3s;
}

.segmented button:hover { color: var(--pearl); }
.segmented button[aria-checked="true"] { background: var(--pearl); color: var(--onyx); }

.segmented.small button { padding: 0.5rem 0.8rem; font-size: 0.6rem; letter-spacing: 0.18em; }

/* ---------- 02 Studio ---------- */
.box-studio { display: flex; flex-direction: column; }

.studio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.studio-opt {
    position: relative;
    flex: 1;
    min-height: 48px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0 1rem 0 0;
    border-radius: 2px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
    text-align: left;
    overflow: hidden;
    transition: border-color 0.35s, background 0.35s, transform 0.35s var(--ease);
}

.studio-opt .bar {
    width: 3px;
    align-self: stretch;
    background: var(--c);
    transition: width 0.45s var(--ease);
}

.studio-opt .name {
    font-family: var(--serif);
    font-size: 1.15rem;
}

.studio-opt .count {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--smoke);
}

.studio-opt:hover { border-color: var(--line-hi); transform: translateX(2px); }

.studio-opt[aria-checked="true"] {
    border-color: color-mix(in srgb, var(--c) 55%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 80%);
}

.studio-opt[aria-checked="true"] .bar { width: 6px; }
.studio-opt[aria-checked="true"] .count { color: var(--pearl); }
.studio-opt.is-empty .name { color: var(--smoke); }

/* ---------- Rows (locations, events) ---------- */
.rows { list-style: none; }

.row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
}

.row:last-child { border-bottom: 1px solid var(--line); }

.row-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    line-height: 1.2;
}

.row-meta {
    margin-top: 0.25rem;
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--smoke);
}

.row-flag {
    font-size: 0.56rem;
    letter-spacing: 0.24em;
    color: var(--champagne);
    margin-left: 0.6rem;
    vertical-align: 0.2em;
}

.dots { display: inline-flex; gap: 4px; }

.group-head {
    padding: 1rem 0 0.4rem;
    font-size: 0.58rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--champagne);
    display: flex;
    justify-content: space-between;
}

.group-head:first-child { padding-top: 0; }
.group-head span:last-child { color: var(--smoke); }

/* Events */
.event {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.event:last-child { border-bottom: 1px solid var(--line); }
.event.is-past { opacity: 0.42; }

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-hi);
    border-radius: 2px;
    height: 54px;
}

.event.is-next .event-date { border-color: var(--champagne); }

.event-date .m { font-size: 0.54rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--champagne); }
.event-date .d { font-family: var(--serif); font-size: 1.35rem; line-height: 1; margin-top: 2px; }

.event-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }

.event-title { font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; }
.event:hover .event-title { color: var(--champagne); }

/* ---------- 05 Meditation ---------- */
.box-quote {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(90% 70% at 100% 0%, rgba(200, 169, 106, 0.1), transparent 70%),
        linear-gradient(170deg, var(--box-hi), var(--box) 60%);
}

.box-quote blockquote { margin-top: auto; }

.quote-text {
    font-family: var(--serif);
    font-size: clamp(1.35rem, 1.8vw, 1.7rem);
    line-height: 1.28;
}

.quote-text::before { content: '\201C'; color: var(--champagne); }
.quote-text::after { content: '\201D'; color: var(--champagne); }

.box-quote footer {
    margin-top: 1.1rem;
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.box-quote footer a { color: var(--smoke); text-decoration: none; transition: color 0.3s; }
.box-quote footer a::before { content: '— '; }
.box-quote footer a[href]:hover { color: var(--champagne); }

/* ---------- 06 News ---------- */
.box-news { min-height: 300px; }

.news-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem;
}

.news-kicker { display: flex; align-items: center; gap: 0.7rem; font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--smoke); }

.news-title {
    margin: 0.6rem 0 0.9rem;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 4.4vw, 4rem);
    line-height: 0.95;
}

.news-lede { font-family: var(--serif); font-size: 1.08rem; line-height: 1.5; color: var(--pearl-2); }

.news-points { list-style: none; }

.news-points li {
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
}

.news-points li:last-child { border-bottom: 1px solid var(--line); }
.news-points b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1rem; }
.news-points span { display: block; margin-top: 0.2rem; font-size: 0.8rem; line-height: 1.5; color: var(--smoke); }

.news-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- 07 Next ---------- */
.box-next {
    display: flex;
    flex-direction: column;
}

#nextBox { display: flex; flex-direction: column; flex: 1; }

.next-name { font-family: var(--serif); font-size: 1.9rem; line-height: 1.05; }
.next-where { margin-top: 0.4rem; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--smoke); }

.countdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 1.4rem 0;
}

.countdown div {
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 0.9rem 0.4rem 0.7rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.015);
}

.countdown b {
    display: block;
    font-family: var(--mono);
    font-weight: 400;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    letter-spacing: 0.04em;
}

.countdown span { display: block; margin-top: 0.4rem; font-size: 0.54rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--smoke); }

.next-unveil { font-size: 0.8rem; line-height: 1.55; color: var(--smoke); }
.next-unveil em { font-family: var(--serif); font-size: 0.98rem; color: var(--pearl); }
.next-note { font-family: var(--serif); font-style: italic; font-size: 0.86rem; color: var(--smoke); margin-bottom: 0.6rem; }
.box-next .btn { margin-top: auto; align-self: flex-start; }
.box-next .next-unveil { margin-bottom: 1.2rem; }

/* ---------- 08 Instagram ---------- */
.box-insta {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(80% 60% at 100% 100%, rgba(200, 169, 106, 0.1), transparent 70%),
        linear-gradient(170deg, var(--box-hi), var(--box) 60%);
}

.insta {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.insta-handle {
    font-family: var(--serif);
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1;
    transition: color 0.4s;
}

.insta-copy {
    margin-top: 0.8rem;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.45;
    color: var(--smoke);
}

.insta .btn { margin-top: auto; align-self: flex-start; }
.insta:hover .insta-handle { color: var(--champagne); }
.insta:hover .btn { background: var(--champagne); border-color: var(--champagne); }
.box-insta .insta-copy { margin-bottom: 1.4rem; }

/* ---------- Colophon ---------- */
.colophon {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.58rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--smoke);
}

.colophon a { text-decoration: none; transition: color 0.3s; }
.colophon a:hover { color: var(--champagne); }

/* ============================================================
   09 Map — the last box on the page
   ============================================================ */
.box-map { padding: 22px 24px 24px; }

.map-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    height: min(680px, 78vh);
    min-height: 480px;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.map-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-right: 1px solid var(--line);
    background: var(--box);
}

.map-side-head {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border-radius: 2px;
    border: 1px solid var(--line);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--smoke);
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.chip:hover { color: var(--pearl); border-color: var(--line-hi); }
.chip[aria-checked="true"] { color: var(--pearl); border-color: var(--champagne-soft); background: var(--champagne-faint); }
.chip .dot { width: 6px; height: 6px; }

.map-side-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 18px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.map-side-list .group-head { padding-top: 1.2rem; }

.pick {
    width: calc(100% + 1rem);
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 0.6rem 0.75rem 0.4rem;
    margin: 0 -0.6rem 0 -0.4rem;
    border-top: 1px solid var(--line);
    text-align: left;
    transition: background 0.3s;
}

.pick:hover { background: rgba(255, 255, 255, 0.03); }
.pick.is-selected { background: var(--champagne-faint); }
.pick .row-title { font-size: 1.02rem; }
.pick .row-meta { font-size: 0.58rem; }
.pick.is-past { opacity: 0.45; }

.glyph { width: 14px; height: 14px; justify-self: center; }
.glyph.loc { border-radius: 50%; border: 2px solid var(--c); }
.glyph.ev { border: 2px solid var(--c); transform: rotate(45deg) scale(0.85); }

.map-stage { position: relative; min-width: 0; isolation: isolate; }

.map { position: absolute; inset: 0; background: #2a2a2c; }

/* Bright enough to read: the Esri dark canvas lifted toward graphite */
.map .leaflet-tile-pane { filter: brightness(1.55) contrast(0.95) saturate(0); }

.leaflet-container { font-family: var(--sans); }

.leaflet-control-zoom {
    border: 1px solid var(--line-hi) !important;
    border-radius: var(--r) !important;
    overflow: hidden;
    margin: 18px 18px 0 0 !important;
}

.leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;
    display: grid !important;
    place-items: center;
    background: rgba(8, 8, 10, 0.88) !important;
    color: var(--pearl) !important;
    border-bottom: 1px solid var(--line) !important;
}

.leaflet-control-zoom a:hover { color: var(--champagne) !important; }

.leaflet-control-attribution {
    background: rgba(5, 5, 6, 0.6) !important;
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 9px !important;
}

.leaflet-control-attribution a { color: rgba(255, 255, 255, 0.6) !important; }

/* Pins — locations are rings, events are diamonds */
.pin {
    position: relative;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    transition: transform 0.4s var(--ease);
}

.pin:hover { transform: scale(1.12); }

.pin-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ring);
    -webkit-mask: radial-gradient(circle, transparent 7px, #000 7.5px);
    mask: radial-gradient(circle, transparent 7px, #000 7.5px);
}

.pin-core {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--pearl);
    box-shadow: 0 0 0 2px var(--onyx);
}

.pin.flagship { width: 38px; height: 38px; }
.pin.flagship .pin-ring {
    -webkit-mask: radial-gradient(circle, transparent 10px, #000 10.5px);
    mask: radial-gradient(circle, transparent 10px, #000 10.5px);
}
.pin.flagship .pin-core { inset: 12px; }

.pin.event .diamond {
    position: absolute;
    inset: 5px;
    transform: rotate(45deg);
    background: var(--onyx);
    border: 2px solid var(--c);
}

.pin.event .diamond::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--c);
}

.pin.event.is-past { opacity: 0.55; }

.pin::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1px solid var(--champagne);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.4s, transform 0.5s var(--ease);
}

.pin.is-selected::before { opacity: 1; transform: none; }

.pin-label {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    background: rgba(5, 5, 6, 0.85);
    border: 1px solid var(--line);
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--pearl);
    pointer-events: none;
}

/* Map card */
.map-card {
    position: absolute;
    z-index: 600;
    left: 18px;
    bottom: 18px;
    width: min(380px, calc(100% - 36px));
    padding: 20px 22px 20px;
    border-radius: var(--r);
    border: 1px solid var(--line-hi);
    background: rgba(8, 8, 10, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: boxIn 0.5s var(--ease) both;
}

.map-card::after {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 14px; height: 14px;
    border-top: 1px solid var(--champagne);
    border-left: 1px solid var(--champagne);
}

.map-card .eyebrow { font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--champagne); }
.map-card h3 { margin: 0.45rem 0 0.25rem; font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.08; }
.map-card .meta { font-size: 0.74rem; color: var(--smoke); line-height: 1.5; }
.map-card .tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
.map-card .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.map-card .btn { padding: 0.6rem 0.9rem; font-size: 0.6rem; }

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    display: grid;
    place-items: center;
    color: var(--smoke);
    transition: color 0.3s, background 0.3s;
}

.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--pearl); background: rgba(255, 255, 255, 0.06); }
.map-card .icon-btn { position: absolute; top: 10px; right: 10px; }

/* ============================================================
   The Oracle — floating, bottom right
   ============================================================ */
.oracle {
    position: fixed;
    right: clamp(16px, 2vw, 28px);
    bottom: clamp(16px, 2vw, 28px);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    pointer-events: none;
}

.oracle > * { pointer-events: auto; }

.orb {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95), rgba(244, 239, 230, 0.3) 20%, transparent 44%),
        radial-gradient(circle at 50% 62%, rgba(200, 169, 106, 0.7), rgba(200, 169, 106, 0.1) 58%, transparent 72%),
        radial-gradient(circle, #1a1812, #050506 72%);
    box-shadow: 0 0 0 1px var(--champagne-soft), 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 34px rgba(200, 169, 106, 0.22);
}

.orb.small { width: 30px; height: 30px; box-shadow: 0 0 0 1px var(--champagne-soft), 0 0 16px rgba(200, 169, 106, 0.2); }

.oracle-fab {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 999px;
}

.oracle-fab .orb { animation: breathe 5s ease-in-out infinite; transition: transform 0.5s var(--ease); }

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 0 1px var(--champagne-soft), 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 26px rgba(200, 169, 106, 0.16); }
    50% { box-shadow: 0 0 0 1px var(--champagne-soft), 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 46px rgba(200, 169, 106, 0.34); }
}

.fab-label {
    position: absolute;
    right: calc(100% + 12px);
    white-space: nowrap;
    padding: 0.55rem 0.9rem;
    border-radius: 2px;
    background: rgba(8, 8, 10, 0.9);
    border: 1px solid var(--line-hi);
    font-size: 0.6rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    transition: opacity 0.4s, transform 0.5s var(--ease);
}

.oracle-fab:hover .fab-label { opacity: 1; transform: none; }
.oracle.is-open .fab-label { display: none; }
.oracle.is-open .oracle-fab .orb { animation: none; transform: scale(0.86); }

.oracle-panel {
    width: min(390px, calc(100vw - 32px));
    height: min(580px, calc(100vh - var(--top) - 120px));
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    border: 1px solid var(--line-hi);
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s 0.5s;
}

.oracle.is-open .oracle-panel {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s;
}

.oracle-head {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 14px 12px 14px 16px;
    border-bottom: 1px solid var(--line);
}

.oracle-name { font-family: var(--serif); font-size: 1.1rem; }
.oracle-state { font-size: 0.56rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--champagne); margin-top: 2px; }

.oracle-log {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.msg { max-width: 88%; animation: msgIn 0.5s var(--ease) both; }

@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg.oracle-msg {
    align-self: flex-start;
    font-family: var(--serif);
    font-size: 1.08rem;
    line-height: 1.4;
    color: var(--pearl);
}

.msg.oracle-msg em { color: var(--champagne); }
.msg.oracle-msg .sub { display: block; margin-top: 0.35rem; font-style: italic; font-size: 0.86rem; color: var(--smoke); }

.msg.user-msg {
    align-self: flex-end;
    padding: 0.5rem 0.8rem;
    border-radius: 2px;
    background: var(--pearl);
    color: var(--onyx);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.msg.typing { display: flex; gap: 5px; padding: 0.4rem 0; }
.msg.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--champagne); animation: blink 1.1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.msg.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* An answer card inside the log */
.answer {
    align-self: stretch;
    max-width: none;
    border: 1px solid var(--line-hi);
    border-radius: 3px;
    padding: 14px 14px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--c, var(--champagne));
}

.answer h4 { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; line-height: 1.15; }
.answer p { margin-top: 0.3rem; font-size: 0.78rem; line-height: 1.5; color: var(--smoke); }
.answer .meta { font-size: 0.56rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--champagne); margin-bottom: 0.35rem; }
.answer .links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }

.answer .links a, .answer .links button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.6rem;
    border-radius: 2px;
    border: 1px solid var(--line-hi);
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--pearl);
    transition: border-color 0.3s, color 0.3s;
}

.answer .links a:hover, .answer .links button:hover { border-color: var(--champagne); color: var(--champagne); }

.oracle-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--line);
    max-height: 46%;
    overflow-y: auto;
}

.oracle-replies:empty { display: none; }

.reply {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 0.55rem 0.8rem;
    border-radius: 2px;
    border: 1px solid var(--line-hi);
    text-align: left;
    transition: border-color 0.3s, background 0.3s;
    animation: msgIn 0.45s var(--ease) both;
}

.reply:hover { border-color: var(--champagne); background: var(--champagne-faint); }
.reply b { font-weight: 400; font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; display: flex; align-items: center; gap: 0.4rem; }
.reply small { font-family: var(--serif); font-style: italic; font-size: 0.78rem; color: var(--smoke); }
.reply.quiet { border-style: dashed; color: var(--smoke); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "city city"
            "studio next"
            "loc ev"
            "news news"
            "quote insta"
            "map map";
    }
    .topbar-context { display: none; }
    .topbar { grid-template-columns: 1fr auto; }
}

@media (max-width: 760px) {
    :root { --top: 58px; --gap: 10px; }

    .grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "city" "studio" "ev" "loc" "next" "news" "quote" "insta" "map";
    }

    .topbar-clock #clockDate { display: none; }
    .brand-mark { width: 30px; height: 30px; }

    .box { padding: 18px 16px 20px; }
    .box-city { min-height: 380px; padding: 18px 16px 18px; }
    .city-emblem { width: 90%; right: -30%; }
    .city-foot { flex-direction: column; align-items: stretch; }
    .segmented { display: flex; }
    .segmented button { flex: 1; padding: 0.66rem 0.4rem; }
    .city-foot .btn { justify-content: center; }

    .studio-opt { min-height: 44px; }
    .news-grid { grid-template-columns: 1fr; gap: 1.2rem; }

    .box-map { padding: 18px 12px 12px; }
    .map-layout { grid-template-columns: 1fr; grid-template-rows: 380px auto; height: auto; min-height: 0; }
    .map-stage { grid-row: 1; }
    .map-side { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); }
    .map-side-head { padding: 12px 12px; gap: 10px; }
    .map-side-list { max-height: 420px; padding: 0 12px 20px; }
    .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .chip { flex: none; }
    .map-card { left: 10px; right: 10px; bottom: 10px; width: auto; }

    .oracle-panel { height: min(560px, calc(100vh - var(--top) - 100px)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
