/*
 * Osobytosti — public site styles (docs/ui_spec.md).
 * Colors, fonts, sizes and motion come from var.css only.
 */

/* --- Reset & base --------------------------------------------------------- */

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

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

body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-primary);
    font-stretch: var(--font-primary-stretch);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    letter-spacing: var(--ls-normal);
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--dur-mid) var(--ease-out), color var(--dur-mid) var(--ease-out);
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
    margin: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-secondary);
    font-weight: 400;
    letter-spacing: var(--ls-normal);
}

h1 {
    font-size: var(--fs-display);
    line-height: var(--lh-tight);
}

h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-snug);
}

h1 em,
h2 em,
blockquote {
    font-family: var(--font-secondary);
    font-style: italic;
}

p {
    max-width: var(--measure);
}

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

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
    transition: opacity var(--dur-fast) var(--ease-out);
}

/* Hover-only effects stay inside (hover: hover): on touch they would stick after a tap. */
@media (hover: hover) {
    a:hover {
        opacity: var(--hover-dim);
    }
}

button {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 1px solid var(--text);
    outline-offset: 4px;
}

::selection {
    background: var(--text);
    color: var(--bg);
}

/* --- Typographic helpers -------------------------------------------------- */

.eyebrow {
    font-size: var(--fs-micro);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--text-soft);
}

.lead {
    font-size: var(--fs-lead);
    line-height: var(--lh-snug);
}

.muted {
    color: var(--muted);
}

/* Keyboard users jump past the navbar; visible only while focused. */
.skip-link {
    position: absolute;
    top: var(--sp-1);
    left: var(--sp-1);
    z-index: var(--z-overlay);
    padding: var(--sp-1) var(--sp-2);
    background: var(--bg);
    color: var(--text);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

#main:focus {
    outline: none;
}

.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;
}

/* --- 50/50 split layout --------------------------------------------------- */

#main {
    height: 100%;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.split__media {
    position: relative;
    overflow: hidden;
    background: var(--surface);
}

.split__media img,
.split__media picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* One shared text column: the measure is resolved in the container's (body)
   font, so children with other font sizes still share the same left edge. */
.split__content {
    display: flex;
    flex-direction: column;
    justify-content: safe center; /* overflow (if any) goes below, never under the navbar */
    align-items: stretch;
    gap: var(--sp-3);
    padding: var(--sp-5) max(var(--sp-5), calc((100% - var(--measure)) / 2));
    overflow: hidden;
}

.split__content > * {
    max-width: none;
}

/* --- Navbar --------------------------------------------------------------- */

.site-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: var(--z-nav);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-3);
    padding: var(--sp-3);
    /* Full-width translucent band over the photos (does not take layout space). */
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    -webkit-backdrop-filter: blur(var(--nav-blur));
    backdrop-filter: blur(var(--nav-blur));
    font-family: var(--font-primary);
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    line-height: var(--lh-snug);
}

.site-nav ul {
    display: flex;
    align-items: baseline;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__list {
    gap: var(--sp-2);
}

/* Brand on the left, the rest stays right. */
.site-nav .site-nav__home {
    margin-right: auto;
    color: var(--text);
    font-size: var(--fs-lead);
    letter-spacing: var(--ls-normal, normal);
    font-family: var(--font-secondary);
    text-transform: uppercase;
    line-height: 1;
}

.site-nav a,
.site-nav button {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    transform: scale(1);
    transform-origin: center;
    transition:
        transform var(--dur-fast) var(--ease-out),
        text-shadow var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out);
}

.site-nav a:focus-visible,
.site-nav button:focus-visible {
    color: var(--text);
    opacity: 1;
    transform: scale(var(--pop-scale));
    text-shadow: var(--pop-shadow);
}

@media (hover: hover) {
    .site-nav a:hover,
    .site-nav button:hover {
        color: var(--text);
        opacity: 1;
        transform: scale(var(--pop-scale));
        text-shadow: var(--pop-shadow);
    }
}

.site-nav__list a[aria-current="page"] {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.35em;
}

/* "CZ / EN": slash separators, active option in --text */
.site-nav__lang li + li::before,
.site-nav__sep {
    padding: 0 var(--sep-gap);
    color: var(--muted);
}

.site-nav__lang li + li::before {
    content: "/";
}

.site-nav__lang a[aria-current="true"] {
    color: var(--text);
}

/* Split layout: the menu wrapper is invisible to the layout (list + CZ / EN
   stay items of the navbar row); the burger exists only in the stacked layout. */
.site-nav__menu {
    display: contents;
}

.site-nav .site-nav__toggle {
    display: none;
}

