/* ============================================================
   LADONA v2 — one stage: Welcome → Ladona → Photo / Video / Me.
   Picking a category fades everything out; tiles rise from below.
   ============================================================ */

:root {
    /*
       iPhone Safari (Liquid Glass): the toolbar floats over the page. Full-bleed layers use the
       large viewport so video and photos run under the glass to the very bottom; things that must
       stay readable use the visible (dynamic) viewport. --bar is the part hidden by the toolbar.
    */
    --screen: 100vh;
    --visible: 100vh;
    --ink: #282828;
    --muted: #6f6f6f;
    --line: #e4e4e1;
    --bg: #ffffff;
    --tile: #f4f4f2;
    --font: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --gutter: 24px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (height: 100lvh) {
    :root { --screen: 100lvh; --visible: 100dvh; }
}
:root { --bar: calc(var(--screen) - var(--visible) + env(safe-area-inset-bottom)); }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    /* white from the first paint: iPhone Safari tints its bars from this and doesn't pick up later changes */
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { overflow: hidden; }

button { font: inherit; color: inherit; }

/* line icons: drawn with the text colour, 1.25px stroke at any size */
.icon { display: block; flex: none; height: auto; overflow: visible; }
.icon path { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.icon-play path { fill: currentColor; stroke: none; }
.icon-pause path { stroke-width: 2; }

::selection { background: var(--ink); color: #fff; }

/* --- STAGE --- */
.stage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--screen); /* reaches under the floating Safari toolbar */
    overflow: hidden;
    background: var(--bg);
}

.stage-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.9s ease;
}
.stage-bg::-webkit-media-controls { display: none !important; }

.stage-veil {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.24);
    pointer-events: none;
    transition: opacity 0.9s ease;
}

.stage-intro {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--visible); /* centred in what you can actually see */
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 var(--gutter);
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.18);
    transition: opacity 0.7s ease, transform 0.9s var(--ease);
}

.stage-title { position: relative; }

.stage-welcome,
.stage-name,
.stage-cats {
    margin: 0;
    opacity: 0;
    transform: translateY(28px);
}

.stage-welcome {
    /* floats above the title without taking space */
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 18px);
    font-weight: 200;
    font-size: clamp(13px, 1.3vw, 16px);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    padding-left: 0.42em; /* optically centre the tracked word */
}

.stage-name {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(64px, 11vw, 168px);
    line-height: 0.95;
    letter-spacing: 0.02em;
}

.stage-cats {
    display: flex;
    justify-content: center;
    gap: clamp(22px, 4vw, 56px);
    margin-top: 28px;
}

.stage-cat {
    position: relative;
    padding: 8px 2px;
    background: none;
    border: 0;
    font-weight: 300;
    font-size: clamp(12px, 1.1vw, 14px);
    line-height: 1;
    letter-spacing: 0.24em;
    text-indent: 0.24em; /* balance the trailing tracking so each word is truly centred */
    text-transform: uppercase;
    cursor: pointer;
}

.stage-cat::after {
    content: '';
    position: absolute;
    left: 0.24em;
    right: 0.24em;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.45s var(--ease);
}
.stage-cat:hover::after,
.stage-cat:focus-visible::after { transform: scaleX(1); }
.stage-cat:focus-visible { outline: none; }

/* Sequence: each line floats up in turn; Welcome hands over to the categories */
.stage.is-playing .stage-welcome { animation: rise 1.1s var(--ease) 0.2s forwards, fade-out 0.8s ease 2.1s forwards; }
.stage.is-playing .stage-name    { animation: rise 1.3s var(--ease) 1.2s forwards; }
.stage.is-playing .stage-cats    { animation: rise 1.1s var(--ease) 2.3s forwards; }

.stage.is-settled .stage-name,
.stage.is-settled .stage-cats { opacity: 1; transform: none; animation: none; }
.stage.is-settled .stage-welcome { opacity: 0; animation: none; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; } }

