@font-face {
    font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap;
    src: url(fonts/bodoni-moda-latin-wght-normal.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: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap;
    src: url(fonts/bodoni-moda-latin-ext-wght-normal.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 900; font-display: swap;
    src: url(fonts/bodoni-moda-latin-wght-italic.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: "Bodoni Moda"; font-style: italic; font-weight: 400 900; font-display: swap;
    src: url(fonts/bodoni-moda-latin-ext-wght-italic.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(fonts/jost-latin-wght-normal.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: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(fonts/jost-latin-ext-wght-normal.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --paper: #f7f3ec;
    --paper-deep: #efe8dc;
    --sheet: #fbf8f3;
    --ink: #2a2521;
    --ink-soft: #625850;
    --line: #ddd3c4;
    --green: #1e4a43;
    --green-deep: #153833;
    --gold: #a07a3c;
    --danger: #9b2f27;
    --night: #14110f;
    --field: #fffdf9;
    --selection: #e3d3b4;
    --placeholder: #736960;
    --night-text: #d9cfc1;
    --night-muted: #b9ad9e;
    --night-danger: #f0b3aa;
    /* Fields and the add button run one step above body size for elderly readers. */
    --control-size: 1.2rem;
    --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
    --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) var(--paper); }
body {
    margin: 0; background: var(--paper); color: var(--ink);
    font: 400 1.125rem/1.55 var(--sans); caret-color: var(--green);
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--selection); color: var(--ink); }
img, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Shared type ---------- */

.names { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; line-height: 1; text-wrap: balance; }
.amp { font-style: italic; color: var(--gold); font-weight: 400; padding: 0 .04em; }

/* Double hairline with a lozenge: the site's one ornament. */
.ornament { display: flex; align-items: center; gap: .75rem; width: min(13rem, 70%); margin: 1.1rem auto; color: var(--gold); }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 3px; border-block: 1px solid currentColor; opacity: .55; }
.ornament span { width: 7px; height: 7px; rotate: 45deg; border: 1px solid currentColor; }

/* ---------- Buttons & fields ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 56px; padding: .8rem 1.5rem; border: 1px solid transparent; border-radius: 4px;
    font-weight: 500; font-size: 1.125rem; letter-spacing: .01em; text-decoration: none; cursor: pointer;
    transition: background-color .2s, border-color .2s, transform .15s var(--ease-out);
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--green); color: var(--paper); }
.btn-primary:hover { background: var(--green-deep); }
.btn-quiet { background: transparent; color: var(--ink-soft); }
.btn-quiet:hover { color: var(--ink); background: var(--paper-deep); }

input[type=text] {
    width: 100%; min-height: 56px; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 4px;
    background: var(--field); font-size: var(--control-size); transition: border-color .2s;
}
input[type=text]::placeholder { color: var(--placeholder); }
input[type=text]:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgb(160 122 60 / .18); }
input[aria-invalid=true] { border-color: var(--danger); }

/* ---------- Welcome ---------- */

/* Layout, names and the kicker follow the first (production) landing; everything else uses the site faces.
   The landing keeps its own pill button and 12px field corners by the couple's choice. */
.page-login { --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --classic: Georgia, "Times New Roman", serif; }
.welcome { min-height: 100svh; display: grid; align-content: start; }
.welcome-photo { margin: 0; height: 52svh; overflow: hidden; background: var(--paper-deep); }
.welcome-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.welcome-card {
    position: relative; width: 100%; max-width: 30rem; margin: -2.5rem auto 0;
    padding: 2rem 1.5rem calc(2rem + var(--safe-bottom)); background: var(--paper); border-radius: 28px 28px 0 0; text-align: center;
}
.welcome-kicker { margin: 0; font: 400 .8rem var(--ui); text-transform: uppercase; letter-spacing: .18em; color: var(--ink-soft); }
.welcome-names { margin: .25rem 0; font: 400 clamp(2.6rem, 11vw, 4rem)/1.05 var(--classic); }
.welcome-names span { font-style: italic; color: var(--gold); }
.welcome-date { margin: 0 0 1rem; font: italic 400 1.25rem var(--classic); color: var(--ink-soft); }
.welcome-lead { margin: 0 0 1.5rem; font: 400 1.15rem/1.55 var(--sans); text-wrap: balance; }
.login-form { display: grid; gap: .6rem; text-align: left; }
.login-form label { font-weight: 500; }
.page-login input[type=text] { min-height: 54px; border-radius: 12px; font-size: 1.15rem; }
.page-login .btn { min-height: 52px; border-radius: 999px; font-weight: 500; letter-spacing: 0; }
.welcome-enter { width: 100%; }
.login-error { margin: 0; color: var(--danger); font-weight: 600; }
.welcome-hint { margin-top: 1.5rem; font: 400 1.125rem/1.5 var(--sans); color: var(--ink-soft); text-wrap: balance; }

@media (min-width: 900px) {
    .welcome { grid-template-columns: 1fr 1fr; }
    .welcome-photo { height: 100vh; }
    .welcome-card { margin: auto; border-radius: 0; background: none; }
}

/* ---------- Gallery ---------- */

.app-header {
    position: sticky; top: 0; z-index: 5; padding: calc(.9rem + var(--safe-top)) 1.25rem 0;
    background: rgb(247 243 236 / .96); border-bottom: 1px solid var(--line);
}
.app-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; max-width: 1200px; margin: 0 auto; }
.app-title .names { font-size: 1.75rem; white-space: nowrap; }
.app-title p { margin: 0; font: italic 400 1.125rem var(--serif); color: var(--ink-soft); white-space: nowrap; }
.tabs { display: flex; gap: 1.5rem; max-width: 1200px; margin: .35rem auto 0; }
.tab {
    min-height: 48px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
    font-size: 1.125rem; color: var(--ink-soft); transition: color .2s, border-color .2s;
}
.tab[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--gold); font-weight: 500; }

.gallery { max-width: 1200px; margin: 0 auto; padding-bottom: calc(9rem + var(--safe-bottom)); }
.day-title {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 1rem;
    margin: 1.9rem 1.25rem .75rem; font: italic 400 1.4rem/1.25 var(--serif);
}
.day-count { font: 400 1.125rem var(--sans); color: var(--ink-soft); font-style: normal; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
/* Narrow screens: count always on its own line so every day heading breaks the same way. */
@media (max-width: 699px) { .day-count { flex-basis: 100%; } }
/* Keeps the longest heading ('Czwartek, 22 października · 23:00') on one line at 360px. */
@media (max-width: 379px) { .day-title { font-size: 1.25rem; } }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(5, 1fr); gap: 4px; } .day-title { margin-inline: 0; } }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: var(--paper-deep); overflow: hidden; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s var(--ease-out); }
.tile:hover img { scale: 1.03; }
.tile-placeholder { position: absolute; inset: 0; margin: auto; width: 2rem; height: 2rem; color: var(--ink-soft); opacity: .5; }
.badge { position: absolute; display: grid; place-items: center; color: #fff; }
.badge-video { left: 50%; top: 50%; translate: -50% -50%; width: 46px; height: 46px; border-radius: 50%; background: rgb(20 17 15 / .5); }
.badge-video .icon { width: 1.25rem; height: 1.25rem; stroke: none; margin-left: 3px; }
.badge-private { right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; background: rgb(20 17 15 / .55); }
.badge-private .icon { width: 1rem; height: 1rem; }

.gallery-empty { margin: 3.5rem auto; padding: 0 1.75rem; max-width: 24rem; text-align: center; }
.gallery-empty p { margin: 0; font: italic 400 1.3rem/1.45 var(--serif); color: var(--ink-soft); text-wrap: balance; }

.add-bar {
    position: fixed; inset: auto 0 0; z-index: 6; display: flex; justify-content: center;
    padding: .9rem 1.25rem calc(.9rem + var(--safe-bottom)); background: var(--paper); border-top: 1px solid var(--line);
}
.btn-add { width: min(100%, 28rem); min-height: 60px; font-size: var(--control-size); }
.btn-add .icon { width: 1.4rem; height: 1.4rem; stroke-width: 1.8; }

.uploads {
    position: fixed; left: 1rem; right: 1rem; bottom: calc(6.1rem + var(--safe-bottom)); z-index: 7; max-width: 28rem; margin: 0 auto;
    padding: 1rem 1.15rem; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 10px 30px -8px rgb(42 37 33 / .22);
}
.uploads-summary { display: grid; gap: .2rem; }
.uploads-summary strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.uploads-summary span { font-size: 1.125rem; color: var(--ink-soft); }
.progress { height: 4px; background: var(--line); overflow: hidden; margin-top: .55rem; }
.progress-bar { height: 100%; width: 0; background: var(--green); transition: width .4s var(--ease-out); }
.uploads-list { margin: .6rem 0 0; padding-left: 1.1rem; font-size: 1.125rem; color: var(--danger); }
.uploads-actions { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .8rem; }
.btn-outline { background: transparent; border-color: var(--green); color: var(--green); }
.btn-outline:hover { background: var(--paper-deep); }

/* ---------- Send sheet ---------- */

.sheet {
    width: 100%; max-width: 32rem; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
    border-radius: 1.25rem 1.25rem 0 0; background: var(--paper); color: var(--ink); overflow-y: auto;
}
.sheet[open] { animation: sheet-up .45s var(--ease-out); }
@keyframes sheet-up { from { translate: 0 30%; opacity: .4; } }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 8px; } }
.sheet::backdrop { background: rgb(20 17 15 / .5); }
.sheet-body { display: grid; gap: .6rem; padding: 1.75rem 1.4rem calc(1.4rem + var(--safe-bottom)); }
.sheet h2 { margin: 0 0 .3rem; font: 400 1.75rem/1.15 var(--serif); }
.sheet label { font-weight: 500; }
.send-previews { display: flex; gap: 6px; overflow-x: auto; margin-bottom: .6rem; }
.send-previews img, .send-video { flex: none; width: 68px; height: 68px; object-fit: cover; background: var(--paper-deep); }
.send-video { display: grid; place-items: center; color: var(--ink-soft); }
.field-hint { margin: 0; font-size: 1.125rem; color: var(--ink-soft); }
.check {
    display: flex; gap: .85rem; align-items: flex-start; margin-top: .6rem; padding: 1rem;
    border: 1px solid var(--line); border-radius: 4px; background: var(--field); cursor: pointer;
}
.check input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--green); }
.check small { display: block; font-weight: 400; font-size: 1.125rem; color: var(--ink-soft); text-wrap: balance; }
.sheet-actions { display: grid; gap: .4rem; margin-top: .9rem; }

