:root {
    --text-color: #333;
    --safe-top: env(safe-area-inset-top, 0px); /* space taken by notches / Dynamic Island */
    --panel-bg: rgba(235, 235, 205, 0.65); /* translucent cream panels */
    --bar-height: 33.47vh; /* landscape: menu bar and About upper tab, a share of the screen height */
    --side-width: 34vw; /* portrait: menu side tab and About left tab, a share of the screen width */
    --about-top-height: 28vh; /* landscape: About upper tab */
    --panel-gap: 4.93vh; /* landscape: gap between the About tabs */
    --toggle-top: calc(2rem + env(safe-area-inset-top, 0px)); /* ☰/✕ position, clear of notches */
    --toggle-right: calc(2rem + env(safe-area-inset-right, 0px));
    --about-text: clamp(0.6rem, min(0.95vw, 1.75vh), 1.35rem); /* About text size */
    --about-side: clamp(1.5rem, 4.5vw, 6rem); /* About left/right margin */
    /* Helvetica Neue is built into Apple devices; others use Helvetica / Arial.
       It's a licensed font, so it isn't downloaded - nothing to load, nothing to license. */
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* --edge is the colour along the top of the current photo (set by js/script.js).
       Safari fills the strip behind the status bar with this colour. */
    background-color: var(--edge, #aca3a3);
    transition: background-color var(--edge-fade, 1.5s) linear;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--edge, #aca3a3);
    transition: background-color var(--edge-fade, 1.5s) linear;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}
@media (hover: hover) {
    a:hover {
        text-decoration: underline;
    }
}

/* ---------- Top bar (menu) ---------- */

.top-bar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* Keep columns rigidly inline so they never wrap and double the required vertical space */
    justify-content: space-between;
    --pad-left: clamp(1.5rem, 3vw, 3rem);
    --nav-bottom: 0.75rem; /* distance from ABOUT / CONTACT / CLIENTS to the bottom of the bar */
    padding: clamp(0.8rem, 3vh, 2.5rem) max(clamp(4rem, 6vw, 6rem), calc(var(--toggle-right) + 3rem)) clamp(0.8rem, 3vh, 2.5rem) calc(var(--pad-left) + env(safe-area-inset-left, 0px)); /* right side clears the ✕ */
    gap: clamp(0.5rem, 1.5vw, 1.5rem);
    background: var(--panel-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    position: fixed; /* fixed (not absolute) so the off-screen menu doesn't widen the page on phones */
    top: 0;
    left: 0;
    width: 100%;
    height: var(--bar-height);
    font-size: clamp(0.6rem, min(0.9vw + 0.2rem, 2vh), 1.05rem);
    font-weight: 400;
    line-height: 1.25;
    transform: translateY(-100%); /* Hidden until the menu is opened */
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, visibility 0s linear 0s;
    overflow: hidden;
}

/* Menu open */
.menu-state:checked ~ .top-bar {
    transform: none;
}

/* Clients: the menu fades out in step with the Clients panel fading in (and
   back on close), so the two cream panels are never fully stacked */
html[data-panel="clients"] .top-bar,
html[data-panel="about"] .top-bar {
    opacity: 0;
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, visibility 0s linear 0.4s;
}

/* About: the upper tab sits exactly where the menu bar is, so the menu's own
   panel stays and only its text is swapped for the About text. The tint can't
   double up or jump. */
.top-bar .mobile-left-panel > *,
.top-bar .mobile-right-panel > * {
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

html[data-panel="about"] .top-bar .mobile-left-panel > *,
html[data-panel="about"] .top-bar .mobile-right-panel > * {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease-in-out, visibility 0s linear 0.18s;
}

.desktop-contents {
    display: contents;
}

.top-bar .col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-shrink: 1;
}

.brand-col {
    justify-content: space-between;
}

.brand-title {
    font-weight: bold;
    white-space: normal;
    font-size: clamp(0.95rem, 1.42vw, 1.6rem); /* shrinks on smaller laptops for breathing room */
    color: rgba(0, 0, 0, 0.95);
    line-height: 1.2;
}

.nav {
    font-weight: bold;
    opacity: 0.85;
    color: #000;
}

.nav-desktop {
    display: flex;
    gap: clamp(1rem, 2.8vw, 2.5rem); /* tightens on narrow screens so it never reaches the addresses */
    font-size: clamp(0.75rem, 1.11vw, 1.25rem); /* shrinks on smaller laptops for breathing room */
    position: absolute;
    left: calc(var(--pad-left) + env(safe-area-inset-left, 0px));
    bottom: var(--nav-bottom);
}

.nav-mobile {
    display: none;
    flex-direction: column;
    gap: 2rem;
    font-size: 1.1rem;
}

.address-block {
    /* the 1.4vw cap only kicks in on narrow screens, so the emails fit their column */
    font-size: min(clamp(0.75rem, 1.05vw + 0.15rem, 1.1rem), 1.4vw);
    color: #111;
    justify-content: center;
}

.address-block div {
    margin-bottom: 0.1rem;
}

/* blank line in the Norfolk column, the height of London's phone number, so both
   columns are the same height and every line (emails included) lines up */
.addr-spacer {
    visibility: hidden;
}

.email-container {
    margin-top: 0.5rem;
}

/* landscape: emails always stay on one line (the text is sized to fit) */
@media (orientation: landscape) {
    .address-block .action-link {
        white-space: nowrap;
    }
}

.action-link {
    transition: opacity 0.2s ease;
    display: inline-block;
}

@media (hover: hover) {
    .action-link:hover {
        opacity: 0.5;
        text-decoration: none;
    }
}

/* ---------- Menu toggle (☰ / ✕) ---------- */

.menu-toggle {
    display: block;
    position: fixed;
    top: var(--toggle-top);
    right: var(--toggle-right);
    z-index: 400; /* above the menu and the About / Clients panels */
    font-weight: 300;
    cursor: pointer;
    font-size: 1.75rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2); /* Gentle shadow keeps it readable over images */
    line-height: 1;
    color: var(--text-color);
    transform-origin: top right;
    transition: transform 0.2s ease;
    user-select: none;
}