/* SEO text from the admin: a quiet caption at the foot of the first screen */
.stage-seo {
    position: absolute;
    left: 50%;
    bottom: calc(28px + var(--bar));
    z-index: 2;
    width: min(620px, calc(100% - 2 * var(--gutter)));
    margin: 0;
    transform: translate(-50%, 12px);
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 300;
    line-height: 1.65;
    letter-spacing: 0.02em;
    text-align: center;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 1s ease, transform 1.2s var(--ease);
}
.stage.is-settled .stage-seo { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.3s; }
.stage.is-open .stage-seo { opacity: 0; transition-delay: 0s; }

/* Open: everything dims away to the white ground */
.stage.is-open .stage-bg,
.stage.is-open .stage-veil { opacity: 0; }
.stage.is-open .stage-intro { opacity: 0; transform: translateY(-24px); pointer-events: none; }

/* --- LANGUAGE SWITCH (top-right inside the sections) --- */
.lang {
    position: absolute;
    top: calc(max(10px, env(safe-area-inset-top)) + 8px); /* centred on the header's 44px row */
    right: var(--gutter);
    z-index: 5;
    display: flex;
    gap: 14px;
    color: var(--ink);
    /* hidden on the video intro; appears with the section's top bar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.stage.is-open .lang { opacity: 1; visibility: visible; transition: opacity 0.5s ease 0.6s, visibility 0s; }
.lang-btn {
    position: relative;
    padding: 8px 0;
    border: 0;
    background: none;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.06em;
    color: #1d1d1f;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.3s ease;
}
.lang-btn::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0.16em;
    bottom: 2px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.45s var(--ease);
}
.lang-btn:hover { opacity: 0.85; }
.lang-btn.is-active { opacity: 1; }
.lang-btn.is-active::after { transform: scaleX(1); }
.lang-btn:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

/* --- PANEL --- */
.stage-panel {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
}
.stage.is-open .stage-panel { visibility: visible; }

.stage-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px calc(var(--gutter) + 88px) 10px var(--gutter);
    padding-top: max(10px, env(safe-area-inset-top));
    /* no plate at all: just Back, the title and the logo circles with their shadows */
    background: none;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.stage.is-open .stage-bar { opacity: 1; transition-delay: 0.6s; }


.stage-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    background: none;
    border: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
    color: rgba(29, 29, 31, 0.8);
    cursor: pointer;
    transition: color 0.3s ease;
}
.stage-back:hover { color: #1d1d1f; }
.stage-back .icon-back { width: 13px; transition: transform 0.45s var(--ease); }
.stage-back:hover .icon-back { transform: translateX(-4px); }
.stage-back:focus { outline: none; }
.stage-back:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.stage-bar-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #1d1d1f;
}

/* --- brands: a quiet ribbon of logo circles in the section header --- */
.brands {
    --size: 44px;
    --gap: 14px;
    overflow: hidden;
    /* the ribbon fades out at both ends instead of being cut */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.brands-track {
    display: flex;
    gap: var(--gap);
    width: max-content;
    padding: 14px 0; /* full room for the circles' shadow, so the ribbon never clips it */
    animation: brands-drift 70s linear infinite;
    will-change: transform;
}
.brands:hover .brands-track,
.brands.is-holding .brands-track { animation-play-state: paused; }
/* one copy is 23 circles + 23 gaps wide: sliding by half the track lands exactly on the second copy */
@keyframes brands-drift { to { transform: translateX(calc(-50% - var(--gap) / 2)); } }
.brand {
    flex: none;
    width: var(--size);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 3px 10px rgba(0, 0, 0, 0.07);
    transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}
/* the circle itself stays put; a floating copy of it does the flight (see site.js) */
.brand.is-lifted { opacity: 0; transition: none; }
.brand-float {
    position: fixed;
    z-index: 50;
    margin: 0;
    pointer-events: none;
    transform-origin: center;
    transition:
        transform var(--fly, 0.8s) cubic-bezier(0.33, 1, 0.68, 1),
        box-shadow var(--fly, 0.8s) ease;
}
.brand-float.is-up { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.16); }
.brand img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }

