/* Variable Archivo (width 62 to 125 %, weight 100 to 900), served by the site: no request to
   Google Fonts. Files from the @fontsource-variable/archivo package, latin and latin-ext
   subsets, same Unicode ranges as Google Fonts. Font Awesome is imported by the layout. */
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    src: url('/_astro/archivo-latin-ext-wdth-normal.7khWdh9v.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;
}

@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    src: url('/_astro/archivo-latin-wdth-normal.DY7AcnAa.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;
}
/* ==========================================================================
   VARIABLES
   Palette inspired by cabling: steel, graphite, OM3 fibre (cyan)
   and yellow labelling tape, which marks what is "in progress".
   ========================================================================== */
:root {
    --paper: #EDF0F2;
    --surface: #FFFFFF;
    --surface-2: #E2E7EB;
    --scene-bg: #DCE5E9;
    --ink: #14222E;
    --muted: #4F5E6A;
    --line: #CBD3D9;
    --accent: #00727A;
    --accent-strong: #005A61;
    --accent-ink: #FFFFFF;
    --accent-soft: #D4ECEE;
    --tape: #F3C623;
    --tape-ink: #1B1A12;
    --led: #16A34A;
    --threat: #FF6B5E;
    --shield: #34D399;
    --band: #14222E;
    --band-ink: #E9EEF1;
    --band-muted: #A9B7C2;
    --band-accent: #3CC6CE;
    --band-accent-ink: #06282B;
    --band-grad: linear-gradient(115deg, #06424B 0%, #0B6B74 30%, #17508F 65%, #2E2F78 100%);
    --photo-disc: radial-gradient(circle at 50% 32%, #E8F7F8 0%, #BFDDE3 100%);
    --folder: #E2A82B;
    --pdf: #D2443B;
    --video: #E27A2B;
    --code: #1E9A63;
    --backdrop: rgb(8 16 22 / 0.55);

    --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --gutter: clamp(1rem, 5vw, 3rem);
    --header-h: 3.75rem;
    --radius: 14px;
    --radius-sm: 8px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* DARK THEME VARIABLES (automatic) */
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0E161D;
        --surface: #15202A;
        --surface-2: #1C2934;
        --scene-bg: #111C24;
        --ink: #E4EAEE;
        --muted: #9AA8B3;
        --line: #273642;
        --accent: #3CC6CE;
        --accent-strong: #6FD7DD;
        --accent-ink: #06282B;
        --accent-soft: #123A40;
        --band: #15202A;
        --band-ink: #E4EAEE;
        --band-muted: #9AA8B3;
        --photo-disc: radial-gradient(circle at 50% 32%, #1F4E57 0%, #0F1D26 100%);
        --backdrop: rgb(0 0 0 / 0.7);
    }
}

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

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
}

/* Blocks page scrolling while a dialog is open */
html:has(dialog[open]) {
    overflow: hidden;
}

body {
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* The hero photo's halo overflows the screen edge on medium screens: it is clipped there,
   without creating horizontal scrolling (even with the keyboard or an internal link).
   "clip", unlike "hidden", creates no scroll container: the rack and the radar stay
   sticky. The overflow-x on body covers browsers without "clip". */
main {
    overflow-x: clip;
}

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

a {
    color: inherit;
}

ul, ol {
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
}

strong {
    font-weight: 650;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

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

.container {
    width: 100%;
    max-width: calc(72rem + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 0.75rem;
}

/* Labelling tape: marks what is in progress (job, course) */
.tape {
    display: inline-block;
    padding: 0.12em 0.55em 0.16em;
    background: var(--tape);
    color: var(--tape-ink);
    font-weight: 700;
    font-stretch: 75%;
    letter-spacing: 0.01em;
    line-height: 1.4;
    border-radius: 3px;
    transform: rotate(-1.2deg);
    box-shadow: 0 1px 0 rgb(0 0 0 / 0.15);
}

/* "Link up" LED */
.led {
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    margin-right: 0.5em;
    vertical-align: 0.05em;
    border-radius: 50%;
    background: var(--led);
    box-shadow: 0 0 0 0 rgb(22 163 74 / 0.6);
}

.tag {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 700;
    font-stretch: 75%;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0.7rem 1.35rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    background: var(--accent-strong);
    box-shadow: 0 10px 24px -12px var(--accent);
}

.btn-ghost {
    border-color: var(--ink);
    color: var(--ink);
    background: transparent;
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.95rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.btn-sm:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background-color 0.2s;
}

.icon-btn:hover:not(:disabled) {
    background: var(--surface-2);
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.navbar-content {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    font-stretch: 125%;
    letter-spacing: -0.02em;
    text-decoration: none;
}

/* MOBILE MENU (popover) */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    padding: 0.4rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 650;
    font-stretch: 87.5%;
    cursor: pointer;
}

.menu-toggle .fa-xmark {
    display: none;
}

.navbar:has(.navbar-links:popover-open) .menu-toggle .fa-bars {
    display: none;
}

.navbar:has(.navbar-links:popover-open) .menu-toggle .fa-xmark {
    display: inline-block;
}

.navbar-links:popover-open {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0.25rem var(--gutter) 1.25rem;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    border: 0;
    border-bottom: 1px solid var(--line);
}

.navbar-links::backdrop {
    background: var(--backdrop);
}

.navbar-links a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.3rem;
    font-weight: 700;
    font-stretch: 112%;
    text-decoration: none;
}

.navbar-links li:last-child a {
    border-bottom: 0;
}

/* Browsers without popover: links always visible */
@supports not selector(:popover-open) {
    .menu-toggle {
        display: none;
    }

    .navbar-content {
        height: auto;
        flex-wrap: wrap;
        padding-block: 0.75rem;
    }

    .navbar-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 1.25rem;
    }

    .navbar-links a {
        padding: 0.25rem 0;
        border: 0;
        font-size: 0.95rem;
        font-weight: 600;
        font-stretch: 100%;
    }
}

@media (min-width: 52em) {
    .menu-toggle {
        display: none;
    }

    .navbar-links,
    .navbar-links:popover-open {
        position: static;
        display: flex;
        flex-direction: row;
        gap: clamp(1.25rem, 2.5vw, 2.25rem);
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
        background: none;
        color: inherit;
        border: 0;
    }

    .navbar-links a {
        position: relative;
        padding: 0.35rem 0;
        border: 0;
        font-size: 0.95rem;
        font-weight: 550;
        font-stretch: 100%;
        color: var(--muted);
        transition: color 0.2s;
    }

    .navbar-links a::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        background: var(--accent);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.3s var(--ease);
    }

    .navbar-links a:hover {
        color: var(--ink);
    }

    .navbar-links a:hover::after {
        transform: scaleX(1);
    }
}

/* ==========================================================================
   HERO
   Mobile: everything centred. Desktop: text on the left, photo on the right.
   ========================================================================== */
.hero {
    display: grid;
    gap: 2.25rem;
    align-items: center;
    justify-items: center;
    text-align: center;
    padding-block: clamp(2.75rem, 6vw, 5.5rem) clamp(3rem, 8vw, 6.5rem);
}

.hero-text {
    width: 100%;
    container-type: inline-size;
}

.hero-badge {
    margin-bottom: 1.25rem;
}

.hero-badge .tape {
    font-size: 1rem;
}

/* Size fitted to the column width: « Raphaël » fills it without overflowing */
.hero-title {
    margin-bottom: 0.35em;
    font-size: clamp(3rem, 15vw, 8rem);
    font-size: clamp(3rem, 19cqi, 8rem);
    font-weight: 820;
    font-stretch: 125%;
    line-height: 0.92;
    letter-spacing: -0.035em;
}

.hero-title span {
    display: block;
}

.hero-lead {
    max-width: 36ch;
    margin-inline: auto;
    font-size: clamp(1.15rem, 1rem + 0.55vw, 1.4rem);
    line-height: 1.45;
}

.hero-sub {
    max-width: 44ch;
    margin: 1rem auto 0;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Round photo (transparent background) on a tinted disc, with halo and ring */
.hero-photo {
    position: relative;
    order: -1;
    width: clamp(10rem, 44vw, 13rem);
    aspect-ratio: 1;
    isolation: isolate;
}

/* The image is scaled up by 20 % then clipped to a circle to frame the bust */
.hero-photo img {
    position: absolute;
    left: -10%;
    top: -9.8%;
    width: 120%;
    max-width: none;
    height: 120%;
    object-fit: cover;
    object-position: 50% 0;
    background: var(--photo-disc);
    clip-path: circle(41.667% at 50% 49.83%);
}

/* Coloured halo behind the photo */
.hero-photo::before {
    content: '';
    position: absolute;
    inset: -24%;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgb(60 198 206 / 0.5), transparent 58%),
        radial-gradient(circle at 72% 72%, rgb(243 198 35 / 0.35), transparent 55%);
    filter: blur(32px);
}

/* Ring: a glowing "packet" circles the photo */
.hero-photo::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, transparent 0 58%, var(--accent) 86%, var(--tape) 100%),
        var(--line);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}

