/* ==========================================================================
   Daniell Skourup — portfolio
   Mobile first: base styles are for phones (below 700px). The @media (min-width: 700px)
   blocks in each section are the larger layout, used by tablets and desktop. Tablets
   (700–1099px) then get a few changes of their own: see "Tablet" near the end.
   The layout stops growing at 1440px wide and sits centred (see --gridMargin).
   ========================================================================== */

:root {
    /* Our colours */
    --white: #ffffff;
    --black: #202020;

    /* What the page uses. Light mode here; dark mode swaps them in the block below.
       Always use these (not --white / --black) so both modes work. */
    --paper: var(--white);  /* page background */
    --ink: var(--black);    /* text, lines, button borders */
    --lightGrey: #E4E4E4;   /* thin lines: timeline, light image borders, skill chips */
    --tile: #F4F4F4;        /* playground tiles */
    --darkGrey: #707070;    /* secondary text: years, labels, "Last updated" */
    --grey: #b3b3b3;        /* "Show more" hover, list triangles, grid lines, slider arrow hover */
    --error: #DB1924;       /* the red from the original colour list */
    --shadow: rgba(32, 32, 32, 0.08);        /* header shadow */
    --shadowStrong: rgba(32, 32, 32, 0.16);  /* to-top button shadow */
    --glassEdge: rgba(255, 255, 255, 0.35);  /* to-top button: frosted glass */
    --glassFill: rgba(255, 255, 255, 0.12);
    --glassShine: rgba(255, 255, 255, 0.45);
    --imageBackground: transparent;          /* dark mode: white behind images (see below) */
    --imageBorder: none;                     /* dark mode: a thin white frame around images */
    --imageBorderLight: var(--lightGrey);    /* .bordered-light images */
    --timelineLine: var(--lightGrey);        /* CV timeline: the line and (dark mode) the logo frames */
    color-scheme: light;                     /* browser parts (scrollbars, form fields) in light */

    /* Layout grid (see "Grid mode" in the footer): 4 columns on phones, 12 on desktop.
       --col is one column's width inside <main>; a span of n columns is
       n * var(--col) + (n - 1) * var(--gridGap). */
    --gridMargin: 5vw;
    --gridGap: 2vw;
    --gridCols: 4;
    --col: calc((100% - (var(--gridCols) - 1) * var(--gridGap)) / var(--gridCols));

    /* Text sizes: a golden-ratio scale (x 1.618) from the paragraph size (16px = 1rem),
       with half steps (x 1.272) in between. Change a step here and every text using it follows. */
    --step--half: 0.786rem;  /* 12.6px  buttons, copyright, small labels */
    --step-0:     1rem;      /* 16px    paragraphs, menu, footer            */
    --step-half:  1.272rem;  /* 20.4px                                      */
    --step-1:     1.618rem;  /* 25.9px                                      */
    --step-1half: 2.058rem;  /* 32.9px                                      */
    --step-2:     2.618rem;  /* 41.9px                                      */
    --step-2half: 3.330rem;  /* 53.3px                                      */
    --step-3:     4.236rem;  /* 67.8px                                      */

    /* One easing for the site's animations: slow start, smooth finish (as on jonyablonski.com) */
    --ease: cubic-bezier(0.645, 0.045, 0.355, 1);

    --tablet: 700px;  /* reference only — media queries can't read variables */
    --desktop: 1100px;
}

/* ---------- Dark mode ----------
   Follows the visitor's device setting, unless they chose otherwise with the switch in the
   footer (main.js then puts class "dark" or "light" on <html>). The two blocks must stay the same. */

@media (prefers-color-scheme: dark) {
    :root:not(.light) {
        --paper: var(--black);
        --ink: var(--white);
        --lightGrey: #3d3d3d;
        --tile: #2a2a2a;
        --darkGrey: #a3a3a3;
        --grey: #6b6b6b;
        --error: #ff5c63;
        --shadow: rgba(0, 0, 0, 0.35);
        --shadowStrong: rgba(0, 0, 0, 0.5);
        --glassEdge: rgba(255, 255, 255, 0.12);
        --glassFill: rgba(255, 255, 255, 0.06);
        --glassShine: rgba(255, 255, 255, 0.12);
        --imageBackground: var(--white);
        --imageBorder: 1px solid var(--white);
        --imageBorderLight: var(--white);
        --timelineLine: var(--grey);
        color-scheme: dark;
    }
}

:root.dark {
    --paper: var(--black);
    --ink: var(--white);
    --lightGrey: #3d3d3d;
    --tile: #2a2a2a;
    --darkGrey: #a3a3a3;
    --grey: #6b6b6b;
    --error: #ff5c63;
    --shadow: rgba(0, 0, 0, 0.35);
    --shadowStrong: rgba(0, 0, 0, 0.5);
    --glassEdge: rgba(255, 255, 255, 0.12);
    --glassFill: rgba(255, 255, 255, 0.06);
    --glassShine: rgba(255, 255, 255, 0.12);
    --imageBackground: var(--white);
    --imageBorder: 1px solid var(--white);
    --imageBorderLight: var(--white);
    --timelineLine: var(--grey);
    color-scheme: dark;
}


/* ---------- Font ----------
   Montserrat, stored on our own server (assets/fonts/) so no visitor data goes to Google.
   One variable file covers weights 400-700; the browser only loads latin-ext if a page needs it. */

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Outfit: only for the type sample on the Nordic Drum Store case (the shop's typeface). Free under the SIL Open Font
   License; stored here like Montserrat, so no fonts load from Google. Browsers only download it where it is used. */
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/outfit-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ---------- Base ---------- */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px; /* links to a section (e.g. /about#experience) stop below the header */
}

body {
    font-family: "Montserrat", "Segoe UI", Roboto, sans-serif;
    margin: 0;
    color: var(--ink);               /* all text in our black (the browser default is pure black) */
    background-color: var(--paper);

    /* Sticky footer: the page is at least one screen tall, and <main> fills the space
       between header and footer, so the footer sits at the bottom even on short pages */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh; /* phones: the visible screen, without the browser bar */
}

p, li {
    font-weight: 400;
    line-height: 1.5;
}

p, li, h1, h2, h3 {
    text-wrap: pretty; /* avoids a single word alone on the last line */
}

a, button {
    font-weight: 400;
}

button {
    font-family: inherit; /* browsers give buttons their own font by default; use Montserrat */
}

strong {
    font-weight: 600;
}

img {
    width: 100%;
    height: auto;
    box-sizing: border-box;                   /* a border never makes an image wider than its space */
    background-color: var(--imageBackground); /* dark mode: see-through images keep the white they were made for */
    border: var(--imageBorder);               /* dark mode: 1px white frame (follows round corners, e.g. the portrait) */
}

/* Icons (Material Symbols Rounded, see includes/icons.php) */
.icon {
    width: 1.5em;
    height: 1.5em;
    margin: -0.3em -0.5em; /* the SVG box has built-in padding; this keeps text spacing as before */
    vertical-align: middle;
    fill: currentColor;
}

/* Up/down chevrons are wider than left/right ones, so they need less negative margin */
.icon-expand_more,
.icon-expand_less {
    margin: -0.3em -0.43em;
}

/* Show something on one screen size only: add class="mobileOnly" or class="desktopOnly" */
@media (max-width: 699.98px) {
    .desktopOnly {
        display: none !important;
    }
}

@media (min-width: 700px) {
    :root {
        /* The layout is at most 1440px wide: beyond that the margins grow and it stays centred */
        --gridMargin: max(6vw, calc(50vw - 720px + 86.4px));
        --gridGap: min(2vw, 28.8px);
        --gridCols: 12;
        --insetCols: 2; /* the text column starts this many grid columns in from each side */
        --textInset: calc(var(--insetCols) * (var(--col) + var(--gridGap)));
        /* One grid column measured from inside the text column (which spans gridCols - 2 * insetCols columns) */
        --textCols: calc(var(--gridCols) - 2 * var(--insetCols));
        --colInText: calc((100cqw - (var(--textCols) - 1) * var(--gridGap)) / var(--textCols));
    }
}

@media (min-width: 700px) {
    .mobileOnly {
        display: none !important;
    }
}


/* ---------- Buttons ---------- */

/* The round outline buttons: fixed size on every screen, small uppercase text like the menu */
.button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 24px;
    font-size: var(--step--half);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
    color: var(--ink);
    background-color: var(--paper);
    border-radius: 50px;
    border: 1px solid currentColor;
    cursor: pointer;
    transition: color 0.6s var(--ease), background-color 0.6s var(--ease);
}

.button .icon {
    width: 1.3em;
    height: 1.3em;
    margin: 0 -0.35em; /* the icon's built-in padding; the gap gives the spacing */
}

@media (min-width: 700px) {
    .button {
        height: 50px; /* phones: 44px */
        padding: 0 28px;
    }

    .button:hover {
        color: var(--paper);
        background-color: var(--ink);
    }
}


/* ---------- Grid system ----------
   .grid          gallery grid (gap + vertical spacing)
   .cols-N        N columns on phones        (N = 1–6)
   .d-cols-N      N columns on desktop       (N = 1–6)
   Example: <div class="grid cols-2 d-cols-4"> ... </div>
*/

.grid {
    display: grid;
    grid-gap: var(--gridGap);
    margin: 5vh 0;
}