/* The two-line burger (.burger) and @keyframes rise-in are shared with the
   admin: assets/css/menu.css (docs/responsive_spec.md §2.2). */

/* --- Section transitions -------------------------------------------------- */

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

#main {
    animation: fade-in var(--dur-mid) var(--ease-out) backwards;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.split__content > * {
    animation: rise-in var(--dur-slow) var(--ease-out) backwards;
}

.split__content > :nth-child(2) { animation-delay: var(--stagger); }
.split__content > :nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.split__content > :nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.split__content > :nth-child(n + 5) { animation-delay: calc(var(--stagger) * 4); }

/* Set by main.js on an internal link click, just before navigating. */
.is-leaving #main {
    opacity: 0;
    transform: translateY(calc(var(--leave-shift) * -1));
}

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

    .site-nav a:hover,
    .site-nav a:focus-visible,
    .site-nav button:hover,
    .site-nav button:focus-visible {
        transform: none;
    }
}

/* --- Notices & standalone pages ------------------------------------------- */

.admin-notice {
    position: fixed;
    bottom: var(--sp-2);
    left: var(--sp-2);
    z-index: var(--z-overlay);
    max-width: none;
    padding: var(--sp-1) var(--sp-2);
    background: var(--bg);
    border: 1px solid var(--rule);
    font-size: var(--fs-micro);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
}

.maintenance {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--sp-3);
    height: 100%;
    padding: var(--sp-5);
    text-align: center;
}

/* --- Content typography (editor choices, rich text, links) ---------------- */

.ff-primary {
    font-family: var(--font-primary);
    font-stretch: var(--font-primary-stretch);
}

.ff-secondary {
    font-family: var(--font-secondary);
}

.fs-display { font-size: var(--fs-display); line-height: var(--lh-tight); }
.fs-h2 { font-size: var(--fs-h2); line-height: var(--lh-snug); }
.fs-lead { font-size: var(--fs-lead); line-height: var(--lh-snug); }
.fs-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.fs-small { font-size: var(--fs-small); line-height: var(--lh-body); }

.rich > * + * {
    margin-top: var(--sp-2);
}

.rich h3 {
    font-family: var(--font-secondary);
    font-size: var(--fs-lead);
    font-weight: 400;
    line-height: var(--lh-snug);
    letter-spacing: normal;
    text-transform: none;
}

.rich hr {
    height: 0;
    margin-block: var(--sp-3);
    border: 0;
    border-top: 1px solid var(--c-line);
}

/* Per-block subheading style (page_sections.subheading_font / _size) */
.sub-ff-primary h3 { font-family: var(--font-primary); }
.sub-ff-secondary h3 { font-family: var(--font-secondary); }
.sub-fs-display h3 { font-size: var(--fs-display); line-height: var(--lh-tight); }
.sub-fs-h2 h3 { font-size: var(--fs-h2); line-height: var(--lh-snug); }
.sub-fs-lead h3 { font-size: var(--fs-lead); line-height: var(--lh-snug); }
.sub-fs-body h3 { font-size: var(--fs-body); line-height: var(--lh-body); }
.sub-fs-small h3 { font-size: var(--fs-small); line-height: var(--lh-body); }

.rich ul,
.rich ol {
    padding-left: var(--list-indent);
}

.text-link {
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
}

/* Optional small image above the intro copy */
.split__content > .content-image {
    width: var(--content-image-w);
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

/* --- Writing: links below the copy ---------------------------------------- */

.link-list {
    display: flex;
    flex-direction: column;
    padding: var(--sp-2) 0 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}

.link-list a {
    display: inline-block;
    column-gap: var(--sep-gap); /* as inline-flex (touch / stacked) the space before "→" collapses */
    padding: var(--sp-1) 0;
    text-underline-offset: 0.35em;
}

/* Contact: links in a row below the form (tight, the page is viewport-locked) */
.link-list--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 var(--sp-3);
}

/* --- Portfolio sub-menu ---------------------------------------------------- */

/* Covers are stacked; the active one fades in. */
[data-cover-stage] img {
    opacity: 0;
    transition: opacity var(--dur-slow) var(--ease-out);
}

[data-cover-stage] img.is-active {
    opacity: 1;
}

.portfolio-headline,
.contact-headline {
    font-size: var(--fs-h2);
    line-height: var(--lh-snug);
}

.gallery-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: 0;
    list-style: none;
}

.gallery-list a {
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-2);
    text-decoration: none;
    transform-origin: left center;
    transition:
        transform var(--dur-fast) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
}

.gallery-list a:focus-visible {
    opacity: 1;
    transform: translateX(var(--nudge));
}