/* ---------- Viewer ---------- */

.viewer {
    width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
    background: var(--night); color: var(--paper-deep); overflow: hidden;
}
.viewer::backdrop { background: var(--night); }
.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
/* Media is boxed explicitly: max-height: 100% does not resolve inside the grid row on some mobile browsers,
   which let tall photos slide under the bottom bar. */
.viewer-stage { position: relative; min-height: 0; overflow: hidden; }
.viewer-stage img, .viewer-stage video {
    position: absolute; left: 0; top: calc(3.75rem + var(--safe-top)); width: 100%; height: calc(100% - 3.75rem - var(--safe-top));
    max-width: none; object-fit: contain;
}
.viewer-stage video { width: 100%; background: var(--night); }
.viewer-note { position: absolute; inset: auto 0 0; z-index: 1; margin: 0; padding: 1rem 1.5rem; text-align: center; background: rgb(20 17 15 / .72); }
.viewer-close {
    position: absolute; z-index: 2; top: calc(.6rem + var(--safe-top)); right: .6rem; display: grid; place-items: center;
    width: 52px; height: 52px; border: 1px solid rgb(255 255 255 / .14); border-radius: 50%; background: rgb(20 17 15 / .55); color: #fff; cursor: pointer;
}
.viewer-close .icon { width: 1.5rem; height: 1.5rem; }
.viewer-bar { position: relative; z-index: 1; padding: .5rem 1rem calc(1rem + var(--safe-bottom)); background: rgb(20 17 15 / .72); border-top: 1px solid rgb(255 255 255 / .08); }
.viewer-nav-row { display: flex; align-items: center; gap: .5rem; }
.viewer-caption { flex: 1; min-width: 0; margin: 0; text-align: center; font-size: 1.125rem; line-height: 1.4; color: var(--night-text); }
.viewer-caption span { display: block; }
.viewer-caption .viewer-when { color: var(--night-muted); }
.viewer-nav {
    display: grid; place-items: center; width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%;
    background: rgb(255 255 255 / .1); color: #fff; cursor: pointer;
}
.viewer-nav:disabled { opacity: .25; cursor: default; }
.viewer-nav .icon { width: 1.5rem; height: 1.5rem; }
.viewer-actions { display: flex; justify-content: center; gap: .6rem; margin-top: .6rem; }
.btn-viewer { min-height: 48px; padding: .5rem 1.15rem; font-size: 1.125rem; background: rgb(255 255 255 / .1); color: #fff; }
.btn-viewer:hover { background: rgb(255 255 255 / .18); }
.btn-danger { color: var(--night-danger); }

.notfound { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: .25rem; padding: 2rem; text-align: center; }
.notfound .names { font-size: clamp(2.5rem, 11.2vw, 4.5rem); }
.notfound p { margin: 0 0 1.25rem; font: italic 400 1.4rem/1.25 var(--serif); color: var(--ink-soft); }

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