.cols-1 { grid-template-columns: repeat(1, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
.cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (min-width: 700px) {
    .d-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .d-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .d-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .d-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .d-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .d-cols-6 { grid-template-columns: repeat(6, 1fr); }
    .d-cols-7 { grid-template-columns: repeat(7, 1fr); }
}


/* Thin light border on one image (class="framed"), e.g. a screenshot with a white background */
img.framed {
    border: 1px solid var(--imageBorderLight);
}

/* Optional thin border around every image in a grid */
.bordered img {
    border: 1px solid var(--ink);
}

.bordered-light img {
    border: 1px solid var(--imageBorderLight);
}


/* "Before → after" arrow between two images in a gallery, drawn in code (follows dark mode).
   Points right; class "down" points down (for galleries stacked in one column). */
.changeArrow {
    align-self: center;
    justify-self: center;
    width: 0;
    height: 0;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 28px solid var(--ink);
}

.changeArrow.down {
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 28px solid var(--ink);
    border-bottom: 0;
}

/* Bento gallery (Biobridge cell textures): 6 square columns on phones, tiles marked big (2x2), wide (2x1) or tall (1x2).
   The tile order in the page is chosen so the grid closes without holes. */
.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* square rows: the bento spans the full grid width (phones: the text width; desktop: d-wide) */
    grid-auto-rows: calc((100cqw - 5 * var(--gridGap)) / 6);
    grid-auto-flow: dense;
    gap: var(--gridGap);
    margin: 5vh 0;
}

/* Tablet and desktop: 12 columns, so every tile sits on the layout grid. The tile order in the page
   closes without holes at both 6 and 12 columns */
@media (min-width: 700px) {
    .bento {
        grid-template-columns: repeat(12, 1fr);
        grid-auto-rows: calc((100cqw + 2 * var(--insetCols) * (var(--colInText) + var(--gridGap)) - 11 * var(--gridGap)) / 12); /* square: the bento's full width / 12 */
    }
}

.bento img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bento .big  { grid-column: span 2; grid-row: span 2; }
.bento .wide { grid-column: span 2; }
.bento .tall { grid-row: span 2; }

/* Gallery images that open in full size (e.g. big overviews) */
.grid a {
    display: block;
}

/* Desktop: wider than the text, across all 12 grid columns (for big overviews and diagrams) */
@media (min-width: 700px) {
    .textSection .d-wide {
        margin-left: calc(-1 * var(--insetCols) * (var(--colInText) + var(--gridGap)));
        margin-right: calc(-1 * var(--insetCols) * (var(--colInText) + var(--gridGap)));
    }

    /* One grid column wider than the text on each side (desktop: 10 of 12 columns; tablet: all 8) */
    .textSection .d-wider {
        margin-left: calc(-1 * (var(--colInText) + var(--gridGap)));
        margin-right: calc(-1 * (var(--colInText) + var(--gridGap)));
    }
}


/* ---------- Divider ---------- */

.divider {
    display: block;
    height: 1px;
    background-color: var(--ink);
    margin: 10vh 0;
}


/* ---------- Header ----------
   Sticks to the top of the screen: slides away while scrolling down and comes back as soon
   as you scroll up (see main.js), with a soft shadow as a border once the page is scrolled.
*/

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--paper);
    padding-bottom: 5vh; /* same space below the name as above it */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

header.is-hidden {
    transform: translateY(calc(-100% - 10px)); /* -10px: the shadow goes too */
}

header.is-scrolled {
    box-shadow: 0 2px 6px var(--shadow);
}

.top {
    margin: 5vh 5vw 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
}

.top a {
    text-decoration: none;
    color: var(--ink);
}

.topName,
.menuToggle {
    position: relative;
    z-index: 2; /* stay above the phone menu overlay */
}

.topName {
    justify-self: start; /* the link is only as wide as the name, not the whole bar */
    font-size: var(--step-0);
    text-transform: uppercase;
    letter-spacing: 0;
    transition: letter-spacing 0.6s var(--ease);
}

/* Hover on the name: the letters spread out a little */
@media (hover: hover) {
    .topName:hover {
        letter-spacing: 0.08em;
    }
}

/* Burger button (phones only): three lines that turn into an X when the menu is open */
.menuToggle {
    width: 44px;
    height: 44px;
    margin-right: -11px; /* lines the icon up with the page edge */
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.menuToggle span {
    position: absolute;
    left: 11px;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.menuToggle span:nth-child(1) { top: 15px; }
.menuToggle span:nth-child(2) { top: 21px; }
.menuToggle span:nth-child(3) { top: 27px; }

.menuToggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menuToggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menuToggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* The menu: a full-screen overlay on phones, a row on desktop */
.menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0 5vw;
    background-color: var(--paper);
    font-size: var(--step-1half);
    line-height: 2;
    text-transform: uppercase;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu.open {
    opacity: 1;
    visibility: visible;
}

.menu li {
    line-height: inherit;
}

body.menu-open {
    overflow: hidden; /* the page behind the open menu doesn't scroll */
}

/* Underline that grows from left to right on hover (menu and footer links);
   the current page's menu item keeps it */
.menu a,
.footerLinks a,
.privacyLink {
    position: relative;
}

.menu a::after,
.footerLinks a::after,
.privacyLink::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35em;
    width: 100%;
    max-width: 0;
    height: 1px;
    background-color: currentColor;
    transition: max-width 0.4s var(--ease);
}

.menu a.activeBtn::after {
    max-width: 100%;
}

@media (hover: hover) {
    .menu a:hover::after,
    .footerLinks a:hover::after,
    .privacyLink:hover::after {
        max-width: 100%;
    }
}

@media (min-width: 700px) {
    header {
        padding-bottom: 3vh;
    }

    .top {
        margin: 3vh calc(var(--gridMargin) - 1.5vw) 0 var(--gridMargin); /* right: minus the last link's 1.5vw space, so its text ends at the margin */
        grid-template-columns: 1fr auto; /* the menu takes the width it needs, at the right */
    }

    .menuToggle {
        display: none;
    }

    .menu a {
        padding: 0 1.5vw;
        white-space: nowrap; /* a link never breaks over two lines */
    }

    /* Items sit right-aligned and touch each other: each link has 1.5vw of space on both
       sides, and the underline covers that space too. So the underline of the next item
       continues exactly where the current page's underline ends (as on jonyablonski.com). */
    .menu {
        position: static;
        display: flex;
        flex-direction: row; /* side by side (the phone overlay stacks them) */
        justify-content: flex-end;
        gap: 0;
        padding: 0;
        background: none;
        font-size: var(--step-0);
        line-height: normal;
        opacity: 1;
        visibility: visible;
        transition: none;
    }
}


/* ---------- Main ---------- */

main {
    flex: 1 0 auto; /* take up the space left between header and footer */
    margin: 5vh 5vw 0; /* + the header's 5vh below the name = 10vh */
}

/* Keep the spacing exactly as before the sticky footer (margins no longer merge) */
main > :first-child,
main > :first-child > :first-child {
    margin-top: 0;
}

@media (min-width: 700px) {
    main {
        margin: 17vh var(--gridMargin) 0; /* + the header's 3vh = 20vh */
    }
}


/* ---------- Home ---------- */

.intro p {
    font-size: var(--step-1);
    font-weight: 600;
    line-height: 1.5;
}

/* Home headline */
.designLine {
    margin: 1em 0;          /* same as the paragraph it replaced */
    font-size: var(--step-1);
    font-weight: 600;
    line-height: 1.5;
}

/* Keeps a word whole, e.g. "human-centered" never breaks after the hyphen */
.noBreak {
    white-space: nowrap;
}

/* Phones: the headline wraps by itself into even lines (no lone word at the end);
   the desktop line breaks are switched off */
@media (max-width: 699.98px) {
    .designLine {
        text-wrap: balance;
    }

    .desktopBreak {
        display: none;
    }
}

/* Same space the two line breaks gave on the old site */
.intro.spaced {
    margin-top: 2.375em;
}

.featuredHeader {
    font-size: var(--step-0);
    text-transform: uppercase;
    font-weight: 600;
}

@media (min-width: 700px) {
    .intro p {
        font-size: var(--step-2);
        width: calc(8 * var(--col) + 7 * var(--gridGap)); /* columns 1-8 */
    }

    /* Home: the space from the headline down to the divider matches the space from the name down to the
       headline (20vh: the header's 3vh + main's 17vh). 93px = what the headline's last line, the button
       and the space between them already take up. */
    main > .intro:first-child + .divider {
        margin-top: calc(20vh - 93px);
    }

    /* Desktop: three lines, broken by hand in index.php. Wide enough for the longest line;
       on small laptops the text shrinks slightly so that line always fits. */
    .designLine {
        font-size: min(var(--step-2), calc((100vw - 2 * var(--gridMargin)) / 20.5));
        width: 20.5em;
        max-width: 100%;
    }
}


/* ---------- About ---------- */

.about {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 5vw;
}

.aboutText {
    order: 1; /* below the photo on phones */
}

.about p {
    font-size: var(--step-1);
    font-weight: 600;
    line-height: 1.5;
}

.about img {
    border-radius: 50%;
    margin: 0 10vw 2vh;
    width: 80%;
}

.aboutMe,
.cv,
.legal {
    margin: 5vh 0;
}

.aboutMe h2,
.cv h2,
.legal h1 {
    font-size: var(--step-1);
    text-transform: uppercase;
    font-weight: 600;
}

.cv h2 {
    margin: 2.5em 0 1em;
}

/* Privacy policy */
.legal h1 {
    margin: 0;
}

.legal .legalUpdated,
.formNote {
    font-size: var(--step--half);
    color: var(--darkGrey);
}

.legal h2 {
    font-size: var(--step-0);
    font-weight: 600;
    margin: 2.5em 0 0.5em;
}

.legal a,
.formNote a {
    color: inherit;
}

/* "Experience" with the Download CV button beside it */
.cvHeader {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em 1em;
    margin: 0 0 1em;
    font-size: var(--step-1); /* so 1em below is the same space as below "Education" */
}

.cvHeader h2 {
    margin: 0;
}

/* Experience / Education timeline, laid out like the CV:
   years | logo on a thin vertical line | role, company, notes and "Show more" */
.timeline {
    --years: 3.4em;
    --logo: 44px;
    --gap: 1em;
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--years) + var(--gap) + var(--logo) / 2);
    width: 1px;
    background-color: var(--timelineLine);
}

