@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/outfit-600-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/outfit-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/dm-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/dm-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --night: #170f22;
    --plum: #231733;
    --plum-2: #2e1f42;
    --line: #43305f;
    --cream: #f7ebdd;
    --glow: #ffebd2;
    --rose: #e0577d;
    --rose-deep: #c2415f;
    --teal: #35b0a5;
    --violet: #a98bf0;
    --color-bg: var(--night);
    --color-bg-raised: var(--plum-2);
    --color-text: var(--cream);
    --color-muted: #bcafcb;
    --color-accent: #f0829c;
    --color-backdrop: rgba(10, 6, 16, 0.6);
    --color-border: var(--line);
    --font-head: 'Outfit', system-ui, sans-serif;
    --stars:
        radial-gradient(1.5px 1.5px at 6% 22%, rgba(247, 235, 221, 0.7), transparent),
        radial-gradient(1px 1px at 17% 64%, rgba(247, 235, 221, 0.45), transparent),
        radial-gradient(1.5px 1.5px at 29% 38%, rgba(247, 235, 221, 0.35), transparent),
        radial-gradient(1px 1px at 41% 12%, rgba(247, 235, 221, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 53% 78%, rgba(247, 235, 221, 0.3), transparent),
        radial-gradient(1px 1px at 64% 30%, rgba(247, 235, 221, 0.55), transparent),
        radial-gradient(2px 2px at 76% 56%, rgba(255, 235, 210, 0.5), transparent),
        radial-gradient(1px 1px at 88% 18%, rgba(247, 235, 221, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 95% 84%, rgba(247, 235, 221, 0.35), transparent);
    --stars-size: 22rem 14rem;
    --garland: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='28' viewBox='0 0 200 28'%3E%3Cdefs%3E%3Cfilter id='g' x='-3' y='-3' width='7' height='7'%3E%3CfeGaussianBlur stdDeviation='2.4'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M0 1Q100 25 200 1' fill='none' stroke='rgba(247,235,221,.28)' stroke-width='1.2'/%3E%3Cpath d='M40 8.7v4M80 12.5v4M120 12.5v4M160 8.7v4' stroke='rgba(247,235,221,.28)' stroke-width='1.2'/%3E%3Cg filter='url(%23g)' opacity='.85'%3E%3Ccircle cx='40' cy='15.7' r='4.6' fill='%23FFEBD2'/%3E%3Ccircle cx='80' cy='19.5' r='4.6' fill='%23E0577D'/%3E%3Ccircle cx='120' cy='19.5' r='4.6' fill='%2335B0A5'/%3E%3Ccircle cx='160' cy='15.7' r='4.6' fill='%23A98BF0'/%3E%3C/g%3E%3Ccircle cx='40' cy='15.7' r='2.7' fill='%23FFEBD2'/%3E%3Ccircle cx='80' cy='19.5' r='2.7' fill='%23E0577D'/%3E%3Ccircle cx='120' cy='19.5' r='2.7' fill='%2335B0A5'/%3E%3Ccircle cx='160' cy='15.7' r='2.7' fill='%23A98BF0'/%3E%3C/svg%3E");
    --garland-height: 28px;
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --content-width: 42rem;
    --page-width: 60rem;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--plum);
    background-image: var(--stars), linear-gradient(180deg, var(--night), var(--plum));
    background-size: var(--stars-size), 100% 40rem;
    background-repeat: repeat, no-repeat;
    color: var(--color-text);
    font-family: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    min-height: 100dvh;
}

body.has-fullscreen-map {
    height: 100%;
    height: 100dvh;
}

body.has-fullscreen-map .page-wrap {
    flex-shrink: 1;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.has-fullscreen-map .page-content-wrap {
    flex-shrink: 1;
    min-height: 0;
    max-width: none;
    margin: 0;
}

body.has-fullscreen-map .site-footer {
    display: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-accent);
}

h1 {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0 0 var(--space-2);
    color: var(--color-text);
}

.page-wrap {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: calc(var(--space-2) + var(--garland-height) - 6px) var(--space-2) var(--space-2);
}

