/* ignatius-visser.com */

/* The page is dark grey (#3f464a) in light and dark mode, so --text/--muted/--accent below
   are light page-level colours for both modes (all 4.5:1 or better on the grey); the
   surfaces further down (cards, tables, charts) set their own per mode. */
:root {
    --bg: #3f464a;
    --text: #e7ecf2;
    --muted: #b4bec9;
    --accent: #5fd0d8;
    --accent-strong: #7fd8de;
    /* Lines and timeline nodes drawn straight on the grey (header and footer borders, the timeline
       line): the same in both modes, like the grey. --border/--surface change per mode and are for the
       surfaces only; in dark mode --border is 1.3:1 on the grey and the timeline line vanished. */
    --page-line: #dde2e9;   /* 7.4:1 on the grey */
    --page-node: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --border: #dde2e9;
    --accent-soft: #e2f2f3;
    --shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 4px 16px rgb(16 24 40 / 0.06);
    --radius: 14px;
    --max: 1080px;
    /* How far chart panels reach past the content's right edge into the window margin (0 on narrower
       windows). The CV References row reaches as far, to line up with the panels. */
    --chart-overhang: min(7rem, max(0px, (100vw / var(--page-zoom, 1) - var(--max)) / 2 - 2rem));
    --label-size: 1.15rem; /* header tabs and hero tagline share this size */
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #161d25;
        --surface-2: #1e2731;
        --border: #2a3542;
        --accent-soft: #15353a;
        --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
    }
}

/* Surfaces: their own text and accent colours, matched to the surface colour of each mode. */
.card, .skill-group, .stat, .role-duties, .chart-card, .table-wrap, .section-button, button.chip {
    --text: #18202b;
    --muted: #5b6676;
    --accent: #0f6e78;
    --accent-strong: #0a545c;
    color: var(--text);
}

@media (prefers-color-scheme: dark) {
    .card, .skill-group, .stat, .role-duties, .chart-card, .table-wrap, .section-button, button.chip {
        --text: #e7ecf2;
        --muted: #9aa6b4;
        --accent: #4cc3cc;
        --accent-strong: #7fd8de;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh / var(--page-zoom, 1)); /* the full window, whatever the page scale */
}

/* Honeycomb behind the page, drawn by the honeycomb script below and fixed to the window. */
.honeycomb {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

main { flex: 1; padding-bottom: 4rem; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header & tabs ------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--page-line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center; /* tabs only; the Home tab replaces the brand link */
    gap: 1rem;
    min-height: 64px;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); font-weight: 650; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: var(--label-size);
    font-weight: 550;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.tab:hover { background: rgb(255 255 255 / 0.08); color: var(--text); }
.tab.is-active { background: rgb(255 255 255 / 0.14); color: var(--text); }

@media (max-width: 720px) {
    .header-inner { padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .tabs { max-width: 100%; } /* scrolls sideways instead of overflowing on narrow phones */
    :root { --label-size: 1rem; }
    .tab { padding: 0.45rem 0.8rem; }
}

/* Hero (landing) ------------------------------------------------------ */

/* Centred column: portrait window, then headline and tagline beneath it.
   One spacing value (--hero-gap) above the portrait and between every item. */
.hero { --hero-gap: 2rem; padding: var(--hero-gap) 0; }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: var(--hero-gap); text-align: center; }
.hero-text { display: flex; flex-direction: column; gap: var(--hero-gap); }
.hero-text h1, .hero-text .eyebrow { margin: 0; }
.hero-text .eyebrow { font-size: var(--label-size); }

@media (max-width: 720px) {
    .hero { --hero-gap: 1.5rem; }
}

.eyebrow { color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin: 0 0 0.75rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.lead p:first-child { margin-top: 0; }

/* Section buttons (landing) ------------------------------------------- */

.section-title { font-size: 1.35rem; margin: 2.5rem 0 1rem; }

.section-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

.section-button {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.4rem 1.4rem 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, border-color 0.15s;
}
.section-button:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.section-button-title { font-weight: 650; font-size: 1.15rem; }
.section-button-summary { color: var(--muted); font-size: 0.95rem; padding-right: 1.5rem; }
.section-button-arrow { position: absolute; right: 1.2rem; top: 1.25rem; color: var(--accent); font-size: 1.2rem; transition: transform 0.15s; }
.section-button:hover .section-button-arrow { transform: translateX(3px); }

/* Inner pages ----------------------------------------------------------- */

.page-header { padding: 3.5rem 1.25rem 1rem; }

.button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    font-weight: 600;
}
.button:hover { background: var(--accent-strong); color: var(--bg); }

.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }

.prose { max-width: 46rem; }
.prose-wide { max-width: var(--max); }

.figure { margin: 2rem 0; }
.figure img { border-radius: var(--radius); }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

blockquote { margin: 2rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--accent); color: var(--muted); font-size: 1.15rem; }