@media (max-width: 30em) {
    .hero-actions .btn {
        flex: 1 1 auto;
        white-space: nowrap;
    }
}

@media (min-width: 56em) {
    .hero {
        grid-template-columns: minmax(0, 1fr) clamp(16rem, 26vw, 21rem);
        justify-items: stretch;
        text-align: left;
    }

    .hero-lead,
    .hero-sub {
        margin-inline: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .hero-photo {
        order: 0;
        width: 100%;
    }
}

@media (prefers-reduced-motion: no-preference) {
    /* The name widens on load (Archivo's width axis) */
    .hero-title span {
        animation: stretch-in 1s var(--ease) 0.15s both;
    }

    .hero-title span + span {
        animation-delay: 0.25s;
    }

    .hero-badge .tape {
        animation: tape-in 0.5s var(--ease) 0.9s both;
    }

    .led {
        animation: led-pulse 2s ease-out infinite;
    }

    .hero-photo {
        animation: float 7s ease-in-out infinite;
    }

    .hero-photo img {
        animation: pop-in 0.9s var(--ease) 0.2s both;
    }

    .hero-photo::before {
        animation: halo 9s ease-in-out infinite alternate;
    }

    .hero-photo::after {
        animation: spin 5s linear infinite;
    }
}

@keyframes stretch-in {
    from {
        font-stretch: 62%;
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

@keyframes tape-in {
    from {
        transform: rotate(-6deg) scale(1.08);
        opacity: 0;
    }
}

@keyframes led-pulse {
    0% {
        box-shadow: 0 0 0 0 rgb(22 163 74 / 0.6);
    }
    70%, 100% {
        box-shadow: 0 0 0 0.55em rgb(22 163 74 / 0);
    }
}

@keyframes float {
    50% {
        translate: 0 -12px;
    }
}

@keyframes pop-in {
    from {
        opacity: 0;
        scale: 0.85;
    }
}

@keyframes halo {
    to {
        rotate: 50deg;
        scale: 1.1;
    }
}

@keyframes spin {
    to {
        rotate: 1turn;
    }
}

/* ==========================================================================
   STATEMENT: quote centred over an animated network
   ========================================================================== */
.statement {
    position: relative;
    overflow: hidden;
    padding-block: clamp(4.5rem, 11vw, 8rem);
    background: var(--band-grad);
    background-size: 180% 180%;
    color: #F2FBFC;
    text-align: center;
}

/* Coloured reflections */
.statement::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 0%, rgb(255 255 255 / 0.14), transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgb(243 198 35 / 0.18), transparent 50%);
    pointer-events: none;
}

.network-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.statement .container {
    position: relative;
    z-index: 1;
}

.statement p {
    max-width: 30ch;
    margin-inline: auto;
    font-size: clamp(1.5rem, 1rem + 2.2vw, 2.75rem);
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.015em;
    text-wrap: balance;
    text-shadow: 0 2px 24px rgb(4 30 40 / 0.45);
}

@media (prefers-reduced-motion: no-preference) {
    .statement {
        animation: band-drift 16s ease-in-out infinite alternate;
    }
}

@keyframes band-drift {
    to {
        background-position: 100% 50%;
    }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section {
    padding-block: clamp(4rem, 9vw, 7rem);
}

.section-title {
    margin-bottom: clamp(1.75rem, 4vw, 3rem);
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem);
    font-weight: 780;
    font-stretch: 118%;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.section-title.is-centered {
    text-align: center;
}

/* SKILLS */
.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 2.75rem 2rem;
}

.skill {
    position: relative;
    padding-top: 1.25rem;
    border-top: 2px solid var(--line);
}

/* On hover, the top "cable" fills with signal */
.skill::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--tape)) no-repeat;
    background-size: 0% 100%;
    transition: background-size 0.5s var(--ease);
}