.preview-banner {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 22;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    max-width: min(90vw, 26rem);
    padding: 0.65rem 0.6rem 0.65rem 0.9rem;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    background: var(--color-bg-raised);
    color: var(--color-text);
    font-size: 0.8rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transition: opacity 0.4s ease;
}

.preview-banner.is-hiding {
    opacity: 0;
}

.preview-banner-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-content-wrap {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
}

.site-footer {
    flex: 0 0 auto;
    padding: var(--space-3) var(--space-2);
    text-align: center;
    color: var(--color-muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--color-muted);
}

.site-footer a:hover {
    color: var(--color-accent);
}

.site-footer-sep {
    margin: 0 0.4rem;
}

.map-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.map-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

/* maplibre-gl.css sa načíta neskôr a na kontajner dáva position:relative – preto vyššia špecificita a explicitné rozmery */
.map-shell .site-map-full {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-fallback-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    transform: translate(-50%, -50%);
    max-width: 20rem;
    margin: 0;
    padding: var(--space-2);
    border-radius: 8px;
    background: rgba(23, 15, 34, 0.85);
    color: var(--cream);
    text-align: center;
    font-size: 0.875rem;
}

.map-topbar {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.85rem var(--space-2);
    background: var(--night) var(--stars);
    background-size: var(--stars-size);
    box-shadow: 0 4px 14px 2px var(--night);
}

.map-topbar::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: var(--garland-height);
    background: var(--garland) repeat-x 0 0 / 200px var(--garland-height);
    pointer-events: none;
}

.map-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
}

.map-brand::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 10px 2px rgba(255, 235, 210, 0.65);
}

@media (max-width: 22.5rem) {
    .map-brand {
        font-size: 0.95rem;
    }
}

.map-menu-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--plum);
    color: var(--color-text);
}

.map-menu-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.map-topbar-nav {
    display: none;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.map-topbar-nav a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.map-topbar-nav a.is-active {
    color: var(--glow);
    border-bottom: 1px solid var(--rose);
    padding-bottom: 0.25rem;
}

.map-topbar-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.map-topbar-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--plum);
    color: var(--color-text);
}

.map-topbar-social svg {
    width: 1.05rem;
    height: 1.05rem;
}

.map-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: var(--color-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.map-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.map-menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    width: min(80%, 18rem);
    background: var(--plum);
    color: var(--color-text);
    padding: var(--space-4) var(--space-2) var(--space-2);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.35);
    transform: translateX(calc(-100% - 2rem));
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.map-menu-drawer.is-open {
    transform: translateX(0);
}

.map-menu-drawer a {
    color: var(--color-text);
}

.map-menu-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.map-menu-close:hover {
    color: var(--color-text);
}