.gallery-list__title {
    font-family: var(--font-secondary);
    font-size: var(--fs-h2);
    line-height: var(--lh-snug);
}

.gallery-list a:focus-visible .gallery-list__title {
    font-style: italic;
}

@media (hover: hover) {
    .gallery-list a:hover {
        opacity: 1;
        transform: translateX(var(--nudge));
    }

    .gallery-list a:hover .gallery-list__title {
        font-style: italic;
    }
}

/* Cover tiles of the stacked layout (§2.4); not shown (and not fetched) in the split. */
.gallery-list__frame {
    display: none;
}

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

/* Detail page: a full-width strip on top (photos side by side at one common
   height, endless with JS), the text in a row below. */
.split--gallery {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
}

.split--gallery .split__media {
    padding: var(--sp-6) 0; /* same space above (navbar band) and below the strip */
    background: transparent;
}

.split--gallery .split__content {
    flex-flow: row wrap;
    align-items: baseline;
    justify-content: flex-start;
    max-height: 30vh;
    padding: 0 var(--sp-6) var(--sp-4);
    gap: var(--sp-1) var(--sp-4);
}

.split--gallery .split__content > * {
    margin: 0;
}

.carousel__viewport {
    height: 100%;
    margin: 0 var(--sp-6);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.carousel__viewport::-webkit-scrollbar {
    display: none;
}

.is-endless .carousel__viewport {
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
}

.carousel__track {
    position: relative;
    display: flex;
    width: max-content;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform var(--dur-mid) var(--ease-out);
    will-change: transform;
}

.carousel__track:focus {
    outline: none;
}

.carousel__slide {
    flex: 0 0 auto;
    height: 100%;
}

.carousel__open {
    display: block;
    height: 100%;
    cursor: zoom-in;
}

@media (hover: hover) {
    .carousel__open:hover {
        opacity: 1;
    }
}

.carousel__open:focus-visible {
    outline-offset: -8px;
}

.split__media .carousel__slide img {
    position: static;
    width: auto;
    max-width: none;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.carousel__arrow,
.lightbox__arrow {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: none;
    padding: var(--sp-2) var(--sp-3);
    font-family: var(--font-secondary);
    font-size: var(--fs-h2);
    line-height: 1;
    color: var(--text);
    transform: translateY(-50%);
    transition:
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out),
        text-shadow var(--dur-fast) var(--ease-out);
}

.js .carousel__arrow,
.js .lightbox__arrow {
    display: block;
}

.carousel__arrow {
    background: color-mix(in srgb, var(--bg) 70%, transparent);
}

/* No outline box around the carousel arrows; the pop-out below is the focus cue. */
.carousel__arrow:focus-visible {
    outline: none;
}

.carousel__arrow:focus-visible,
.lightbox__arrow:focus-visible {
    text-shadow: var(--pop-shadow);
    transform: translateY(-50%) scale(var(--pop-scale));
}

@media (hover: hover) {
    .carousel__arrow:hover,
    .lightbox__arrow:hover {
        text-shadow: var(--pop-shadow);
        transform: translateY(-50%) scale(var(--pop-scale));
    }
}

.lightbox__arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

.split--gallery .carousel__arrow {
    top: 50%; /* the strip has equal space above and below */
}

.carousel__arrow--prev,
.lightbox__arrow--prev {
    left: 0;
}

.carousel__arrow--next,
.lightbox__arrow--next {
    right: 0;
}

.lightbox__counter {
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    font-variant-numeric: tabular-nums;
    color: var(--text-soft);
}

/* --- Lightbox -------------------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5) var(--sp-6);
    background: var(--backdrop);
    touch-action: pinch-zoom; /* one finger: lightbox.js swipes; two fingers: browser zoom */
    opacity: 0;
    transition: opacity var(--dur-mid) var(--ease-out);
}

.lightbox.is-zoomed {
    touch-action: pan-x pan-y pinch-zoom; /* pinch-zoomed: one finger pans the photo */
}

.lightbox[hidden] {
    display: none;
}

.lightbox.is-open {
    opacity: 1;
}

.lightbox__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: scale(0.98);
    transition: transform var(--dur-mid) var(--ease-out);
}

.lightbox.is-open .lightbox__image {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-3);
    padding: var(--sp-1);
    font-family: var(--font-secondary);
    font-size: var(--fs-h2);
    line-height: 1;
    transition: transform var(--dur-fast) var(--ease-out), text-shadow var(--dur-fast) var(--ease-out);
}

.lightbox__close:focus-visible {
    text-shadow: var(--pop-shadow);
    transform: scale(var(--pop-scale));
}

@media (hover: hover) {
    .lightbox__close:hover {
        text-shadow: var(--pop-shadow);
        transform: scale(var(--pop-scale));
    }
}