.menu-toggle::before,
.menu-toggle::after {
    transition: opacity 0.2s ease;
}

.menu-toggle::before {
    content: '☰';
}

/* ✕ sits exactly where the ☰ is (right-aligned) and crossfades with it */
.menu-toggle::after {
    content: '✕';
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0;
}

.menu-state:checked ~ .menu-toggle::before {
    opacity: 0;
}

.menu-state:checked ~ .menu-toggle::after {
    opacity: 1;
}

.menu-state:checked ~ .menu-toggle {
    transform: translateY(-0.25rem) scale(1.4286); /* 1.75rem -> 2.5rem */
}


/* While About/Clients is open the same ✕ stays on top and closes the panel
   (js/script.js), so there's only ever one ✕ and it never moves */
html[data-panel] .menu-toggle {
    transform: translateY(-0.25rem) scale(1.4286);
}

html[data-panel] .menu-toggle::before {
    opacity: 0;
}

html[data-panel] .menu-toggle::after {
    opacity: 1;
}

/* ---------- Slideshow ---------- */

/* 1px strips along the very top and bottom edges in the colours of the current
   photo's top and bottom edges. Safari samples fixed strips like these to tint
   the iPhone status bar area and toolbars, so they blend into the photo. */
.edge {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 50; /* above the photos, below the menu and panels */
    pointer-events: none;
    transition: background-color var(--edge-fade, 1.5s) linear;
}