.map-menu-links {
    list-style: none;
    margin: var(--space-2) 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.map-menu-links li {
    border-bottom: 1px solid var(--color-border);
}

.map-menu-links li:last-child {
    border-bottom: none;
}

.map-menu-links a {
    display: block;
    padding: 0.75rem 0;
    text-decoration: none;
    font-size: 1.05rem;
}

.map-menu-links a.is-active {
    color: var(--glow);
}

.map-menu-drawer .footer-links {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

.map-menu-drawer .footer-links a {
    color: var(--color-accent);
}

.calendar-sheet {
    flex: 0 0 auto;
    padding: 0 var(--space-2) max(var(--space-2), env(safe-area-inset-bottom));
    background: var(--plum) var(--stars);
    background-size: var(--stars-size);
    border-top: 1px solid var(--color-border);
}

.calendar-sheet-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 var(--space-1);
    min-height: 2.75rem;
}

.calendar-next {
    flex: 1 0 100%;
    order: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.calendar-next[hidden] {
    display: none;
}

.calendar-next::before {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 10px 2px rgba(255, 235, 210, 0.65);
}

.calendar-sheet-header:has(.calendar-open-all:not([hidden])) {
    justify-content: space-between;
}

.calendar-open-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 999px;
    background: var(--rose-deep);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.calendar-open-all:hover {
    background: var(--rose);
}

.calendar-open-all svg {
    width: 0.95rem;
    height: 0.95rem;
}

.calendar-sheet-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0;
    border: none;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.calendar-sheet-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.calendar-sheet.is-expanded .calendar-sheet-toggle svg {
    transform: rotate(180deg);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem 0.5rem;
    max-width: 24rem;
    margin: 0 auto;
}

.calendar-sheet:not(.is-expanded) .window:not(.is-current-row) {
    display: none;
}

.window {
    --c: var(--glow);
    --window-frame: var(--line);
    --window-mullion: var(--line);
    --window-leaf-radius: 0;
    --window-glow-soft: color-mix(in srgb, var(--c) 35%, transparent);
    --window-glow-strong: color-mix(in srgb, var(--c) 65%, transparent);
    position: relative;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 3px;
    padding: 0;
    font: inherit;
    background: var(--night);
    color: rgba(247, 235, 221, 0.55);
    box-shadow: inset 0 0 0 3px var(--window-frame);
    perspective: 5rem;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.calendar-grid > .window:nth-child(4n+1) {
    --c: var(--glow);
}

.calendar-grid > .window:nth-child(4n+2) {
    --c: var(--rose);
}

.calendar-grid > .window:nth-child(4n+3) {
    --c: var(--teal);
}

.calendar-grid > .window:nth-child(4n) {
    --c: var(--violet);
}

.calendar-grid > .window.is-special {
    --c: var(--rose);
}

/* Repeating 5-step rhythm of arched and narrow windows, like a row of house facades. */
.calendar-grid > .window:nth-child(5n+1),
.calendar-grid > .window:nth-child(5n+3),
.calendar-grid > .window:nth-child(5n+4) {
    --window-leaf-radius: 999px;
    border-radius: 999px 999px 3px 3px;
}

.calendar-grid > .window:nth-child(5n+3),
.calendar-grid > .window:nth-child(5n) {
    width: 80%;
    justify-self: center;
}

.window-leaf {
    position: absolute;
    top: 3px;
    bottom: 3px;
    width: calc(50% - 3px);
    border: 2px solid var(--window-mullion);
    background: linear-gradient(to bottom, transparent calc(56% - 1px), var(--window-mullion) calc(56% - 1px) calc(56% + 1px), transparent calc(56% + 1px));
}

.window-leaf-left {
    left: 3px;
    border-radius: var(--window-leaf-radius) 0 0 0;
    transform-origin: left center;
}

.window-leaf-right {
    right: 3px;
    border-radius: 0 var(--window-leaf-radius) 0 0;
    transform-origin: right center;
}

.window.is-opened .window-leaf {
    background-color: rgba(23, 15, 34, 0.45);
}

.window.is-opened .window-leaf-left {
    transform: rotateY(-58deg);
}

.window.is-opened .window-leaf-right {
    transform: rotateY(58deg);
}

.window.is-opening .window-leaf {
    transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1), background-color 0.6s ease;
}

.window-number {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.3rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--night);
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.window-star {
    position: absolute;
    z-index: 3;
    top: -0.7rem;
    left: 50%;
    color: var(--glow);
    font-size: 1rem;
    line-height: 1;
    text-shadow: 0 0 6px rgba(255, 235, 210, 0.95), 0 0 2px var(--rose-deep);
    transform: translateX(-50%);
    animation: window-star-twinkle 3s ease-in-out infinite;
}

@keyframes window-star-twinkle {
    0%, 100% {
        transform: translateX(-50%) scale(1) rotate(0);
    }
    50% {
        transform: translateX(-50%) scale(1.18) rotate(8deg);
    }
}

.window.is-unlocked {
    --window-mullion: rgba(23, 15, 34, 0.3);
    cursor: pointer;
    color: var(--night);
    background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 75%);
    box-shadow: inset 0 0 0 3px var(--window-frame), 0 0 14px 2px var(--window-glow-soft);
}

.window.is-unlocked .window-number {
    background: color-mix(in srgb, var(--c) 80%, #fff);
}

.window.is-unlocked.is-opened {
    background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--c) 40%, #fff) 0%, var(--c) 80%);
}

.window.is-special {
    --window-frame: var(--rose-deep);
}

.window.is-unlocked.is-special {
    color: #fff;
}

.window.is-unlocked.is-special .window-number {
    background: #ec7795;
}

.window.is-locked .window-star {
    color: var(--rose);
    text-shadow: none;
    animation: none;
}

.window.is-unlocked:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: inset 0 0 0 3px var(--window-frame), 0 0 20px 4px var(--window-glow-strong);
}