.skill:hover::before {
    background-size: 100% 100%;
}

.skill-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 10px;
    font-size: 1.15rem;
    transition: background-color 0.3s, color 0.3s, rotate 0.3s var(--ease);
}

.skill:hover .skill-icon {
    background: var(--accent);
    color: var(--accent-ink);
    rotate: -8deg;
}

.skill h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-stretch: 110%;
    line-height: 1.25;
}

.skill p {
    color: var(--muted);
    font-size: 1rem;
}

/* EXPERIENCE & SECURITY WATCH */
.split {
    display: grid;
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: center;
}

.split-text .section-title {
    margin-bottom: 0.6rem;
}

.split-meta {
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 650;
    font-stretch: 87.5%;
}

.split-text > p:not(.split-meta) {
    max-width: 62ch;
    color: var(--muted);
}

.split-visual {
    position: relative;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
}

@media (min-width: 56em) {
    .split {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    }

    .split-reverse {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }

    .split-reverse .split-visual {
        order: -1;
    }
}

.task-list {
    display: grid;
    gap: 0.8rem;
    max-width: 62ch;
    margin-block: 1.5rem 2rem;
}

.task-list li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--muted);
}

.task-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.78em;
    width: 0.9rem;
    height: 2px;
    background: var(--accent);
}

.task-list strong {
    color: var(--ink);
}

/* JOBS */
.split-text .section-title + .jobs {
    margin-top: 1.5rem;
}

.jobs {
    display: grid;
    gap: 2.25rem;
}

.job {
    position: relative;
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    column-gap: 1.1rem;
}

/* Link between the two jobs */
.job:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(1.375rem - 1px);
    top: 3.5rem;
    bottom: -1.75rem;
    width: 2px;
    background: var(--line);
}

.job-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 10px;
    font-size: 1.15rem;
}