.edge-top {
    top: 0;
    background-color: var(--edge, #aca3a3);
}

.edge-bottom {
    bottom: 0;
    background-color: var(--edge-bottom, var(--edge, #aca3a3));
}

/* phones: the large viewport height runs the slideshow down behind Safari's toolbar */
@supports (height: 100lvh) {
    .slider {
        bottom: auto;
        height: 100lvh;
    }
}

.slider {
    position: fixed; /* fills the whole screen, edge to edge, on every device */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    background-color: var(--edge, #aca3a3);
    transition: background-color var(--edge-fade, 1.5s) linear;
}

.slide {
    position: absolute;
    top: var(--safe-top); /* below any notch / Dynamic Island; the strip above gets a mirror */
    left: 0;
    width: 100%;
    height: calc(100% - var(--safe-top));
    opacity: 0;
    z-index: 1;
    transition: opacity var(--fade-duration, 7s) linear; /* Fades in on top; duration set by js/script.js */
    will-change: opacity;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-mirror, .slide-fg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}

/* Image foreground layer, locked to full height */
.slide-fg {
    background-size: auto 100%;
    z-index: 2;
}

/* Mirrored copies either side to fill wide screens (the top one is for phones) */
.slide-mirror.top {
    /* flipped copy directly above the photo: fills the strip behind a notch /
       Dynamic Island on phones; off-screen everywhere else */
    left: 0;
    right: 0;
    width: auto;
    top: -100%;
    bottom: auto;
    height: 100%;
    transform: scaleY(-1);
}

.slide-mirror {
    top: 0; bottom: 0;
    width: var(--img-w, 177vh);
    background-size: auto 100%;
    z-index: 1;
}

.slide-mirror.left {
    left: auto;
    right: calc(50% + var(--img-w, 177vh) * 0.5 - 1px);
    transform: scaleX(-1);
}
.slide-mirror.right {
    right: auto;
    left: calc(50% + var(--img-w, 177vh) * 0.5 - 1px);
    transform: scaleX(-1);
}

.slide-mirror.left2 {
    left: auto;
    right: calc(50% + var(--img-w, 177vh) * 1.5 - 2px);
}
.slide-mirror.right2 {
    right: auto;
    left: calc(50% + var(--img-w, 177vh) * 1.5 - 2px);
}

.slide-mirror.left3 {
    left: auto;
    right: calc(50% + var(--img-w, 177vh) * 2.5 - 3px);
    transform: scaleX(-1);
}
.slide-mirror.right3 {
    right: auto;
    left: calc(50% + var(--img-w, 177vh) * 2.5 - 3px);
    transform: scaleX(-1);
}

/* Text over slides (not currently used, see comment in index.html) */
.slide-content {
    position: relative;
    z-index: 4;
    padding: 3rem;
    max-width: 90%;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.slide.active .slide-content {
    opacity: 1;
    transition: opacity 0.5s ease-in 0.4s;
}

.slide-content h2 {
    font-size: clamp(3rem, 7vw, 6.5rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

/* ---------- About / Clients ---------- */

/* Clients: one full-screen panel */
.info-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--panel-bg);
    z-index: 300;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    padding: calc(clamp(3rem, 8vh, 6rem) + var(--safe-top)) clamp(2rem, 6vw, 6rem) clamp(3rem, 8vh, 6rem);

    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

html[data-panel="about"] .about-overlay,
html[data-panel="clients"] .clients-overlay {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

@keyframes fadeInTab {
    from { opacity: 0; }
    to { opacity: 1; }
}

html[data-panel="clients"] .clients-list {
    animation: fadeInTab 0.4s ease-out;
}

/* Every client fits on screen without scrolling: the row height is the panel's
   height divided by the number of rows, and the text is sized to suit */
.clients-overlay {
    --cl-top: max(8vh, calc(var(--toggle-top) + 2.75rem)); /* clears the ✕ */
    --cl-bottom: clamp(1rem, 4vh, 3rem);
    padding: var(--cl-top) clamp(1.5rem, 5vw, 6rem) var(--cl-bottom);
}

.clients-list {
    --rows: 26.6; /* rows in each of the 5 columns, plus a little slack */
    --row: calc((100vh - var(--cl-top) - var(--cl-bottom)) / var(--rows));
    column-count: 5;
    column-gap: clamp(1.5rem, 5vw, 7rem); /* columns spread evenly across the full width */
    opacity: 0.8;
    font-size: min(clamp(0.6rem, 0.9vw, 1rem), calc(var(--row) * 0.62));
    line-height: var(--row);
    overflow-wrap: anywhere;
    text-align: center;
}

/* About: an upper tab (the size of the menu bar), a gap, then a lower tab.
   The section itself is just a transparent frame for the two tabs. */
.about-overlay {
    display: flex;
    flex-direction: column;
    gap: var(--panel-gap);
    padding: 0;
    background: none;
    overflow: hidden;
    opacity: 1;
    transition: visibility 0s linear 0.4s; /* stays until the tabs have faded out */
}

html[data-panel="about"] .about-overlay {
    transition: visibility 0s linear 0s;
}

.about-top,
.about-lower {
    background: var(--panel-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    color: rgba(17, 17, 17, 0.95);
}

.about-top {
    flex: 0 0 var(--about-top-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center; /* intro centred top-to-bottom in the tab */
    padding: clamp(0.6rem, 2.5vh, 2rem) max(var(--about-side), 4.5rem) clamp(0.6rem, 2.5vh, 2rem) var(--about-side); /* right side clears the ✕ */
    /* crossfades with the menu bar, which fades out in step */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

/* With the menu open its panel is already in this spot, so the upper tab
   uses that panel instead of adding a second one */


.about-lower {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(1rem, 4vh, 3.5rem) var(--about-side) clamp(0.75rem, 3vh, 2.5rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

html[data-panel="about"] .about-top {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

html[data-panel="about"] .about-lower {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0s linear 0s;
}

html[data-panel="about"] .about-container {
    animation: fadeInTab 0.4s ease-out;
}

/* Upper tab: one bold block, justified, each paragraph on a new line */
.about-intro {
    font-size: var(--intro-fit, clamp(0.5rem, min(1vw, 2.35vh), 1.45rem)); /* --intro-fit: sized to fit by js/script.js */
    font-weight: bold;
    line-height: 1.6;
    text-align: justify;
}

/* Lower tab: three evenly spaced columns */
.about-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: var(--about-side);
    margin: auto 0; /* centred top-to-bottom in the lower tab, above the company line */
}

.about-item {
    margin-bottom: 1.6em;
    font-size: var(--lower-fit, var(--about-text)); /* --lower-fit: sized to fit by js/script.js */
    line-height: 1.25;
}

.about-item h3 {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 0.9em; /* a blank line under each heading */
}

.about-item p {
    text-align: justify; /* wrapped lines are justified; single lines aren't stretched */
}

@media (orientation: landscape) {
    .about-col > .about-item:last-child {
        margin-bottom: 0; /* so the centred block is truly centred */
    }
}

/* phones: use the visible height (excludes Safari's toolbars) where supported */
@supports (height: 100dvh) {
    .clients-list {
        --row: calc((100dvh - var(--cl-top) - var(--cl-bottom)) / var(--rows));
    }
}

/* Company details line at the foot of About */
.legal {
    padding-top: 1em;
    font-size: calc(var(--lower-fit, var(--about-text)) * 0.8);
    line-height: 1.4;
    opacity: 0.7;
}

/* Shown only in the portrait layout */
.about-label,
.addr-ops {
    display: none;
}

/* Landscape: "Restoration work - sculpture conservation" as one bold line */
.about-item-restoration h3 {
    display: none;
}

.about-item-restoration p {
    font-weight: bold;
}

/* Read by screen readers, not shown on screen */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Short, wide screens ---------- */

@media (max-height: 600px) and (orientation: landscape) {
    .top-bar {
        --pad-left: 2rem;
        --nav-bottom: 0.5rem;
        padding: clamp(0.5rem, 1vh + 0.5rem, 1.5rem) clamp(4.5rem, 9vw, 6rem) clamp(0.5rem, 1vh + 0.5rem, 1.5rem) var(--pad-left); /* right side clears the ✕ */
        gap: clamp(0.5rem, 1vw, 1.5rem);
        font-size: clamp(0.65rem, 2.5vh, 1rem);
        line-height: 1.15;
    }
    .top-bar .address-block {
        flex-shrink: 0; /* addresses keep their width; the brand title wraps instead */
        font-size: min(clamp(0.75rem, 1.05vw + 0.15rem, 1.1rem), 1.3vw);
    }
    .nav-desktop {
        gap: clamp(0.75rem, 2.2vw, 2.5rem);
        font-size: min(clamp(0.75rem, 1.11vw, 1.25rem), 2vw);
    }
    .address-block div {
        margin-bottom: 0;
    }
    .email-container {
        margin-top: min(0.5vh, 0.25rem);
    }

    /* About tabs follow the bar's short-screen sizing */
    .about-top {
        padding: clamp(0.5rem, 1vh + 0.5rem, 1.5rem) clamp(4.5rem, 9vw, 6rem) clamp(0.5rem, 1vh + 0.5rem, 1.5rem) 2rem;
    }
    .about-lower {
        padding: clamp(0.5rem, 2.5vh, 1.5rem) 2rem;
    }
    .about-item {
        margin-bottom: 1.2em;
    }
    .about-item h3 {
        margin-bottom: 0.5em;
    }
}

/* ---------- Mobile ---------- */

/* Portrait (phones and tablets held upright): the menu is two tabs sliding in
   from the left - links in a tab 34% of the screen wide, a gap, then the name
   and addresses in a second tab. About uses the same two tabs. */
@media (orientation: portrait) {
    :root {
        --panel-gap: clamp(0.75rem, 5vw, 2.5rem); /* tabs sit side by side here */
        --about-side-width: 28vw; /* About left tab */
        --about-gap: 4.5vw; /* gap between the About tabs */
        --tab-pad: clamp(0.6rem, 3vw, 1.25rem);
        --tab-top: calc(clamp(1rem, 3.5vh, 2.25rem) + var(--safe-top));
    }

    .top-bar {
        flex-direction: row;
        align-items: stretch;
        width: 100vw;
        height: 100vh;
        padding: 0;
        gap: var(--panel-gap);
        background: none;
        border: none;
        box-shadow: none;
        transform: none; /* the two tabs slide in separately (below) */
        pointer-events: none;
    }

    .menu-state:checked ~ .top-bar,
    .error-page .top-bar {
        pointer-events: auto;
    }

    .desktop-contents {
        display: flex;
        flex-direction: column;
        height: 100%;
        background: var(--panel-bg);
        border-right: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
        transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* left tab comes in from the left, right tab from the right */
    .mobile-left-panel {
        transform: translateX(calc(-100% - 30px));
    }

    .mobile-right-panel {
        transform: translateX(calc(100% + 30px));
    }

    .menu-state:checked ~ .top-bar .desktop-contents,
    .error-page .top-bar .desktop-contents {
        transform: none;
    }

    .mobile-left-panel {
        flex: 0 0 var(--side-width);
        align-items: center;
        padding: var(--tab-top) 0.5rem 2rem;
    }

    .mobile-right-panel {
        flex: 1 1 auto;
        min-width: 0;
        padding: var(--tab-top) var(--tab-pad) 2rem;
    }

    .nav-mobile {
        display: flex;
        align-items: center;
        gap: 4vh;
        font-size: clamp(0.8rem, 4.2vw, 1.4rem);
        text-align: center;
    }

    .nav-desktop {
        display: none;
    }

    .top-bar .col {
        width: 100%;
        flex: none;
    }

    .top-bar .col:empty {
        display: none;
    }

    .brand-col {
        padding-right: calc(var(--toggle-right) + 2.25rem - var(--tab-pad)); /* clear of the ✕ */
    }

    .brand-ops {
        display: none;
    }

    .brand-title {
        font-weight: normal;
        font-size: clamp(0.8rem, 4.2vw, 1.5rem);
    }

    .address-block {
        font-size: clamp(0.6rem, 3.15vw, 1.15rem);
        line-height: 1.3;
        justify-content: flex-start;
    }

    .addr-ops {
        display: block;
        margin-bottom: 1.2em;
    }

    .addr-spacer {
        display: none; /* only needed when the columns sit side by side */
    }

    .email-container {
        margin-top: 0;
    }

    /* addresses sit together in the middle of the tab */
    .mobile-right-panel > .address-block:nth-child(3) {
        margin-top: auto;
    }

    .mobile-right-panel > .address-block:nth-child(4) {
        margin-top: 2.2em;
        margin-bottom: auto;
    }

    /* About: each heading in the left tab (28% of the width), a gap (4.5%),
       its text beside it in the right tab. Both tabs are painted behind one list
       so the rows line up; the menu crossfades out as they fade in. */
    /* one screen, no scrolling: js/script.js sizes the text (--about-fit) so
       everything fits, and the rows spread down the full height */
    .about-overlay {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
        padding: calc(var(--toggle-top) + 3rem) 0 calc(1.25rem + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(to right,
            var(--panel-bg) 0 var(--about-side-width),
            transparent var(--about-side-width) calc(var(--about-side-width) + var(--about-gap)),
            var(--panel-bg) calc(var(--about-side-width) + var(--about-gap)) 100%);
        opacity: 0;
        transition: opacity 0.4s ease, visibility 0s linear 0.4s; /* crossfades with the menu */
    }

    html[data-panel="about"] .about-overlay {
        opacity: 1;
        transition: opacity 0.4s ease, visibility 0s linear 0s;
    }

    .about-top,
    .about-lower,
    .about-container,
    .about-col {
        display: contents;
    }

    .about-intro,
    .about-item {
        display: grid;
        grid-template-columns: var(--about-side-width) 1fr;
        align-items: start;
        margin: 0 0 0.9em;
        font-size: var(--about-fit, clamp(0.6rem, 2.9vw, 1rem));
        line-height: 1.3;
        text-align: left;
    }

    .about-label,
    .about-item h3,
    .about-item-restoration h3 {
        display: block;
        grid-column: 1;
        margin: 0;
        padding: 0 var(--tab-pad);
        font-size: 1em;
        font-weight: bold;
    }

    .about-text,
    .about-item p {
        grid-column: 2;
        padding: 0 var(--tab-pad) 0 calc(var(--about-gap) + var(--tab-pad));
        text-align: justify;
    }

    .about-intro .about-text {
        font-weight: bold;
    }

    .legal {
        margin: 0;
        padding: 0 var(--tab-pad) 0 calc(var(--about-side-width) + var(--about-gap) + var(--tab-pad));
        font-size: calc(var(--about-fit, 0.6rem) * 0.85);
    }

    .about-item-restoration p {
        font-weight: normal;
    }

    /* the ✕ is smaller here to suit the small About text; it shrinks towards its
       top-right corner, so it stays in the same spot */
    html[data-panel="about"] .menu-state ~ .menu-toggle {
        transform: translateY(-0.25rem) scale(0.85);
    }

    /* Clients: three columns */
    .clients-list {
        --rows: 45;
        column-count: 3;
        column-gap: clamp(0.5rem, 4vw, 3rem);
        font-size: min(clamp(0.5rem, 2.6vw, 1rem), calc(var(--row) * 0.62));
    }

    .clients-overlay {
        padding-left: clamp(0.75rem, 3vw, 2rem);
        padding-right: clamp(0.75rem, 3vw, 2rem);
    }
}

@media (max-width: 768px) {
    .slide-content h2 {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
}

/* ---------- 404 page ---------- */

.error-page .top-bar {
    transform: none; /* menu always open */
}

.error-page .slider {
    background: #aca3a3 url('../assets/images/landscape/main-01.jpg?v=1') center / cover no-repeat;
}

@media (orientation: portrait) {
    .error-page .slider {
        background-image: url('../assets/images/portrait/main-01.jpg?v=1');
    }
}

.error-message {
    margin-top: 0.75rem;
    font-size: clamp(0.85rem, 1.2vw + 0.2rem, 1.25rem);
    font-weight: normal;
    color: #111;
}

h1.error-message {
    font-weight: bold;
}

/* ---------- Text pages (privacy) ---------- */

.doc-page .slider {
    background: #aca3a3 url('../assets/images/landscape/h1440/main-01.webp?v=2') center / cover no-repeat;
}

@media (orientation: portrait) {
    .doc-page .slider {
        background-image: url('../assets/images/portrait/h2560/main-01.webp?v=2');
    }
}

.doc-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 300;
    overflow-y: auto;
    background: var(--panel-bg);
    padding: calc(var(--toggle-top) + 3rem) clamp(1.25rem, 6vw, 6rem) 3rem;
}

/* same place and size as the menu ✕ */
.doc-close {
    position: fixed;
    top: var(--toggle-top);
    right: var(--toggle-right);
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transform-origin: top right;
    transform: translateY(-0.25rem) scale(1.4286);
}

.doc {
    max-width: 44rem;
    color: rgba(17, 17, 17, 0.95);
    font-size: clamp(0.9rem, 0.6vw + 0.65rem, 1.05rem);
    line-height: 1.5;
}

.doc h1 {
    font-size: 1.6em;
    margin-bottom: 1.2em;
}

.doc h2 {
    font-size: 1em;
    margin: 1.8em 0 0.4em;
}

.doc p + p {
    margin-top: 0.6em;
}

.doc a {
    text-decoration: underline;
}

.doc-updated {
    margin-top: 2em;
    opacity: 0.7;
}