/* in the section header: between Back and the section title */
.brands-bar {
    flex: 1 1 auto;
    min-width: 0;
    /* clear air on both sides, so the ribbon never crowds Back or the section title */
    margin: -14px clamp(64px, 11vw, 200px);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.stage:not(.is-open) .brands-bar .brands-track { animation-play-state: paused; }


.stage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    /* extra room so the last row can scroll up clear of the Safari toolbar */
    padding: 4px var(--gutter) calc(var(--gutter) + var(--bar));
}
.stage-grid[data-cat="video"] { grid-template-columns: repeat(5, 1fr); }

.stage-empty {
    grid-column: 1 / -1;
    padding: 18vh 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.06em;
}

.tile {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--tile);
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(110%);
    transition:
        transform 1.1s var(--ease) var(--d, 0ms),
        opacity 0.8s ease var(--d, 0ms);
}
.stage-grid[data-cat="video"] .tile { aspect-ratio: 9 / 16; }
.rise {
    opacity: 0;
    transform: translateY(40px);
    transition:
        transform 1.1s var(--ease) var(--d, 0ms),
        opacity 0.9s ease var(--d, 0ms);
}
.stage-grid.is-shown .tile,
.stage-grid.is-shown .rise { opacity: 1; transform: none; }

.tile img,
.tile video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease);
}
.tile:hover img,
.tile:hover video { transform: scale(1.03); }
/* photos show whole, never cropped: the tile's own tone fills the spare edges */
.tile:not(.tile-video) img { object-fit: contain; }
.tile:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* video tiles: first frame + play badge; tap plays inline, expand opens full screen */
.tile-video { cursor: default; }
.tile-video:hover video { transform: none; }
.tile-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.16), transparent 42%);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
/* just the triangle: no ring or blur, a soft shadow keeps it readable on light frames */
.tile-play-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    aspect-ratio: 1;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35));
    transition: opacity 0.35s ease, transform 0.5s var(--ease);
}
.tile-play-badge .icon { width: 56px; }
.tile-play-badge .icon-pause { width: 40px; }
.tile-play-badge .icon-play { transform: translateX(3px); } /* a triangle's weight sits left of its box */
.tile-play:hover .tile-play-badge { transform: scale(1.1); }
.tile-play:active .tile-play-badge { transform: scale(0.94); }
.tile-play:focus-visible { outline: 1px solid #fff; outline-offset: -6px; }
.tile-play .when-playing,
.tile-video.is-playing .when-paused { display: none; }
.tile-video.is-playing .when-playing { display: block; }
.tile-video.is-playing .tile-play { background: none; }
.tile-video.is-playing .tile-play-badge { opacity: 0; }
.tile-video.is-playing .tile-play:hover .tile-play-badge,
.tile-video.is-playing .tile-play:focus-visible .tile-play-badge { opacity: 1; }

.tile-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    color: #fff;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}
.tile-expand .icon { width: 14px; }
.tile-expand:hover { opacity: 1; background: rgba(0, 0, 0, 0.38); }
.tile-expand:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }

/* --- CONTACT: one calm column --- */
.stage-grid[data-cat="me"] {
    display: flex;
    flex-direction: column;
    max-width: 640px;
    min-height: calc(100% - 70px); /* fill the panel so the links can sit at the bottom */
    margin: 0 auto;
    padding: clamp(24px, 8vh, 96px) var(--gutter) calc(40px + var(--bar));
}

.contact-role {
    margin: 0 0 14px;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}
.contact-name {
    margin: 0 0 20px;
    font-family: var(--serif);
    font-size: clamp(46px, 6vw, 80px);
    font-weight: 500;
    line-height: 0.96;
}
.contact-text {
    margin: 0 0 48px;
    max-width: 520px;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.75;
    color: #4a4a4a;
    white-space: pre-line;
}