.lightbox__counter {
    position: absolute;
    bottom: var(--sp-3);
    left: 50%;
    transform: translateX(-50%);
}

/* Client gallery: select the shown photo (bottom left). */
.lightbox__select {
    position: absolute;
    left: var(--sp-3);
    bottom: var(--sp-3);
    padding: 0 0 calc(var(--sp-1) / 2);
    border-bottom: 1px solid transparent;
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--muted);
    transform-origin: left center;
    transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.lightbox__select:focus-visible {
    color: var(--text);
    transform: scale(var(--pop-scale));
}

@media (hover: hover) {
    .lightbox__select:hover {
        color: var(--text);
        transform: scale(var(--pop-scale));
    }
}

.lightbox__select[aria-pressed="true"] {
    color: var(--text);
    border-bottom-color: var(--text);
}

.lightbox__select[hidden] {
    display: none;
}

/* Client gallery: the only place a single original is downloaded. */
.lightbox__download {
    position: absolute;
    right: var(--sp-3);
    bottom: var(--sp-3);
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    transform-origin: right center;
    transition: transform var(--dur-fast) var(--ease-out), text-shadow var(--dur-fast) var(--ease-out);
}

.lightbox__download:focus-visible {
    opacity: 1;
    text-shadow: var(--pop-shadow);
    transform: scale(var(--pop-scale));
}

@media (hover: hover) {
    .lightbox__download:hover {
        opacity: 1;
        text-shadow: var(--pop-shadow);
        transform: scale(var(--pop-scale));
    }
}

.lightbox__download[hidden] {
    display: none;
}

/* --- Contact form ---------------------------------------------------------- */

/* The form is the tallest section: tighter rhythm so it fits ~700px viewports. */
.split--contact .split__content {
    gap: var(--sp-2);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--field-gap);
}

.field__label {
    font-size: var(--fs-micro);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--text-soft);
}

.field__input {
    width: 100%;
    margin: 0;
    padding: var(--sp-1) 0;
    border: 0;
    border-bottom: 1px solid var(--muted);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font: inherit;
    transition: border-color var(--dur-fast) var(--ease-out);
}

.field__input:focus {
    border-bottom-color: var(--text);
}

@media (hover: hover) {
    .field__input:hover {
        border-bottom-color: var(--text);
    }
}

.field__input:focus-visible {
    outline: none;
    box-shadow: 0 1px 0 0 var(--text);
}

/* Native arrow replaced by a typographic "↓". */
.field__select {
    appearance: none;
    padding-right: var(--select-arrow-space);
    cursor: pointer;
}

.field__select option {
    background: var(--bg);
    color: var(--text);
}

/* Opened list in the site's style (text only, hairline frame, paper background).
   Needs customizable selects (Chromium); other browsers keep the native list. */
@supports (appearance: base-select) {
    .field__select,
    .field__select::picker(select) {
        appearance: base-select;
    }

    .field__select::picker-icon {
        display: none;
    }

    .field__select::picker(select) {
        margin-top: var(--sp-1);
        padding: var(--sp-1) 0;
        border: 1px solid var(--rule);
        border-radius: var(--radius);
        background: var(--bg);
        box-shadow: none;
    }

    .field__select option {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-small);
        letter-spacing: var(--ls-wide);
        text-transform: uppercase;
        color: var(--muted);
    }

    .field__select option::checkmark {
        display: none;
    }

    /* No outline box around the focused option; the ink colour is the focus cue. */
    .field__select option:hover,
    .field__select option:focus,
    .field__select option:focus-visible {
        outline: none;
        background: transparent;
        color: var(--text);
    }

    .field__select option:checked {
        color: var(--text);
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 0.3em;
    }
}

.field--select::after {
    content: "↓";
    position: absolute;
    right: 0;
    top: calc(var(--fs-micro) * var(--lh-body) + var(--field-gap) + var(--sp-1));
    pointer-events: none;
    color: var(--muted);
}

.field__textarea {
    height: var(--textarea-h);
    resize: none;
    line-height: var(--lh-body);
}

.field--error .field__input {
    border-bottom: 2px solid var(--text);
}

.field__error {
    font-family: var(--font-secondary);
    font-size: var(--fs-small);
    font-style: italic;
}

/* Honeypot: off-screen for people, present for bots. */
.field--hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status {
    padding-left: var(--sp-2);
    border-left: 1px solid var(--text);
    font-family: var(--font-secondary);
    font-size: var(--fs-body);
    line-height: var(--lh-snug);
}

.form-status--error {
    font-style: italic;
}