.job.is-current .job-icon {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.job-title {
    font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
    font-weight: 720;
    font-stretch: 108%;
    line-height: 1.25;
}

.job-company {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin-top: 0.3rem;
    font-weight: 650;
}

.job-company .tape {
    font-size: 0.85rem;
}

.job-meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.job .task-list {
    margin-block: 1.1rem 1.5rem;
}

/* ==========================================================================
   ILLUSTRATION: NETWORK RACK (SVG animated with CSS)
   ========================================================================== */
.rack-scene {
    display: grid;
    place-items: center;
    padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem) clamp(5.5rem, 12vw, 6.5rem);
    background:
        radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 65%),
        var(--scene-bg);
}

@media (min-width: 56em) {
    .rack-scene {
        position: sticky;
        top: calc(var(--header-h) + 2rem);
        align-self: start;
    }
}

.rack {
    width: min(100%, 21rem);
    height: auto;
    filter: drop-shadow(0 24px 30px rgb(5 15 22 / 0.35));
}

.rack .rk-dev { fill: #2A3946; }
.rack .rk-fw { fill: #12434B; }
.rack .rk-blank { fill: #1A2530; }
.rack .rk-slot { fill: #0B1218; }
.rack .rk-port { fill: #0A1117; stroke: #3A4B59; stroke-width: 0.6; }
.rack .rk-bay { fill: #1A252F; stroke: #36495A; stroke-width: 0.8; }
.rack .rk-tape { fill: var(--tape); }
.rack .rk-pwr { fill: #22C55E; }
.rack .rk-g { fill: #3BE07A; }
.rack .rk-a { fill: #F5B83D; }
.rack .rk-b { fill: #5B8DEF; }
.rack .rk-charge { fill: #3CC6CE; }

.rack .rk-label {
    font: 700 6.5px var(--font);
    font-stretch: 75%;
    fill: #1B1A12;
}

.rack .rk-lcd {
    font: 600 5.5px var(--mono);
    fill: #3CC6CE;
    letter-spacing: 0.04em;
}

.rack .rk-lcd-dim {
    fill: #8FA3B0;
}

.rack .rk-cable {
    fill: none;
    stroke-width: 2.6;
    stroke-linecap: round;
}

.rack .rk-flow {
    fill: none;
    stroke: #FFFFFF;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-dasharray: 1.5 22;
    opacity: 0.9;
}

/* Small terminal "typing" the backup to the NAS */
.term {
    position: absolute;
    left: clamp(0.75rem, 3vw, 1.5rem);
    right: clamp(0.75rem, 3vw, 1.5rem);
    bottom: clamp(0.75rem, 3vw, 1.5rem);
    max-width: 19rem;
    margin-inline: auto;
    overflow: hidden;
    background: rgb(8 18 24 / 0.92);
    color: #CFE9EC;
    border: 1px solid rgb(60 198 206 / 0.35);
    border-radius: 10px;
    box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.55);
    font-family: var(--mono);
    font-size: 0.72rem;
    rotate: -1.5deg;
}

.term-bar {
    display: flex;
    gap: 5px;
    padding: 0.45rem 0.6rem;
    background: rgb(255 255 255 / 0.05);
}

.term-bar span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3A4B59;
}

.term-bar span:nth-child(1) { background: #FF6B5E; }
.term-bar span:nth-child(2) { background: #F3C623; }
.term-bar span:nth-child(3) { background: #22C55E; }

/* Margins (not padding): the 5 lines fill exactly 100 % of the clipped box */
.term-log {
    margin: 0.55rem 0.8rem 0.7rem;
    font: inherit;
    line-height: 1.6;
    white-space: normal;
}

.term-log span {
    display: block;
    overflow: hidden;
    white-space: pre;
    text-overflow: ellipsis;
}

.term-log span:first-child {
    color: var(--tape);
}

.term-ok {
    color: #4ADE80;
}

.term-ok::after {
    content: '▋';
    margin-left: 0.3em;
    color: #CFE9EC;
}

@media (prefers-reduced-motion: no-preference) {
    .rack .rk-led {
        animation: rk-blink var(--d) steps(1, end) var(--o) infinite;
    }

    .rack .rk-flow {
        animation: rk-flow var(--d) linear var(--o) infinite;
    }

    .rack .rk-charge {
        animation: rk-charge 2.4s ease-in-out infinite;
        animation-delay: calc(var(--n) * 0.25s);
    }

    .term-log {
        animation: term-type 9s steps(1, end) infinite;
    }

    .term-ok::after {
        animation: caret 1s steps(1, end) infinite;
    }
}

@keyframes rk-blink {
    0%, 100% { opacity: 1; }
    14% { opacity: 0.2; }
    20% { opacity: 1; }
    46% { opacity: 0.25; }
    50% { opacity: 1; }
    77% { opacity: 0.3; }
    81% { opacity: 1; }
}

@keyframes rk-flow {
    to { stroke-dashoffset: -23.5; }
}

@keyframes rk-charge {
    50% { opacity: 0.3; }
}

/* Lines appear one by one (5 lines = 5 x 20 %) */
@keyframes term-type {
    0% { clip-path: inset(0 0 100% 0); }
    8% { clip-path: inset(0 0 80% 0); }
    20% { clip-path: inset(0 0 60% 0); }
    32% { clip-path: inset(0 0 40% 0); }
    44% { clip-path: inset(0 0 20% 0); }
    56%, 100% { clip-path: inset(0 0 0 0); }
}

@keyframes caret {
    50% { opacity: 0; }
}

/* ==========================================================================
   TIMELINE (EDUCATION): most recent first, centred
   Cards are linked like network devices; a packet travels back in time.
   ========================================================================== */
.timeline {
    --tl-gap: 3.25rem;
    display: grid;
    gap: var(--tl-gap);
    max-width: 40rem;
    margin-inline: auto;
}

.timeline-item {
    position: relative;
}

.timeline-card {
    position: relative;
    padding: clamp(1.4rem, 3.5vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.timeline-card:hover {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--accent) 80%, transparent);
}

.timeline-item.is-current .timeline-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Connection ports at the top and bottom of the cards */
.timeline-item:not(:first-child) .timeline-card::before,
.timeline-item:not(:last-child) .timeline-card::after {
    content: '';
    position: absolute;
    left: 50%;
    z-index: 1;
    width: 12px;
    height: 12px;
    background: var(--paper);
    border: 2px solid var(--accent);
    border-radius: 50%;
    translate: -50% 0;
}

.timeline-item:not(:first-child) .timeline-card::before {
    top: -7px;
}

.timeline-item:not(:last-child) .timeline-card::after {
    bottom: -7px;
}

/* Cable between two cards */
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: var(--tl-gap);
    background: color-mix(in srgb, var(--accent) 55%, var(--line));
    translate: -50% 0;
    transform-origin: top;
}

/* Packet travelling up to the most recent step */
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + var(--tl-gap) - 12px);
    z-index: 2;
    width: 8px;
    height: 8px;
    background: var(--tape);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--tape);
    translate: -50% 0;
    opacity: 0;
}

.timeline-date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 700;
    font-stretch: 75%;
    font-variant-numeric: tabular-nums;
}

.timeline-date .tape {
    font-size: 0.9rem;
}

.timeline-card h3 {
    font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
    font-weight: 750;
    font-stretch: 112%;
    line-height: 1.2;
}

.timeline-school {
    margin-top: 0.25rem;
    font-weight: 650;
}

.timeline-card p:not([class]) {
    max-width: 46ch;
    margin: 0.6rem auto 0;
    color: var(--muted);
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
    .timeline-item:not(:last-child)::before {
        animation: packet-up 2.6s var(--ease) infinite;
    }

    .timeline-item.is-revealed:not(:last-child)::after {
        animation: cable-draw 0.9s var(--ease) 0.35s both;
    }
}

@keyframes packet-up {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    20%, 80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(calc(16px - var(--tl-gap)));
    }
}

@keyframes cable-draw {
    from {
        scale: 1 0;
    }
}

/* ==========================================================================
   SECURITY WATCH: ALERT FEED AND RADAR
   feed.js reads the feed from data/feed.json. The radar is not an
   illustration: each dot is a publication of the feed. Angle = kind of
   publication (one quarter each), distance to the centre = age.
   One colour per kind, for the radar as for the list LEDs: always on a
   dark background, it stays readable in both themes.
   ========================================================================== */
.feed {
    --k-alert: #FF6B5E;
    --k-exploited: #FF9F43;
    --k-threat: #B197FC;
    --k-advisory: #6EA8FE;
    --socket: #0F2A31;
}

.feed [data-kind="alert"] { --k: var(--k-alert); --dot: 10px; }
.feed [data-kind="exploited"] { --k: var(--k-exploited); --dot: 8px; }
.feed [data-kind="threat"] { --k: var(--k-threat); --dot: 8px; }
.feed [data-kind="advisory"] { --k: var(--k-advisory); --dot: 6px; }

/* Feed status: green LED = up to date, yellow = stale, red = unavailable */
.feed-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
    font-stretch: 87.5%;
}

.feed-status .led {
    flex: none;
    margin: 0;
}

.feed-status.is-stale .led {
    background: var(--tape);
    animation: none;
}

.feed-status.is-error .led {
    background: var(--threat);
    animation: none;
}

.feed-heading {
    margin-top: 2.25rem;
    font-size: 1.2rem;
    font-weight: 720;
    font-stretch: 110%;
    line-height: 1.25;
}

.feed-list {
    margin-top: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.feed-list > li {
    display: grid;
    grid-template-columns: 1.375rem minmax(0, 1fr) auto;
    column-gap: 0.9rem;
    padding-block: 0.95rem;
    border-top: 1px solid var(--line);
}

.feed-list > li[hidden] {
    display: none;
}

.feed-list.is-alerts > li {
    grid-template-columns: 1.375rem minmax(0, 1fr);
    padding-block: 1.15rem;
}

/* LED: same colour and shape as the radar dot */
.feed-led {
    position: relative;
    width: 1.375rem;
    height: 1.375rem;
    background: var(--socket);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgb(60 198 206 / 0.3);
}

.feed-led::before,
.blip::before,
.radar-keys li::before {
    content: '';
    width: var(--dot);
    height: var(--dot);
    background: var(--k);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--k);
}

.feed-led::before,
.blip::before {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: calc(var(--dot) / -2);
}

[data-kind="threat"].feed-led::before,
[data-kind="threat"].blip::before,
.radar-keys [data-kind="threat"]::before {
    border-radius: 1.5px;
    rotate: 45deg;
}

/* The hovered row lights its LED (and its radar dot, through feed.js) */
.feed-list > li:hover .feed-led::before,
.feed-list > li:focus-within .feed-led::before {
    box-shadow: 0 0 3px 1px var(--k), 0 0 14px var(--k);
}

.feed-title {
    font-weight: 650;
    line-height: 1.35;
    text-wrap: pretty;
}

.is-alerts .feed-title {
    font-size: 1.15rem;
    font-weight: 720;
    font-stretch: 106%;
    line-height: 1.3;
}

.feed-title a,
.feed-products a {
    text-decoration: none;
}

.feed-title a:hover,
.feed-products a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.feed-summary {
    display: -webkit-box;
    max-width: 62ch;
    margin-top: 0.4rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.97rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.feed-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.9rem;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    font-stretch: 80%;
    font-variant-numeric: tabular-nums;
}

.is-alerts .feed-meta {
    margin-top: 0.65rem;
}

.feed-meta .tape {
    font-size: 0.85rem;
}

.feed-meta .tag {
    font-size: 0.8rem;
}

.feed-ref {
    color: var(--ink);
    font-weight: 680;
    letter-spacing: 0.01em;
}

.feed-date {
    padding-top: 0.1rem;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 650;
    font-stretch: 80%;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Daily advisory digest: the affected products, each linking to its advisory */
.feed-products {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.97rem;
}

.feed-products a {
    color: var(--ink);
}

.feed-products li:not(:last-child)::after {
    content: ',';
    margin-right: 0.4em;
}

.feed-more {
    margin-top: 1rem;
    cursor: pointer;
}

.feed-pdf {
    margin-top: 2.25rem;
}

/* --- Radar --- */
.radar-scene {
    display: grid;
    justify-items: center;
    gap: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background:
        radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
        var(--scene-bg);
}

@media (min-width: 56em) {
    .radar-scene {
        position: sticky;
        top: calc(var(--header-h) + 2rem);
        align-self: start;
    }
}

/* Rings at 1/3, 2/3 and the edge: 48 h, 7 days, 30 days */
.radar {
    --sweep: 4s;
    position: relative;
    width: min(100%, 22rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        linear-gradient(transparent calc(50% - 0.5px), rgb(60 198 206 / 0.25) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(90deg, transparent calc(50% - 0.5px), rgb(60 198 206 / 0.25) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        repeating-radial-gradient(circle closest-side, transparent 0 calc(33.333% - 1px), rgb(60 198 206 / 0.3) calc(33.333% - 1px) 33.333%),
        radial-gradient(circle closest-side, #0F3A42 0%, #0A1D24 100%);
    box-shadow: inset 0 0 0 2px rgb(60 198 206 / 0.45), 0 0 50px -10px rgb(60 198 206 / 0.5);
}

.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg 290deg, rgb(60 198 206 / 0.08) 300deg, rgb(60 198 206 / 0.45) 357deg, rgb(190 245 248 / 0.95) 360deg);
}

.radar-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px;
    background: #BFF4F7;
    border-radius: 50%;
    box-shadow: 0 0 12px #3CC6CE;
}

/* Scale marks on the horizontal axis, opposite the alert labels */
.radar-ring {
    position: absolute;
    left: calc(50% - var(--r) * 50%);
    top: 50%;
    padding: 0.1rem 0.3rem;
    background: #0B232A;
    color: rgb(191 244 247 / 0.7);
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 650;
    font-stretch: 80%;
    line-height: 1.1;
    white-space: nowrap;
    translate: 0.3rem -50%;
}

.blip {
    position: absolute;
    left: var(--x);
    top: var(--y);
}

/* Hover area wider than the dot; permanent ring for alerts */
.blip::after {
    content: '';
    position: absolute;
    left: -11px;
    top: -11px;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--k);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s, scale 0.25s var(--ease), border-color 0.2s;
}

.blip[data-kind="alert"]::after {
    opacity: 0.55;
}

.blip.is-active,
.blip:hover {
    z-index: 3;
}

.blip.is-active::after {
    border-color: #E6F6F7;
    border-width: 2px;
    opacity: 1;
    scale: 1.2;
}

.blip-label {
    position: absolute;
    left: 13px;
    top: var(--ly, 0px);
    display: none;
    max-width: 9.5rem;
    overflow: hidden;
    color: #E6F6F7;
    font-size: 0.78rem;
    font-weight: 650;
    font-stretch: 87.5%;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 6px rgb(0 0 0 / 0.8);
    translate: 0 -50%;
    pointer-events: none;
}

.blip.is-left .blip-label {
    left: auto;
    right: 13px;
}

.blip.is-labeled .blip-label,
.blip.is-active .blip-label,
.blip:hover .blip-label {
    display: block;
}

.blip.is-active .blip-label,
.blip:hover .blip-label {
    padding: 0.15rem 0.45rem;
    background: rgb(6 22 28 / 0.92);
    border-radius: 4px;
    text-shadow: none;
    animation: none;
}

/* Legend laid out like the radar quarters */
.radar-legend {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.radar-keys {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.4rem 2rem;
    color: var(--ink);
    font-weight: 600;
    font-stretch: 87.5%;
}

.radar-keys li {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.radar-keys li:nth-child(odd) {
    justify-self: end;
}

.radar-keys li:nth-child(even) {
    justify-self: start;
}

.radar-keys li::before {
    box-shadow: 0 0 0 4px var(--socket), 0 0 0 5px rgb(60 198 206 / 0.3);
}

.radar-legend p {
    max-width: 30ch;
    font-size: 0.85rem;
    text-wrap: balance;
}

/* Each dot lights up as the sweep passes over it (delay = dot angle) */
@media (prefers-reduced-motion: no-preference) {
    .radar-sweep {
        animation: spin var(--sweep) linear infinite;
    }

    .blip::before {
        animation: blip-dot var(--sweep) linear infinite;
        animation-delay: calc(var(--a) / 360 * var(--sweep) - var(--sweep));
    }

    .blip-label {
        animation: blip-label var(--sweep) linear infinite;
        animation-delay: calc(var(--a) / 360 * var(--sweep) - var(--sweep));
    }
}

@keyframes blip-dot {
    0% {
        opacity: 1;
        scale: 1.6;
    }
    15% {
        scale: 1;
    }
    75%, 100% {
        opacity: 0.35;
    }
}

@keyframes blip-label {
    0% { opacity: 1; }
    75%, 100% { opacity: 0.6; }
}

/* ==========================================================================
   LABS
   ========================================================================== */
.blocks {
    display: grid;
    gap: 1.25rem;
}

.block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.block:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: 0 22px 44px -24px color-mix(in srgb, var(--accent) 75%, transparent);
}

.block-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.9rem;
    align-items: center;
}

.block-icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 10px;
    font-size: 1.2rem;
    transition: background-color 0.3s, color 0.3s, rotate 0.3s var(--ease);
}

.block:hover .block-icon {
    background: var(--accent);
    color: var(--accent-ink);
    rotate: -8deg;
}

.block h3 {
    font-size: 1.35rem;
    font-weight: 750;
    font-stretch: 112%;
    line-height: 1.15;
}

.block-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.35;
}

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

.block .collection {
    margin-top: auto;
}

@media (min-width: 40em) and (max-width: 59.99em) {
    .block {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 2rem;
        align-items: end;
    }

    .block-head,
    .block-desc {
        grid-column: 1;
    }

    .block .collection {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: end;
    }

    .block .collection[open] {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}

@media (min-width: 60em) {
    .blocks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* DOCUMENT TREE (shown without JS) */
.collection > summary {
    list-style: none;
}

.collection > summary::-webkit-details-marker {
    display: none;
}

.collection[open] > summary .fa-folder-open::before,
.collection[open] > summary .fa-folder-tree::before {
    content: "\f07c";
}

.tree-panel,
.collection > .tree {
    margin-top: 1rem;
}

.tree-note {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.925rem;
}

.tree,
.tree ul {
    display: grid;
    gap: 0.1rem;
}

.tree ul {
    margin: 0.1rem 0 0.4rem 0.6rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--line);
}

.tree summary,
.tree a {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    padding: 0.35rem 0.3rem;
    border-radius: 6px;
    line-height: 1.35;
    text-decoration: none;
}

.tree summary {
    list-style: none;
    font-weight: 650;
    cursor: pointer;
}

.tree summary::-webkit-details-marker {
    display: none;
}

.tree summary:hover,
.tree a:hover {
    background: var(--surface-2);
}

.tree summary::before,
.tree a::before {
    flex: none;
    width: 1.1em;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    text-align: center;
}

.tree summary::before {
    content: "\f07b";
    color: var(--folder);
}

.tree details[open] > summary::before {
    content: "\f07c";
}

.tree a::before {
    content: "\f1c1";
    color: var(--pdf);
}

.tree a[data-type="video"]::before {
    content: "\f1c8";
    color: var(--video);
}

.tree a[data-type="code"]::before {
    content: "\f1c9";
    color: var(--code);
}

/* ==========================================================================
   DOWNLOAD CV & CONTACTS
   ========================================================================== */
.contact {
    padding-block: clamp(4rem, 10vw, 7rem);
    background:
        radial-gradient(ellipse at 50% 130%, rgb(60 198 206 / 0.3), transparent 60%),
        var(--band);
    color: var(--band-ink);
    text-align: center;
}

.contact-title {
    font-size: clamp(2.25rem, 1.3rem + 4vw, 4.75rem);
    font-weight: 800;
    font-stretch: 125%;
    line-height: 1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.contact-desc {
    max-width: 46ch;
    margin: 1.25rem auto 0;
    color: var(--band-muted);
    font-size: 1.125rem;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.25rem;
}

.contact .btn-primary {
    background: var(--band-accent);
    color: var(--band-accent-ink);
}

.contact .btn-primary:hover {
    background: var(--band-ink);
}

.btn-inverse {
    border-color: var(--band-muted);
    color: var(--band-ink);
}

.btn-inverse:hover {
    border-color: var(--band-ink);
    background: var(--band-ink);
    color: var(--band);
}

@media (max-width: 30em) {
    .contact-actions .btn {
        flex: 1 1 100%;
    }
}

/* FOOTER */
.footer {
    padding-block: 1.5rem;
    background: var(--band);
    color: var(--band-muted);
    border-top: 1px solid rgb(255 255 255 / 0.1);
    font-size: 0.925rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
}

.footer-links a {
    text-decoration: none;
    overflow-wrap: anywhere;
}

.footer-links a:hover {
    color: var(--band-ink);
    text-decoration: underline;
}

/* ==========================================================================
   DIALOGS (<dialog>)
   ========================================================================== */
.modal {
    width: min(64rem, 100% - 2rem);
    max-width: none;
    height: min(52rem, 100% - 2rem);
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.modal[open] {
    display: flex;
    flex-direction: column;
}

.modal::backdrop {
    background: var(--backdrop);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

@media (prefers-reduced-motion: no-preference) {
    .modal[open] {
        animation: modal-in 0.25s var(--ease);
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-title span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modal-title .fa-file-pdf {
    color: var(--pdf);
}

@media (max-width: 40em) {
    .modal {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }
}

/* FILE EXPLORER */
.explorer-path {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.9rem;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.875rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.explorer-body {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    align-content: start;
    gap: 0.5rem;
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.explorer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 0.5rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 550;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.explorer-item:hover {
    background: var(--surface-2);
    border-color: var(--line);
}

.explorer-item i {
    font-size: 2.75rem;
}

.icon-folder { color: var(--folder); }
.icon-pdf { color: var(--pdf); }
.icon-video { color: var(--video); }
.icon-code { color: var(--code); }

/* On small screens: list view, easier to read than the icon grid */
@media (max-width: 40em) {
    .explorer-body {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0.5rem;
    }

    .explorer-item {
        flex-direction: row;
        gap: 0.9rem;
        padding: 0.8rem 0.75rem;
        font-size: 1rem;
        text-align: left;
    }

    .explorer-item i {
        flex: none;
        width: 1.75rem;
        font-size: 1.5rem;
        text-align: center;
    }
}

/* PDF VIEWER MODAL */
.pdf-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #525659;
}

@media (max-width: 30em) {
    #pdfDownloadBtn .label-long {
        display: none;
    }
}

/* PROTECTED ACCESS WARNING */
.modal-sm {
    width: min(27rem, 100% - 2rem);
    height: fit-content;
    border-radius: var(--radius);
}

@media (max-width: 40em) {
    .modal-sm {
        width: calc(100% - 2rem);
        height: fit-content;
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }
}

.modal-body-center {
    position: relative;
    padding: 2.5rem 1.75rem 1.75rem;
    text-align: center;
}

.modal-corner {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.warning-icon {
    display: inline-grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    font-size: 1.4rem;
}

.warning-heading {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    font-weight: 750;
    font-stretch: 112%;
}

.warning-text {
    margin-bottom: 1.5rem;
    color: var(--muted);
}

.warning-actions {
    display: grid;
    gap: 0.6rem;
}

/* ==========================================================================
   SCROLL REVEALS
   Only main.js adds .is-pending, and only to elements still below the
   viewport: without JavaScript, everything stays visible.
   ========================================================================== */
.is-pending {
    opacity: 0;
}

.is-revealed {
    animation: reveal 0.8s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 110ms);
}

@keyframes reveal {
    from {
        opacity: 0;
        translate: 0 2.25rem;
    }
}

/* Off-screen illustrations: animations paused */
.is-paused,
.is-paused *,
.is-paused *::before,
.is-paused *::after {
    animation-play-state: paused !important;
}

@media print {
    .is-pending {
        opacity: 1;
    }
}

/* ==========================================================================
   404 PAGE (src/pages/404.astro)
   ========================================================================== */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.25rem;
    min-height: 100vh;
    min-height: 100dvh;
    padding-block: 3rem;
}

.not-found h1 {
    font-size: clamp(2.5rem, 1.5rem + 5vw, 4.5rem);
    font-weight: 820;
    font-stretch: 125%;
    line-height: 1;
    letter-spacing: -0.03em;
}

.not-found p {
    max-width: 44ch;
    color: var(--muted);
}

/* ==========================================================================
   ACCESSIBILITY: REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