.timelineItem {
    display: grid;
    grid-template-columns: var(--years) var(--logo) 1fr;
    column-gap: var(--gap);
    align-items: start;
    padding-bottom: 2.5em;
}

/* Logo, then role + company + notes as one block (a link when the job has a Work page) */
.timelineHead {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: var(--logo) 1fr;
    column-gap: var(--gap);
    align-items: start;
}

.timelineText {
    display: block;
    justify-self: start; /* only as wide as its text, not the whole column */
    color: var(--ink);
    text-decoration: none;
}

/* Hover on a linked job: the title's letters spread out, like the name in the header */
.timelineRole {
    letter-spacing: 0;
    transition: letter-spacing 0.6s var(--ease);
}

@media (hover: hover) {
    a.timelineText:hover .timelineRole {
        letter-spacing: 0.08em;
    }
}

.timelineMore {
    grid-column: 3;
}

.timelineItem:last-child {
    padding-bottom: 0;
}

.years {
    margin: 0;
    display: grid;
    text-align: right;
    color: var(--darkGrey);
    font-size: var(--step--half);
    line-height: 1.4;
}

.timelineLogo {
    position: relative; /* above the vertical line */
    width: var(--logo);
    height: var(--logo);
    border-color: var(--timelineLine); /* dark mode: the logo frame in the timeline's grey, not white */
}

.timelineRole {
    margin: 0;
    font-size: var(--step-half);
    font-weight: 600;
    line-height: 1.3;
}

.timelineOrg {
    margin: 0.3em 0 0;
    font-style: italic;
}

.timelineNote {
    margin: 0.2em 0 0;
    font-size: var(--step--half);
    color: var(--darkGrey);
}

/* The bullets fold open and closed (main.js animates the height) */
.timelinePoints {
    overflow: hidden;
    padding-top: 0.7em;
    transition: height 0.5s var(--ease), opacity 0.5s var(--ease);
}

.timelinePoints.is-closed {
    opacity: 0;
}

/* List with small grey triangles, like the CV */
.triangleList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.triangleList li {
    position: relative;
    padding-left: 1.8em;
    margin-top: 0.3em;
}

.triangleList li::before {
    content: "";
    position: absolute;
    left: 0.2em;
    top: 0.5em;
    border-left: 9px solid var(--grey);
    border-top: 5.5px solid transparent;
    border-bottom: 5.5px solid transparent;
}

/* "Show more" under each entry (see main.js) */
.showMore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.6em;
    padding: 0.3em 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: var(--step--half);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.4s var(--ease);
}

@media (hover: hover) {
    .showMore:hover {
        color: var(--grey); /* the grey of the years */
    }
}

.showMore[hidden] {
    display: none; /* only shown when JavaScript can make it work */
}

.showMore .icon {
    width: 1.3em;
    height: 1.3em;
    margin: 0;
    transition: transform 0.4s var(--ease);
}

.showMore[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

/* Skills, in the CV's groups */
.skillGroup {
    margin: 1.5em 0 0.8em;
    font-size: var(--step-0);
    font-weight: 600;
    text-transform: uppercase;
}

.skillDisplay {
    margin: 0;
    padding: 0;
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
}

.skill {
    border: solid 1px var(--ink);
    border-radius: 6px;
    padding: 0.25em 0.7em; /* fixed size, like the chips in the CV */
    margin: 0 8px 8px 0;
}

@media (min-width: 700px) {
    .about {
        grid-template-columns: repeat(12, 1fr);
        column-gap: var(--gridGap);
        align-items: center;
    }

    /* No extra space above the first and below the last line, so the centring is exact */
    .aboutText p:first-child {
        margin-top: 0;
    }

    .aboutText p:last-child {
        margin-bottom: 0;
    }

    /* The space from the text down to the divider matches the space from the name down to
       the text (20vh: the header's 3vh + main's 17vh), as on the home page */
    .about + .divider {
        margin-top: 20vh;
    }

    .aboutText {
        order: 0; /* beside the photo on desktop */
        grid-column: 1 / 9; /* text: columns 1-8 */
    }

    .about > div:last-child {
        grid-column: 10 / 13; /* portrait: columns 10-12 */
    }

    /* The text sets the spacing (as the headline on the home page); the portrait is centred on the
       text and may reach a little above and below it, without pushing anything away */
    .about > div:last-child {
        height: 0;
        display: flex;
        align-items: center;
    }

    .about p {
        font-size: var(--step-2);
    }

    .about img {
        margin: 0;
        width: 100%;
        vertical-align: top; /* no gap under the portrait */
    }

    .aboutMe,
    .cv,
    .legal {
        margin: 5vh var(--textInset); /* columns 3-10, like the work pages */
    }

    .aboutMe h2,
    .cv h2,
    .legal h1,
    .cvHeader {
        font-size: var(--step-2);
    }

    .timeline {
        --years: 4.5em;
        --logo: 56px;
        --gap: 1.5em;
    }
}


/* ---------- Work pages (projects and jobs) ---------- */

.boldText {
    font-weight: 600;
}

.projectSection h1 {
    margin-top: 5vh;
    padding-bottom: 5vh;
    border-bottom: 1px solid currentColor;
    font-size: var(--step-1);
    font-weight: 600;
    text-transform: uppercase;
}

.projectInformation {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 5vw;
}

.projectInformation a,
.textSection a {
    color: var(--ink);
}

.textSection {
    margin: 5vh 0 0;
    container-type: inline-size; /* lets galleries inside measure the text column (cqw), see .bento and .d-wide */
}

.textSection h2 {
    font-size: var(--step-half);
    font-weight: 600;
}

/* Gallery insets on desktop (phones always use the full width) */
@media (min-width: 700px) {
    .projectSection h1 {
        font-size: var(--step-2);
    }

    .projectInformation {
        grid-template-columns: repeat(5, 1fr); /* Client/Employer, Role, Timeframe, Type, Link */
        grid-gap: 3vw var(--gridGap);         /* 2 grid columns each */
        margin-right: var(--textInset); /* ends at column 10 */
    }

    .textSection {
        margin: 5vh var(--textInset) 0; /* columns 3-10 */
    }

    .textSection h2 {
        font-size: var(--step-1);
    }

    /* inside the text (8 columns wide): one or two columns in from each side */
    .d-inset-10 {
        margin: 5vh calc((100% - 7 * var(--gridGap)) / 8 + var(--gridGap));           /* columns 4-9 */
    }

    .d-inset-20 {
        margin: 5vh calc(2 * (100% - 7 * var(--gridGap)) / 8 + 2 * var(--gridGap));   /* columns 5-8 */
    }
}

/* Phones (4 columns): one column in from each side, so the gallery is half as wide. Combine with a
   d-inset class for desktop, e.g. class="grid cols-1 inset-10 d-inset-20" */
@media (max-width: 699.98px) {
    .inset-10 {
        margin: 5vh calc((100% - 3 * var(--gridGap)) / 4 + var(--gridGap));           /* columns 2-3 */
    }
}


/* ---------- Spacing in portfolio pages ----------
   "One line" of extra space (the height of a line of text) separates the parts of a page.
   Automatic: above every section heading except the first, around buttons, around sliders.
   By hand: add class="space-above" or class="space-below" to a paragraph, list or gallery.
*/

.textSection {
    --line: 19px;
}

.textSection h2 {
    margin-top: 0;
    padding-top: calc(var(--line) + 0.83em); /* 0.83em = a heading's normal top margin */
}

.textSection > img:first-child + h2 {
    margin-top: 0.83em; /* the first heading, straight under the cover image */
    padding-top: 0;
}

.textSection .intro {
    padding: var(--line) 0;
}

.textSection .intro + h2 {
    padding-top: 0.83em; /* the button already brings the line of space */
}

.space-above {
    margin-top: 0 !important;
    padding-top: calc(var(--line) + var(--space, 1em));
}

.space-below {
    margin-bottom: 0 !important;
    padding-bottom: calc(var(--line) + var(--space, 1em));
}

.grid {
    --space: 5vh; /* galleries have 5vh margins instead of the 1em of text */
}

/* ---------- Diagrams built in code (Six Aspects page) ----------
   Readable at any size, and they follow dark mode. Colors per item come from style="--c: …" in the page. */

/* Survey highlights: hexagons in six triangle pieces; one full-color piece per respondent, the rest light */
.hexStats {
    list-style: none;
    padding: 0;
    margin: 5vh 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2em 5vw;
    text-align: center;
    font-size: var(--step--half);
}

.hexStats li::before {
    display: none; /* no list triangles */
}

.hexShape {
    display: block;
    width: 70%;
    margin: 0 auto 0.8em;
    fill: var(--c);
}

.hexShape .hexLight {
    fill: color-mix(in srgb, var(--c) 45%, white);
}

.hexNumber {
    display: block;
    font-size: var(--step-half);
    font-weight: 600;
}

/* Information architecture: two equal interface views (hexagon and grid), each with its pages and their topics.
   Desktop: side by side, the two names joined by a line */
.iaDiagram {
    position: relative;
    margin: 5vh 0;
}

.iaBranch + .iaBranch {
    margin-top: 3em;
}

.iaRoot {
    display: inline-block;
    margin: 0;
    padding: 0.5em 1em;
    background-color: var(--ink);
    color: var(--paper);
    font-size: var(--step--half);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.iaNodes {
    list-style: none;
    padding: 0;
    margin: 1em 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.iaNodes > li::before,
.iaTopics li::before {
    display: none; /* no list triangles */
}

.iaNode {
    padding: 0.8em;
    border: 1px solid var(--lightGrey);
    border-top: 4px solid var(--c, var(--ink));
}

.iaName {
    margin: 0 0 0.6em;
    font-size: var(--step--half);
    font-weight: 600;
}

.iaTopics {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
}

.iaThree {
    grid-template-columns: 1fr;
}

/* Text for screen readers only (hidden on screen) */
.visuallyHidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Palette comparison (Biobridge): columns of swatches with name and hex code */
.palettes {
    margin: 5vh 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5em var(--gridGap);
}

/* Phones: each scheme splits its groups over two columns */
.paletteCols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1em;
}

.paletteLabel {
    margin: 0 0 0.6em;
    font-size: var(--step--half);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.paletteGroup {
    margin: 1.2em 0 0.5em;
    font-size: var(--step--half);
    color: var(--darkGrey);
}

.paletteList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    font-size: var(--step--half);
}

.paletteList li {
    display: grid;
    grid-template-columns: 2.6em 1fr;
    column-gap: 0.8em;
    align-items: center;
}

.paletteList li::before,
.officeGrid li::before {
    display: none; /* no list triangles */
}

.swatchChip {
    grid-row: span 2;
    aspect-ratio: 1;
    background-color: var(--c);
    border: 1px solid var(--lightGrey);
}

.paletteList .swatchHex {
    color: var(--darkGrey);
}

.paletteList li:not(:has(.swatchName)) .swatchChip {
    grid-row: auto; /* hex only: one line */
}

/* Office theme grids: the theme colors on top, the five shades Office generates below */
.officeThemes {
    margin: 5vh 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5em;
}

.officeNote {
    margin: 0.8em 0 0;
    font-size: var(--step--half);
    color: var(--darkGrey);
}

.officeGrid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr)); /* minmax: squares may shrink, so ten always fit a phone */
    gap: 2px;
}