/* CV timeline --------------------------------------------------------- */

.cv-section { margin-top: 1rem; }

/* The line runs from the first node's centre to the last node's centre. Browsers without anchor
   positioning get it as a full-height border instead. */
.timeline { --node: 16px; position: relative; list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--page-line); }

@supports (anchor-name: --a) {
    .timeline { border-left: 0; anchor-scope: --timeline-first, --timeline-last; }
    .timeline-item:first-child .timeline-head { anchor-name: --timeline-first; }
    .timeline-item:last-child .timeline-head { anchor-name: --timeline-last; }
    .timeline::after {
        content: "";
        position: absolute;
        left: 0;
        width: 2px;
        top: anchor(--timeline-first center);
        bottom: anchor(--timeline-last center);
        background: var(--page-line);
    }
}

.timeline-item { padding: 0 0 0.75rem 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }

/* Node: on the head itself, so it stays centred on the bar whatever the bar's height. Its centre sits
   on the line (1px in from the list's edge): the head starts 1.5rem + 1px border to the right. */
.timeline-head { position: relative; }
.timeline-head::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: calc(-1.5rem - var(--node) / 2);
    top: 50%;
    width: var(--node);
    height: var(--node);
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--page-node);
    border: 2px solid var(--accent);
}

/* Each node is a box: date, title and organisation always show; where there is a description the
   box is a <details> dropdown that expands to show it. The box is darker than the page grey, so the
   page text colours only gain contrast on it. */
.timeline-entry {
    background: rgb(0 0 0 / 0.14);
    border: 1px solid rgb(255 255 255 / 0.07);
    border-radius: var(--radius);
    transition: background 0.15s, border-color 0.15s;
}
.timeline-head {
    display: grid;
    grid-template-columns: 9rem 1fr auto;
    gap: 1.5rem;
    align-items: start;
    padding: 0.9rem 1.1rem;
}
details.timeline-entry { margin: 0; }
/* Undo the site's general summary style (accent colour, small bold text, margin when open). */
summary.timeline-head, details[open] > summary.timeline-head {
    cursor: pointer;
    list-style: none;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: inherit;
    font-size: inherit;
    margin: 0;
}
summary.timeline-head::-webkit-details-marker { display: none; }
summary.timeline-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.timeline-entry:hover, details.timeline-entry[open] { background: rgb(0 0 0 / 0.2); border-color: rgb(255 255 255 / 0.12); }

/* Chevron: points down when closed, up when open. */
summary.timeline-head::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    margin: 0.4rem 0.2rem 0 0;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    transition: transform 0.2s;
}
details[open] > summary.timeline-head::after { transform: translateY(0.25rem) rotate(-135deg); }

.timeline-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; color: var(--muted); font-size: 0.9rem; padding-top: 0.15rem; }

/* Qualifications: date and type share one chip in the type's colours, the width of the date column,
   with date and type on one left edge. */
.timeline-meta .badge {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}
.badge-date { font-size: 0.9rem; font-weight: 600; text-transform: none; letter-spacing: 0; }

