:root {
    color-scheme: dark;
    --evergreen: #132724;
    --deep: #0c1d1c;
    --ink: #f8f3e7;
    --muted: #c5d5cb;
    --gold: #f4d59c;
    --line: #d3e2ce38;
    --serif: Georgia, 'Times New Roman', serif;
    font-family: system-ui, sans-serif;
    color: var(--ink);
    background: var(--deep);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100svh; margin: 0; }
button, input { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid #fff5cc;
    outline-offset: 4px;
}

.site-scene {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 22%, #315450 0%, #172f2f 43%, var(--deep) 85%);
    pointer-events: none;
}

.page--calendar .site-scene {
    background-color: #405d62;
    background-image: linear-gradient(180deg, #091d25c7 0%, #132b3777 29%, #1e363c0c 48%, #132b3335 69%, #0c1d1cf0 100%), url('/hatter/mobil');
    background-size: cover;
    background-position: center;
}

.site-shell { position: relative; min-height: 100svh; }

.site-header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: min(calc(100% - 2rem), 68rem);
    min-height: 4.25rem;
    margin-inline: auto;
    padding-block: .375rem;
    border-bottom: 1px solid #f8f3e738;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.75rem;
    font: 400 clamp(1rem, 4.2vw, 1.2rem)/1.15 var(--serif);
    text-decoration: none;
}

.site-sparkle { color: var(--gold); font: 1.45em/1 system-ui, sans-serif; }
.site-actions { display: flex; align-items: center; gap: clamp(.25rem, 1.5vw, .625rem); }
.site-actions form, .preview-banner form { margin: 0; }