.officeGrid li {
    min-width: 0;
    aspect-ratio: 1;
    background-color: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); /* keeps white swatches visible */
}

.officeGrid .themeColor {
    margin-bottom: 6px; /* theme row a little apart from the shades, as in Office */
}

@media (min-width: 700px) {
    .palettes,
    .officeThemes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: var(--gridGap);
    }

    .officeThemes {
        align-items: start;
    }

    /* tablet and desktop: one column per scheme, groups back in their original order (--o) */
    .palette {
        display: flex;
        flex-direction: column;
    }

    .paletteCols,
    .paletteCols > div {
        display: contents;
    }

    .paletteSet {
        order: var(--o);
    }
}

/* Spreads: a print document shown as opened pages (Biobridge Perspective), one spread per row on the layout grid.
   Desktop: page left in columns 4-6, page right in 7-9; tablet: 3-4 and 5-6; phones: 1-2 and 3-4.
   An empty side (class is-empty) leaves the front or back cover on its own, as in a real booklet. */
.spreads {
    margin: 5vh 0;
    display: grid;
    grid-template-columns: repeat(var(--gridCols), 1fr);
    gap: var(--gridGap);
}

.spread {
    display: contents; /* the pages sit directly on the grid */
}

.spreadPage {
    display: block;
}

.spreadPage img {
    display: block;
    border: 1px solid var(--imageBorderLight); /* light grey in light mode, white in dark mode */
}

.spreadPage.left  { grid-column: 1 / 3; }
.spreadPage.right { grid-column: 3 / 5; }

@media (min-width: 700px) {
    .spreadPage.left  { grid-column: 3 / 5; }
    .spreadPage.right { grid-column: 5 / 7; }
}

@media (min-width: 1100px) {
    .spreadPage.left  { grid-column: 4 / 7; }
    .spreadPage.right { grid-column: 7 / 10; }
}

/* Color scheme swatches */
.swatches {
    list-style: none;
    padding: 0;
    margin: 5vh 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5em 10px;
    font-size: var(--step--half);
}

.swatches li::before {
    display: none;
}

.swatch {
    display: block;
    aspect-ratio: 3 / 4;
    margin-bottom: 0.5em;
    background-color: var(--c);
    border: 1px solid var(--lightGrey);
}

.swatchHex {
    display: block;
    color: var(--darkGrey);
}

/* Five colors in one row (Nordic Drum Store) */
.swatches.swatches5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Type specimen on a case page, in code (like the Segoe UI image on the Biobridge case): name, alphabet, weights.
   The typeface itself is set on the element (font-family in the page). */
.typeSpecimen {
    margin: 5vh 0;
}

.typeSpecimen p { margin: 0; }

.typeSpecimenName {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.typeSpecimenGlyphs {
    margin-top: 1.6em !important;
    font-size: var(--step-half);
    line-height: 1.5;
    letter-spacing: 0.08em;
}

.typeSpecimenCols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gridGap);
    max-width: 34em;
    margin-top: 2em;
}

.typeSpecimen ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--step-half);
    line-height: 1.55;
}

.typeSpecimen li::before { display: none; }   /* no list triangles */

/* The weights the shop uses: what for (grey), and the weight itself */
.typeSpecimenUse li {
    display: grid;
    line-height: 1.3;
    margin-bottom: 0.8em;
}

.typeSpecimenUse li span:first-child {
    font-size: var(--step--half);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--darkGrey);
}

@media (min-width: 700px) {
    .hexStats {
        grid-template-columns: repeat(3, 1fr);
    }

    .iaDiagram {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--gridGap); /* desktop: each view is 6 grid columns, each page in it 2 */
        align-items: start;
    }

    .iaDiagram::before {
        content: "";
        position: absolute;
        top: 1.1em;
        left: 25%;
        right: 25%;
        height: 1px;
        background-color: var(--ink);
    }

    .iaBranch {
        text-align: center;
    }

    .iaBranch + .iaBranch {
        margin-top: 0;
    }

    .iaRoot {
        position: relative; /* above the line */
    }

    .iaNodes {
        text-align: left;
        gap: var(--gridGap);
    }

    .iaSix,
    .iaThree {
        grid-template-columns: repeat(3, 1fr);
    }

    .swatches {
        grid-template-columns: repeat(8, 1fr);
    }
}


/* ---------- Slider (see includes/slider.php) ---------- */

/* Phones: every page in a 3-column grid */
.slider .slides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: var(--gridGap);
    margin: 5vh 0;
}

.slider .slideNumber,
.slider .prev,
.slider .next,
.slider .slideRow {
    display: none;
}

.slider .slide img {
    vertical-align: top; /* no gap under the images in the phone grid */
}

.slider {
    padding-bottom: var(--line); /* phones: one line below the grid */
}

/* Desktop: one page at a time, arrows and thumbnails */
@media (min-width: 700px) {
    .slider {
        position: relative;
        padding-bottom: 0;
        margin-top: calc(var(--line) + 1em); /* one line above the slider (1em = the text above it) */
    }

    .slider .slides {
        display: block;
        margin: 0;
    }

    .slider .slide {
        display: none;
    }

    .slider .slide.current {
        display: block;
    }

    .slider .slide img {
        margin: 0 10%;
        width: 80%;
        vertical-align: baseline;
    }

    .slider .slideNumber {
        display: block;
        font-size: var(--step--half);
        position: absolute;
        top: 0;
    }

    .slider .prev,
    .slider .next {
        display: block;
        position: absolute;
        top: 40%;
        margin-top: -50px;
        padding: 16px;
        border: 0;
        background: none;
        color: var(--ink);
        font-size: 20px;
        line-height: 1.2; /* same height as the old icon font */
        cursor: pointer;
        user-select: none;
    }

    .slider .next {
        right: 0;
    }

    .slider .prev:hover,
    .slider .next:hover {
        color: var(--grey);
    }

    .slider .slideRow {
        display: block;
        width: 81%;
        margin: 1vh 9.5% 0;
    }

    .slideRow::after {
        content: "";
        display: table;
        clear: both;
    }

    .slideColumn {
        float: left;
        width: 10%;
    }

    .slideColumn img {
        width: 92%;
        margin: 1% 4%;
        cursor: pointer;
        opacity: 0.75;
    }

    .slideColumn img.current,
    .slideColumn img:hover {
        opacity: 1;
    }
}


/* ---------- Contact ---------- */

.contactForm {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 3vh var(--gridGap);
    margin: 5vh 0;
}

.contactForm label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    text-transform: uppercase;
}

.contactForm input,
.contactForm textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 1em 1.2em;
    border: 1px solid var(--ink);
    border-radius: 10px;
    background-color: var(--paper);
    color: var(--ink);
    font: inherit;
}

.contactForm textarea {
    min-height: 12em;
    resize: vertical;
}

.contactForm input:focus,
.contactForm textarea:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--ink); /* the line gets twice as thick */
}