/* Charts beside content (CV Experience and Skills, Qualifications): content on the left, a chart in a
   panel on the right, level with the top of the content. The panel starts in the 15rem column and grows
   into the window's right margin when there is room (up to 22rem), so the chart gets larger without
   narrowing the content. Below 900px the panel sits above the content. The chart script fills each
   panel from the page (data-summary says what it counts); a panel stays hidden until then. */
.chart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.5rem; align-items: start; }
.chart-layout > :not(.chart-panel) { grid-column: 1; grid-row: 1; margin-top: 0; }
/* The panel stretches to the height of the content beside it, so its top and bottom line up with
   the first and last timeline box or skill card (user's request); the chart stays at its top. */
.chart-panel {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    width: calc(15rem + var(--chart-overhang));
    padding: 1.1rem;
    background: rgb(0 0 0 / 0.14); /* same box as the timeline entries */
    border: 1px solid rgb(255 255 255 / 0.07);
    border-radius: var(--radius);
}
.chart-title { font-size: 1rem; margin: 0 0 0.75rem; }
.chart-plot { position: relative; }
.chart-tip {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, calc(-100% - 10px));
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    background: #18202b;
    color: #e7ecf2;
    font-size: 0.85rem;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}

/* Pie */
.chart-pie { display: block; width: 100%; max-width: 18rem; margin: 0 auto; overflow: visible; }
.chart-pie path { stroke: #363c40; stroke-width: 2; stroke-linejoin: round; cursor: default; transition: opacity 0.15s; }
.chart-pie text { font: 700 15px var(--font); fill: #18202b; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.chart-panel.is-focused path:not(.is-active) { opacity: 0.35; }
.chart-legend { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.15rem; font-size: 0.9rem; }
.chart-legend li, .chart-bars li { border-radius: 6px; cursor: default; }
.chart-legend li {
    display: grid;
    grid-template-columns: 0.85rem 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.2rem 0.4rem;
}
.chart-legend li:hover, .chart-legend li:focus-visible, .chart-legend li.is-active,
.chart-bars li:hover, .chart-bars li:focus-visible, .chart-bars li.is-active { background: rgb(255 255 255 / 0.06); outline: none; }
.chart-swatch { width: 0.85rem; height: 0.85rem; border-radius: 3px; }
.chart-count { font-weight: 650; font-variant-numeric: tabular-nums; }

/* Bars: one row per category, label and value above a bar scaled to the largest value. */
.chart-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9rem; }
.chart-bars li { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.6rem; padding: 0.35rem 0.4rem; }
.chart-bar-track, .chart-bar-fill { display: block; }
.chart-bar-track { grid-column: 1 / -1; height: 0.9rem; border-radius: 4px; background: rgb(0 0 0 / 0.18); }
.chart-bar-fill { height: 100%; border-radius: 4px; transition: opacity 0.15s; }
.chart-panel.is-focused .chart-bars li:not(.is-active) .chart-bar-fill { opacity: 0.35; }

@media (max-width: 900px) {
    .chart-layout { grid-template-columns: minmax(0, 1fr); }
    .chart-layout > :not(.chart-panel), .chart-panel { grid-column: 1; grid-row: auto; }
    .chart-panel { width: auto; margin-left: 1.5rem; }
    .chart-panel:has(.chart-pie) { display: grid; grid-template-columns: 9rem 1fr; gap: 0 1.25rem; align-items: center; }
    .chart-panel[hidden] { display: none; }
    .chart-title { grid-column: 1 / -1; }
    .chart-legend { margin: 0; }
}

/* CV and Qualifications pages: the heading lines up with the timeline boxes (1.5rem in from the
   content edge). On the CV page the section titles and the content that is not a timeline line up with
   it too, so the page has one left edge. */
.page-cv .page-header h1,
.page-qualifications .page-header h1,
.page-blog .page-header h1{ padding-left: 1.5rem; }
.page-cv .section-title,
.page-cv .cv-section .skill-groups,
.page-cv .cv-section > .prose,
.page-cv .references{ margin-left: 1.5rem; }
/* Interests (CV): white line icons spread evenly across the width of the skill cards above (first at
   the left edge, last at the right edge; user's request); the selected one's text shows below,
   in a framed box across the same width. The right margin leaves out the chart column (15rem + 1.5rem gap). */
.interests { max-width: none; margin-right: 16.5rem; }
.interest-icons { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.interest-icon {
    display: grid;
    place-items: center;
    width: 6.5rem;
    height: 6.5rem;
    padding: 0;
    border-radius: var(--radius);
    background: rgb(0 0 0 / 0.14); /* same box as the timeline entries */
    border: 1px solid rgb(255 255 255 / 0.07);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.interest-icon svg { width: 3.85rem; height: 3.85rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.interest-icon:hover { background: rgb(0 0 0 / 0.22); border-color: rgb(255 255 255 / 0.15); }
.interest-icon[aria-expanded="true"] { background: rgb(0 0 0 / 0.26); border-color: var(--accent); }
.interest-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The selected text sits centred in a box framed like the icons (user's request; it was justified
   before). */
.interest-text {
    margin: 0;
    padding: 1rem 1.25rem;
    text-align: center;
    background: rgb(0 0 0 / 0.14);
    border: 1px solid rgb(255 255 255 / 0.07);
    border-radius: var(--radius);
}
.interest-text[hidden] { display: none; }
@media (max-width: 900px) {
    .interests { margin-right: 0; } /* no chart column beside the skills here */
}

/* Skill groups beside the skills pie: two wide columns. The first two cards stack on the left
   (Microsoft systems, then Software development tools); the third (Geographical information systems)
   fills the right column at their combined height. One column on small phones. Each card is marked
   with its group's colour (the same colour as its slice); colours go by position, in this order. */
.chart-layout .skill-groups { grid-template-columns: 1fr 1fr; }
.chart-layout .skill-group:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.chart-layout .skill-group:nth-child(1) { --group-color: #c3a6ff; }
.chart-layout .skill-group:nth-child(2) { --group-color: #ffd166; }
.chart-layout .skill-group:nth-child(3) { --group-color: #4fd1c5; }
@media (max-width: 560px) {
    .chart-layout .skill-groups { grid-template-columns: 1fr; }
    .chart-layout .skill-group:nth-child(3) { grid-column: auto; grid-row: auto; }
}
.chart-layout .skill-group h3 { display: flex; align-items: center; gap: 0.5rem; }
.chart-layout .skill-group h3::before {
    content: "";
    flex: none;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 3px;
    background: var(--group-color);
}

/* Certificate scans in an opened entry (Qualifications): the whole scan fits on screen; click opens
   it full size. */
.certificate { display: inline-block; margin-top: 0.75rem; }
.certificate img {
    width: auto;
    max-width: 100%;
    max-height: calc(60vh / var(--page-zoom, 1)); /* fits between the sticky header and footer */
    border-radius: 8px;
    box-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
/* Blog post (expanded entry): the downloadable PDF, then the images. */
.timeline-body .post-downloads { margin-top: 0.75rem; } /* clear gap between the summary and the button (user's request, 2026-11-18) */
.post-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.post-images a { display: block; }
.post-images img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 12px rgb(0 0 0 / 0.35); }
.post-images a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.certificate:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.timeline-title h3 { margin: 0 0 0.15rem; }
.timeline-org { display: block; color: var(--accent-strong); font-weight: 550; }

/* The description lines up under the title. */
.timeline-body { padding: 0 1.1rem 1rem calc(1.1rem + 9rem + 1.5rem); }

/* Expand smoothly where the browser can animate <details> (others open instantly). */
.timeline-entry { interpolate-size: allow-keywords; }
.timeline-entry::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}
.timeline-entry[open]::details-content { block-size: auto; }

@media (max-width: 720px) {
    .timeline-head { grid-template-columns: 1fr auto; gap: 0.25rem 1rem; }
    .timeline-meta { grid-column: 1; }
    .timeline-title { grid-column: 1; }
    summary.timeline-head::after { grid-column: 2; grid-row: 1 / span 2; }
    .timeline-body { padding-left: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-entry::details-content { transition: none; }
}

.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.skill-group h3:last-child { margin-bottom: 0; }

.timeline-body ul { margin: 0; padding-left: 1.1rem; }
.timeline-body li + li { margin-top: 0.35rem; }
.timeline-body p { margin: 0; }

/* References (CV): one frame per referee, framed like the interest icons, side by side. A white
   head-and-shoulders line icon, then the name and organisation, centred. */
/* Frames of one width, spread evenly from the content's left edge to the chart panels' right edge
   (first and last on the edges; user's request); two per row on phones. */
.references { list-style: none; margin: 0 calc(-1 * var(--chart-overhang)) 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.reference {
    flex: 0 1 10.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    text-align: center;
    background: rgb(0 0 0 / 0.14);
    border: 1px solid rgb(255 255 255 / 0.07);
    border-radius: var(--radius);
}
.reference svg { width: 3.25rem; height: 3.25rem; margin-bottom: 0.4rem; fill: none; stroke: #ffffff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.reference-name { font-size: 1rem; margin: 0; }
.reference-org { color: var(--muted); margin: 0; font-size: 0.9rem; line-height: 1.4; }
@media (max-width: 560px) {
    .reference { flex-basis: calc(50% - 0.5rem); }
}
/* Phone number: pushed to the frame's bottom, so the numbers line up across the row. */
.reference-phone { margin-top: auto; padding-top: 0.25rem; color: var(--accent); font-size: 0.9rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.reference-phone:hover { text-decoration: underline; }
.reference-phone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Chips --------------------------------------------------------------- */

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }

.chip {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.875rem;
    border: 1px solid transparent;
    font-family: inherit;
}
.chips-small .chip { font-size: 0.8rem; padding: 0.15rem 0.6rem; }

button.chip { cursor: pointer; border-color: var(--border); background: var(--surface); }
button.chip:hover { border-color: var(--accent); }
button.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--surface); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; }

/* Cards --------------------------------------------------------------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 1rem; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem;
    overflow: hidden;
}
.card[hidden] { display: none; }
.card h3 { margin-bottom: 0.25rem; }
.card p { margin: 0 0 0.75rem; }
.card-meta { color: var(--muted); font-size: 0.9rem; }
.card-links { display: flex; gap: 1rem; margin-top: auto !important; padding-top: 0.5rem; font-weight: 600; font-size: 0.95rem; }

.project-card { padding: 0; }
.card-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.4rem; }
.card-body .chips { margin-bottom: 0.75rem; }

details { margin-bottom: 0.75rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
details[open] summary { margin-bottom: 0.5rem; }

.badge {
    align-self: flex-start;
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem !important;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #13c2f9; /* certification */
    color: #18202b;
}
/* Type colours chosen by the user, the same in both modes. Dark text on each (contrast in brackets);
   white text would fail on all of them. */
.badge-certification { background: #13c2f9; } /* 7.9:1 */
.badge-course { background: #13d4c7; }        /* 8.8:1 */
.badge-degree { background: #ff8000; }        /* 6.5:1 */
.badge-award { background: #ffed02; }         /* 13.6:1 */
.badge-school { background: #bce211; }        /* 11.0:1 */
.badge-post { background: #a0c4ff; }          /* blog post, 9.1:1 */
/* CV role categories (chosen to stay apart from each other in the validator; dark text). */
.badge-hod { background: #ff6f91; }           /* Head of Department, 6.2:1 */
.badge-manager { background: #ffc15e; }       /* 10.2:1 */
.badge-planner { background: #6ee7a8; }       /* 10.7:1 */

/* Data ---------------------------------------------------------------- */

/* Projects page: one frame per company with four stat cards (no CMS field yet; markup in includes/project_frames.html).
   The frame is framed like the reference and interest boxes: black at low opacity, darker than the grey. */
.project-frames { display: grid; gap: 1.25rem; margin: 1.5rem 0 0.5rem; }
.project-frame {
    padding: 1.25rem 1.5rem 1.5rem;
    background: rgb(0 0 0 / 0.14);
    border: 1px solid rgb(255 255 255 / 0.07);
    border-radius: var(--radius);
}
.project-frame h2 { margin: 0 0 1rem; }
.project-frame .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.project-frame .stat-label { font-size: 0.95rem; line-height: 1.3; }
.project-frame .stat-note { margin-top: auto; padding-top: 0.35rem; } /* level across cards whose labels wrap */
@media (max-width: 720px) {
    .project-frame .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* HeroTel frame as role tiers (user's sketch, documents/project_layout.drawio): columns card, card,
   responsibilities. The person icon is centred over the two cards with its title beside it; the
   role-links script draws the lines from it (an svg.role-links laid over each .role). Under National
   Head of Planning the team row sits between the icon and the cards. */
.project-roles { --role-cols: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.8fr); --role-gap: 1rem; }
.project-roles h2 { text-align: center; margin-bottom: 1.75rem; width: calc((100% - 2 * var(--role-gap)) * 2 / 3.8 + var(--role-gap)); }
.role { position: relative; display: grid; grid-template-columns: var(--role-cols); column-gap: var(--role-gap); row-gap: 2.75rem; align-items: start; }
.role + .role { margin-top: 2rem; padding-top: 1.75rem; border-top: 1px solid rgb(255 255 255 / 0.07); }
.role > .stat, .role-duties { grid-row: 2; align-self: stretch; }
.role-team ~ .stat, .role-team ~ .role-duties { grid-row: 3; }
.role-node { grid-column: 1 / 3; justify-self: center; position: relative; line-height: 0; }
.role svg.person { width: 3.25rem; height: 3.25rem; fill: none; stroke: #ffffff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.role-title { position: absolute; left: calc(100% + 0.6rem); bottom: 0.3rem; width: max-content; max-width: 19rem; font-weight: 600; line-height: 1.3; }
.role-team { grid-column: 1 / 3; list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 2.5rem; line-height: 0; }
.role-team svg.person { width: 2.5rem; height: 2.5rem; }
/* fibertime: managers over pairs of contractors. Both rows use the same group width (--pair) and gap,
   so each pair sits under its manager; the row's label sits beside its last icon, like .role-title. */
.role-team { grid-row: 2; }
.role-team + .role-team { grid-row: 3; }
.role-team ~ .role-team ~ .stat, .role-team ~ .role-team ~ .role-duties { grid-row: 4; }
.role-team-groups { --pair: 5.1rem; position: relative; justify-self: center; gap: 2.5rem; }
.role-team-groups > li { width: var(--pair); display: flex; justify-content: center; }
.role-team-groups > li.role-pair { justify-content: space-between; }
.role-pair > span { display: block; }
.role-pair svg.person { width: 2.1rem; height: 2.1rem; }
.role-team-groups > li.role-team-label { position: absolute; left: calc(100% + 0.6rem); top: 50%; transform: translateY(-50%); width: max-content; max-width: 12rem; display: block; font-weight: 600; line-height: 1.3; }
.role-surveys > .stat { grid-column: 1 / 3; } /* one wide card under the two contractor icons, as in the sketch */
.role-duties { grid-column: 3; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.role-duties h3 { font-size: 0.95rem; margin: 0 0 0.5rem; line-height: 1.3; }
.role-duties ul { margin: 0; padding-left: 1.2rem; }
.role-duties li { margin: 0.15rem 0; }
svg.role-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; color: var(--page-line); }
@media (max-width: 720px) {
    .project-roles { --role-cols: minmax(0, 1fr) minmax(0, 1fr); }
    .project-roles h2 { width: auto; }
    .role { row-gap: 1rem; }
    .role-node { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; line-height: 1.3; text-align: center; }
    .role-title { position: static; width: auto; }
    .role-duties, .role-team ~ .role-duties, .role-team ~ .role-team ~ .role-duties { grid-column: 1 / -1; grid-row: auto; }
    .role-team-groups { justify-self: stretch; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; }
    .role-team-groups > li.role-team-label { position: static; transform: none; flex-basis: 100%; width: auto; max-width: none; text-align: center; }
    svg.role-links { display: none; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.15rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { font-weight: 600; }
.stat-note { color: var(--muted); font-size: 0.875rem; }

.chart-card { margin: 0 0 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.chart-wrap { position: relative; height: 340px; }

.table-wrap { overflow-x: auto; margin: 0 0 2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
caption { text-align: left; padding: 1rem 1rem 0.5rem; font-weight: 650; }
th, td { padding: 0.65rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }

/* Footer -------------------------------------------------------------- */

/* Sticky and frosted like the header: the honeycomb shows through blurred. */
.site-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--page-line);
    color: var(--muted);
    font-size: 0.9rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem; text-align: center; }
.footer-inner p { margin: 0; }
.footer-links { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.footer-links:empty { display: none; } /* else the flex gap nudges the copyright off centre */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Portrait window (landing) ------------------------------------------- */
/* Transparent cut-outs straight on the page: no box, and the cropped bottom fades out. */

.portrait-window {
    position: relative;
    /* 420 px at most; in a short window it shrinks (4:5 ratio) so that the login row under the tagline
       still fits above the sticky footer without scrolling (user's request, 2026-11-18). 440px is the
       height of everything else on the home page. */
    width: clamp(240px, calc((100vh / var(--page-zoom, 1) - 440px) * 0.8), 420px);
    max-width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}
.portrait-track { position: relative; height: 100%; }
.portrait-track img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    /* Fade out at the bottom and both sides; the two gradients are intersected. */
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent),
        linear-gradient(to right, transparent, #000 16%, #000 84%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, #000 78%, transparent),
        linear-gradient(to right, transparent, #000 16%, #000 84%, transparent);
    mask-composite: intersect;
}
.portrait-track img.is-active { opacity: 1; }

.portrait-dots { position: absolute; left: 0; right: 0; bottom: 0.75rem; display: flex; justify-content: center; gap: 0.4rem; }
.portrait-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--page-node);
    background: color-mix(in srgb, var(--text) 35%, transparent);
    cursor: pointer;
}
.portrait-dot.is-active { background: var(--accent); }

@media (max-width: 720px) {
    .portrait-window { width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    .portrait-track img { transition: none; }
}

/* Login (home page, under the tagline) and the Log out / locked tabs -------------------------- */
.login-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; width: min(30rem, 100%); }
.login-form input {
    min-width: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.login-form input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.login-form .button { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.login-error { grid-column: 1 / -1; margin: 0; font-weight: 600; color: #ffa3a3; } /* light red, 5.0:1 on the grey */
.login-error[hidden], .login-form[hidden] { display: none; }
@media (max-width: 720px) {
    .login-form { grid-template-columns: 1fr; }
}
button.tab { border: 0; background: none; font-family: inherit; cursor: pointer; }
button.tab[hidden] { display: none; }
/* Logged out: the tabs that need a login are greyed out and do nothing (user's request). */
.tab.is-locked, .tab.is-locked:hover { background: none; color: var(--muted); opacity: 0.4; cursor: not-allowed; }
/* Tabs open to everyone are lighter than the locked one (user's request, 2026-11-19). */
.tab.is-open { color: var(--text); }
.tab.is-locked { color: var(--muted); }
/* Logged out: certificate scans are shown in place but cannot be opened, dragged or right-clicked, and referees' contact details are not shown. */
.certificate.is-private, .certificate.is-private img { pointer-events: none; cursor: default; -webkit-user-drag: none; user-select: none; }
.reference-phone.is-private { color: var(--muted); font-size: 0.8rem; font-weight: 500; white-space: normal; pointer-events: none; text-decoration: none; }