/* form: bare fields with a single hairline that darkens on focus */
.contact-form { display: flex; flex-direction: column; gap: 26px; }
.pit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.pit-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pit-field > span {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}
.pit-field input,
.pit-field textarea {
    width: 100%;
    padding: 8px 0 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: 300 16px/1.5 var(--font);
    transition: border-color 0.35s ease;
    -webkit-appearance: none;
    appearance: none;
}
.pit-field textarea { resize: vertical; min-height: 96px; }
.pit-field input::placeholder,
.pit-field textarea::placeholder { color: #b5b5b1; }
.pit-field input:focus,
.pit-field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.pit-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-form-foot { display: flex; align-items: center; justify-content: flex-start; gap: 24px; margin-top: 8px; }
.contact-error { margin: 0; font-size: 13px; color: #b3261e; }
.contact-error:empty { visibility: hidden; }
.contact-send:disabled { opacity: 0.5; cursor: default; }

.contact-done-title { margin: 0 0 6px; font-family: var(--serif); font-size: 36px; font-weight: 500; }
.contact-done-text { margin: 0; font-size: 15px; font-weight: 300; color: #4a4a4a; }

.contact-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 30px;
    margin: auto 0 0; /* pushed to the bottom of the section */
    padding: 72px 0 0;
}
.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.contact-arrow { width: 14px; transition: transform 0.45s var(--ease), color 0.3s ease; }
.contact-arrow.is-external { transform: rotate(-45deg); }
.contact-links .contact-arrow { color: var(--muted); }
.contact-links a:hover .contact-arrow { color: var(--ink); transform: translateX(4px); }
.contact-links a:hover .contact-arrow.is-external { transform: rotate(-45deg) translateX(4px); }
.contact-links a:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 5px; }

/* --- NOTEBOOK (Photo albums) --- */
[hidden] { display: none !important; }

.nb-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px var(--gutter) 0;
    overflow-x: auto;
    scrollbar-width: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease 0.5s, transform 0.8s var(--ease) 0.5s;
}
.nb-tabs::-webkit-scrollbar { display: none; }
.stage.is-open .nb-tabs { opacity: 1; transform: none; }

.nb-tab {
    position: relative;
    z-index: 1;
    flex: none;
    padding: 10px 20px;
    border: 0;
    background: none;
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.4s ease;
}
.nb-tab:hover,
.nb-tab.is-active { color: var(--ink); }
.nb-tab:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 6px; }

/* the only line: a black outline that glides to the active tab */
.nb-ink {
    position: absolute;
    left: 0;
    top: 10px;
    border: 1px solid var(--ink);
    pointer-events: none;
    transition: transform 0.55s var(--ease), width 0.55s var(--ease);
}
.nb-ink.no-anim { transition: none; }

.is-notebook .nb-page { margin: 0 var(--gutter) var(--gutter); }
.is-notebook .stage-grid { padding: 4px 0 var(--bar); }

.nb-intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* button sits under the description, on the left */
    gap: 16px;
    padding: 22px var(--gutter) 22px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease 0.55s, transform 0.9s var(--ease) 0.55s;
}
.is-notebook .nb-intro { padding: 22px 0 26px; }
.stage.is-open .nb-intro { opacity: 1; transform: none; }
.stage.is-open .nb-intro.is-turning { opacity: 0; transform: translateY(8px); transition-delay: 0s; transition-duration: 0.25s; }
.nb-intro[hidden] { display: none; }

.nb-desc {
    margin: 0;
    max-width: 620px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    white-space: pre-line;
}

.nb-cta {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 8px;
    border: 0;
    background: none;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 24px;
    font-style: italic;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
/* hairline: grey at rest, a black line sweeps across on hover */
.nb-cta::before,
.nb-cta::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--line);
}
.nb-cta::after {
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease);
}
.nb-cta:hover::after,
.nb-cta:focus-visible::after { transform: scaleX(1); }
.nb-cta:focus-visible { outline: none; }
.nb-cta-arrow {
    width: 22px;
    align-self: center;
    margin-top: 2px; /* optical centre against the italic x-height */
    transition: transform 0.5s var(--ease);
}
.nb-cta:hover .nb-cta-arrow,
.nb-cta:focus-visible .nb-cta-arrow { transform: translateX(6px); }

