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

:root {
    --bg: #0c0c0c;
    --fg: #f4f3f0;
    --muted: rgba(244, 243, 240, .72);
    --line: rgba(244, 243, 240, .22);
    --glass: rgba(14, 14, 14, .5);
    --pad: clamp(1.1rem, 3vw, 2.25rem);
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
    color-scheme: dark;
}

html { font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--fg); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

h1, h2 { font-weight: 500; line-height: 1.3; }
h1 { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 1.5rem; }
h2 { font-size: .78rem; font-family: var(--mono); font-weight: 400; color: var(--muted); margin: 2rem 0 .75rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .78rem; }

/* Zdjęcie jako tło całej strony */
.bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); overflow: hidden; }
.bg img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity .7s ease;
}
.bg img.on { opacity: 1; }
/* Przyciemnienie krawędzi, żeby napisy były czytelne na każdym zdjęciu. */
.bg::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 24%),
        linear-gradient(to top, rgba(0, 0, 0, .62), transparent 34%);
}
/* Dodatkowe przyciemnienie pod panelem podstrony – wchodzi i schodzi płynnie. */
.bg::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: rgba(0, 0, 0, .38); opacity: 0; transition: opacity .5s ease;
}
.sub .bg::before { opacity: 1; }

main { transition: opacity .22s ease; }
main.swap { opacity: 0; }

.top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 2;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem;
    padding: var(--pad); padding-top: max(var(--pad), env(safe-area-inset-top));
    text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}
.name { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.name .icon { width: 2.05rem; height: 1.3rem; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .4)); }
.tagline { margin: .5rem 0 0; max-width: 17rem; font-size: .85rem; line-height: 1.45; color: var(--muted); }
.top nav { display: flex; gap: 1.4rem; font-size: .9rem; white-space: nowrap; }
.top nav a, .prose a, .notice a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s ease; }
.top nav a:hover { background-size: 100% 1px; }
.prose a, .notice a { background-size: 100% 1px; }

/* Zdjęcie dnia: podpis i strzałki na dole okna */
.stage main {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1;
    display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem;
    padding: var(--pad); padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
    text-shadow: 0 1px 14px rgba(0, 0, 0, .5);
}
.caption p { margin: 0; }
.caption .when { font-size: clamp(1.5rem, 3.4vw, 2.5rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.caption .title { margin-top: .5rem; font-size: 1rem; color: var(--muted); }
.caption .mono { margin-top: .6rem; color: var(--muted); }

.arrows { display: flex; gap: .6rem; }
.arrows a, .arrows span {
    display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 50%;
    border: 1px solid var(--line); background: rgba(14, 14, 14, .28);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    font-size: 1.15rem; line-height: 1; text-shadow: none;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.arrows .icon, .back .icon { fill: none; }
.arrows .icon { width: 1.25rem; height: 1.25rem; }
.arrows > :first-child .icon, .back .icon { transform: scaleX(-1); }
.back { display: inline-flex; align-items: center; gap: .3rem; }
.arrows a:hover { background: var(--fg); border-color: var(--fg); color: #0c0c0c; }
.arrows .off { opacity: .3; }

/* Podstrony: szklany panel na tle zdjęcia */
.sub main {
    max-width: 46rem; margin: 0 var(--pad); padding: 1.75rem;
    margin-top: calc(var(--pad) + 6.5rem); margin-bottom: var(--pad);
    background: var(--glass);
    -webkit-backdrop-filter: blur(26px) saturate(1.2); backdrop-filter: blur(26px) saturate(1.2);
}
.sub main > :last-child, .prose > :last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; }
.grid a { display: block; overflow: hidden; border-radius: .45rem; }
.grid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; transition: transform .35s ease; }
.grid a:hover img { transform: scale(1.05); }
.prose { max-width: 34rem; }
.contact { display: flex; align-items: center; gap: .65rem; }
.icon { width: 1.05rem; height: 1.05rem; flex: none; fill: currentColor; }
.notice { text-align: center; }

/* Panel */
.bare { max-width: 46rem; margin: 0 auto; padding: 1.75rem; }
.bare h1 { font-size: 1.15rem; }
.bare header { display: flex; justify-content: space-between; align-items: baseline; }
.flash { border-left: 2px solid var(--fg); padding: .1rem 0 .1rem .75rem; margin-bottom: 1.25rem; }
.flash p { margin: 0; }
input[type=text], input[type=password], input[type=datetime-local] {
    font: inherit; color: inherit; background: transparent;
    border: 0; border-bottom: 1px solid var(--line); padding: .3rem 0; min-width: 0; width: 100%;
}
input[type=file] { font: inherit; max-width: 100%; }
button {
    font: inherit; color: inherit; background: transparent; cursor: pointer;
    border: 1px solid var(--line); border-radius: 2rem; padding: .3rem .95rem;
}
button:hover { border-color: var(--fg); }
button.link { border: 0; padding: 0; color: var(--muted); }
button.link:hover { color: var(--fg); }
.upload { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.login { max-width: 16rem; padding-top: 25vh; margin: 0 auto; }
.login input { margin-bottom: 1rem; }
.rows { border-top: 1px solid var(--line); }
.row {
    display: grid; grid-template-columns: 4rem 13.5rem minmax(0, 1fr) auto auto; gap: .9rem; align-items: center;
    padding: .6rem 0; border-bottom: 1px solid var(--line);
}
.row img { display: block; width: 4rem; height: 4rem; object-fit: cover; border-radius: .3rem; }

@media (max-width: 760px) {
    .tagline { max-width: 13rem; font-size: .8rem; }
    .top nav { gap: 1rem; }
    .sub main { padding: 1.25rem; margin-top: calc(var(--pad) + 7rem); }
    .arrows a, .arrows span { width: 2.8rem; height: 2.8rem; }
    .row { grid-template-columns: 4rem minmax(0, 1fr) auto auto; }
    .row img { grid-row: span 2; }
    .row .title { grid-column: 2 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
    .bg img, .bg::before, main, .grid img, .arrows a, .top nav a { transition: none; }
}