.text-button {
    align-self: flex-start;
    padding: var(--sp-1) 0;
    border-bottom: 1px solid var(--text);
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    transform-origin: left center;
    transition: transform var(--dur-fast) var(--ease-out), text-shadow var(--dur-fast) var(--ease-out);
}

.text-button:focus-visible {
    text-shadow: var(--pop-shadow);
    transform: scale(var(--pop-scale));
}

@media (hover: hover) {
    .text-button:hover {
        text-shadow: var(--pop-shadow);
        transform: scale(var(--pop-scale));
    }
}

/* --- Error pages ----------------------------------------------------------- */

.error-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-media__code {
    font-family: var(--font-secondary);
    font-size: var(--fs-error-code);
    line-height: 1;
    color: var(--text-soft);
}

/* --- Client gallery (client/view.php, ui_spec §8) -------------------------- */

/* The only page that scrolls; scrollbars stay hidden like everywhere else. */
.page-client {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
}

/* #main is 100% of the body, which grows here: the gate keeps a full-height split. */
.page-client #main.split {
    height: 100vh;
    height: 100dvh;
}

/* Fixed height: the hero below it is sized from the viewport minus this bar. */
.site-nav--bar {
    position: sticky;
    left: auto;
    justify-content: flex-end;
    align-items: center;
    height: var(--client-bar-h);
    padding-block: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}

.site-nav__brand {
    margin-right: auto;
    color: var(--text);
}

/* Hero + grid: assets/css/client_gallery.css. */
.client-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--client-gutter) var(--sp-6); /* --client-gutter: client_gallery.css */
}

.client-head {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.client-head__meta {
    display: flex;
    flex-wrap: wrap;
    max-width: none;
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--text-soft);
}

.client-head__meta span {
    white-space: nowrap;
}

.client-head__meta span + span::before {
    content: "·";
    padding: 0 var(--sep-gap);
    color: var(--muted);
}

.client-head__downloads {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-3);
}

.client-head__downloads [hidden] {
    display: none;
}

.client-notice {
    max-width: var(--measure);
}

.client-proof-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-1) var(--sp-4);
    padding: var(--sp-2) 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    font-size: var(--fs-small);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
}

.client-proof-bar__count {
    font-variant-numeric: tabular-nums;
}

.client-proof-bar__filter a {
    color: var(--muted);
    text-decoration: none;
}

.client-proof-bar__filter a[aria-current="true"] {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.35em;
}

.client-proof-bar .text-link {
    margin-left: auto;
}

/* "Vybírat fotografie" / "Hotovo": a text switch, underlined while on. */
.client-proof-bar__mode {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--muted);
    transition: border-color var(--dur-fast) var(--ease-out);
}

.client-proof-bar__mode[aria-pressed="true"] {
    opacity: 1;
    border-bottom-color: var(--text);
}

@media (hover: hover) {
    .client-proof-bar__mode:hover {
        opacity: 1;
        border-bottom-color: var(--text);
    }
}

.client-proof-bar__hint {
    flex: 1 1 100%;
    font-family: var(--font-secondary);
    font-size: var(--fs-small);
    font-style: italic;
    letter-spacing: var(--ls-normal);
    text-transform: none;
    color: var(--text-soft);
}

.client-proof-bar__hint[hidden] {
    display: none;
}

.client-empty {
    max-width: var(--measure);
}

.client-proof {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    max-width: var(--measure);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--rule);
}

.client-proof__note {
    font-family: var(--font-secondary);
    line-height: var(--lh-snug);
}

@media (prefers-reduced-motion: reduce) {
    .gallery-list a:hover,
    .gallery-list a:focus-visible,
    .lightbox__close:hover,
    .lightbox__close:focus-visible,
    .lightbox__download:hover,
    .lightbox__download:focus-visible,
    .lightbox__select:hover,
    .lightbox__select:focus-visible,
    .text-button:hover,
    .text-button:focus-visible {
        transform: none;
    }

    .carousel__arrow:hover,
    .carousel__arrow:focus-visible,
    .lightbox__arrow:hover,
    .lightbox__arrow:focus-visible {
        transform: translateY(-50%);
    }
}

/* --- Pages with blocks: Yoga, Writing (ui_spec §5, §7.8) ------------------ */

/* The one exception to the viewport lock: with a visible additional block the
   page scrolls vertically and the root snaps to whole blocks (each .split is
   still one viewport). Scrollbars stay hidden (var.css). */
html:has(> body.page--blocks) {
    scroll-snap-type: y proximity;
}

body.page--blocks {
    height: auto;
    overflow: visible;
}

.page--blocks #main {
    height: auto;
}

.page--blocks .split {
    scroll-snap-align: start;
}