/* --- LIGHTBOX --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--screen);
    padding-bottom: var(--bar); /* media centred in the visible part */
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.97);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-visible { opacity: 1; }

.lb-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(92vw, 1100px);
    height: calc(var(--visible) * 0.86);
}
.lb-media img,
.lb-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lb-btn {
    position: absolute;
    z-index: 1;
    width: 48px;
    height: 48px;
    background: none;
    border: 0;
    font-family: var(--serif);
    font-size: 40px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
}
.lb-close { top: 12px; right: 12px; font-size: 34px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count {
    position: absolute;
    bottom: calc(18px + var(--bar));
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--muted);
}

@media (max-width: 820px) {
    :root { --gutter: 16px; }
    .stage-name { font-size: min(25vw, 150px); }
    .stage-welcome { font-size: 10px; bottom: calc(100% + 12px); }
    .stage-cats { gap: 26px; margin-top: 22px; }
    .stage-cat { font-size: 10px; letter-spacing: 0.22em; text-indent: 0.22em; }
    .stage-seo { font-size: 11px; line-height: 1.6; bottom: calc(20px + var(--bar)); }
    .stage-grid,
    .stage-grid[data-cat="video"] { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    
    .lb-prev, .lb-next { display: none; }
    .nb-tabs { gap: 0; padding-left: 10px; padding-right: 10px; }
    .nb-tab { font-size: 17px; padding: 10px 14px; }
    .is-notebook .nb-page { margin: 0 var(--gutter) var(--gutter); }
    /* compact on phones: the whole form should fit with little or no scrolling */
    .stage-grid[data-cat="me"] { padding: 8px var(--gutter) calc(20px + var(--bar)); }
    .contact-role { margin-bottom: 8px; font-size: 10px; }
    .contact-name { font-size: 38px; margin-bottom: 10px; }
    .contact-text { font-size: 13px; line-height: 1.6; margin-bottom: 22px; }
    .contact-form { gap: 16px; }
    .pit-row { grid-template-columns: 1fr 1fr; gap: 16px; }
    .pit-field { gap: 2px; }
    .pit-field input, .pit-field textarea { font-size: 16px; padding: 6px 0 8px; } /* 16px stops iOS zoom on focus */
    .pit-field textarea { height: 76px; min-height: 60px; }
    .contact-form-foot { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 2px; }
    .contact-links { padding-top: 22px; gap: 8px 22px; }
    .nb-cta { font-size: 22px; }
    .stage-bar { flex-wrap: wrap; row-gap: 10px; min-height: 0; }
    .lang { top: calc(max(10px, env(safe-area-inset-top)) - 1px); } /* phones: the first row is 26px */
    /* full width: the bar keeps 88px on the right for EN/PL, the ribbon runs under it */
    .brands-bar { --size: 35px; --gap: 12px; order: 3; flex: 0 0 calc(100% + 2 * var(--gutter) + 88px); margin: -14px 0 -12px calc(-1 * var(--gutter)); }
    .tile-play-badge { width: 60px; }
    .tile-play-badge .icon { width: 46px; }
    .tile-play-badge .icon-pause { width: 32px; }
    .tile-expand { width: 28px; height: 28px; top: 6px; right: 6px; }
    .tile-expand .icon { width: 13px; }
    .nb-intro, .is-notebook .nb-intro { padding: 18px 0 20px; gap: 12px; }
    .nb-desc { font-size: 13px; }
    .lb-media { width: 100vw; height: calc(var(--visible) * 0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .stage-welcome, .stage-name, .stage-cats, .tile, .rise, .stage-bar, .nb-tabs, .nb-intro, .nb-ink { transition: none !important; animation: none !important; }
    .brands-track { animation: none; }
    .brands { overflow-x: auto; scrollbar-width: none; }
    .stage-name, .stage-cats { opacity: 1; transform: none; }
    .stage-welcome { display: none; }
}

/* no rounded corners anywhere, including native form controls */
button, input, textarea, select, img, video { border-radius: 0; }