.header-action, .snow-switch {
    display: inline-grid;
    min-height: 2.75rem;
    min-width: 2.75rem;
    place-items: center;
    padding: 0 .5rem;
    border: 0;
    border-radius: .75rem;
    color: var(--ink);
    background: transparent;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.header-action:hover, .snow-switch:hover { background: #f8f3e71f; }

.snow-switch {
    position: relative;
    border: 1px solid #f8f3e736;
    background: #12283156;
    line-height: 1;
}

.snow-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.snow-switch span { color: var(--gold); font-size: 1.275rem; }
.snow-switch:has(input:not(:checked)) span { opacity: .48; }
.snow-switch:has(input:focus-visible) { outline: 2px solid #fff5cc; outline-offset: 3px; }
body:has([data-snow-switch]:not(:checked)) .snowfall { display: none; }

.preview-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .15rem .875rem;
    padding: .25rem .75rem;
    background: #fae4b6;
    color: #172b28;
    font-size: .875rem;
    text-align: center;
}

.preview-banner button {
    min-height: 2.75rem;
    padding: .25rem 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.preview-banner button:focus-visible { outline-color: #172b28; }

.hero {
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    min-height: calc(100svh - 4.25rem);
    padding: clamp(2.7rem, 9svh, 6rem) 1rem 1.3rem;
    text-align: center;
}

.hero-message { position: relative; z-index: 3; align-self: start; }

.hero h1 {
    margin: 0;
    font: 400 clamp(2.45rem, 10.5vw, 6.6rem)/.99 var(--serif);
    letter-spacing: -.055em;
    text-wrap: balance;
    text-shadow: 0 3px 24px #071417af;
}

.hero p {
    width: fit-content;
    margin: 1rem auto 0;
    color: #fcf4e5;
    font-size: clamp(1rem, 3.8vw, 1.22rem);
    text-shadow: 0 2px 10px #071417;
}

.hero-jump {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .68rem;
    min-height: 2.875rem;
    padding: .25rem 1rem;
    border: 1px solid #f7e9ca73;
    border-radius: 9rem;
    background: #0c1d1cb8;
    color: var(--ink);
    font-size: .875rem;
    font-weight: 650;
    text-decoration: none;
}

.hero-jump:hover { background: #223b34; }

.calendar {
    position: relative;
    padding: clamp(2.6rem, 8vw, 5.5rem) 1rem clamp(3.4rem, 10vw, 7rem);
    background: radial-gradient(ellipse at 50% 0, #304d3e75, transparent 55%), linear-gradient(180deg, #0c1d1c, #142b24 50%, #0c1d1c);
    text-align: center;
    border-top: 1px solid #f8f3e730;
}

.calendar-heading { position: relative; z-index: 3; margin-bottom: 1.65rem; }
.calendar-heading h2 { margin: 0; font: 400 clamp(1.8rem, 7vw, 3.37rem)/1.08 var(--serif); letter-spacing: -.035em; }

.day-grid {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: clamp(.375rem, 1.55vw, .75rem);
    max-width: 36rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.day-item { grid-column: span 2; }
.day-item:first-child { grid-column: 2 / span 2; }

.day-tile {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: .6rem;
    min-height: 3.375rem;
    aspect-ratio: .92;
    padding: .375rem .125rem;
    overflow: hidden;
    border: 1px solid #ceeee24d;
    border-radius: clamp(.625rem, 2vw, 1.05rem);
    background: linear-gradient(145deg, #243f37, #182f2a);
    color: #e2e9de;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, translate .2s ease;
}

.day-tile--locked::before, .day-tile--available::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 13%, currentColor 13% 20%, transparent 20%),
        linear-gradient(0deg, transparent 27%, currentColor 27% 33%, transparent 33%);
    opacity: .12;
    pointer-events: none;
    content: '';
}

.day-tile:target, .day-tile:focus-visible { outline: 2px solid #fff5cc; outline-offset: 3px; }
.day-tile:target { scroll-margin-block: 6rem; }
.day-tile:hover { border-color: #dfebd9b3; }
.day-tile--available {
    border-color: #fff1ba;
    background: linear-gradient(145deg, #f8e7be, #e2bc78);
    color: #2e3022;
    box-shadow: 0 0 1.4rem #f4d59c43;
}
.day-tile--opened {
    border-color: #b8e0cd8a;
    background: linear-gradient(145deg, #3f6658, #264438);
    color: #f4fff6;
}
.day-tile--empty { border-style: dashed; background: #192e2b; color: #c3cec6; }
.day-number { position: relative; font: 400 clamp(1.2rem, 5vw, 2rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

.tile-mark {
    position: relative;
    display: inline-block;
    flex: none;
    width: .875rem;
    height: .875rem;
    color: inherit;
}

.tile-mark--locked::before {
    position: absolute;
    inset: .385em .18em .05em;
    border: 1px solid currentColor;
    border-radius: .12em;
    content: '';
}

.tile-mark--locked::after {
    position: absolute;
    inset: .08em .31em auto;
    height: .37em;
    border: 1px solid currentColor;
    border-bottom: 0;
    border-radius: 9em 9em 0 0;
    content: '';
}

.tile-mark--available::before {
    position: absolute;
    inset: 0;
    background: currentColor;
    clip-path: polygon(50% 0%, 62% 34%, 100% 50%, 62% 64%, 50% 100%, 37% 64%, 0% 50%, 37% 34%);
    content: '';
}

.tile-mark--opened::before {
    position: absolute;
    inset: .05em auto auto .38em;
    width: .31em;
    height: .59em;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    content: '';
    transform: rotate(45deg);
}

.tile-mark--empty::before {
    position: absolute;
    inset: .31em;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.day-legend {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    margin: 1.6rem auto 0;
    padding: 0;
    color: var(--muted);
    font-size: .875rem;
    list-style: none;
}

.day-legend li { display: inline-flex; align-items: center; gap: .28rem; }
.day-legend .tile-mark--available { color: var(--gold); }

.auth-main {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    padding: clamp(2.8rem, 11svh, 7rem) 1rem 3rem;
}

.auth-card {
    width: min(100%, 27rem);
    padding: clamp(1.2rem, 6vw, 2.4rem);
    border: 1px solid #f4d59c5c;
    border-radius: 1.35rem;
    background: radial-gradient(ellipse at top, #395b4c6b, transparent 58%), #142a26;
    box-shadow: 0 1rem 5rem #0b1615b0;
    text-align: center;
}

.auth-emblem, .dialog-emblem {
    display: grid;
    place-items: center;
    width: 3rem;
    aspect-ratio: 1;
    margin: 0 auto 1rem;
    border: 1px solid #f4d59c61;
    border-radius: 50%;
    color: var(--gold);
    font-size: 1.5rem;
}

.auth-card h1 {
    margin: 0;
    font: 400 clamp(1.8rem, 8vw, 2.6rem)/1.08 var(--serif);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.auth-intro { margin: .8rem 0 1.4rem; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.auth-form { display: grid; gap: .95rem; text-align: left; }
.auth-form label { display: grid; gap: .35rem; color: var(--ink); font-size: .875rem; font-weight: 650; }

.auth-form input:not([type='checkbox']) {
    width: 100%;
    min-height: 2.875rem;
    padding: .45rem .75rem;
    border: 1px solid #c5d5cb75;
    border-radius: .625rem;
    background: #0e211e;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 400;
}

.auth-form .remember {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    gap: .58rem;
    color: var(--muted);
    font-weight: 500;
    cursor: pointer;
}

.remember input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--gold); }

.primary-button {
    display: inline-grid;
    align-items: center;
    min-height: 2.875rem;
    padding: .55rem 1.05rem;
    border: 1px solid #ffe9ba;
    border-radius: .7rem;
    background: #f4d59c;
    color: #1d3027;
    font-size: 1rem;
    font-weight: 720;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.primary-button:hover { background: #ffebb9; }
.primary-button:disabled { opacity: .72; cursor: wait; }
.auth-card > .primary-button { margin-top: 1.35rem; }

.form-error {
    padding: .7rem .75rem;
    border: 1px solid #efd6bb62;
    border-radius: .65rem;
    background: #583832;
    color: #fff1e8;
    font-size: .9rem;
    line-height: 1.45;
}

.has-day-dialog { overflow: hidden; }
.has-day-dialog .site-shell { filter: blur(2px); }

.day-dialog[open] {
    position: fixed;
    z-index: 5;
    inset: 0;
    width: min(calc(100% - 1.5rem), 33rem);
    max-width: none;
    max-height: calc(100svh - 1.5rem);
    margin: auto;
    padding: clamp(1.2rem, 6vw, 2.5rem);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #f5d59c78;
    border-radius: 1.375rem;
    background: radial-gradient(ellipse at 50% 5%, #37594b89, transparent 65%), #172e29;
    color: var(--ink);
    text-align: center;
    box-shadow: 0 0 0 200vmax #0a1919ad, 0 1.6rem 5rem #06100d9c;
    animation: dialog-entrance .3s cubic-bezier(.2,.75,.3,1) both;
}

.day-dialog:modal { box-shadow: 0 1.6rem 5rem #06100d9c; }
.day-dialog::backdrop { background: #0a1919bd; }

.dialog-close {
    position: absolute;
    top: .55rem;
    right: .55rem;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #f8f3e743;
    border-radius: 50%;
    background: #172e29;
    color: var(--ink);
    font-size: 1.7rem;
    line-height: 1;
    text-decoration: none;
}

.dialog-close:hover { background: #2c473d; }
.dialog-date { margin: 0 2.5rem 1.6rem; color: var(--gold); font-size: .875rem; line-height: 1.3; font-weight: 650; }
.dialog-inner h2 { margin: 0; font: 400 clamp(1.75rem, 8vw, 2.6rem)/1.06 var(--serif); letter-spacing: -.025em; overflow-wrap: anywhere; }
.dialog-hint, .gift-message { margin: .85rem auto 0; color: var(--muted); font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.dialog-hint { font-size: .875rem; }
.gift-message { white-space: pre-line; }
.gift-before form { margin-top: 1.15rem; }
.gift-before .primary-button { min-width: min(100%, 12rem); }
.gift-photo { display: block; width: 100%; max-height: min(52svh, 26rem); margin: 1rem auto 0; border-radius: .85rem; object-fit: contain; }
.gift-reveal h2:focus { outline: none; }
.gift-reveal.is-new { animation: reveal-gift .35s ease-out both; }
.dialog-emblem .tile-mark { font-size: 1.05rem; transform: scale(1.4); }
.day-dialog--locked .dialog-emblem { animation: lock-nudge .42s .23s ease-in-out; }

.gift-art {
    position: relative;
    isolation: isolate;
    width: 8rem;
    height: 7.8rem;
    margin: 0 auto 1.3rem;
}

.gift-art::before {
    position: absolute;
    z-index: -1;
    inset: -.5rem -1.25rem;
    background: radial-gradient(ellipse, #f3d39228 0%, transparent 72%);
    content: '';
}

.gift-art-box, .gift-art-lid {
    position: absolute;
    background: #eabe79;
    border: 1px solid #ffe9ac;
}

.gift-art-box {
    inset: 3.5rem .65rem .45rem;
    border-radius: .25rem .25rem .65rem .65rem;
    background: linear-gradient(105deg, #d0a166, #f2cb83 21%, #c59658 100%);
    box-shadow: 0 .5rem 1.5rem #071813a1;
}

.gift-art-box::after, .gift-art-lid::after {
    position: absolute;
    inset: 0 40%;
    background: linear-gradient(90deg, #674039, #a36053);
    content: '';
}

.gift-art-lid {
    z-index: 1;
    inset: 2.75rem .275rem auto;
    height: 1.35rem;
    border-radius: .22rem;
    background: linear-gradient(105deg, #dfb471, #ffdb93 22%, #d4a364 100%);
    transform-origin: right center;
}

.gift-art-lid::before, .gift-art-lid span {
    position: absolute;
    z-index: 1;
    bottom: 100%;
    left: 50%;
    width: 1.6rem;
    height: 1.25rem;
    border: .3rem solid #ad6f5c;
    border-radius: 100% 80% 25% 70%;
    content: '';
    transform: rotate(-25deg);
}

.gift-art-lid span { right: 50%; left: auto; transform: scaleX(-1) rotate(-25deg); }
.gift-art-stars { position: absolute; z-index: 2; inset: .05rem 0 auto; color: var(--gold); font: .95rem/1.1 system-ui, sans-serif; }
.gift-before.is-opening .gift-art-lid { animation: open-lid .48s cubic-bezier(.22,.6,.37,1) both; }
.gift-before.is-opening .gift-art-stars { animation: gift-sparks .48s ease-out both; }

.snowfall { position: fixed; z-index: 2; inset: 0; overflow: hidden; pointer-events: none; }
.snowfall span {
    position: absolute;
    top: -.5rem;
    left: var(--x);
    width: .19rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fffbf2;
    opacity: .5;
    animation: fall var(--speed) var(--delay) linear infinite;
}
.snowfall span:nth-child(3n) { width: .125rem; opacity: .32; }
.snowfall span:nth-child(5n) { width: .3rem; opacity: .66; }

@keyframes fall {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(var(--drift), calc(100vh + 1rem), 0); }
}
@keyframes dialog-entrance {
    from { transform: translateY(.75rem) scale(.91); opacity: .45; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes lock-nudge {
    0%, 100% { transform: rotate(0); }
    28% { transform: rotate(-8deg); }
    62% { transform: rotate(6deg); }
}
@keyframes open-lid {
    from { transform: translateY(0) rotate(0); }
    to { transform: translate(-.5rem, -2.85rem) rotate(-23deg); }
}
@keyframes gift-sparks {
    from { transform: translateY(0) scale(.9); }
    to { transform: translateY(-1.65rem) scale(1.2); opacity: 0; }
}
@keyframes reveal-gift {
    from { transform: translateY(.5rem); opacity: .45; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 42rem) and (min-aspect-ratio: 3/4) {
    .page--calendar .site-scene {
        background-image: linear-gradient(180deg, #0a1d27ba 0%, #132b3760 28%, #1e363c00 52%, #132b334a 75%, #0c1d1cf0 100%), url('/hatter/szeles');
        background-position: center 54%;
    }
}

@media (max-width: 22rem) {
    .site-header { width: calc(100% - 1rem); }
    .site-brand { gap: .25rem; }
    .header-action { padding-inline: .25rem; }
    .calendar { padding-inline: .7rem; }
    .day-grid { column-gap: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .snowfall span { animation-play-state: paused; }
    .day-dialog[open], .day-dialog--locked .dialog-emblem, .gift-before.is-opening .gift-art-lid,
    .gift-before.is-opening .gift-art-stars, .gift-reveal.is-new { animation: none; }
    .day-tile { transition: none; }
}