.window.is-unlocked:active {
    transform: scale(0.96);
}

.window:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 3px;
}

.window.is-unlocked:not(.is-opened) {
    animation: window-glow 2.4s ease-in-out infinite;
}

@keyframes window-glow {
    0%, 100% {
        box-shadow: inset 0 0 0 3px var(--window-frame), 0 0 12px 1px var(--window-glow-soft);
    }
    50% {
        box-shadow: inset 0 0 0 3px var(--window-frame), 0 0 22px 7px var(--window-glow-strong);
    }
}

.window.is-unlocked.is-lighting {
    animation: window-light-up 1.4s ease-out;
}

@keyframes window-light-up {
    0% {
        filter: brightness(0.25) saturate(0.4);
        transform: scale(0.92);
    }
    55% {
        filter: brightness(1.45);
        transform: scale(1.14);
        box-shadow: inset 0 0 0 3px var(--window-frame), 0 0 34px 14px var(--window-glow-strong);
    }
    100% {
        filter: none;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .window.is-unlocked.is-lighting {
        animation: none;
    }

    .window,
    .window.is-opening .window-leaf {
        transition: none;
    }

    .window.is-unlocked:not(.is-opened),
    .window-star {
        animation: none;
    }
}

.window:disabled {
    cursor: not-allowed;
}

.window.is-empty {
    opacity: 0.3;
}

.map-marker {
    position: relative;
    width: 2.125rem;
    height: 2.75rem;
    cursor: pointer;
    filter: drop-shadow(0 0 7px color-mix(in srgb, var(--c, var(--glow)) 70%, transparent));
    transform-origin: 50% 100%;
    transition: filter 0.2s ease, transform 0.15s ease;
}

.map-marker svg {
    display: block;
    width: 100%;
    height: 100%;
}

.map-marker-pin {
    fill: var(--c, var(--glow));
    stroke: var(--night);
    stroke-width: 2;
}

.map-marker-number {
    position: absolute;
    top: 0.625rem;
    left: 0;
    right: 0;
    color: var(--night);
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
}

.map-marker.is-special {
    filter: drop-shadow(0 0 8px rgba(224, 87, 125, 0.7));
}

.map-marker.is-special .map-marker-pin {
    fill: var(--rose);
}

.map-marker.is-special .map-marker-number {
    color: #fff;
}

.map-marker:hover,
.map-marker:focus-visible {
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c, var(--glow)) 90%, transparent));
}

.map-marker:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

.calendar-open-all[hidden] {
    display: none;
}

/* maplibre-gl.css sa načíta neskôr a mape nastavuje Helveticu – značky, bubliny aj atribúcia majú mať písmo webu */
.map-stage .maplibregl-map {
    font-family: inherit;
}

.maplibregl-map .maplibregl-popup-tip {
    display: none;
}

.maplibregl-map .maplibregl-popup-content {
    --popup-pad-y: 1rem;
    --popup-pad-x: 1.1rem;
    min-width: 13rem;
    max-width: 17rem;
    padding: var(--popup-pad-y) var(--popup-pad-x);
    border: 1px solid var(--line);
    border-radius: 1.1rem 1.1rem 0.35rem 0.35rem;
    background: linear-gradient(170deg, var(--plum-2) 0%, var(--plum) 70%);
    color: var(--color-text);
    box-shadow: 0 0 0 4px rgba(23, 15, 34, 0.6), 0 14px 34px rgba(0, 0, 0, 0.5);
    font-family: inherit;
}

.maplibregl-map .maplibregl-popup-close-button {
    top: 0.45rem;
    right: 0.5rem;
    min-height: 0;
    min-width: 0;
    padding: 0.1rem 0.4rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.15rem;
    line-height: 1.2;
}

.maplibregl-map .maplibregl-popup-close-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
}