/* Long text never clips: the text column scrolls on its own (photo stays) and,
   once its end is reached, the wheel chains on to the page and the next block.
   The padding keeps a margin below the navbar band at the top of a long text. */
.page--blocks .split__content {
    overflow-y: auto;
    overscroll-behavior-y: auto;
    padding-block: calc(var(--nav-band-h) + var(--sp-3));
}

/* Zigzag: odd additional blocks put the photo on the right. */
.split--reverse .split__media {
    order: 2;
}

/* "Dál ↓": micro link to the next block at the end of the text column. */
.scroll-cue {
    align-self: flex-start;
    color: var(--muted);
    font-size: var(--fs-micro);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

.scroll-cue:focus-visible {
    color: var(--text);
}

@media (hover: hover) {
    .scroll-cue:hover {
        color: var(--text);
        opacity: 1;
    }
}

/* Additional blocks rise in when they enter the view (main.js adds .is-inview);
   without JS or with reduced motion they are simply visible. */
@media (prefers-reduced-motion: no-preference) {
    .js .split--block:not(.is-inview) .split__content > * {
        opacity: 0;
        animation: none;
    }
}

/* ==========================================================================
   Responsive (docs/responsive_spec.md). The desktop split above stays as it
   is; everything below is added inside the spec's queries only.
   ========================================================================== */

/* --- Touch: bigger hit areas (padding / min size, never a bigger font) ----- */

@media (pointer: coarse) {
    /* Tablet landscape (split mode): the tap-sized links already give the band its
       height, so the vertical padding shrinks. Stacked mode sets its own below. */
    .site-nav {
        padding-block: var(--sp-1);
    }

    .site-nav .site-nav__home,
    .site-nav .site-nav__lang a,
    .text-link,
    .client-proof-bar__filter a {
        display: inline-flex;
        align-items: center;
        min-height: var(--tap-min);
    }

    /* Link + "→" in one underline: block-level padding instead of a flex box. */
    .link-list a {
        display: inline-block;
        padding-block: calc((var(--tap-min) - 1lh) / 2);
    }

    /* Underlined buttons: the extra height goes above, the rule stays under the text. */
    .text-button,
    .lightbox__select,
    .client-proof-bar__mode {
        display: inline-flex;
        align-items: flex-end;
        min-height: var(--tap-min);
    }

    .lightbox__close,
    .lightbox__download {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: var(--tap-min);
        min-height: var(--tap-min);
    }

    /* Swipe steps the client lightbox; the side arrows would cover the photo. */
    .js .lightbox__arrow {
        display: none;
    }
}

/* --- Stacked layout: tablet portrait, phone, narrow windows (§2) ---------- */

@media (max-width: 63.99rem), (orientation: portrait) {
    /* 2.1 The viewport lock is released: the page scrolls (scrollbars stay hidden). */
    body {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        overflow: visible;
    }

    #main {
        height: auto;
    }

    .split,
    .page-client #main.split {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        overflow: visible; /* sticky needs no clipping ancestor */
    }

    /* Curtain: the photo stays (sticky), the text block slides up over it. */
    .split__media {
        position: sticky;
        top: 0;
        height: var(--stack-media-h);
    }

    .split__content {
        position: relative;
        justify-content: flex-start;
        min-height: calc(100svh - var(--stack-media-h));
        padding: var(--sp-4) max(var(--stack-gutter), calc((100% - var(--measure)) / 2)) var(--sp-5);
        overflow: visible;
        background: var(--bg);
    }

    /* 2.2 Navbar band: brand left, burger right (JS); without JS the links wrap below. */
    .site-nav {
        align-items: center;
        padding: var(--sp-1) var(--stack-gutter);
    }

    .js .site-nav {
        flex-wrap: nowrap;
        height: var(--nav-band-h);
        padding-block: 0;
    }

    /* The band's tint + blur move to a pseudo-element: a backdrop-filter on the
       band itself would stop the panel inside it from blurring the page. */
    .js .site-nav:not(.site-nav--bar) {
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .js .site-nav:not(.site-nav--bar)::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: color-mix(in srgb, var(--bg) 72%, transparent);
        -webkit-backdrop-filter: blur(var(--nav-blur));
        backdrop-filter: blur(var(--nav-blur));
    }

    /* The client gallery bar keeps its own height (the hero is measured below it). */
    .js .site-nav.site-nav--bar {
        height: var(--client-bar-h);
    }

    .js .site-nav__toggle {
        display: inline-flex;
    }

    /* The panel: full screen under the band (absolute to the fixed band),
       revealed from the top. */
    .js .site-nav__menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: var(--sp-4);
        height: calc(100vh - var(--nav-band-h));
        height: calc(100svh - var(--nav-band-h));
        padding: var(--sp-4) var(--stack-gutter) var(--sp-5);
        overflow-y: auto;
        background: color-mix(in srgb, var(--bg) 72%, transparent); /* same tint as the band */
        -webkit-backdrop-filter: blur(var(--nav-blur));
        backdrop-filter: blur(var(--nav-blur));
        clip-path: inset(0 0 100% 0);
        visibility: hidden;
        transition:
            clip-path var(--dur-fast) var(--ease-out),
            visibility 0s linear var(--dur-fast);
    }

    .js.nav-open .site-nav__menu {
        clip-path: inset(0);
        visibility: visible;
        transition:
            clip-path var(--dur-mid) var(--ease-out),
            visibility 0s;
    }

    .js .site-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-2);
    }

    .js .site-nav__list a {
        font-family: var(--font-primary);
        font-size: var(--fs-lead);
        line-height: var(--lh-snug);
        letter-spacing: var(--ls-wide);
        text-transform: uppercase;
        transform-origin: left center;
    }

    .js.nav-open .site-nav__list li,
    .js.nav-open .site-nav__lang {
        animation: rise-in var(--dur-slow) var(--ease-out) backwards;
    }

    .js.nav-open .site-nav__list li:nth-child(1) { animation-delay: var(--stagger); }
    .js.nav-open .site-nav__list li:nth-child(2) { animation-delay: calc(var(--stagger) * 2); }
    .js.nav-open .site-nav__list li:nth-child(3) { animation-delay: calc(var(--stagger) * 3); }
    .js.nav-open .site-nav__list li:nth-child(n + 4) { animation-delay: calc(var(--stagger) * 4); }
    .js.nav-open .site-nav__lang { animation-delay: calc(var(--stagger) * 5); }

    /* Open menu: the page behind does not scroll. */
    html.nav-open {
        overflow: hidden;
    }

    /* The "more" cue is a desktop aid: here the page simply scrolls on. */
    .scroll-cue {
        display: none;
    }

    /* 2.3 Sections */
    /* Not a flex box: text and "→" would become two items with two separate underlines. */
    .link-list a {
        display: inline-block;
        min-height: 0;
        padding-block: calc((var(--tap-min) - 1lh) / 2);
    }

    /* Yoga / Writing blocks: no snap (blocks are taller than the viewport), no
       zigzag (photo always on top); each block repeats the curtain, its sticky
       photo is released at the end of the block. */
    html:has(> body.page--blocks) {
        scroll-snap-type: none;
    }

    .split--reverse .split__media {
        order: 0;
    }

    /* Stacked: the text curtain grows with its content, no inner scroll. */
    .page--blocks .split__content {
        overflow: visible;
        padding-block: var(--sp-4) var(--sp-5);
    }

    .split--contact .split__content {
        gap: var(--sp-3);
    }

    .split--contact .text-button {
        display: inline-flex;
        align-items: flex-end;
        min-height: var(--tap-min);
    }

    .split--error .split__media {
        height: var(--error-media-h);
    }

    .split--error .split__content {
        min-height: calc(100svh - var(--error-media-h));
    }

    .maintenance {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        padding-inline: var(--stack-gutter);
    }

    /* 2.4 Portfolio sub-menu: cover tiles instead of the hover crossfade. */
    .split--portfolio .gallery-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--sp-3);
    }

    .split--portfolio .gallery-list a,
    .split--portfolio .gallery-list a:hover,
    .split--portfolio .gallery-list a:focus-visible {
        display: flex;
        flex-direction: column;
        gap: var(--sp-1);
        transform: none;
    }

    .gallery-list__frame {
        display: block;
        overflow: hidden;
        aspect-ratio: var(--ratio-portrait);
        background: var(--surface);
    }

    .gallery-list__cover {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform var(--dur-fast) var(--ease-out);
    }

    .gallery-list a:active .gallery-list__cover {
        transform: scale(var(--image-zoom));
    }

    /* The title is set in paper colour straight on the photo, over a soft ink
       gradient rising from the bottom edge (a tile without a cover keeps the
       plain title below). */
    .split--portfolio .gallery-list a {
        position: relative;
    }

    .gallery-list__frame {
        aspect-ratio: 4 / 5;
    }

    .gallery-list__frame::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, color-mix(in srgb, var(--text) 62%, transparent) 0%, transparent 55%);
        pointer-events: none;
    }

    .gallery-list__frame {
        position: relative;
    }

    .gallery-list__frame + .gallery-list__title {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        padding: var(--sp-3) var(--sp-3) var(--sp-2);
        color: var(--bg);
        font-size: calc(var(--fs-h2) * 0.75);
        text-wrap: balance;
    }

    /* Smaller carousel arrows on small screens. */
    .carousel__arrow {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-lead);
    }

    /* 2.5 Gallery detail: no sticky photo, no curtain (the strip / stream is the page). */
    .split--gallery .split__media {
        position: relative;
        top: auto;
        height: auto;
    }

    .split--gallery .split__content {
        min-height: 0;
        background: transparent;
    }

    /* Lightbox: the photo fills the screen; controls sit on paper plates. */
    .lightbox {
        padding: var(--sp-2);
    }

    .lightbox__close,
    .lightbox__select,
    .lightbox__download,
    .lightbox__counter {
        background: var(--bg);
    }

    .lightbox__close {
        top: var(--sp-2);
        right: var(--sp-2);
    }

    .lightbox__select,
    .lightbox__download {
        bottom: var(--sp-2);
        padding-inline: var(--sp-1);
    }

    .lightbox__select {
        left: var(--sp-2);
    }

    .lightbox__download {
        right: var(--sp-2);
    }

    .lightbox__counter {
        bottom: var(--sp-2);
        padding: 0 var(--sp-1);
    }
}