.contactForm [aria-invalid="true"] {
    border-color: var(--error);
}

.fieldError {
    margin: 0.4em 0 0;
    color: var(--error);
}

.formMessage {
    margin: 5vh 0;
    padding: 1em 1.2em;
    border: 1px solid var(--ink);
    border-radius: 10px;
}

.formError {
    margin: 0;
    border-color: var(--error);
    color: var(--error);
}

/* The spam trap field is kept out of sight (bots still see it) */
.contactForm .trap {
    position: absolute;
    left: -9999px;
}

@media (min-width: 700px) {
    .contactForm,
    .formMessage {
        width: calc(8 * var(--col) + 7 * var(--gridGap)); /* columns 1-8, like the text above */
    }

    .contactForm {
        grid-template-columns: 1fr 1fr; /* name and email side by side */
    }

    .contactForm .full {
        grid-column: 1 / -1;
    }
}


/* ---------- 404 page ---------- */

/* The message sits in the middle of the space between header and footer */
main:has(> .error) {
    display: flex;
    flex-direction: column;
    margin-top: 0 !important; /* centring gives the space, so it fits on low screens too */
}

.error + .divider {
    margin-top: 0;
}

.error {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    margin: 0 var(--gridMargin);
    text-align: center;
}

.error h1 {
    font-size: var(--step-2);
    text-transform: uppercase;
    margin: 0;
}

.error p {
    font-size: var(--step-half);
}

@media (min-width: 700px) {
    .error {
        margin: 0 calc(3 * var(--col) + 3 * var(--gridGap)); /* columns 4-9 */
    }

    .error h1 {
        font-size: var(--step-3);
    }

    .error p {
        font-size: var(--step-1);
    }

    .error p {
        margin-left: 8vw;
        margin-right: 8vw;
    }
}


/* ---------- Project tiles (home + Work) ---------- */

.projectGrid {
    display: grid; /* one column unless a cols-/d-cols- class says otherwise */
    grid-gap: 3vh;
    text-transform: uppercase;
}

.projectTile {
    text-decoration: none;
    color: var(--ink);
}

.projectBanner {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
    box-sizing: border-box;
    border: var(--imageBorder); /* dark mode: the frame sits on the tile, so the zoom on hover stays inside it */
}

.projectBanner img {
    vertical-align: top;
    max-width: 100%;
    border: none;
    transition: all 1s;
}

/* Title and "Type · years" under each tile: the space is always kept (so nothing jumps),
   the text fades in on hover. On touch screens, which have no hover, it is always shown. */
.projectCaption {
    padding-top: 0.8em;
    text-transform: none;
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.projectTitle {
    margin: 0;
    font-weight: 600;
}

.projectMeta {
    margin: 0.2em 0 0;
    color: var(--darkGrey);
    font-size: var(--step--half);
}

@media (hover: hover) {
    .projectCaption {
        opacity: 0;
        transform: translateY(-4px);
    }

    .projectTile:hover .projectCaption,
    .projectTile:focus-visible .projectCaption {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 700px) {
    .projectGrid {
        grid-gap: var(--gridGap);
    }

    .projectBanner:hover img {
        transform: scale(1.05);
    }
}


/* ---------- Previous / Next project (bottom of Work pages) ---------- */

.projectNav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5vw;
    margin: 10vh 0 0;
}

.projectNavLink {
    display: grid;
    gap: 0.5em;
    justify-self: start;
    color: var(--ink);
    text-decoration: none;
}

.projectNavLink.next {
    grid-column: 2; /* "Older" stays on the right, also when there is no "Newer" */
    justify-self: end;
    text-align: right;
}

.projectNavLabel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--darkGrey);
    font-size: 0.7rem; /* 11px on phones: label and title the same size (off the scale on purpose) */
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.projectNavLink.next .projectNavLabel {
    justify-content: flex-end;
}

.projectNavLabel .icon {
    width: 1.3em;
    height: 1.3em;
    margin: 0 -0.3em;
}

.projectNavTitle {
    font-size: var(--step--half); /* phones: 12.6px (label 11px) */
    font-weight: 600;
    letter-spacing: 0;
    transition: letter-spacing 0.6s var(--ease); /* same hover as the name in the header */
}

@media (hover: hover) {
    .projectNavLink:hover .projectNavTitle {
        letter-spacing: 0.08em;
    }
}

@media (min-width: 700px) {
    .projectNav {
        margin: 10vh var(--textInset) 0; /* columns 3-10, like the text */
    }

    .projectNavLabel {
        font-size: var(--step--half); /* desktop: label 12.6px */
    }

    .projectNavTitle {
        font-size: var(--step-0);     /* desktop: title 16px */
    }
}


/* ---------- Footer ---------- */

footer {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 8vh;
    margin: 0 5vw calc(3vh + 52px + 1.5em); /* bottom: the to-top button's height and position, plus a gap */
    text-transform: uppercase;
}