.map-popup-head {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.map-popup-number {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 2.4rem;
    line-height: 0.9;
    color: var(--glow);
}

.map-popup-month {
    color: var(--color-muted);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.map-popup-place {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.map-popup-title {
    margin-top: 0.2rem;
    color: var(--glow);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
}

.map-popup-desc {
    margin: 0.45rem 0 0;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.map-popup-place-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.map-popup-nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid var(--rose);
    border-radius: 50%;
    color: var(--color-accent);
}

.map-popup-nav:hover,
.map-popup-nav:focus-visible {
    background: var(--rose);
    color: #fff;
}

.map-popup-nav svg {
    width: 0.9rem;
    height: 0.9rem;
}

@media (hover: hover) and (pointer: fine) {
    .map-popup-nav {
        display: none;
    }
}

.map-popup-ribbon {
    margin: 0.8rem calc(-1 * var(--popup-pad-x)) 0;
    padding: 0.55rem var(--popup-pad-x);
    background: linear-gradient(90deg, rgba(194, 65, 95, 0.95), rgba(194, 65, 95, 0.55));
    border-top: 1px solid rgba(255, 235, 210, 0.45);
    border-bottom: 1px solid rgba(255, 235, 210, 0.45);
}

.map-popup-ribbon:last-of-type {
    margin-bottom: calc(-1 * var(--popup-pad-y));
    border-bottom: none;
    border-radius: 0 0 0.35rem 0.35rem;
}

@media (max-width: 30rem), (max-height: 44rem) {
    .maplibregl-map .maplibregl-popup-content {
        --popup-pad-y: 0.7rem;
        --popup-pad-x: 0.85rem;
        min-width: 0;
        max-width: 14.5rem;
        border-radius: 0.9rem 0.9rem 0.3rem 0.3rem;
    }

    .maplibregl-map .maplibregl-popup-close-button {
        top: 0.3rem;
        right: 0.35rem;
    }

    .map-popup-head {
        gap: 0.35rem;
        padding-bottom: 0.4rem;
        margin-bottom: 0.45rem;
    }

    .map-popup-number {
        font-size: 1.7rem;
    }

    .map-popup-month {
        font-size: 0.65rem;
    }

    .map-popup-place {
        font-size: 0.9rem;
    }

    .map-popup-title {
        font-size: 0.85rem;
    }

    .map-popup-desc {
        margin-top: 0.3rem;
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .map-popup-nav {
        width: 1.7rem;
        height: 1.7rem;
    }

    .map-popup-ribbon {
        margin-top: 0.55rem;
        padding-top: 0.4rem;
        padding-bottom: 0.45rem;
    }

    .map-popup-ribbon-label {
        font-size: 0.64rem;
    }
}

.map-popup-ribbon-label {
    color: var(--glow);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.map-popup-ribbon .map-popup-desc {
    margin-top: 0.25rem;
    color: #fdeef0;
}

.map-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(23, 15, 34, 0.75) 100%);
}

.map-stage .maplibregl-ctrl-top-right {
    top: 18px;
}

.maplibregl-map .maplibregl-ctrl-group {
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    background: rgba(35, 23, 51, 0.92);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.maplibregl-map .maplibregl-ctrl-group button + button {
    border-top: 1px solid var(--line);
}

.maplibregl-map .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
    filter: invert(94%) sepia(8%) saturate(500%) hue-rotate(330deg);
}

.maplibregl-map .maplibregl-ctrl-group button:not(:disabled):hover {
    background-color: rgba(247, 235, 221, 0.1);
}

.maplibregl-map .maplibregl-ctrl-attrib,
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact {
    background: rgba(23, 15, 34, 0.85);
    color: var(--color-muted);
}

.maplibregl-map .maplibregl-ctrl-attrib a {
    color: var(--color-muted);
}

.maplibregl-map .maplibregl-ctrl-attrib-button {
    filter: invert(94%) sepia(8%) saturate(500%) hue-rotate(330deg);
    background-color: transparent;
}

.countdown-stage {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) 0;
}

.page-content.homepage-content {
    text-align: center;
}

.homepage-content .countdown-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    margin: 2rem 0;
}

.countdown-caption {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 4.5rem));
    gap: 0.5rem;
}