/* Gallery detail, portrait (phone, tablet portrait): a vertical stream —
   photos one under another, each whole and fitting the screen. Also the
   no-JS presentation (gallery.js builds the strip only in landscape). */
@media (orientation: portrait) {
    .split--gallery {
        display: block;
    }

    .split--gallery .split__media {
        padding: calc(var(--nav-band-h) + var(--sp-3)) var(--stack-gutter) var(--sp-5);
    }

    .split--gallery .carousel__viewport {
        height: auto;
        margin: 0;
        overflow: visible;
    }

    .split--gallery .carousel__track {
        flex-direction: column;
        gap: var(--sp-3);
        width: auto;
        height: auto;
        transform: none;
        will-change: auto; /* no layer for the whole stream */
    }

    .split--gallery .carousel__slide,
    .split--gallery .carousel__open {
        height: auto;
    }

    .split--gallery .carousel__slide img {
        width: min(100%, calc(var(--stream-max-h) * var(--ar, 1)));
        height: auto;
        margin-inline: auto;
        aspect-ratio: var(--ar, auto);
    }

    .js .split--gallery .carousel__arrow {
        display: none;
    }
}

/* Gallery detail, landscape below the desktop width (phone landscape, small
   tablets): the strip, viewport-locked, with less space above and below. */