.footerTools {
    order: 1; /* phones: links, then the switches, then the copyright */
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gridToggle .icon,
.themeToggle .icon {
    margin: 0 -0.2em 0 -0.35em;
}

.gridToggle .icon-visibility_off,
.gridToggle[aria-pressed="true"] .icon-visibility {
    display: none;
}

.gridToggle[aria-pressed="true"] .icon-visibility_off {
    display: inline-block;
}

/* Dark mode switch: the moon in light mode, the sun in dark mode */
.themeToggle .icon-light_mode,
.themeToggle[aria-pressed="true"] .icon-dark_mode {
    display: none;
}

.themeToggle[aria-pressed="true"] .icon-light_mode {
    display: inline-block;
}

/* "Dark mode" / "Light mode": both words sit on top of each other and only one is shown,
   so the button is always as wide as the longer one and never changes size when pressed */
.toggleLabels {
    display: grid;
}

.toggleLabels > span {
    grid-area: 1 / 1;
}

.themeToggle .labelOn,
.themeToggle[aria-pressed="true"] .labelOff {
    visibility: hidden;
}

.themeToggle[aria-pressed="true"] .labelOn {
    visibility: visible;
}

.gridToggle[hidden],
.themeToggle[hidden] {
    display: none; /* only shown when JavaScript can make it work */
}

/* Bottom line: copyright on the left, Privacy on the right, both small.
   Privacy goes all the way to the right; the footer's bottom margin leaves room for the
   to-top button below it, so the two never overlap when the page is scrolled to the end. */
.footerBottom {
    order: 2;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1em;
    margin: 5vh 0 0;
    font-size: var(--step--half);
}

.copyright {
    margin: 0;
}

.privacyLink {
    color: var(--ink);
    text-decoration: none;
}

.formNote {
    margin: 0;
}

/* Three groups side by side: the menu's pages, the extra pages, and the Instagram/LinkedIn icons at the right edge */
.footerLinks {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas: "pages more social";
    align-items: start;
    column-gap: var(--gridGap);
}

.footerPages { grid-area: pages; }
.footerMore { grid-area: more; }
.footerSocial { grid-area: social; justify-self: end; margin-right: -11px; } /* the drawn edge of the last icon meets the margin */

/* Each icon sits in a box as tall as a line of links (line-height 2), so it is level with the first link,
   and wider than the icon, so it is easier to tap */
.footerSocial ul { display: flex; }

.footerLinks .socialLink {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 2em;
    transition: opacity 0.3s ease;
}

.footerLinks .socialLink::after { display: none; } /* no hover underline on the icons */

.socialIcon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.socialIcon .socialDot { fill: currentColor; stroke: none; }

@media (hover: hover) {
    .footerLinks .socialLink:hover { opacity: 0.6; }
}

.footerLinks ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footerLinks li {
    line-height: inherit;
}

.footerLinks a {
    text-decoration: none;
    color: var(--ink);
    line-height: 2;
}

@media (min-width: 700px) {
    footer {
        grid-template-columns: repeat(12, 1fr);
        column-gap: var(--gridGap);
        row-gap: 0;
        margin: 0 var(--gridMargin) calc(3vh + 52px + 1.5em); /* bottom: room for the to-top button below the last line */
    }

    .footerTools {
        grid-column: 1 / 9;
        grid-row: 1;
    }

    .footerBottom {
        grid-column: 1 / 13;
        grid-row: 2;
        display: grid;
        grid-template-columns: subgrid; /* same 12 columns as the footer */
        column-gap: var(--gridGap);
        margin: 15vh 0 0;
    }

    .copyright {
        grid-column: 1 / 9;
    }

    .privacyLink {
        grid-column: 9 / 13;
        justify-self: end;    /* all the way to the right margin */
    }

    .footerLinks {
        grid-column: 9 / 13;
        grid-row: 1 / 3;     /* reaches down beside the copyright line (Privacy sits below them) */
    }

}


/* ---------- Tablet (700–1099px) ----------
   The larger layout with 8 grid columns instead of 12. The text column sits one column in from
   each side; galleries with many columns get fewer, so the images stay a useful size. */

@media (min-width: 700px) and (max-width: 1099.98px) {
    :root {
        --gridCols: 8;
        --insetCols: 1;
    }

    .projectSection h1 {
        font-size: var(--step-1half);
    }

    .projectInformation {
        grid-template-columns: repeat(3, 1fr);
    }

    .intro p,
    .contactForm,
    .formMessage {
        width: calc(7 * var(--col) + 6 * var(--gridGap)); /* columns 1-7 */
    }

    .about {
        grid-template-columns: repeat(8, 1fr);
    }

    .aboutText {
        grid-column: 1 / 6; /* text: columns 1-5 */
    }

    .about > div:last-child {
        grid-column: 6 / 9; /* portrait: columns 6-8 */
    }

    .error {
        margin: 0 calc(var(--col) + var(--gridGap)); /* columns 2-7 */
    }

    footer {
        grid-template-columns: repeat(8, 1fr);
    }

    .footerTools,
    .copyright {
        grid-column: 1 / 5;
    }

    .footerTools { grid-column: 1 / 4; } /* the two switches sit one above the other here */

    .footerBottom {
        grid-column: 1 / 9;
    }

    .privacyLink {
        grid-column: 5 / 9;
    }

    .footerLinks {
        grid-column: 4 / 9; /* five columns, so "How I work" fits on one line */
    }

    .d-cols-5,
    .d-cols-6 { grid-template-columns: repeat(4, 1fr); }
    .d-cols-7 { grid-template-columns: repeat(3, 1fr); }
    .t-cols-3 { grid-template-columns: repeat(3, 1fr); } /* tablets only: overrides d-cols- (e.g. the Biobridge carousels) */

    .gridOverlay span:nth-child(n + 9) {
        display: none;
    }
}


/* Footer on desktop: the switches in columns 1-6; the menu's pages, the extra pages and the social icons side by
   side in columns 7-8, 9-10 and 11-12 */
@media (min-width: 1100px) {
    .footerTools { grid-column: 1 / 7; }

    .footerLinks {
        grid-column: 7 / 13;
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ---------- Scroll to top ----------
   Frosted glass (as on jonyablonski.com): see-through white with the page blurred behind it,
   a thin light edge and a soft shadow instead of a black border. Fades in once you scroll.
*/

.toTop {
    position: fixed;
    bottom: 3vh;
    right: 3vw;
    z-index: 98;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--glassEdge);
    border-radius: 50%;
    background-color: var(--glassFill);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px var(--shadowStrong), inset 0 1px 0 var(--glassShine);
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease),
                color 0.6s var(--ease), background-color 0.6s var(--ease),
                border-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.toTop.visible {
    opacity: 1;
    visibility: visible;
}

.toTop .icon {
    margin: 0;
}

@media (min-width: 700px) {
    .toTop {
        right: 2vw;
    }

    .toTop:hover {
        color: var(--paper);
        background-color: var(--ink);
        border-color: transparent; /* no glass edge on the filled button */
        box-shadow: 0 2px 12px var(--shadowStrong); /* shadow stays, top highlight goes */
    }
}


/* ---------- Layout grid overlay (the "Grid mode" switch in the footer, see main.js) ----------
   Each column is drawn as a pair of thin lines, as on jonyablonski.com, fitted to our margins.
*/

.gridOverlay {
    position: fixed;
    inset: 0;
    z-index: 40; /* over the page, but behind the header (z-index 50) */
    display: grid;
    grid-template-columns: repeat(var(--gridCols), 1fr);
    column-gap: var(--gridGap);
    padding: 0 var(--gridMargin);
    pointer-events: none; /* clicks go straight through to the page */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.gridOverlay span {
    border-left: 1px solid var(--grey);
    border-right: 1px solid var(--grey);
}

.gridOverlay span:nth-child(n + 5) {
    display: none; /* phones: 4 columns */
}

html.gridOn .gridOverlay {
    opacity: 0.5; /* the grey, half see-through */
    visibility: visible;
}

@media (min-width: 700px) {
    .gridOverlay span:nth-child(n + 5) {
        display: block;
    }
}


/* ---------- Playground (playground.php, behaviour in main.js) ---------- */
/* A bento grid on the layout grid: one tile per row on phones, a mix of sizes on tablet and desktop.
   Tiles play by themselves while on screen (on a timer); with "reduce motion" they show their finished state. */

.playground {
    display: grid;
    grid-template-columns: repeat(var(--gridCols), 1fr);
    grid-template-areas:
        "type type type type"
        "theme theme theme theme"
        "draw draw draw draw"
        "mtv mtv mtv mtv"
        "journey journey journey journey"
        "sketch sketch sketch sketch"
        "logo logo logo logo"
        "pal pal pal pal"
        "six six six six"
        "micro micro micro micro";
    gap: var(--gridGap);
    margin: 5vh 0;
}

.pgType     { grid-area: type; }
.pgTheme    { grid-area: theme; }
.pgDraw     { grid-area: draw; }
.pgMtv      { grid-area: mtv; }
.pgSketch   { grid-area: sketch; }
.pgLogo     { grid-area: logo; }
.pgPal      { grid-area: pal; }
.pgMicro    { grid-area: micro; }
.pgSix      { grid-area: six; }
.pgJourney  { grid-area: journey; }
.pgTile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.2em;
    min-width: 0;
    padding: clamp(16px, 2vw, 28px);
    background-color: var(--tile);
}

.pgTitle {
    margin: 0;
    font-size: var(--step-half);
    font-weight: 600;
    line-height: 1.25;
}

.pgLabel {
    margin: 0;
    font-size: var(--step--half);
    color: var(--darkGrey);
}

.pgCase {
    color: var(--ink);
    white-space: nowrap;
}

.pgHint {
    display: none;
}

@media (hover: hover) {
    .pgHint {
        display: inline;
    }
}

/* Typewriter: types, waits, deletes, types again (main.js) */
.pgType {
    justify-content: center;
    min-height: 9em;
}

.pgTypewriter {
    margin: 0;
    font-size: var(--step-1half);
    font-weight: 600;
    line-height: 1.2;
}

.pgCaret {
    display: inline-block;
    width: 0.08em;
    height: 1em;
    margin-left: 0.06em;
    vertical-align: -0.1em;
    background-color: var(--ink);
    animation: pgBlink 1s steps(1) infinite;
}

@keyframes pgBlink {
    50% { opacity: 0; }
}

/* Dark mode switch: sun and moon at each end; the knob springs across, stretching on the way,
   and the icons turn a little as it lands */
.pgTheme {
    align-items: center;
    justify-content: center;
}

.pgSwitch {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.pgSwitchTrack {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 132px;
    height: 64px;
    padding: 0 18px;
    box-sizing: border-box;
    border: 1px solid var(--ink);
    border-radius: 32px;
}

.pgSwitch.themeToggle .pgSwitchTrack .icon {
    display: block;
    width: 26px;
    height: 26px;
    margin: 0;
    fill: currentColor;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pgSwitch[aria-pressed="true"] .icon-light_mode { transform: rotate(90deg) scale(0.85); }
.pgSwitch[aria-pressed="true"] .icon-dark_mode  { transform: rotate(-20deg) scale(1.1); }

.pgSwitchKnob {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--ink);
    mix-blend-mode: difference; /* the icon under the knob turns light, so it stays visible */
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pgSwitch[aria-pressed="true"] .pgSwitchKnob {
    transform: translateX(68px);
}

.pgSwitch.is-moving .pgSwitchKnob {
    animation: pgStretch 0.6s ease;
}

@keyframes pgStretch {
    35% { width: 66px; }
}

.pgSwitch[aria-pressed="true"].is-moving .pgSwitchKnob {
    animation-name: pgStretchBack; /* grows towards the left, so it stays inside the track */
}

@keyframes pgStretchBack {
    35% { width: 66px; margin-left: -16px; }
}

.pgSwitch:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
    border-radius: 36px;
}

/* One-line illustration that draws itself (pathLength="1" on the line, see playground.php).
   is-drawn draws it; is-fading takes it away again before the next round (main.js). */
.pgDrawing svg {
    display: block;
    width: 100%;
    height: auto;
}

.drawLine {
    fill: none;
    stroke: var(--ink);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.drawBlob {
    opacity: 0; /* its color comes from the SVG file itself */
    transform: scale(0.6);
    transform-box: fill-box;
    transform-origin: center;
}

.pgDraw.is-drawn .drawLine {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 3.2s cubic-bezier(0.45, 0, 0.35, 1);
}

.pgDraw.is-drawn .drawBlob {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.8s ease 2.6s, transform 1s var(--ease) 2.6s;
}

.pgDrawing {
    transition: opacity 0.8s ease;
}

.pgDraw.is-fading .pgDrawing {
    opacity: 0;
}

/* Wireframe/mockup slider: the "after" image is cut off at --pos; an invisible range input does the dragging,
   so it also works with the keyboard and screen readers */
.pgCompareFrame {
    position: relative;
    aspect-ratio: 1600 / 3488; /* the wireframe's and mockup's own proportions: the whole page, nothing cut */
    overflow: hidden;
}

.pgCompareFrame img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border: 0;
}

.pgAfter {
    clip-path: inset(0 0 0 var(--pos));
}

.pgHandle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 2px;
    margin-left: -1px;
    background-color: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.pgHandle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.pgCompareTag {
    padding: 0.3em 0.7em;
    font-size: var(--step--half);
    background-color: rgba(255, 255, 255, 0.9);
    color: #202020;
}

.pgCompareTag {
    position: absolute;
    top: 12px;
    pointer-events: none;
}

.pgBefore   { left: 12px; }
.pgAfterTag { right: 12px; }

.pgRange {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

.pgCompareFrame:has(.pgRange:focus-visible) {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* Logo evolution (Biobridge Partners): one SVG with the three versions aligned on the letters
   (img/playground/logo-evolution.svg). data-step 0/1/2 = original, revision 1, revision 2 (main.js).
   The arch you see (lgArchMorph) changes shape between the three versions' arches (main.js), so there is
   only ever one arch; "Partners" glides and scales (--p2 is worked out in main.js). */
.pgLogoArt,
.pgSketchArt {
    margin-top: auto; /* at the bottom of the tile, so a caption of another length can't move it */
    padding: 3% 5%;
    background-color: #fff; /* the logo and the drawing were made for white */
}

.pgLogoNote,
.pgSketchNote {
    min-height: 2lh; /* room for the longest caption, so the tile never changes height */
}

/* A row under the logo and the sketch: the steps (or the step caption) and "See the … case" side by side */
.pgBar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 16px;
}

.pgBar .pgSketchNote { flex: 1 1 14em; }

.pgBar .pgCase { font-size: var(--step--half); }

.pgLogoArt svg,
.pgSketchArt svg {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.4s ease;
}

.pgLogoArt.is-fading svg,
.pgSketchArt.is-fading svg { opacity: 0; }

.lgLetters path { fill: #1d3543; }
.lgPartners path,
.lgArchMorph { fill: #c5c5c5; }

.lgSrc {                            /* the three arches, only read by main.js */
    fill: none;
    visibility: hidden;
}

.lgPartners2 { visibility: hidden; } /* only measured (main.js): "Partners" from revision 1 glides into its size and place */

.lgPartners1 {
    transform: translate(4.93px, 0); /* the original's "Partners", slightly to the right */
    transition: transform 1.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.pgLogoArt[data-step="1"] .lgPartners1 { transform: none; }
.pgLogoArt[data-step="2"] .lgPartners1 { transform: var(--p2, none); }

.lgGuide {
    fill: none;
    stroke: #db1924;
    stroke-width: 1.5;
    stroke-dasharray: 0.004 0.004;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.pgLogoArt[data-step="1"] .lgGuide { opacity: 0.8; }

.lgDot {
    fill: #1d3543;
    cx: var(--x);
    cy: var(--y);
    r: 8.412px;
    transition: r 1.2s cubic-bezier(0.65, 0, 0.35, 1), cx 1.2s cubic-bezier(0.65, 0, 0.35, 1), cy 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}

.pgLogoArt[data-step="2"] .lgDot { cx: var(--x2); cy: var(--y2); r: 6.912px; }

/* Sketch process (BASE): the rough sketch draws itself, then every corner glides into the refined curve
   (main.js redraws spMorph between the two invisible source lines), then the line turns black and the
   color shape grows in (img/playground/sketch-process.svg) */
.spSrc {
    fill: none;
    stroke: none; /* only read by main.js */
}

.spMorph {
    fill: none;
    stroke: #e0483e;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    opacity: 0.55;
}

.spBlob {
    fill: #a96161;
    opacity: 0;
    transform: scale(0.6);
    transform-box: fill-box;
    transform-origin: center;
}

.pgSketchArt:not([data-step="0"]) .spMorph { stroke-dashoffset: 0; }
.pgSketchArt[data-step="1"] .spMorph { transition: stroke-dashoffset 2.6s linear, opacity 1s ease, stroke 1s ease; }
.pgSketchArt[data-step="3"] .spMorph { stroke: #000; opacity: 1; transition: opacity 1s ease, stroke 1s ease; }
.pgSketchArt[data-step="3"] .spBlob { opacity: 1; transform: scale(1); transition: opacity 0.9s ease 0.4s, transform 1.2s var(--ease) 0.4s; }

/* Six Aspects hexagon: a mini version of the Six Aspects MVP's front page (playground.php, main.js).
   The outline draws itself and the dots pop in once the tile is on screen (.is-drawn); pointing at a dot
   (or tapping it) shows the aspect's name and count in the middle. */
.sxWrap {
    position: relative;
    width: min(100%, 400px);
    margin: auto;
}

.sxHex {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
}

.sxLine {
    fill: none;
    stroke: var(--ink);
    stroke-width: 6;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.sxNode {
    cursor: pointer;
    outline: none;
}

.sxHit { fill: transparent; }

.sxDot {
    fill: var(--c);
    transform: scale(0);
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.6s var(--ease);
}

.sxWrap.is-drawn .sxLine {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.1s var(--ease) 0.1s;
}

.sxWrap.is-drawn .sxDot {
    transform: scale(1);
    transition: transform 0.5s var(--ease) calc(0.35s + var(--i) * 0.11s);
}

.sxWrap.is-drawn .sxNode:hover .sxDot,
.sxWrap.is-drawn .sxNode.is-on .sxDot,
.sxWrap.is-drawn .sxNode:focus-visible .sxDot {
    transform: scale(1.1);
    transition-delay: 0s;
}

.sxNode:focus-visible .sxHit {
    stroke: var(--ink);
    stroke-width: 3;
    stroke-dasharray: 6 6;
}

.sxCenter {
    position: absolute;
    inset: 28% 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.sxCenter > span { transition: opacity 0.6s var(--ease); }
.sxCenter.is-fading > span { opacity: 0; transition-duration: 0.15s; }

.sxName {
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sxCount {
    margin-top: 0.6em;
    font-size: var(--step--half);
    color: var(--darkGrey);
}

.sxHint {
    font-size: var(--step--half);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--darkGrey);
}

.sxName:empty,
.sxCount:empty,
.sxHint[hidden] { display: none; }

/* Journey map (My True Value V4): six chapters top to bottom on the V4 map (playground.php, main.js).
   Locked chapters are grey with a lock, the current one is the icon on a white circle, completed ones show
   their scene with a white ring. The dashes up to the current chapter are white, the rest faded. */
.jmMap {
    position: relative;
    width: min(100%, 560px);  /* its content is all positioned, so it needs a width of its own */
    aspect-ratio: 690 / 960;
    margin: 0 auto;
    background: url("../../img/playground/journey-background.webp") center / cover;
    border-radius: 10px;
}

.jmPath {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.jmStep {
    stroke: #fff;
    stroke-width: 6px;
    stroke-linecap: round;
    stroke-dasharray: 1px 12px;
    vector-effect: non-scaling-stroke; /* round dots of the same size, however the map is stretched */
    opacity: 0.4;
    transition: opacity 0.8s ease;
}

.jmStep.is-reached { opacity: 1; }

.jmStop {
    position: absolute;
    width: 21%;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    transform: translate(-50%, -50%);
    cursor: default;
}

.jmStop.is-current { cursor: pointer; }

.jmStop > img,
.jmCurrent {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jmCurrent {
    display: grid;
    place-items: center;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.jmCurrent img { width: 100%; }

.jmDone {
    box-shadow: 0 0 0 5px #fff, 0 2px 10px rgba(0, 0, 0, 0.18);
    transform: scale(0.7);
}

.jmStop.is-locked .jmLocked,
.jmStop.is-current .jmCurrent,
.jmStop.is-done .jmDone { opacity: 1; transform: none; }

.jmStop.is-current .jmCurrent { animation: jmPulse 2.4s ease-in-out infinite; }

@keyframes jmPulse {
    50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.45), 0 2px 10px rgba(0, 0, 0, 0.18); }
}

.jmStop:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.jmReset {
    margin-right: 0.6em;
    padding: 6px 14px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: none;
}

.jmReset[hidden] { display: none; }

/* Tablet: 8 columns */
@media (min-width: 700px) {
    .playground {
        grid-template-areas:
            "type type type type type theme theme theme"
            "mtv mtv mtv mtv draw draw draw draw"
            "mtv mtv mtv mtv sketch sketch sketch sketch"
            "journey journey journey journey logo logo logo logo"
            "journey journey journey journey pal pal pal pal"
            "six six six six micro micro micro micro";
    }
}

/* Desktop: 12 columns. The website slider shows the whole page, so it is a tall four-column strip (two rows);
   the globe and the sketch sit beside it, and the journey map is as tall as both */
@media (min-width: 1100px) {
    .playground {
        grid-template-areas:
            "type type type type type type type type type theme theme theme"
            "mtv mtv mtv mtv draw draw draw draw journey journey journey journey"
            "mtv mtv mtv mtv sketch sketch sketch sketch journey journey journey journey"
            "logo logo logo logo logo logo pal pal pal pal pal pal"
            "six six six six six six micro micro micro micro micro micro";
    }

    .pgType {
        min-height: 12em;
    }

    /* The journey map fills its tall tile (two rows): the background covers it, the path stretches with it */
    .pgJourney .jmMap {
        flex: 1;
        width: 100%;
        min-height: 300px;
        aspect-ratio: auto;
    }

    .pgJourney .jmStop {
        width: 24%;   /* a little bigger in the narrow column; the outer columns still keep them inside */
    }

    .pgTypewriter {
        font-size: var(--step-2);
    }
}

/* Reduce motion: everything shows its finished state, nothing moves by itself */
@media (prefers-reduced-motion: reduce) {
    .pgCaret { animation: none; }
    .drawLine { stroke-dashoffset: 0; }
    .drawBlob { opacity: 1; transform: none; }
    .pgDraw.is-drawn .drawLine,
    .pgDraw.is-drawn .drawBlob,
    .pgDrawing,
    .pgSwitchKnob,
    .pgSwitch.themeToggle .pgSwitchTrack .icon { transition: none; }
    .pgSwitch.is-moving .pgSwitchKnob { animation: none; }
    .lgPartners1, .lgGuide, .lgDot, .spMorph, .spBlob, .pgLogoArt svg, .pgSketchArt svg, .sxLine, .sxDot, .jmStep, .jmStop > img, .jmCurrent { transition: none !important; }
    .jmStop.is-current .jmCurrent { animation: none; }
    .sxLine { stroke-dashoffset: 0; }
    .sxDot { transform: none; }
}


/* ---------- Process page (process.php) ----------
   One scrolling page. The phase menu sticks below the header (main.js sets --headerOffset while the header shows)
   and fills the phase you are reading. Phones: the pills scroll sideways. */
.prIntro h1 {
    margin: 0 0 0.4em;
    font-size: var(--step-2);
    font-weight: 600;
}

.prIntro p {
    max-width: 34em;
    margin: 0;
    font-size: var(--step-half);
    line-height: 1.5;
}

.prMenu {
    position: sticky;
    top: var(--headerOffset, 0px);
    z-index: 40;
    margin: 8vh 0 0;
    padding: 14px 0;
    background-color: var(--paper);
    transition: top 0.3s ease;
}

.prMenu ol {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.prMenu li {
    position: relative;
    flex: 1 1 0;
}

.prPill {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--ink);
    border-radius: 50px;
    background-color: var(--paper);
    color: var(--ink);
    font-size: var(--step--half);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.prPill.is-on,
.prPill:hover {
    background-color: var(--ink);
    color: var(--paper);
}

/* One phase: what and why beside the examples (desktop), one after the other (tablet and phone) */
.prPhase {
    display: grid;
    gap: 4vh var(--gridGap);
    padding: 10vh 0;
    border-bottom: 1px solid var(--lightGrey);
    scroll-margin-top: calc(var(--headerOffset, 0px) + 100px);
}

.prPhase:last-of-type { border-bottom: 0; }

.prPhase h2 {
    margin: 0.1em 0 0.4em;
    font-size: var(--step-2);
    font-weight: 600;
}

.prLead {
    font-size: var(--step-half);
    font-weight: 500;
    line-height: 1.4;
}

.prPhase h3 {
    margin: 1.6em 0 0.8em;
    font-size: var(--step--half);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prWork h3 { margin-top: 0; }

/* "How": the skill chips from the About page (.skillDisplay, .skill) */
.prMethods { margin: 0; }

.prExamples {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.prExample {
    display: grid;
    grid-template-columns: 112px 1fr;
    grid-template-rows: auto 1fr;
    gap: 2px 16px;
    align-items: start;
    color: var(--ink);
    text-decoration: none;
}

/* The image zooms in its frame on hover, like the project tiles; the name gets the site's underline that grows from
   left to right (as in the menu and footer) */
.prExImage {
    grid-row: span 2;
    overflow: hidden;
}

.prExImage img {
    display: block;
    transition: transform 1s;
}

.prExProject {
    position: relative;
    justify-self: start;          /* only as wide as the name, so the underline matches it */
    font-size: var(--step--half);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prExProject::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35em;
    width: 100%;
    max-width: 0;
    height: 1px;
    background-color: currentColor;
    transition: max-width 0.4s var(--ease);
}

.prExDid { line-height: 1.45; }

@media (hover: hover) {
    .prExample:hover .prExImage img { transform: scale(1.05); }
    .prExample:hover .prExProject::after { max-width: 100%; }
}

@media (min-width: 1100px) {
    .prPhase { grid-template-columns: repeat(12, 1fr); }
    .prText { grid-column: 1 / span 5; }
    .prWork { grid-column: 7 / -1; padding-top: 2.2em; }
    .prExample { grid-template-columns: 160px 1fr; }
}

/* Phones: five pills don't fit side by side, so the row scrolls sideways (main.js keeps the active one in view) */
@media (max-width: 699.98px) {
    .prMenu { margin-right: -5vw; padding: 12px 0; }
    .prMenu ol { overflow-x: auto; scrollbar-width: none; padding-right: 5vw; }
    .prMenu ol::-webkit-scrollbar { display: none; }
    .prMenu li { flex: 0 0 auto; }
    .prPill { height: 40px; }
    .prPhase { padding: 7vh 0; scroll-margin-top: calc(var(--headerOffset, 0px) + 72px); }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.prMenu) { scroll-behavior: smooth; }
}

/* ---------- Refinement (5 Nov 2026) ----------
   "Luxury brand meets Daniell Skourup": the same minimal greyscale site with the projects in focus, made less flat and
   more high-end through type, tone and spacing alone. Montserrat stays; the work is in weights, sizes and spacing:
   - large type lighter (500) with tighter lines; small labels in spaced capitals;
   - a second tone: supporting text and labels in grey, reading text a touch softer than headings;
   - smaller capitals in the header and footer menus (the same style in both), reading text 15px;
   - tighter spacing between header, hero and sections;
   - quieter buttons; "Back" as a text link.
   These rules come last in the file on purpose: they refine the rules above. Light and dark mode both work. */

:root {
    --refSoft: color-mix(in srgb, var(--ink) 80%, var(--paper));   /* body text: a step below the headings */
    --refGrey: var(--darkGrey);                                     /* labels, meta, supporting text */
}

/* ---------- Header and footer: smaller capitals, more air between the letters ---------- */
.topName {
    font-size: 0.86rem;
    letter-spacing: 0.1em;
}

@media (hover: hover) {
    .topName:hover { letter-spacing: 0.22em; }   /* the name still spreads on hover, from its wider start */
}

/* The menu and the footer links: the same small capitals (0.8rem, regular weight, .06em) */
@media (min-width: 700px) {
    .menu {
        font-size: 0.8rem;
        font-weight: 400;
        letter-spacing: 0.06em;
    }
}

@media (max-width: 699.98px) {
    .menu { letter-spacing: 0.06em; }   /* phones: the full-screen menu keeps its size */
}

.footerLinks a {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 2.5;
}

.socialIcon { stroke-width: 1.2; }   /* thinner lines on the Instagram and LinkedIn icons */

.footerBottom { color: var(--refGrey); letter-spacing: 0.08em; }
.privacyLink { color: var(--refGrey); }

/* ---------- Spacing: tighter, to match the smaller type (about a third less) ---------- */
.divider { margin: 7vh 0; }

@media (min-width: 700px) {
    main { margin-top: 12vh; }                                 /* nav to the first line of the page */
    main > .intro:first-child + .divider { margin-top: 7vh; } /* home: hero button to the line */
    .about + .divider { margin-top: 7vh; }                    /* About: intro to the line */
}

/* ---------- Reading text: 15px instead of 16px (headings and labels have their own sizes) ---------- */
body { font-size: 0.9375rem; }

/* ---------- Large type: lighter and tighter ---------- */
.designLine {
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -0.015em;
}

.about p {
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.intro p {          /* e.g. the contact page's opening line */
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.projectSection h1 {
    font-weight: 500;
    letter-spacing: 0.05em;
}

.aboutMe h2,
.cv h2,
.legal h1 {
    font-weight: 500;
    letter-spacing: 0.06em;
}

/* ---------- Labels: small spaced capitals in grey ---------- */
.featuredHeader {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--refGrey);
}

.projectInformation .boldText {
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--refGrey);
}

.projectInformation p:not(.boldText),
.projectInformation a { font-size: 0.95rem; }

/* every value sits the same small distance under its label (the link isn't wrapped like the others) */
.projectInformation p:not(.boldText) { margin-top: 0; }
.projectInformation a { display: inline-block; }

.years { letter-spacing: 0.06em; }

/* ---------- Text: headings in full ink, reading text a touch softer ---------- */
.textSection p,
.textSection li,
.timelinePoints li,
.legal p {
    color: var(--refSoft);
}

.textSection p strong { color: var(--ink); }

.projectTitle { font-weight: 500; letter-spacing: 0.01em; }

.timelineRole { font-weight: 500; }
.timelineOrg { color: var(--refGrey); }

/* ---------- About: skill groups as quiet labels, lighter chips, softer timeline details ---------- */
.skillGroup {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--refGrey);
}

.skill {
    padding: 0.35em 0.85em;
    border-color: color-mix(in srgb, var(--ink) 30%, var(--paper));
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.timelineNote,
.timelinePoints li::marker { color: var(--refGrey); }

/* Experience and education: sizes in step with the rest */
.aboutMe h2,
.cv h2 { font-size: 2rem; }
.cvHeader { font-size: 2rem; }
.timelineRole { font-size: 1.125rem; }

.years,
.timelineNote { font-size: 0.8rem; letter-spacing: 0.06em; }

.showMore,
.showMoreLabel {                       /* exactly like the menu items */
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
}

/* ---------- Contact: labels as small spaced capitals, lighter field lines that darken on focus ---------- */
.contactForm label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--refGrey);
}

.contactForm input,
.contactForm textarea {
    border-color: color-mix(in srgb, var(--ink) 30%, var(--paper));
    transition: border-color 0.4s var(--ease);
}

.contactForm input:focus,
.contactForm textarea:focus {
    border-color: var(--ink);
    box-shadow: none;
}

.formNote { color: var(--refGrey); font-size: 0.85rem; }

/* ---------- How I work: headings lighter, small headings as quiet labels ---------- */
.prIntro h1,
.prPhase h2 { font-weight: 500; letter-spacing: -0.01em; }

.prPhase h3 {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--refGrey);
}

.prPill { font-weight: 500; letter-spacing: 0.14em; }

/* ---------- Buttons: quieter pills; "Back" becomes a text link ---------- */
.button {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
}

@media (min-width: 700px) {
    .button { height: 48px; padding: 0 30px; }
}

.backButton {
    height: auto;
    padding: 0 0 4px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: none;
    transition: border-color 0.4s var(--ease);
}

.backButton:hover {
    color: var(--ink);
    background: none;
    border-bottom-color: var(--ink);
}