.countdown-timer[hidden] {
    display: none;
}

.countdown-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1.1rem 0.25rem 0.55rem;
    border-radius: 1.75rem 1.75rem 4px 4px;
    background-color: var(--night);
    background-image:
        linear-gradient(var(--line), var(--line)),
        linear-gradient(var(--line), var(--line));
    background-size: 2px 100%, 100% 2px;
    background-position: 50% 0, 0 58%;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 3px var(--line);
}

.countdown-value {
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    background: var(--night);
    font-family: var(--font-head);
    font-size: clamp(1.5rem, 6vw, 2rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--glow);
    text-shadow: 0 0 14px rgba(255, 235, 210, 0.55);
}

.countdown-label {
    padding: 0 0.3rem;
    border-radius: 4px;
    background: var(--night);
    font-size: 0.7rem;
    color: var(--color-muted);
}

.countdown-done {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-links a {
    margin-right: var(--space-2);
}

.page-stage {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: var(--space-3) var(--space-2);
}

.page-heading {
    font-size: clamp(2.25rem, 6vw, 4rem);
    line-height: 1.05;
    margin: 0;
}

.page-divider {
    width: 4.5rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--glow) 0 25%, var(--rose) 25% 50%, var(--teal) 50% 75%, var(--violet) 75%);
    margin: 1.75rem auto;
}

.error-code {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(3.5rem, 12vw, 7rem);
    line-height: 1;
    color: var(--rose);
    opacity: 0.85;
}

.error-code + h1 {
    margin-top: 0.5rem;
}

.error-text {
    width: 100%;
    max-width: 26rem;
    color: var(--color-muted);
    line-height: 1.75;
    margin: 0 auto;
}

.error-home-link {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--rose);
    border-radius: 999px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.error-home-link:hover {
    background: var(--rose);
    color: #fff;
}

.page-content {
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    text-align: left;
    color: var(--color-muted);
    line-height: 1.75;
}

.page-content > :first-child {
    margin-top: 0;
}

.page-content > :last-child {
    margin-bottom: 0;
}

.page-content p,
.page-content ul,
.page-content ol {
    margin: 0 0 1.1rem;
}

.page-content ul,
.page-content ol {
    padding-left: 1.4rem;
}

.page-content li + li {
    margin-top: 0.35rem;
}

.page-content li::marker {
    color: var(--color-accent);
}

.page-content h2,
.page-content h3 {
    margin: 2rem 0 0.75rem;
    color: var(--color-text);
    line-height: 1.25;
}

.page-content h2 {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.5rem;
}

.page-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.page-content strong {
    color: var(--color-text);
}

.page-content .align-left {
    text-align: left;
}

.page-content .align-center {
    text-align: center;
}

.page-content .align-right {
    text-align: right;
}

.page-content p:empty:has(+ .features),
.page-content .features + p:empty {
    display: none;
}

.features {
    --features-width: min(var(--page-width), calc(100vw - 2 * var(--space-2)));
    --features-gap: 2rem;
    --feature-icon-size: 4.8rem;
    width: var(--features-width);
    margin: 2.75rem 0 2.75rem calc(50% - var(--features-width) / 2);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--features-gap);
    text-align: center;
}

.feature {
    --ic: var(--glow);
    position: relative;
}

.feature:nth-child(4n + 2) {
    --ic: #f0829c;
}

.feature:nth-child(4n + 3) {
    --ic: #5ccbc0;
}

.feature:nth-child(4n) {
    --ic: var(--violet);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: var(--feature-icon-size);
    height: var(--feature-icon-size);
    margin: 0 auto 1.25rem;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--ic) 20%, transparent), transparent);
    pointer-events: none;
}

.feature-icon::before {
    content: '';
    width: 58%;
    height: 58%;
    background: var(--ic);
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ic) 55%, transparent));
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.page-content .feature h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-head);
    font-size: 1.15rem;
}