@media (max-width: 63.99rem) and (orientation: landscape) {
    .split--gallery {
        height: 100vh;
        height: 100svh;
        overflow: hidden;
    }

    .split--gallery .split__media {
        padding: calc(var(--nav-band-h) + var(--sp-2)) 0;
    }

    .split--gallery .carousel__viewport {
        margin-inline: var(--stack-gutter);
    }
}

/* --- Phone (§2, refinement of stacked) ------------------------------------- */

@media (max-width: 39.99rem) {
    .split--portfolio .gallery-list {
        grid-template-columns: minmax(0, 1fr);
    }

    /* 2.6 Client gallery: the proofing bar moves below the grid and sticks to
       the bottom of the screen while the grid scrolls. */
    .client-proof-bar {
        position: sticky;
        bottom: 0;
        z-index: var(--z-nav);
        order: 1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0 var(--sp-2);
        margin-inline: calc(-1 * var(--client-gutter));
        padding: var(--sp-1) var(--client-gutter) calc(var(--sp-1) + env(safe-area-inset-bottom));
        border-bottom: 0;
        background: var(--bg);
    }

    .client-proof-bar__count { order: 1; }
    .client-proof-bar__mode { order: 2; justify-self: end; }
    .client-proof-bar__filter { order: 3; }

    .client-proof-bar .text-link {
        order: 4;
        justify-self: end;
        margin-left: 0;
    }

    .client-proof-bar__hint {
        order: 5;
        grid-column: 1 / -1;
    }

    .client-proof {
        order: 2;
    }
}

/* Reduced motion: the menu panel only fades (no clip, no rise). */
@media (prefers-reduced-motion: reduce) and (max-width: 63.99rem), (prefers-reduced-motion: reduce) and (orientation: portrait) {
    .js .site-nav__menu,
    .js.nav-open .site-nav__menu {
        clip-path: none;
        opacity: 0;
        transition: opacity var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
    }

    .js.nav-open .site-nav__menu {
        opacity: 1;
        transition: opacity var(--dur-fast) var(--ease-out), visibility 0s;
    }

    .gallery-list a:active .gallery-list__cover {
        transform: none;
    }
}