.page-content .feature p {
    max-width: 20rem;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (min-width: 48rem) {
    .features:has(> .feature:nth-child(4)) {
        --features-width: min(46rem, calc(100vw - 2 * var(--space-2)));
        grid-auto-flow: row;
        grid-template-columns: repeat(2, 1fr);
        row-gap: 2.75rem;
    }
}

@media (max-width: 47.99rem) {
    .features {
        --features-gap: 1.75rem;
        --feature-icon-size: 3.75rem;
        grid-auto-flow: row;
        text-align: left;
    }

    .feature:has(.feature-icon) {
        display: grid;
        grid-template-columns: auto 1fr;
        align-content: start;
        column-gap: 1.1rem;
    }

    .feature-icon {
        grid-row: span 2;
        margin: 0;
    }

    .page-content .feature h3 {
        margin-top: 0.35rem;
    }

    .page-content .feature p {
        max-width: none;
        margin: 0;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin: var(--space-2) 0;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    text-decoration: none;
    color: inherit;
}

.gallery-item img {
    border-radius: 6px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-item span {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.gallery-back {
    margin: 0 0 var(--space-1);
}

.gallery-back a {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.gallery-back a:hover {
    color: var(--color-accent);
}

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text);
}

.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox::backdrop {
    background: rgba(14, 9, 21, 0.94);
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: calc(100vw - 2rem);
    margin: 0;
    pointer-events: none;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: calc(100dvh - 8rem);
    border-radius: 6px;
    object-fit: contain;
    pointer-events: auto;
}

.lightbox-figure figcaption {
    color: var(--color-muted);
    font-size: 0.9rem;
    text-align: center;
}

.lightbox-figure figcaption[hidden] {
    display: none;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: rgba(35, 23, 51, 0.85);
    color: var(--color-text);
    font: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.lightbox-close {
    top: var(--space-2);
    right: var(--space-2);
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: var(--space-2);
}

.lightbox-next {
    right: var(--space-2);
}

.lightbox-nav[hidden] {
    display: none;
}

.lightbox-counter {
    position: absolute;
    top: var(--space-2);
    left: 50%;
    margin: 0;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    transform: translateX(-50%);
}

.gallery-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: var(--space-3);
    margin: var(--space-3) 0;
}

.gallery-year-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    aspect-ratio: 3 / 2;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--plum-2), var(--plum));
    border: 1px solid var(--color-border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.gallery-year-card:hover {
    border-color: var(--rose);
    box-shadow: inset 0 0 0 1px rgba(224, 87, 125, 0.5), 0 0 18px 2px rgba(224, 87, 125, 0.35);
    transform: translateY(-2px);
}

.gallery-year-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-year-card:hover .gallery-year-card-img {
    transform: scale(1.05);
}

.gallery-year-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(14, 9, 21, 0.85), rgba(14, 9, 21, 0.05) 60%);
}

.gallery-year-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    padding: var(--space-3);
    color: #fff;
}

.gallery-year-card-year {
    font-size: 2rem;
    font-weight: 700;
}

.gallery-year-card-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 30rem) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 48rem) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .map-menu-toggle {
        display: none;
    }

    .calendar-sheet {
        padding-top: var(--space-2);
    }

    .calendar-sheet-toggle {
        display: none;
    }

    .calendar-grid {
        grid-template-columns: repeat(12, 3.25rem);
        justify-content: center;
        max-width: none;
    }

    .calendar-sheet:not(.is-expanded) .window:not(.is-current-row) {
        display: flex;
    }

    .window {
        height: 3.5rem;
    }

    .window-number {
        font-size: 1.05rem;
    }

    .map-topbar-nav {
        display: flex;
    }

    .map-topbar-social {
        margin-left: 0;
    }

    .calendar-sheet-header,
    .calendar-sheet-header:has(.calendar-open-all:not([hidden])) {
        justify-content: center;
        min-height: 0;
    }

    .calendar-sheet-header {
        gap: var(--space-2);
    }

    .calendar-sheet-header:has(.calendar-open-all:not([hidden]), .calendar-next:not([hidden])) {
        margin-bottom: 0.75rem;
    }

    .calendar-next {
        flex: 0 0 auto;
        order: 0;
        margin: 0;
    }
}
