/*
FEATURES : sections ajoutees au portfolio (chargees apres style.css).
1. Badge de disponibilite (accueil)
2. Globe reseau 3D (accueil)
3. Terminal interactif (accueil)
4. Parcours de formation en diagramme (a propos)
5. Grille de projets avec filtres et apercus (projets)
6. Cartes "Explorer le site" (accueil)
7. Page contact : formulaire, liens directs et retour d'experience
9. Page competences : ce que j'apporte a une equipe, puis competences par domaine
8. Animations : cartes qui s'inclinent vers le curseur, sections qui se redressent au defilement
Les couleurs reprennent les variables de style.css pour suivre les modes clair et sombre.
*/
:root {
    --threat: rgb(255, 117, 135);
    --globe-dot: #63ead3;
    --globe-node: #edf3ff;
    --globe-arc: #63ead3;
    --globe-packet: #edf3ff;
    --globe-threat: #ff7587;
    --globe-ring: #b0a0ff;
    --globe-ocean-light: #173a55;
    --globe-ocean-dark: #070c19;
    --globe-shade: rgba(3, 6, 14, 0.82);
    --globe-atmosphere: rgba(99, 234, 211, 0.3);
    --globe-grid: rgba(170, 225, 240, 0.085);
    --globe-glow: rgba(99, 234, 211, 0.1);
    --accent-soft: rgba(99, 234, 211, 0.3);
    --accent-glow: rgba(99, 234, 211, 0.45);
}

:root[data-theme="light"] {
    --threat: #c02a47;
    --globe-dot: var(--lm-accent);
    --globe-node: var(--lm-text);
    --globe-arc: var(--lm-accent);
    --globe-packet: var(--lm-text);
    --globe-threat: #c02a47;
    --globe-ring: #7051ba;
    --globe-ocean-light: #ffffff;
    --globe-ocean-dark: #cfe2ee;
    --globe-shade: rgba(70, 100, 135, 0.34);
    --globe-atmosphere: rgba(8, 124, 107, 0.2);
    --globe-grid: rgba(25, 43, 64, 0.075);
    --globe-glow: rgba(8, 124, 107, 0.1);
    --accent-soft: rgba(8, 124, 107, 0.35);
    --accent-glow: rgba(8, 124, 107, 0.3);
}

/* 1. BADGE DE DISPONIBILITE */
.availability {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    margin: 0px 0px 22px;
    padding: 6px 14px;
    border: 1px solid var(--accent-soft);
    border-radius: 999px;
    background: var(--theme-color-4);
    color: var(--theme-color-15);
    font: 500 14px / 1.6 var(--font-mono);
    text-decoration: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.availability:hover {
    border-color: var(--theme-color-17);
    box-shadow: 0px 0px 18px var(--globe-glow);
}

.availability-dot {
    position: relative;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--theme-color-17);
}

.availability-dot::after {
    content: "";
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    background: var(--theme-color-17);
    animation: availability-ping 1.8s ease-out infinite;
}

@keyframes availability-ping {
    from { transform: scale(1); opacity: 0.6; }
    to { transform: scale(3); opacity: 0; }
}

/* 2. GLOBE RESEAU */
.network {
    display: grid;
    grid-template-columns: minmax(0px, 1fr) minmax(0px, 1fr);
    align-items: center;
    gap: 40px;
    padding: 30px 0px 34px;
    border-bottom: 1px solid var(--theme-color-21);
}

.network .panel-label {
    margin: 0px 0px 10px;
    font-family: var(--font-mono);
}

.network h2 {
    margin: 0px 0px 16px;
    font-size: clamp(26px, 2.4vw, 34px);
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.network h2 span {
    color: var(--theme-color-17);
}

.network-intro {
    max-width: 520px;
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 18px;
    line-height: 1.8;
}

.network-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0px, 1fr));
    gap: 12px;
    max-width: 520px;
    margin: 26px 0px 0px;
}

.network-stats > div {
    min-width: 0px;
    padding: 14px 16px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-20);
    border-radius: 8px;
}

.network-stats dt {
    color: var(--theme-color-16);
    font: 500 12px / 1.5 var(--font-mono);
    letter-spacing: 1px;
}

.network-stats dd {
    margin: 6px 0px 0px;
    color: var(--theme-color-17);
    font: 600 26px / 1.2 var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.network-stats .is-threat dd {
    color: var(--threat);
}

.network-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 20px 0px 0px;
    padding: 0px;
    list-style: none;
    color: var(--theme-color-16);
    font: 14px / 1.6 var(--font-mono);
}

.network-legend li {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.network-legend li::before {
    content: "";
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--globe-node);
}

.network-legend .legend-traffic::before {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--globe-arc);
}

.network-legend .legend-shield::before {
    width: 12px;
    height: 12px;
    background: transparent;
    border: 2px solid var(--globe-ring);
}

.network-legend .legend-threat::before {
    background: var(--globe-threat);
}

.network-stage {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
}

#globe {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

#globe.is-dragging {
    cursor: grabbing;
}

.network-hint {
    position: absolute;
    right: 0px;
    bottom: -6px;
    left: 0px;
    margin: 0px;
    color: var(--theme-color-23);
    font: 13px / 1.6 var(--font-mono);
    text-align: center;
    pointer-events: none;
}

@media (max-width: 1100px) {
    .network {
        grid-template-columns: minmax(0px, 1fr);
        gap: 12px;
    }

    .network-stage {
        max-width: 420px;
    }

    .network-intro, .network-stats {
        max-width: none;
    }
}

@media (max-width: 600px) {
    .network {
        padding: 26px 0px 30px;
    }

    .network-intro {
        font-size: 16px;
    }

    .network-stats {
        gap: 8px;
    }

    .network-stats > div {
        padding: 12px 10px;
    }

    .network-stats dt {
        font-size: 10.5px;
        letter-spacing: 0.4px;
    }

    .network-stats dd {
        font-size: 21px;
    }

    .availability {
        font-size: 13px;
    }
}

/* 3. TERMINAL INTERACTIF */
.terminal.is-interactive .terminal-content {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-color-20) transparent;
    cursor: text;
}

.terminal [hidden] {
    display: none !important;
}

.home-layout .terminal-content .terminal-line {
    margin: 0px 0px 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal-line.is-output {
    color: var(--theme-color-24);
}

.terminal-line.is-error {
    color: var(--threat);
}

.terminal-log:not(:empty) {
    margin-bottom: 8px;
}

.terminal-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-input {
    flex: 1;
    min-width: 0px;
    padding: 0px;
    background: transparent;
    border: 0px;
    outline: 0px;
    color: inherit;
    font: inherit;
    caret-color: var(--theme-color-17);
}

.terminal-input::placeholder {
    color: var(--theme-color-23);
    opacity: 0.75;
}

.terminal.is-interactive:focus-within {
    border-color: var(--theme-color-17);
    box-shadow: 0px 0px 0px 1px var(--theme-color-17), 0px 0px 28px var(--globe-glow);
}

.terminal-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--theme-color-21);
    color: var(--theme-color-23);
    font: 13px / 1.6 var(--font-mono);
}

.terminal-hint {
    margin-right: 4px;
}

.terminal-footer button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-20);
    border-radius: 999px;
    color: var(--theme-color-17);
    font: 600 14px / 1.6 var(--font-mono);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.terminal-footer button::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}

.terminal-footer button:hover {
    background: var(--theme-color-11);
    border-color: var(--theme-color-17);
}

:root[data-theme="light"] .terminal-footer button {
    background: var(--lm-accent-soft);
    border-color: rgba(8, 124, 107, 0.28);
    color: #0b5c50;
}

:root[data-theme="light"] .terminal-footer button:hover {
    background: #d2eee6;
    border-color: var(--lm-accent);
}

.terminal-footer button:focus-visible {
    outline: var(--theme-color-17) solid 2px;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    /* 16px evite le zoom automatique d'iOS quand on touche le champ. */
    .terminal-input {
        font-size: 16px;
    }

    .terminal-footer {
        padding: 10px 16px;
    }
}

/* 4. PARCOURS DE FORMATION */
.about-page .journey-section {
    text-align: left;
    background: radial-gradient(ellipse at 100% 0, var(--globe-glow), transparent 55%), var(--theme-color-18);
}

.journey-section > .panel-label {
    font-family: var(--font-mono);
}

.about-page .journey-section > h2 {
    margin-bottom: 8px;
    font-size: clamp(24px, 2.3vw, 30px);
}

.about-page .journey-section > .journey-lead {
    margin: 0px;
    color: var(--theme-color-16);
}

.journey {
    position: relative;
    margin-top: 38px;
}

.journey-svg {
    position: absolute;
    inset: 0px;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.journey-track {
    fill: none;
    stroke: var(--theme-color-20);
    stroke-width: 2;
    stroke-dasharray: 4 8;
}

.journey-line {
    fill: none;
    stroke: var(--theme-color-17);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0px 0px 7px var(--accent-glow));
}

.journey-list {
    position: relative;
    display: grid;
    gap: 46px;
    margin: 0px;
    padding: 0px;
    list-style: none;
}

.journey-step {
    display: flex;
    align-items: center;
    gap: 22px;
    width: 58%;
}

.journey-step:nth-child(even) {
    flex-direction: row-reverse;
    margin-left: auto;
    text-align: right;
}

.journey-node {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-20);
    border-radius: 50%;
    box-shadow: 0px 0px 0px 6px var(--theme-color-18);
    color: var(--theme-color-17);
    font: 600 14px / 1 var(--font-mono);
    transition: background-color 0.45s, border-color 0.45s, color 0.45s, box-shadow 0.45s;
}

.journey-card {
    flex: 1;
    min-width: 0px;
    padding: 20px 22px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-20);
    border-radius: 12px;
    transition: border-color 0.25s, box-shadow 0.25s, opacity 0.6s;
}

.journey-card:hover {
    border-color: var(--theme-color-17);
    box-shadow: 0px 0px 22px var(--globe-glow);
}

.about-page .journey-card .journey-date {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin: 0px;
    font: 14px / 1.6 var(--font-mono);
}

.journey-step:nth-child(even) .journey-date {
    justify-content: flex-end;
}

.journey-year {
    color: var(--theme-color-17);
    font-weight: 600;
}

.journey-place {
    color: var(--theme-color-23);
}

.journey-card h3 {
    margin: 6px 0px 8px;
    font-size: 19px;
    line-height: 1.45;
}

.about-page .journey-card > p:last-child {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.75;
}

/* Avec JavaScript, chaque etape s'allume quand la ligne l'atteint. */
.journey.is-live .journey-card {
    opacity: 0.5;
}

.journey.is-live .is-reached .journey-card {
    opacity: 1;
}

.journey.is-live .is-reached .journey-node {
    background: var(--theme-color-17);
    border-color: var(--theme-color-17);
    color: var(--theme-color-18);
    box-shadow: 0px 0px 0px 6px var(--theme-color-18), 0px 0px 26px var(--accent-glow);
}

@media (max-width: 1000px) {
    .journey-step {
        width: 74%;
    }
}

@media (max-width: 760px) {
    .journey {
        margin-top: 28px;
    }

    .journey-list {
        gap: 26px;
    }

    .journey-step, .journey-step:nth-child(even) {
        flex-direction: row;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
        margin-left: 0px;
        text-align: left;
    }

    .journey-step:nth-child(even) .journey-date {
        justify-content: flex-start;
    }

    .journey-node {
        width: 40px;
        height: 40px;
        margin-top: 14px;
        font-size: 12px;
        box-shadow: 0px 0px 0px 4px var(--theme-color-18);
    }

    .journey.is-live .is-reached .journey-node {
        box-shadow: 0px 0px 0px 4px var(--theme-color-18), 0px 0px 20px var(--accent-glow);
    }

    .journey-card {
        padding: 16px 18px;
    }

    .journey-card h3 {
        font-size: 17px;
    }
}

/* 5. PROJETS : filtres, cartes illustrees et fenetre d'apercu */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0px;
}

.projects-section {
    text-align: left;
}

.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.project-filters button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 16px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-20);
    border-radius: 10px;
    color: var(--theme-color-7);
    font: 500 16px / 1.5 var(--font-mono);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.project-filters button:hover {
    border-color: var(--theme-color-17);
    color: var(--theme-color-17);
}

.project-filters button[aria-pressed="true"] {
    background: linear-gradient(120deg, var(--theme-color-10), rgb(71, 229, 255));
    border-color: transparent;
    color: rgb(4, 27, 25);
    box-shadow: rgba(50, 245, 162, 0.22) 0px 3px 18px;
}

:root[data-theme="light"] .project-filters button[aria-pressed="true"] {
    background: linear-gradient(120deg, #4fdcaa, rgb(71, 229, 255));
}

.project-filters button:focus-visible, .tile-open:focus-visible, .preview-close:focus-visible {
    outline: var(--theme-color-17) solid 2px;
    outline-offset: 3px;
}

.filter-count {
    min-width: 24px;
    padding: 0px 6px;
    background: var(--theme-color-11);
    border-radius: 6px;
    color: var(--theme-color-16);
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.project-filters button[aria-pressed="true"] .filter-count {
    background: rgba(4, 27, 25, 0.16);
    color: rgb(4, 27, 25);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0px, 1fr));
    gap: 24px;
    margin: 0px;
    padding: 0px;
    list-style: none;
}

.project-tile[hidden] {
    display: none;
}

.project-tile > article {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--theme-gradient), var(--theme-gradient));
    border: 1px solid var(--theme-color-20);
    border-radius: 16px;
    box-shadow: rgba(0, 0, 0, 0.267) 0px 10px 30px, rgba(255, 255, 255, 0.03) 0px 1px inset;
    transition: border-color 0.25s, box-shadow 0.25s;
}

:root[data-theme="light"] .project-tile > article {
    box-shadow: rgba(35, 65, 80, 0.1) 0px 10px 30px;
}

.project-tile.is-entering > article {
    animation: tile-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

@keyframes tile-in {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to { opacity: 1; transform: none; }
}

.tile-cover {
    position: relative;
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0d1a2e;
}

.tile-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease-out;
}

.tile-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 3px 12px;
    background: rgba(8, 13, 27, 0.78);
    border: 1px solid rgba(99, 234, 211, 0.22);
    border-radius: 999px;
    color: #edf3ff;
    font: 500 13px / 1.7 var(--font-mono);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.tile-status {
    right: 14px;
    left: auto;
    color: #63ead3;
}

.tile-status.is-progress {
    background: #63ead3;
    border-color: #63ead3;
    color: #07201d;
}

.tile-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.tile-body h3 {
    margin: 0px 0px 8px;
    font-size: 20px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.tile-body > p {
    flex: 1;
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.7;
}

.tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0px 0px;
    padding: 0px;
    list-style: none;
}

.tile-tags li {
    padding: 3px 10px;
    background: rgba(99, 234, 211, 0.027);
    border: 1px solid rgba(99, 234, 211, 0.157);
    border-radius: 6px;
    color: var(--theme-color-5);
    font: 500 13.5px / 1.6 var(--font-mono);
    font-variant-ligatures: none;
}

:root[data-theme="light"] .tile-tags li {
    border-color: rgba(8, 124, 107, 0.25);
}

:root[data-theme="light"] .tile-cover {
    background: var(--lm-accent-soft);
}

:root[data-theme="light"] .tile-badge {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(8, 124, 107, 0.28);
    color: #0b3a34;
    box-shadow: rgba(35, 65, 80, 0.12) 0px 4px 12px;
}

:root[data-theme="light"] .tile-status {
    color: #06705f;
}

:root[data-theme="light"] .tile-status.is-progress {
    background: var(--lm-accent);
    border-color: var(--lm-accent);
    color: #ffffff;
}

.tile-open {
    align-self: flex-start;
    margin-top: 22px;
    padding: 0px;
    background: none;
    border: 0px;
    color: var(--theme-color-17);
    font: 600 16px / 1.65 var(--font-sans);
    cursor: pointer;
}

.tile-open span {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.25s;
}

.tile-open:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .project-tile > article:hover {
        transform: translateY(-5px);
        border-color: var(--theme-color-17);
        box-shadow: rgba(0, 0, 0, 0.333) 0px 14px 32px, rgba(99, 234, 211, 0.17) 0px 0px 22px;
    }

    .project-tile > article:hover .tile-cover img {
        transform: scale(1.05);
    }

    .tile-open:hover span {
        transform: translate(3px, -3px);
    }
}

/* Fenetre d'apercu : element <dialog> natif (touche Echap, focus garde a l'interieur). */
.project-preview {
    width: min(760px, calc(100% - 32px));
    max-height: min(90dvh, 900px);
    padding: 0px;
    overflow: hidden;
    background: var(--theme-color-18);
    border: 1px solid var(--accent-soft);
    border-radius: 18px;
    box-shadow: rgba(0, 0, 0, 0.5) 0px 30px 80px, 0px 0px 40px var(--globe-glow);
    color: var(--theme-color-15);
    text-align: left;
}

.project-preview[open] {
    display: flex;
    flex-direction: column;
    animation: preview-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-preview::backdrop {
    background: rgba(8, 13, 27, 0.72);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: backdrop-in 0.3s ease-out;
}

@keyframes preview-in {
    from { opacity: 0; transform: translateY(26px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.preview-top {
    position: relative;
    flex-shrink: 0;
}

.preview-top .tile-cover {
    aspect-ratio: 16 / 7;
}

.preview-close {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: rgba(8, 13, 27, 0.82);
    border: 1px solid rgba(99, 234, 211, 0.3);
    border-radius: 50%;
    color: #edf3ff;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.preview-close:hover {
    background: #63ead3;
    color: #07201d;
    transform: rotate(90deg);
}

.preview-body {
    padding: 26px 30px 30px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.preview-stack {
    margin: 0px 0px 8px;
    color: var(--theme-color-17);
    font: 500 14px / 1.6 var(--font-mono);
}

.preview-body h3 {
    margin: 0px 0px 10px;
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.preview-summary {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 18px;
    line-height: 1.7;
}

.preview-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0px, 1fr));
    gap: 14px;
    margin: 24px 0px 0px;
}

.preview-details > div {
    padding: 16px 18px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-21);
    border-radius: 12px;
}

.preview-details dt {
    color: var(--theme-color-15);
    font-weight: 600;
}

.preview-details dd {
    margin: 4px 0px 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.7;
}

.preview-body .button {
    margin-top: 24px;
}

/* La page ne defile pas derriere un apercu ouvert. */
html:has(.project-preview[open]) {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0px, 1fr));
    }
}

@media (max-width: 680px) {
    .projects-grid {
        grid-template-columns: minmax(0px, 1fr);
        gap: 20px;
    }

    .project-filters {
        gap: 8px;
        margin-bottom: 22px;
    }

    .project-filters button {
        padding: 6px 12px;
        font-size: 15px;
    }

    .preview-top .tile-cover {
        aspect-ratio: 16 / 9;
    }

    .preview-body {
        padding: 20px 20px 24px;
    }

    .preview-details {
        grid-template-columns: minmax(0px, 1fr);
    }

    .preview-summary {
        font-size: 16px;
    }
}

/* 6. EXPLORER LE SITE : quatre cartes vers les autres pages */
.explore {
    margin-top: 48px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0px, 1fr));
    gap: 20px;
    margin: 0px;
    padding: 0px;
    list-style: none;
}

.explore-grid a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 22px;
    background: var(--theme-color-3);
    border: 1px solid var(--theme-color-21);
    border-radius: 14px;
    color: var(--theme-color-15);
    text-decoration: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.explore-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 20px;
    /* Outline glow: dark tile, thin cyan border, cyan icon with a soft halo. */
    background: rgba(99, 234, 211, 0.06);
    border: 1px solid rgba(99, 234, 211, 0.45);
    border-radius: 13px;
    color: var(--theme-color-17);
    box-shadow: 0px 0px 18px rgba(99, 234, 211, 0.18), inset 0px 0px 12px rgba(99, 234, 211, 0.08);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
}

:root[data-theme="light"] .explore-icon {
    background: rgba(8, 124, 107, 0.06);
    border-color: rgba(8, 124, 107, 0.45);
    box-shadow: 0px 0px 14px rgba(8, 124, 107, 0.12), inset 0px 0px 10px rgba(8, 124, 107, 0.06);
}

.explore-grid h3 {
    margin: 0px 0px 8px;
    font-size: 20px;
    line-height: 1.4;
}

.explore-arrow {
    display: inline-block;
    margin-left: 4px;
    color: var(--theme-color-17);
    font-size: 17px;
    transition: transform 0.25s;
}

.explore-grid p {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.7;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .explore-grid a:hover {
        transform: translateY(-5px);
        border-color: var(--theme-color-17);
        box-shadow: rgba(0, 0, 0, 0.333) 0px 14px 32px, rgba(99, 234, 211, 0.17) 0px 0px 22px;
    }

    .explore-grid a:hover .explore-icon {
        transform: translateY(-2px) rotate(-6deg);
        border-color: var(--theme-color-17);
        box-shadow: 0px 0px 24px rgba(99, 234, 211, 0.32), inset 0px 0px 14px rgba(99, 234, 211, 0.12);
    }

    .explore-grid a:hover .explore-arrow {
        transform: translate(3px, -3px);
    }
}

@media (max-width: 1200px) {
    .explore-grid {
        grid-template-columns: repeat(2, minmax(0px, 1fr));
    }
}

@media (max-width: 600px) {
    .explore {
        margin-top: 32px;
    }

    .explore-grid {
        gap: 14px;
    }

    .explore-grid a {
        padding: 18px;
    }

    .explore-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 14px;
        border-radius: 11px;
    }

    .explore-grid h3 {
        font-size: 18px;
    }

    .explore-grid p {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* 7. CONTACT : formulaire a gauche, liens directs et retour d'experience a droite */
.reach-grid {
    display: grid;
    grid-template-columns: minmax(0px, 1fr) minmax(0px, 1fr);
    align-items: stretch;
    gap: 28px;
    margin-top: 36px;
    text-align: left;
}

/* Les deux colonnes sont deux cartes identiques : meme haut, meme hauteur, meme largeur. */
.reach-form, .reach-side {
    padding: 28px;
    background: linear-gradient(135deg, var(--theme-gradient), var(--theme-gradient));
    border: 1px solid var(--theme-color-20);
    border-radius: 16px;
    box-shadow: rgba(0, 0, 0, 0.267) 0px 10px 30px, rgba(255, 255, 255, 0.03) 0px 1px inset;
}

:root[data-theme="light"] .reach-form, :root[data-theme="light"] .reach-side {
    box-shadow: rgba(35, 65, 80, 0.1) 0px 10px 30px;
}

/* Les deux colonnes ont la meme hauteur : la zone de message s'etire pour
   remplir la carte, et le bouton reste en bas. */
.reach-form, .reach-side {
    display: flex;
    flex-direction: column;
}

.reach-form .message-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-top: 0px;
}

.reach-form .message-form > .message-field {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.reach-form .message-form > .message-field textarea {
    flex: 1;
}

.reach-form button.message-send {
    align-self: flex-start;
}

.reach-side {
    display: flex;
    flex-direction: column;
}

.form-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0px;
    padding: 10px 14px;
    background: var(--theme-color-4);
    border: 1px solid var(--accent-soft);
    border-radius: 10px;
    color: var(--theme-color-15);
    font-size: 15px;
    line-height: 1.6;
}

.form-mode[hidden] {
    display: none;
}

.form-mode-cancel {
    padding: 0px;
    background: none;
    border: 0px;
    color: var(--theme-color-17);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.reach-side h2 {
    margin: 0px 0px 18px;
    font-size: 20px;
    line-height: 1.4;
}

.reach-list {
    display: grid;
    gap: 12px;
    margin: 0px;
    padding: 0px;
    list-style: none;
}

.reach-row {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-20);
    border-radius: 14px;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.reach-link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 14px;
    min-width: 0px;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--theme-color-15);
    text-decoration: none;
}

.reach-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: var(--theme-color-4);
    border: 1px solid var(--accent-soft);
    border-radius: 10px;
    color: var(--theme-color-17);
}

.reach-text {
    display: grid;
    flex: 1;
    min-width: 0px;
}

.reach-text small {
    color: var(--theme-color-16);
    font-size: 14px;
    line-height: 1.5;
}

.reach-text strong {
    overflow: hidden;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reach-arrow {
    flex-shrink: 0;
    color: var(--theme-color-17);
    font-size: 18px;
    transition: transform 0.25s;
}

.reach-copy {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-right: 10px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-20);
    border-radius: 10px;
    color: var(--theme-color-15);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.reach-copy:hover {
    border-color: var(--theme-color-17);
    color: var(--theme-color-17);
}

.reach-copy span {
    display: grid;
}

.reach-copy .copied-icon, .reach-copy.is-copied .copy-icon {
    display: none;
}

.reach-copy.is-copied .copied-icon {
    display: grid;
}

.reach-copy.is-copied {
    border-color: var(--theme-color-17);
    color: var(--theme-color-17);
}

.reach-copied span {
    position: absolute;
    top: -14px;
    right: 8px;
    padding: 2px 10px;
    background: var(--theme-color-17);
    border-radius: 6px;
    color: var(--theme-color-18);
    font: 600 13px / 1.7 var(--font-mono);
    pointer-events: none;
    animation: copied-in 0.2s ease-out;
}

.reach-copied span[hidden] {
    display: none;
}

@keyframes copied-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.reach-link:focus-visible, .reach-copy:focus-visible, .reach-feedback-button:focus-visible, .form-mode-cancel:focus-visible {
    outline: var(--theme-color-17) solid 2px;
    outline-offset: 3px;
}

.reach-feedback {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    margin-top: 18px;
    padding: 22px;
    border: 1px dashed var(--accent-soft);
    border-radius: 14px;
    background: var(--theme-color-12);
}

.reach-feedback h3 {
    margin: 0px 0px 8px;
    font-size: 18px;
    line-height: 1.4;
}

.reach-feedback p {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.7;
}

.reach-feedback-button {
    margin-top: 14px;
    padding: 0px;
    background: none;
    border: 0px;
    color: var(--theme-color-17);
    font: 600 16px / 1.65 var(--font-sans);
    cursor: pointer;
}

.reach-feedback-button span {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.25s;
}

.reach-feedback-button:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .reach-row:hover {
        transform: translateY(-2px);
        border-color: var(--theme-color-17);
        box-shadow: rgba(99, 234, 211, 0.14) 0px 0px 20px;
    }

    .reach-link:hover .reach-arrow, .reach-feedback-button:hover span {
        transform: translate(3px, -3px);
    }
}

@media (max-width: 1100px) {
    .reach-grid {
        grid-template-columns: minmax(0px, 1fr);
    }
}

@media (max-width: 600px) {
    .reach-grid {
        gap: 24px;
        margin-top: 26px;
    }

    .reach-form, .reach-side {
        padding: 20px 18px;
    }

    .reach-link {
        gap: 12px;
        padding: 12px;
    }

    .reach-feedback {
        padding: 18px;
    }
}

/* 9. COMPETENCES : six cartes de services, puis les competences groupees par domaine */
.services-section, .expertise-section {
    margin-top: 44px;
    text-align: left;
}

.expertise-section {
    margin-top: 72px;
}

.skills-heading {
    max-width: 640px;
    margin-bottom: 28px;
}

.skills-heading .panel-label {
    margin: 0px 0px 10px;
    font-family: var(--font-mono);
}

.skills-heading h2 {
    margin: 0px 0px 10px;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.skills-heading > p:last-child {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 18px;
    line-height: 1.7;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0px, 1fr));
    gap: 20px;
    margin: 0px;
    padding: 0px;
    list-style: none;
}

.service-card {
    padding: 24px;
    background: var(--theme-color-3);
    border: 1px solid var(--theme-color-21);
    border-radius: 16px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.service-card:hover {
    border-color: var(--theme-color-17);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 14px 32px, rgba(99, 234, 211, 0.15) 0px 0px 22px;
}

.service-card h3 {
    margin: 0px 0px 8px;
    font-size: 20px;
    line-height: 1.4;
}

.service-card p {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.7;
}

.skill-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0px, 1fr));
    gap: 30px 28px;
}

/* Deux feuilles decalees derriere chaque carte lui donnent de l'epaisseur. */
.skill-group {
    padding: 26px;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-20);
    border-radius: 18px;
    box-shadow:
        5px 5px 0px -1px var(--theme-color-18), 5px 5px 0px 0px var(--theme-color-20),
        10px 10px 0px -1px var(--theme-color-18), 10px 10px 0px 0px var(--theme-color-21);
    transition: border-color 0.25s;
}

.skill-group:hover {
    border-color: var(--theme-color-17);
}

.skill-group-programming, .skill-group-security {
    grid-column: 1 / -1;
}

.skill-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.skill-group h3 {
    margin: 0px;
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.skill-count {
    color: var(--theme-color-17);
    font: 500 14px / 1 var(--font-mono);
}

.skill-items {
    display: grid;
    gap: 26px 24px;
    margin: 0px;
    padding: 0px;
    list-style: none;
}

.skill-group-programming .skill-items {
    grid-template-columns: repeat(3, minmax(0px, 1fr));
}

.skill-group-security .skill-items {
    grid-template-columns: repeat(4, minmax(0px, 1fr));
}

.skill-item {
    min-width: 0px;
}

.skill-item h4 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0px 0px 6px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
}

.skill-learning {
    padding: 1px 9px;
    border: 1px solid var(--accent-soft);
    border-radius: 999px;
    color: var(--theme-color-17);
    font: 500 12.5px / 1.6 var(--font-mono);
}

.skill-item p {
    margin: 0px;
    color: var(--theme-color-16);
    font-size: 16px;
    line-height: 1.65;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0px 0px;
    padding: 0px;
    list-style: none;
}

.skill-tags li {
    padding: 2px 9px;
    background: rgba(99, 234, 211, 0.027);
    border: 1px solid rgba(99, 234, 211, 0.157);
    border-radius: 6px;
    color: var(--theme-color-5);
    font: 500 13px / 1.6 var(--font-mono);
    font-variant-ligatures: none;
}

:root[data-theme="light"] .skill-tags li {
    border-color: rgba(8, 124, 107, 0.25);
}

@media (max-width: 1150px) {
    .skill-group-security .skill-items {
        grid-template-columns: repeat(2, minmax(0px, 1fr));
    }
}

@media (max-width: 900px) {
    .service-grid {
        grid-template-columns: repeat(2, minmax(0px, 1fr));
    }

    .skill-groups {
        grid-template-columns: minmax(0px, 1fr);
    }

    .skill-group-programming .skill-items {
        grid-template-columns: minmax(0px, 1fr);
    }
}

@media (max-width: 600px) {
    .services-section {
        margin-top: 32px;
    }

    .expertise-section {
        margin-top: 52px;
    }

    .service-grid, .skill-group-security .skill-items {
        grid-template-columns: minmax(0px, 1fr);
    }

    .service-grid {
        gap: 14px;
    }

    .service-card {
        padding: 20px;
    }

    .skills-heading > p:last-child {
        font-size: 16px;
    }

    .skill-group {
        padding: 20px 18px;
        box-shadow:
            4px 4px 0px -1px var(--theme-color-18), 4px 4px 0px 0px var(--theme-color-20),
            8px 8px 0px -1px var(--theme-color-18), 8px 8px 0px 0px var(--theme-color-21);
    }

    .skill-groups {
        gap: 26px;
        padding-right: 8px;
    }

    .skill-group h3 {
        font-size: 21px;
    }
}

/* 8. ANIMATIONS */
/* Cartes inclinables : tilt.js regle l'angle ; ici, le halo qui suit le curseur. */
.tilt {
    position: relative;
    will-change: transform;
}

.tilt-light {
    position: absolute;
    inset: 0px;
    z-index: 1;
    border-radius: inherit;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--tilt-light), transparent 62%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}

.tilt.is-tilting > .tilt-light {
    opacity: 1;
}

:root {
    --tilt-light: rgba(99, 234, 211, 0.13);
}

:root[data-theme="light"] {
    --tilt-light: rgba(8, 124, 107, 0.1);
}

/* Sections qui se redressent en entrant dans l'ecran, comme si la camera
   avancait vers elles. Uniquement dans les navigateurs qui savent lier une
   animation au defilement ; ailleurs les sections apparaissent normalement. */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        /* Une section penchee depasse un peu sur les cotes : la page ne doit pas defiler en largeur. */
        html, body {
            overflow-x: clip;
        }

        .network, .technologies, .explore, .featured-work,
        .about-page .panel.section-space, .projects-section, .services-section {
            transform-origin: 50% 0%;
            animation: depth-in linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 70%;
        }
    }
}

@keyframes depth-in {
    from {
        opacity: 0.35;
        transform: perspective(1400px) rotateX(14deg) scale(0.94);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .availability-dot::after {
        animation: none;
    }

    .journey-node, .journey-card {
        transition: none;
    }

    .project-tile.is-entering > article, .project-preview[open], .project-preview::backdrop, .reach-copied span {
        animation: none;
    }
}

@media print {
    .network-stage, .terminal-form, .terminal-footer, .journey-svg {
        display: none;
    }

    .journey.is-live .journey-card {
        opacity: 1;
    }
}

/* About intro card: terminal style (approved mock A2) */
.intro-term {
    position: relative;
    padding: 0;
    overflow: hidden;
    background-color: #0f1729;
    background-image: linear-gradient(rgba(99, 234, 211, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 234, 211, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    border: 1px solid rgba(99, 234, 211, 0.28);
    box-shadow: 0 0 0 1px rgba(176, 160, 255, 0.08), 0 18px 60px rgba(0, 0, 0, 0.5), 0 0 50px rgba(99, 234, 211, 0.14);
}
.intro-term::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
    pointer-events: none;
}
.term-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #26334d;
    background: rgba(8, 13, 27, 0.8);
}
.term-bar i { width: 11px; height: 11px; border-radius: 3px; background: #35405d; }
.term-bar i:nth-child(1) { background: #63ead3; }
.term-bar i:nth-child(2) { background: #b0a0ff; }
.term-bar span { margin-left: 12px; font: 13px var(--font-mono); color: #97a8be; }
.term-bar b {
    margin-left: auto;
    font: 600 12px var(--font-mono);
    color: #080d1b;
    background: #32f5a2;
    border-radius: 999px;
    padding: 4px 10px;
}
.term-body { position: relative; padding: clamp(22px, 3vw, 34px); }
.term-cmd { font: 15px var(--font-mono); color: #63ead3; margin: 0 0 22px; }
.term-cmd span { color: #b0a0ff; }
.intro-term h2 { margin-bottom: 18px; }
.term-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.term-tags span {
    font: 500 13px var(--font-mono);
    color: #b0a0ff;
    border: 1px solid rgba(176, 160, 255, 0.4);
    border-radius: 6px;
    padding: 4px 9px;
}
.term-status {
    font: 16px/1.7 var(--font-mono);
    color: #a6b4cc;
    background: rgba(8, 13, 27, 0.6);
    border: 1px solid #26334d;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 0 22px;
}
.term-status b { color: #32f5a2; font-weight: 600; }
.intro-term .code-note { color: #63ead3; margin: 0; }

/* About: single intro card, left aligned (approved layout) */
.about-page .content-grid > .intro-term { grid-column: 1 / -1; width: 100%; max-width: 100%; }
.about-page .intro-term .term-body { text-align: left; }
.about-page .intro-term p, .about-page .intro-term h2 { text-align: left; margin-left: 0; margin-right: 0; }
.about-page .intro-term .term-tags { justify-content: flex-start; }
.about-page .intro-term .term-status { text-align: left; }
.about-page .intro-term .code-note { text-align: left; }

/* About: other experiences and CV, terminal style (approved mock S1) */
.exp-cmd { font: 15px var(--font-mono); color: #63ead3; margin: 0 0 16px; }
.exp-cmd span { color: #b0a0ff; }
.exp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.exp-file {
    background: #0b1222;
    border: 1px solid #26334d;
    border-left: 3px solid #63ead3;
    border-radius: 8px;
    padding: 18px 20px;
}
.exp-file-alt { border-left-color: #b0a0ff; }
.exp-file-name { font: 600 13px var(--font-mono); color: #b0a0ff; margin: 0 0 8px; }
.exp-file h3 { margin: 0 0 8px; }
.exp-file p { margin: 0; color: #a6b4cc; }
.cv-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cv-row h2 { margin-bottom: 8px; }
.cv-cmd { font: 15px var(--font-mono); color: #a6b4cc; margin: 0 0 8px; }
.cv-btn {
    font: 600 15px var(--font-mono);
    color: #080d1b;
    background: #63ead3;
    border-radius: 8px;
    padding: 12px 18px;
    box-shadow: 0 0 22px rgba(99, 234, 211, 0.35);
    text-decoration: none;
    white-space: nowrap;
}
@media (max-width: 700px) { .exp-list { grid-template-columns: 1fr; } }

/* About: CV block text aligned left */
.about-page .cv-row > div { text-align: left; }
.about-page .cv-row h2, .about-page .cv-row p, .about-page .cv-row .cv-cmd { text-align: left; margin-left: 0; margin-right: 0; }

/* Skills: learning log and next steps as terminal output (approved mock N3) */
.term-log {
    background-color: #0f1729;
    background-image: linear-gradient(rgba(99, 234, 211, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 234, 211, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    border: 1px solid rgba(99, 234, 211, 0.28);
    box-shadow: 0 0 50px rgba(99, 234, 211, 0.12);
}
.term-out {
    font: 15px/1.8 var(--font-mono);
    color: #a6b4cc;
    background: rgba(8, 13, 27, 0.7);
    border: 1px solid #26334d;
    border-radius: 10px;
    padding: 18px 22px;
    margin-top: 20px;
}
.term-entry { margin-bottom: 18px; }
.term-entry:last-child { margin-bottom: 0; }
.term-entry p { margin: 0; font-family: Inter, sans-serif; font-size: 16px; line-height: 1.6; color: #a6b4cc; }
.term-entry p:first-child { font-family: var(--font-mono); font-size: 15px; }
.term-tag { color: #b0a0ff; }
.term-title { color: #edf3ff; font-weight: 600; }
.term-bar { color: #32f5a2; margin-left: 8px; }
.term-line { margin: 0 0 6px; }
.term-line:last-child { margin-bottom: 0; }
.term-ok { color: #32f5a2; }
.term-todo { color: #63ead3; }
.term-next { color: #63ead3; text-shadow: 0 0 10px rgba(99, 234, 211, 0.4); }

/* Skills: terminal log layout fix (left aligned, progress on its own line) */
.term-log, .term-log h2, .term-log .exp-cmd { text-align: left; }
.term-entry p.term-head { font-family: var(--font-mono); font-size: 15px; margin: 0 0 6px; }
.term-entry p.term-progress { font-family: var(--font-mono); font-size: 15px; margin: 0 0 8px; color: #32f5a2; }
.term-bar { color: #32f5a2; margin-left: 0; letter-spacing: 0; }
.term-pct { color: #63ead3; margin-left: 12px; }
.term-entry p:not(.term-head):not(.term-progress) { text-align: left; }

/* Skills: light point before each step */
.term-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #63ead3; box-shadow: 0 0 10px rgba(99, 234, 211, 0.8); margin-right: 10px; vertical-align: middle; position: relative; top: -1px; }

/* Skills: progress bars that fill from empty to full, across the whole line */
.term-track {
    position: relative;
    display: inline-block;
    width: min(320px, 70%);
    height: 14px;
    vertical-align: middle;
    background: #08101f;
    border: 1px solid #26334d;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
}
.term-track::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #08101f calc(10% - 2px) 10%);
    pointer-events: none;
}
.term-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, #32f5a2, #63ead3);
    box-shadow: 0 0 14px rgba(50, 245, 162, 0.7);
}
@media (prefers-reduced-motion: no-preference) {
    .term-fill { transform-origin: left center; animation: term-fill-grow 1.8s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
    .term-entry:nth-child(1) .term-fill { animation-delay: 0.2s; }
    .term-entry:nth-child(2) .term-fill { animation-delay: 0.7s; }
    .term-entry:nth-child(3) .term-fill { animation-delay: 1.2s; }
    .term-line .term-fill { animation: none; }
}
@keyframes term-fill-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Skills: aligned checkboxes, the X pops in when a goal is done */
.term-box { display: inline-block; width: 3ch; margin-right: 12px; text-align: center; font-family: var(--font-mono); white-space: pre; }
.term-box::before { content: "["; color: #63ead3; }
.term-box::after { content: "]"; color: #63ead3; }
.term-box.term-done::before, .term-box.term-done::after { color: #32f5a2; }
.term-mark { display: inline-block; color: #32f5a2; font-weight: 600; }
.term-done .term-mark { text-shadow: 0 0 10px rgba(50, 245, 162, 0.7); }
@media (prefers-reduced-motion: no-preference) {
    .term-done .term-mark { animation: term-x-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
    .term-line:nth-child(1) .term-mark { animation-delay: 0.4s; }
    .term-line:nth-child(2) .term-mark { animation-delay: 1s; }
}
@keyframes term-x-pop {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Skills: the three goal lines type in from left to right */
@media (prefers-reduced-motion: no-preference) {
    .term-log .term-line { animation: term-line-reveal 1.1s steps(28, end) both; }
    .term-log .term-line:nth-child(1) { animation-delay: 0.1s; }
    .term-log .term-line:nth-child(2) { animation-delay: 0.9s; }
    .term-log .term-line:nth-child(3) { animation-delay: 1.7s; }
}
@keyframes term-line-reveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

/* LIGHT MODE FIXES
   1. The header tools (search, language, theme) sit on the right of the nav on wide screens: keep the nav clear of them. */
@media (min-width: 1100px) {
    header { padding-right: 360px; }
}

/* 2. Dark terminal panels keep a dark background in light mode, so their text needs light colours. */
:root[data-theme="light"] .intro-term { color: #a6b4cc; }
:root[data-theme="light"] .intro-term h2 { color: #edf3ff; }
:root[data-theme="light"] .intro-term .code-note { color: #63ead3; }
:root[data-theme="light"] .intro-term .term-cmd { color: #63ead3; }
:root[data-theme="light"] .intro-term .term-cmd span { color: #b0a0ff; }
:root[data-theme="light"] .exp-file h3 { color: #edf3ff; }
:root[data-theme="light"] .exp-file p { color: #a6b4cc; }
:root[data-theme="light"] .term-log { color: #a6b4cc; }
:root[data-theme="light"] .term-log h2 { color: #edf3ff; }
:root[data-theme="light"] .term-log .exp-cmd { color: #63ead3; }
:root[data-theme="light"] .term-log .exp-cmd span { color: #b0a0ff; }
:root[data-theme="light"] .term-title { color: #edf3ff; }
:root[data-theme="light"] .term-entry p { color: #a6b4cc; }
:root[data-theme="light"] .term-line { color: #a6b4cc; }
:root[data-theme="light"] .intro-term p,
:root[data-theme="light"] .exp-file p,
:root[data-theme="light"] .term-entry p,
:root[data-theme="light"] .term-line { color: #c5d1e4; }
:root[data-theme="light"] .term-entry p:first-child { color: #edf3ff; }

/* LIGHT MODE: terminal panels become light cards with dark text, so the code blocks match the page. */
:root[data-theme="light"] .intro-term,
:root[data-theme="light"] .term-log {
    background-color: var(--lm-surface);
    background-image: linear-gradient(rgba(11, 122, 102, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 122, 102, 0.05) 1px, transparent 1px);
    border: 1px solid var(--lm-border);
    box-shadow: 0 18px 50px rgba(20, 40, 70, 0.10);
}
:root[data-theme="light"] .intro-term::after { background: none; }
:root[data-theme="light"] .term-bar {
    background: var(--lm-surface-2);
    border-bottom: 1px solid var(--lm-border);
}
:root[data-theme="light"] .term-bar i { background: var(--lm-border); }
:root[data-theme="light"] .term-bar i:nth-child(1) { background: var(--lm-accent); }
:root[data-theme="light"] .term-bar i:nth-child(2) { background: #5b4bc4; }
:root[data-theme="light"] .term-bar span { color: #5a6b84; }
:root[data-theme="light"] .term-bar b { color: var(--lm-accent); background: var(--lm-accent-soft); border-color: #9fdfcd; }
:root[data-theme="light"] .intro-term h2,
:root[data-theme="light"] .term-log h2,
:root[data-theme="light"] .exp-file h3,
:root[data-theme="light"] .term-title,
:root[data-theme="light"] .term-entry p:first-child { color: #15202f; }
:root[data-theme="light"] .intro-term p,
:root[data-theme="light"] .term-log p,
:root[data-theme="light"] .exp-file p,
:root[data-theme="light"] .term-entry p,
:root[data-theme="light"] .term-line { color: var(--lm-text-2); }
:root[data-theme="light"] .intro-term .term-cmd,
:root[data-theme="light"] .term-log .exp-cmd,
:root[data-theme="light"] .intro-term .code-note,
:root[data-theme="light"] .term-todo,
:root[data-theme="light"] .term-next { color: var(--lm-accent); text-shadow: none; }
:root[data-theme="light"] .intro-term .term-cmd span,
:root[data-theme="light"] .term-log .exp-cmd span,
:root[data-theme="light"] .exp-file-name,
:root[data-theme="light"] .term-tags span,
:root[data-theme="light"] .term-tag { color: #5b4bc4; }
:root[data-theme="light"] .term-tags span { border-color: rgba(91, 75, 196, 0.35); background: #f3f0ff; }
:root[data-theme="light"] .term-status {
    background: var(--lm-surface-2);
    border-color: var(--lm-border);
    color: var(--lm-text-2);
}
:root[data-theme="light"] .term-status b,
:root[data-theme="light"] .term-ok,
:root[data-theme="light"] .term-done .term-mark,
:root[data-theme="light"] .term-box.term-done::before,
:root[data-theme="light"] .term-box.term-done::after { color: var(--lm-accent); text-shadow: none; }
:root[data-theme="light"] .term-box::before,
:root[data-theme="light"] .term-box::after { color: var(--lm-accent); }
:root[data-theme="light"] .term-dot { background: var(--lm-accent); box-shadow: none; }
:root[data-theme="light"] .term-bar { color: var(--lm-accent); }
:root[data-theme="light"] .term-pct { color: var(--lm-accent); }
:root[data-theme="light"] .term-progress { color: var(--lm-accent); }
:root[data-theme="light"] .term-out {
    background: var(--lm-surface-2);
    border-color: var(--lm-border);
    color: var(--lm-text-2);
}
:root[data-theme="light"] .exp-file {
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border);
    border-left: 3px solid var(--lm-accent);
}
:root[data-theme="light"] .exp-file-alt { border-left-color: #5b4bc4; }
:root[data-theme="light"] .term-track { background: var(--lm-surface-2); border-color: var(--lm-border); box-shadow: none; }
:root[data-theme="light"] .term-track::after { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #ffffff calc(10% - 2px) 10%); }
:root[data-theme="light"] .term-fill { background: linear-gradient(90deg, var(--lm-accent), #1fa98c); box-shadow: none; }
:root[data-theme="light"] .term-entry p.term-progress { color: var(--lm-accent); }

/* LIGHT MODE, option A "soft cards": white cards, soft shadow, stronger contrast */
:root[data-theme="light"] .service-card,
:root[data-theme="light"] section.skill-group,
:root[data-theme="light"] .journey-card {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    box-shadow: 0 6px 18px rgba(20, 40, 70, 0.08);
}
:root[data-theme="light"] .exp-cmd { color: var(--lm-accent); }
:root[data-theme="light"] .exp-cmd span { color: #5b4bc4; }
:root[data-theme="light"] .filter-count { background: var(--lm-accent-soft); color: var(--lm-accent); }
:root[data-theme="light"] .project-filters button[aria-pressed="true"] .filter-count { background: var(--lm-accent); color: #ffffff; }
:root[data-theme="light"] .tile-status.is-progress { background: #fff3d1; color: #7a4d00; border-color: #e0b44a; }

/* PREVIEW LINKS (project dialogs) */
.preview-links { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.preview-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid #0b7a66;
    color: #0b7a66;
    font: 600 14px var(--font-mono);
    text-decoration: none;
}
.preview-link:hover { background: #0b7a66; color: #ffffff; }
:root:not([data-theme="light"]) .preview-link { color: #63ead3; border-color: #63ead3; }
:root:not([data-theme="light"]) .preview-link:hover { background: #63ead3; color: #0a1020; }

/* 10. "WHAT'S NEXT?" CARD (end of the Home, About, Skills and Projects pages)
   The invitation is a rounded card with soft cyan and violet light, a gradient "hello."
   and a pill-shaped "Let's talk" button, as in the v2 design. Same HTML as before. */
.footer-invitation {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0 0 32px;
    padding: 40px 44px;
    border: 1px solid var(--theme-color-21);
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 10%, rgba(99, 234, 211, 0.16), transparent 42%),
        radial-gradient(circle at 42% 120%, rgba(176, 160, 255, 0.12), transparent 48%),
        var(--theme-color-18);
    box-shadow: 0px 20px 50px -24px rgba(0, 0, 0, 0.7);
}

.footer-kicker {
    margin: 0 0 12px;
    color: var(--theme-color-17);
    font: 600 12px/1.5 var(--font-mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.footer-kicker span {
    margin-right: 6px;
}

.footer-invitation h2 {
    font-size: clamp(32px, 3.6vw, 46px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.footer-invitation h2 span {
    background: linear-gradient(100deg, var(--theme-color-17), color-mix(in oklab, var(--theme-color-17) 55%, var(--theme-color-22)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

footer.portfolio-footer a.footer-hello {
    flex-shrink: 0;
    gap: 12px;
    padding: 12px 12px 12px 24px;
    border-radius: 999px;
    background: var(--theme-color-17);
    color: var(--theme-color-19);
    font: 600 16px/1 var(--font-sans);
    box-shadow: 0px 0px 40px -10px var(--theme-color-17);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s;
}

.footer-arrow {
    width: 36px;
    height: 36px;
    border: 0;
    background: rgba(0, 0, 0, 0.14);
    color: inherit;
    font-size: 16px;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

footer.portfolio-footer a.footer-hello:hover {
    transform: translateY(-2px);
    box-shadow: 0px 0px 48px -8px var(--theme-color-17);
}

a.footer-hello:hover .footer-arrow {
    background: rgba(0, 0, 0, 0.14);
    color: inherit;
    transform: rotate(45deg);
}

footer.portfolio-footer a.footer-hello:focus-visible {
    outline: 2px solid var(--theme-color-17);
    outline-offset: 3px;
}

:root[data-theme="light"] .footer-invitation {
    background:
        radial-gradient(circle at 92% 10%, rgba(8, 124, 107, 0.1), transparent 42%),
        radial-gradient(circle at 42% 120%, rgba(112, 81, 186, 0.08), transparent 48%),
        var(--theme-color-18);
    box-shadow: 0px 16px 40px -24px rgba(25, 43, 64, 0.35);
}

:root[data-theme="light"] footer.portfolio-footer a.footer-hello {
    color: #ffffff;
}

:root[data-theme="light"] .footer-arrow,
:root[data-theme="light"] a.footer-hello:hover .footer-arrow {
    background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 700px) {
    .footer-invitation {
        flex-direction: column;
        align-items: flex-start;
        gap: 22px;
        padding: 28px 24px;
        border-radius: 20px;
    }

    .footer-invitation h2 {
        font-size: 32px;
    }

    footer.portfolio-footer a.footer-hello {
        flex-direction: row;
        gap: 12px !important;
    }

    .footer-arrow {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    footer.portfolio-footer a.footer-hello,
    .footer-arrow {
        transition: none;
    }
}

/* 11. SECTION DIVIDERS ON EVERY PAGE
   The plain lines between the sections become a faint network wire with a small
   glowing data packet travelling along it. Used on every page:
   - Home: under the status strip, the intro and the live network;
   - Skills: between "What I do", "Skills and tools" and the learning log;
   - every page: above the footer and above the copyright line.
   Each wire starts at a different moment so the packets never move together. */
:root:has(.home-layout) .system-strip,
:root:has(.home-layout) .home-layout,
:root:has(.home-layout) section.network,
.skills-page .services-section,
.skills-page .expertise-section,
footer.portfolio-footer,
footer.portfolio-footer .footer-baseline {
    position: relative;
    border-bottom: 0;
}

footer.portfolio-footer,
footer.portfolio-footer .footer-baseline {
    border-top: 0;
}

:root:has(.home-layout) .system-strip::before,
:root:has(.home-layout) .home-layout::before,
:root:has(.home-layout) section.network::before,
.skills-page .services-section::before,
.skills-page .expertise-section::before,
footer.portfolio-footer::before,
footer.portfolio-footer .footer-baseline::before,
:root:has(.home-layout) .system-strip::after,
:root:has(.home-layout) .home-layout::after,
:root:has(.home-layout) section.network::after,
.skills-page .services-section::after,
.skills-page .expertise-section::after,
footer.portfolio-footer::after,
footer.portfolio-footer .footer-baseline::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* the wire */
:root:has(.home-layout) .system-strip::before,
:root:has(.home-layout) .home-layout::before,
:root:has(.home-layout) section.network::before,
.skills-page .services-section::before,
.skills-page .expertise-section::before,
footer.portfolio-footer::before,
footer.portfolio-footer .footer-baseline::before {
    height: 1px;
    background: color-mix(in srgb, var(--theme-color-17) 16%, transparent);
}

/* the packet */
:root:has(.home-layout) .system-strip::after,
:root:has(.home-layout) .home-layout::after,
:root:has(.home-layout) section.network::after,
.skills-page .services-section::after,
.skills-page .expertise-section::after,
footer.portfolio-footer::after,
footer.portfolio-footer .footer-baseline::after {
    height: 3px;
    margin-bottom: -1px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--theme-color-17)) no-repeat;
    background-size: 120px 3px;
    background-position: -120px 0;
    filter: drop-shadow(0 0 6px var(--theme-color-17));
    animation: section-packet 6s linear infinite;
}

/* The footer wires sit on its top edge (the sections' wires on their bottom edge) */
footer.portfolio-footer::before,
footer.portfolio-footer::after,
footer.portfolio-footer .footer-baseline::before,
footer.portfolio-footer .footer-baseline::after {
    top: 0;
    bottom: auto;
}

footer.portfolio-footer::after,
footer.portfolio-footer .footer-baseline::after {
    margin: -1px 0 0;
}

/* The Skills sections have no bottom padding of their own: leave air above the wire */
.skills-page .services-section,
.skills-page .expertise-section {
    padding-bottom: 48px;
}

:root:has(.home-layout) .home-layout::after { animation-delay: -1.5s; }
:root:has(.home-layout) section.network::after { animation-delay: -3s; }
.skills-page .expertise-section::after { animation-delay: -2s; }
footer.portfolio-footer::after { animation-delay: -4.5s; }
footer.portfolio-footer .footer-baseline::after { animation-delay: -1s; animation-direction: reverse; }

/* Without a "What's next?" card, the copyright line sits right under the footer wire:
   one wire is enough there. */
footer.portfolio-footer:not(:has(.footer-invitation)) .footer-baseline::before,
footer.portfolio-footer:not(:has(.footer-invitation)) .footer-baseline::after {
    content: none;
}

@keyframes section-packet {
    from { background-position: -120px 0; }
    to { background-position: calc(100% + 120px) 0; }
}

@media (prefers-reduced-motion: reduce) {
    :root:has(.home-layout) .system-strip::after,
    :root:has(.home-layout) .home-layout::after,
    :root:has(.home-layout) section.network::after,
    .skills-page .services-section::after,
    .skills-page .expertise-section::after,
    footer.portfolio-footer::after,
    footer.portfolio-footer .footer-baseline::after {
        animation: none;
        background-position: 50% 0;
    }
}

/* 12. RADAR AROUND THE GLOBE
   The globe sits in a radar screen: range rings, a crosshair, bearings and a beam
   that sweeps round. The globe colours turn radar green inside this section. */
.network {
    --radar: #5cf2b5;
    --radar-line: rgba(92, 242, 181, 0.16);
    --radar-beam: rgba(92, 242, 181, 0.28);
    --globe-dot: #5cf2b5;
    --globe-arc: #5cf2b5;
    --globe-ocean-light: #0b2a26;
    --globe-ocean-dark: #02080a;
    --globe-atmosphere: rgba(92, 242, 181, 0.22);
    --globe-grid: rgba(92, 242, 181, 0.14);
}

:root[data-theme="light"] .network {
    --radar: var(--lm-accent);
    --radar-line: rgba(10, 122, 92, 0.2);
    --radar-beam: rgba(10, 122, 92, 0.2);
    --globe-dot: var(--lm-accent);
    --globe-arc: var(--lm-accent);
    --globe-ocean-light: #ffffff;
    --globe-ocean-dark: #cdeee2;
    --globe-atmosphere: rgba(10, 122, 92, 0.2);
    --globe-grid: rgba(10, 122, 92, 0.12);
}

.radar {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.radar-rings,
.radar-cross,
.radar-sweep {
    position: absolute;
    border-radius: 50%;
}

.radar-rings {
    inset: 6%;
    background: repeating-radial-gradient(circle, transparent 0 calc(16.66% - 1px), var(--radar-line) calc(16.66% - 1px) 16.66%);
}

.radar-cross {
    inset: 6%;
    background:
        linear-gradient(var(--radar-line), var(--radar-line)) center / 1px 100% no-repeat,
        linear-gradient(var(--radar-line), var(--radar-line)) center / 100% 1px no-repeat;
}

.radar-sweep {
    inset: 15%;
    background: conic-gradient(from 0deg, transparent 0deg 290deg, var(--radar-beam) 358deg, transparent 360deg);
    mix-blend-mode: screen;
    animation: radar-sweep 4s linear infinite;
}

:root[data-theme="light"] .radar-sweep {
    mix-blend-mode: multiply;
}

.radar-tag {
    position: absolute;
    color: var(--radar);
    font: 500 10px / 1 var(--font-mono);
    letter-spacing: 1px;
}

.radar-north { top: 3%; left: 50%; transform: translateX(-50%); }
.radar-south { bottom: 5%; left: 50%; transform: translateX(-50%); }
.radar-east { top: 50%; right: 1%; transform: translateY(-50%); }
.radar-west { top: 50%; left: 1%; transform: translateY(-50%); }

@keyframes radar-sweep {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .radar-sweep {
        animation: none;
    }
}

/* 13. SKILLS AND TOOLS (Skills page), in the v2 style
   Area buttons filter the cards; each area has a "# title" rule and a two-column
   grid of cards with the tool's logo, a short text and tags. */
.skill-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 26px;
}

.skill-filter button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--theme-color-21);
    border-radius: 999px;
    color: var(--theme-color-16);
    font: 500 14px / 1.3 var(--font-sans);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.skill-filter button:hover {
    color: var(--theme-color-15);
}

.skill-filter button[aria-selected="true"] {
    background: rgba(99, 234, 211, 0.12);
    border-color: rgba(99, 234, 211, 0.45);
    color: var(--theme-color-17);
}

.skill-filter button:focus-visible {
    outline: 2px solid var(--theme-color-17);
    outline-offset: 2px;
}

.skill-total {
    margin-left: auto;
    color: var(--theme-color-16);
    font: 500 13px / 1 var(--font-mono);
}

.skill-areas {
    display: grid;
    gap: 40px;
}

.skill-area[hidden] {
    display: none;
}

.skill-area.is-entering {
    animation: skill-area-in 0.3s ease-out;
}

@keyframes skill-area-in {
    from { opacity: 0; transform: translateY(12px); }
}

.skill-area h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--theme-color-16);
    font: 500 15px / 1.4 var(--font-mono);
}

.skill-area h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--theme-color-21);
}

.skill-hash {
    color: var(--theme-color-17);
}

.skill-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.skill-card {
    min-width: 0;
    padding: 20px;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-21);
    border-radius: 16px;
    transition: border-color 0.25s;
}

.skill-card:hover {
    border-color: rgba(99, 234, 211, 0.35);
}

.skill-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: var(--theme-color-12);
    border-radius: 10px;
}

.skill-icon-text {
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--theme-color-17);
    font: 600 12px / 1 var(--font-mono);
}

.skill-card h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
}

.skill-card .skill-learning {
    margin-left: auto;
    padding: 2px 10px;
    background: rgba(176, 160, 255, 0.15);
    border: 0;
    color: var(--theme-color-22);
    font: 500 12px / 1.5 var(--font-mono);
    white-space: nowrap;
}

.skill-card p {
    margin: 12px 0 0;
    color: var(--theme-color-16);
    font-size: 15px;
    line-height: 1.65;
}

.skill-card .skill-tags {
    gap: 6px;
    margin-top: 16px;
}

.skill-card .skill-tags li {
    padding: 2px 8px;
    background: var(--theme-color-12);
    border-color: var(--theme-color-21);
    color: var(--theme-color-16);
    font-size: 12px;
}

:root[data-theme="light"] .skill-filter button[aria-selected="true"] {
    background: rgba(8, 124, 107, 0.1);
    border-color: rgba(8, 124, 107, 0.4);
}

:root[data-theme="light"] .skill-card:hover {
    border-color: rgba(8, 124, 107, 0.4);
}

:root[data-theme="light"] .skill-card .skill-learning {
    background: rgba(112, 81, 186, 0.12);
}

@media (max-width: 760px) {
    .skill-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .skill-total {
        width: 100%;
        margin: 4px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skill-area.is-entering {
        animation: none;
    }
}

/* 14. LEARNING LOG AND NEXT STEPS (Skills page), in the v2 style
   Two rounded cards side by side: steps with a full gradient bar, and a checklist. */
.skills-journey {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 72px;
}

.journey-card {
    min-width: 0;
    padding: 32px;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-21);
    border-radius: 20px;
    text-align: left;
}

.journey-card .panel-label {
    margin: 0 0 12px;
    font-family: var(--font-mono);
}

.journey-card h2 {
    margin: 0 0 24px;
    font-size: clamp(22px, 2.2vw, 26px);
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.journey-steps,
.journey-todo {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.journey-steps {
    gap: 20px;
}

.journey-meta {
    display: flex;
    justify-content: space-between;
    color: var(--theme-color-16);
    font: 500 12px / 1 var(--font-mono);
}

.journey-pct {
    color: var(--theme-color-17);
}

.journey-bar {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    background: var(--theme-color-12);
    border-radius: 999px;
}

.journey-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--theme-color-17), var(--theme-color-22));
    border-radius: inherit;
}

.journey-steps h3 {
    margin: 12px 0 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.journey-steps p {
    margin: 0;
    color: var(--theme-color-16);
    font-size: 15px;
    line-height: 1.6;
}

.journey-todo {
    gap: 14px;
}

.journey-todo li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--theme-color-15);
    font-size: 16px;
    line-height: 1.5;
}

.journey-todo li.is-done {
    color: var(--theme-color-16);
}

.journey-check {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 1px solid var(--theme-color-21);
    border-radius: 50%;
}

.is-done .journey-check {
    background: var(--theme-color-17);
    border-color: var(--theme-color-17);
    color: var(--theme-color-19);
}

:root[data-theme="light"] .is-done .journey-check {
    color: #ffffff;
}

@media (max-width: 860px) {
    .skills-journey {
        grid-template-columns: minmax(0, 1fr);
        margin-top: 52px;
    }
}

@media (max-width: 600px) {
    .journey-card {
        padding: 24px 20px;
    }
}

/* 15. NEXT STEPS CARD (Skills page): a progress ring with the goals below it. */
.goal-summary {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 22px;
    padding: 18px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-21);
    border-radius: 14px;
}

.goal-ring {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 84px;
    height: 84px;
    background: conic-gradient(var(--theme-color-17) 0 var(--goal-progress), var(--theme-color-21) var(--goal-progress));
    border-radius: 50%;
}

.goal-ring span {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    background: var(--theme-color-18);
    border-radius: 50%;
    color: var(--theme-color-17);
    font: 600 20px / 1 var(--font-mono);
}

.goal-summary-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.goal-summary-text {
    margin: 4px 0 0;
    color: var(--theme-color-16);
    font-size: 14px;
}

.goal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.goal-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--theme-color-21);
}

.goal-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.goal-list li > div {
    flex: 1;
    min-width: 0;
}

.goal-check {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 1px solid var(--theme-color-21);
    border-radius: 50%;
}

.is-done .goal-check {
    background: var(--theme-color-17);
    border-color: var(--theme-color-17);
    color: var(--theme-color-19);
}

:root[data-theme="light"] .is-done .goal-check {
    color: #ffffff;
}

.goal-name {
    margin: 0;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.45;
}

.goal-state {
    margin: 2px 0 0;
    color: var(--theme-color-16);
    font-size: 13.5px;
}

.goal-next {
    flex-shrink: 0;
    padding: 2px 9px;
    background: rgba(176, 160, 255, 0.15);
    border-radius: 999px;
    color: var(--theme-color-22);
    font: 500 11px / 1.6 var(--font-mono);
}

:root[data-theme="light"] .goal-next {
    background: rgba(112, 81, 186, 0.12);
}

@media (max-width: 600px) {
    .goal-summary {
        gap: 16px;
        padding: 14px;
    }
}

/* 16. PROJECTS GRID (Projects page), in the v2 style
   Pill filters with a count, a search box on the right, and cards whose title opens
   the preview (the whole card is clickable). The status sits in the tag row. */
.project-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.project-toolbar .project-filters {
    gap: 8px;
    margin: 0;
}

.project-toolbar .project-filters button {
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--theme-color-21);
    border-radius: 999px;
    color: var(--theme-color-16);
    font: 500 15px / 1.3 var(--font-sans);
    box-shadow: none;
}

.project-toolbar .project-filters button:hover {
    border-color: var(--theme-color-21);
    color: var(--theme-color-15);
}

.project-toolbar .project-filters button[aria-pressed="true"],
:root[data-theme="light"] .project-toolbar .project-filters button[aria-pressed="true"] {
    background: rgba(99, 234, 211, 0.12);
    border-color: rgba(99, 234, 211, 0.45);
    color: var(--theme-color-17);
    box-shadow: none;
}

:root[data-theme="light"] .project-toolbar .project-filters button[aria-pressed="true"] {
    background: rgba(8, 124, 107, 0.1);
    border-color: rgba(8, 124, 107, 0.4);
}

.project-toolbar .filter-count,
.project-toolbar .project-filters button[aria-pressed="true"] .filter-count,
:root[data-theme="light"] .project-toolbar .filter-count,
:root[data-theme="light"] .project-toolbar .project-filters button[aria-pressed="true"] .filter-count {
    min-width: 0;
    padding: 0;
    background: none;
    color: inherit;
    font: 500 11px / 1 var(--font-mono);
    opacity: 0.7;
}

.project-search {
    position: relative;
    display: block;
    width: 288px;
    max-width: 100%;
}

.project-search svg {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--theme-color-16);
    transform: translateY(-50%);
    pointer-events: none;
}

.project-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 38px;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-21);
    border-radius: 12px;
    color: var(--theme-color-15);
    font: 15px / 1 var(--font-sans);
    outline: none;
}

.project-search input::placeholder {
    color: var(--theme-color-16);
}

.project-search input:focus {
    border-color: rgba(99, 234, 211, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 234, 211, 0.15);
}

.projects-empty {
    margin: 0;
    padding: 40px;
    border: 1px dashed var(--theme-color-21);
    border-radius: 16px;
    color: var(--theme-color-16);
    text-align: center;
}

.projects-empty[hidden] {
    display: none;
}

.projects-grid {
    gap: 20px;
}

.project-tile > article {
    position: relative;
    background: var(--theme-color-18);
    border-color: var(--theme-color-21);
    box-shadow: none;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

:root[data-theme="light"] .project-tile > article {
    box-shadow: rgba(35, 65, 80, 0.08) 0px 8px 24px;
}

.project-tile .tile-cover {
    border-bottom: 1px solid var(--theme-color-21);
}

.project-tile .tile-badge {
    top: 12px;
    padding: 4px 10px;
    border-color: var(--theme-color-21);
    font-size: 11px;
    line-height: 1.4;
}

.project-tile .tile-badge:not(.tile-status) {
    left: 12px;
}

.project-tile .tile-status {
    right: 12px;
}

.tile-body {
    padding: 20px;
}

.tile-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tile-body .tile-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* The title is the button; its ::after covers the card so any click opens the preview. */
.tile-title .tile-open {
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
}

.tile-title .tile-open::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.tile-title .tile-open:hover {
    text-decoration: none;
}

.tile-title .tile-open:focus-visible {
    outline: none;
}

.tile-title .tile-open:focus-visible::after {
    outline: 2px solid var(--theme-color-17);
    outline-offset: -2px;
}

.tile-arrow {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--theme-color-16);
    font-size: 15px;
    transition: transform 0.25s, color 0.25s;
}

.tile-body > p {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.6;
}

.tile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
}

.tile-meta .tile-tags {
    display: contents;
}

.tile-meta .tile-tags li {
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--theme-color-21);
    border-radius: 999px;
    color: var(--theme-color-16);
    font-size: 11.5px;
}

.tile-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font: 600 11.5px / 1.6 var(--font-mono);
}

.tile-state.is-finished {
    background: var(--theme-color-12);
    color: var(--theme-color-15);
}

.tile-state.is-live {
    background: rgba(74, 222, 128, 0.14);
    color: #4ade80;
}

.tile-state.is-progress {
    background: rgba(176, 160, 255, 0.15);
    color: var(--theme-color-22);
}

.tile-state-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

:root[data-theme="light"] .tile-state.is-live {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

:root[data-theme="light"] .tile-state.is-progress {
    background: rgba(112, 81, 186, 0.12);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .project-tile > article:hover {
        transform: translateY(-4px);
        border-color: rgba(99, 234, 211, 0.4);
        box-shadow: 0 24px 60px -30px var(--theme-color-17);
    }

    .project-tile > article:hover .tile-cover img {
        transform: scale(1.04);
    }

    .project-tile > article:hover .tile-arrow {
        color: var(--theme-color-17);
        transform: translate(2px, -2px);
    }
}

@media (max-width: 900px) {
    .project-search {
        width: 100%;
    }
}

/* 17. "ASK ABOUT ZAID" ASSISTANT (assistant.js)
   A pill button in the bottom-right corner opens a small chat panel. On phones it
   sits above the bottom navigation bar and shows only its icon. */
.assistant-launch {
    position: fixed;
    right: max(20px, env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 110;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    background: var(--theme-color-17);
    border: 0;
    border-radius: 999px;
    color: var(--theme-color-19);
    font: 600 15px / 1 var(--font-sans);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.55), 0 0 24px rgba(99, 234, 211, 0.35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.assistant-launch[hidden] {
    display: none;
}

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

.assistant-launch:focus-visible {
    outline: 2px solid var(--theme-color-15);
    outline-offset: 3px;
}

:root[data-theme="light"] .assistant-launch {
    color: #ffffff;
}

.assistant-panel {
    position: fixed;
    right: max(20px, env(safe-area-inset-right, 0px));
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 111;
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 32px));
    height: min(560px, calc(100dvh - 120px));
    overflow: hidden;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-21);
    border-radius: 20px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 234, 211, 0.12);
    animation: assistant-in 0.22s ease-out;
}

.assistant-panel[hidden] {
    display: none;
}

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

.assistant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--theme-color-21);
}

.assistant-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--theme-color-15);
    font: 600 15px / 1 var(--font-sans);
}

.assistant-dot {
    width: 8px;
    height: 8px;
    background: var(--theme-color-17);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--theme-color-17);
}

.assistant-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--theme-color-21);
    border-radius: 50%;
    color: var(--theme-color-16);
    font-size: 18px;
    cursor: pointer;
}

.assistant-close:hover {
    color: var(--theme-color-15);
}

.assistant-log {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

.assistant-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.assistant-msg p,
.assistant-msg ul {
    margin: 0;
}

.assistant-msg p + p,
.assistant-msg p + ul,
.assistant-msg ul + p {
    margin-top: 8px;
}

.assistant-msg ul {
    padding-left: 18px;
}

.assistant-msg a {
    color: var(--theme-color-17);
}

.assistant-msg.is-assistant {
    align-self: flex-start;
    background: var(--theme-color-12);
    border-bottom-left-radius: 4px;
    color: var(--theme-color-15);
}

.assistant-msg.is-user {
    align-self: flex-end;
    background: rgba(99, 234, 211, 0.14);
    border: 1px solid rgba(99, 234, 211, 0.3);
    border-bottom-right-radius: 4px;
    color: var(--theme-color-15);
}

.assistant-msg.is-error {
    border: 1px solid rgba(255, 117, 135, 0.4);
}

.assistant-wait {
    color: var(--theme-color-16);
    animation: assistant-pulse 1.2s ease-in-out infinite;
}

@keyframes assistant-pulse {
    50% { opacity: 0.45; }
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
}

.assistant-suggestions:empty {
    display: none;
}

.assistant-suggestions button {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--theme-color-21);
    border-radius: 999px;
    color: var(--theme-color-16);
    font: 13px / 1.3 var(--font-sans);
    text-align: left;
    cursor: pointer;
}

.assistant-suggestions button:hover {
    border-color: rgba(99, 234, 211, 0.45);
    color: var(--theme-color-17);
}

.assistant-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 12px;
    padding: 8px;
    background: var(--theme-color-12);
    border: 1px solid var(--theme-color-21);
    border-radius: 14px;
}

.assistant-form:focus-within {
    border-color: rgba(99, 234, 211, 0.5);
}

.assistant-form textarea {
    flex: 1;
    max-height: 120px;
    padding: 6px 4px;
    background: transparent;
    border: 0;
    color: var(--theme-color-15);
    font: 14.5px / 1.5 var(--font-sans);
    resize: none;
    outline: none;
}

.assistant-send {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 36px;
    height: 36px;
    background: var(--theme-color-17);
    border: 0;
    border-radius: 10px;
    color: var(--theme-color-19);
    cursor: pointer;
}

:root[data-theme="light"] .assistant-send {
    color: #ffffff;
}

.assistant-note {
    margin: 8px 16px 12px;
    color: var(--theme-color-23, var(--theme-color-16));
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .assistant-launch {
        right: 14px;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px));
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    .assistant-launch span {
        display: none;
    }

    .assistant-panel {
        right: 12px;
        bottom: calc(150px + env(safe-area-inset-bottom, 0px));
        width: calc(100vw - 24px);
        height: min(520px, calc(100dvh - 240px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .assistant-panel,
    .assistant-wait {
        animation: none;
    }
}

/* 18. CONTACT FORM AND SIDE CARDS (Contact page), in the v2 style
   Left: "Send me a message" with message-type pills. Right: the direct links card
   and a violet "Worked with me?" card. */
.contact-v2 {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
}

.contact-v2 .reach-form,
.contact-v2 .reach-side,
.contact-v2 .reach-feedback {
    padding: 32px;
    background: var(--theme-color-18);
    border: 1px solid var(--theme-color-21);
    border-radius: 20px;
    box-shadow: none;
}

:root[data-theme="light"] .contact-v2 :is(.reach-form, .reach-side, .reach-feedback) {
    box-shadow: rgba(35, 65, 80, 0.08) 0 8px 24px;
}

.contact-title {
    margin: 0 0 24px;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.contact-v2 .message-form {
    gap: 20px;
    margin: 0;
}

/* Message type pills */
.message-kinds {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.message-kinds legend {
    margin-bottom: 10px;
    padding: 0;
    color: var(--theme-color-15);
    font: 600 15px / 1.5 var(--font-sans);
}

.message-kind-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.message-kind-list button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--theme-color-21);
    border-radius: 999px;
    color: var(--theme-color-16);
    font: 500 14.5px / 1.3 var(--font-sans);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.message-kind-list button:hover {
    color: var(--theme-color-15);
}

.message-kind-list button[aria-checked="true"] {
    background: rgba(99, 234, 211, 0.12);
    border-color: rgba(99, 234, 211, 0.45);
    color: var(--theme-color-17);
}

:root[data-theme="light"] .message-kind-list button[aria-checked="true"] {
    background: rgba(8, 124, 107, 0.1);
    border-color: rgba(8, 124, 107, 0.4);
}

.message-kind-list button:focus-visible {
    outline: 2px solid var(--theme-color-17);
    outline-offset: 2px;
}

/* Fields */
.contact-v2 .message-field label {
    font-size: 15px;
}

.contact-v2 .message-field input,
.contact-v2 .message-field textarea {
    background: var(--theme-color-19);
    border-color: var(--theme-color-21);
    border-radius: 12px;
    font-size: 15px;
}

:root[data-theme="light"] .contact-v2 .message-field :is(input, textarea) {
    background: var(--lm-surface);
}

.contact-v2 .message-field input {
    height: 46px;
}

.contact-v2 .message-field textarea {
    min-height: 140px;
}

/* Privacy note and send button on one line */
.message-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.contact-page .contact-v2 .message-form .message-privacy {
    max-width: 330px;
    color: var(--theme-color-16);
    font-size: 13px;
    line-height: 1.6;
}

.contact-v2 button.message-send {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--theme-color-17);
    border: 0;
    border-radius: 14px;
    color: var(--theme-color-19);
    font: 600 16px / 1.3 var(--font-sans);
    box-shadow: 0 0 24px rgba(99, 234, 211, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

:root[data-theme="light"] .contact-v2 button.message-send {
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(8, 124, 107, 0.25);
}

.contact-v2 button.message-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 32px rgba(99, 234, 211, 0.5);
}

/* Right column */
.contact-side {
    display: grid;
    align-content: start;
    gap: 24px;
}

.contact-v2 .reach-side h2 {
    margin: 0 0 18px;
    font-size: 19px;
}

.contact-v2 .reach-list {
    gap: 10px;
}

.contact-v2 .reach-row {
    background: transparent;
    border-color: var(--theme-color-21);
    border-radius: 14px;
}

.contact-v2 .reach-link {
    gap: 14px;
    padding: 12px 14px;
}

.contact-v2 .reach-icon {
    width: 36px;
    height: 36px;
    background: var(--theme-color-12);
    border: 0;
    border-radius: 10px;
    color: var(--theme-color-16);
}

.contact-v2 .reach-text strong {
    color: var(--theme-color-15);
    font-size: 15px;
    font-weight: 600;
}

.contact-v2 .reach-text small {
    overflow: hidden;
    color: var(--theme-color-16);
    font: 12.5px / 1.5 var(--font-mono);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-v2 .reach-arrow {
    color: var(--theme-color-16);
    font-size: 15px;
}

.contact-v2 .reach-copy {
    display: inline-flex;
    width: auto;
    height: 32px;
    gap: 6px;
    margin-right: 12px;
    padding: 0 12px;
    background: transparent;
    border-color: var(--theme-color-21);
    border-radius: 8px;
    color: var(--theme-color-16);
    font: 500 13px / 1 var(--font-sans);
}

.contact-v2 .reach-copy .copy-label {
    display: inline;
}

/* "Worked with me?" card in violet */
.contact-v2 .reach-feedback {
    margin: 0;
    background: linear-gradient(160deg, rgba(176, 160, 255, 0.07), transparent 60%), var(--theme-color-18);
    border-color: rgba(176, 160, 255, 0.35);
    justify-content: flex-start;
}

.feedback-icon {
    display: inline-grid;
    margin-bottom: 12px;
    color: var(--theme-color-22);
}

.contact-v2 .reach-feedback h3 {
    margin: 0 0 10px;
    font-size: 19px;
}

.contact-v2 .reach-feedback p {
    font-size: 15px;
}

.contact-v2 .reach-feedback-button {
    margin-top: 16px;
    color: var(--theme-color-22);
    font-size: 15px;
}

@media (max-width: 1100px) {
    .contact-v2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .contact-v2 .reach-form,
    .contact-v2 .reach-side,
    .contact-v2 .reach-feedback {
        padding: 22px 18px;
    }

    .message-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-page .contact-v2 .message-form .message-privacy {
        max-width: none;
    }

    .contact-v2 button.message-send {
        justify-content: center;
    }
}

/* 19. ONE DESIGN SYSTEM FOR THE WHOLE SITE
   The pages were built at different times and had drifted apart (six card corner
   sizes, four button shapes, two tag shapes, three label sizes…). These shared rules
   come last, so every page uses the same building blocks:
   - cards: 20px corners, one surface colour, one border, no heavy shadow;
   - cards inside cards: 14px corners;
   - buttons: one pill shape, primary (cyan) and secondary (outline);
   - filter tabs: one pill style; tags: one small mono pill;
   - section labels ("01 / …") and section titles: one size each. */
:root {
    --ds-radius-card: 20px;
    --ds-radius-inner: 14px;
    --ds-card-bg: var(--theme-color-18);
    --ds-card-border: var(--theme-color-21);
    --ds-card-shadow: none;
    --ds-accent-tint: rgba(99, 234, 211, 0.12);
    --ds-accent-line: rgba(99, 234, 211, 0.45);
    --ds-section-title: clamp(26px, 2.6vw, 32px);
    --ds-card-title: 22px;
}

:root[data-theme="light"] {
    --ds-card-shadow: rgba(35, 65, 80, 0.08) 0 8px 24px;
    --ds-accent-tint: rgba(8, 124, 107, 0.1);
    --ds-accent-line: rgba(8, 124, 107, 0.4);
}

/* Cards: big containers on every page */
.panel,
.service-card,
.skill-card,
.project-tile > article,
.journey-card,
.explore-grid a,
.contact-v2 .reach-form,
.contact-v2 .reach-side,
.contact-v2 .reach-feedback {
    border-radius: var(--ds-radius-card);
    border: 1px solid var(--ds-card-border);
    box-shadow: var(--ds-card-shadow);
}

.panel:not(.intro-term),
.service-card,
.skill-card,
.project-tile > article,
.explore-grid a,
.skills-journey .journey-card {
    background: var(--ds-card-bg);
}

/* Terminal windows keep their dark screen, with the same corners and border */
.terminal,
.panel.intro-term {
    border-radius: var(--ds-radius-card);
    border: 1px solid var(--ds-card-border);
}

/* Cards inside cards */
.exp-file,
.goal-summary,
.journey-step .journey-card,
.reach-row,
.message-field input,
.message-field textarea,
.project-search input {
    border-radius: var(--ds-radius-inner);
}

/* "Other experiences" on the About page: same inner cards as elsewhere */
.exp-file,
.exp-file.exp-file-alt {
    padding: 20px;
    background: var(--theme-color-12);
    border: 1px solid var(--ds-card-border);
    text-align: left;
}

.exp-file-name {
    color: var(--theme-color-17);
    font: 500 12.5px / 1.5 var(--font-mono);
}

/* Section labels ("01 / LIVE NETWORK") and titles: one size each */
.panel-label,
.footer-kicker,
.panel .panel-label,
.journey-card .panel-label,
.skills-heading .panel-label,
.network .panel-label {
    margin: 0 0 10px;
    color: var(--theme-color-17);
    font: 600 13px / 1.4 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.panel > h2,
.network h2,
.skills-heading h2,
.featured-work h2,
.explore h2,
.journey-section > h2 {
    margin: 0 0 12px;
    font-size: var(--ds-section-title);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.skills-journey .journey-card h2,
.contact-title,
.contact-v2 .reach-side h2,
.cv-row h2 {
    font-size: var(--ds-card-title);
    font-weight: 600;
    letter-spacing: -0.3px;
}

.panel,
.panel > h2,
.panel > p {
    text-align: left;
}

/* Buttons: one pill shape. Primary = cyan, secondary = outline. */
.button,
a.button,
.cv-btn,
.contact-v2 button.message-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    background: var(--theme-color-17);
    border: 1px solid var(--theme-color-17);
    border-radius: 999px;
    color: var(--theme-color-19);
    font: 600 15px / 1 var(--font-sans);
    letter-spacing: 0;
    text-decoration: none;
    box-shadow: 0 0 22px rgba(99, 234, 211, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send) {
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(8, 124, 107, 0.22);
}

:is(.button, a.button, .cv-btn, .contact-v2 button.message-send):hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(99, 234, 211, 0.45);
}

.button.secondary,
.hero-actions .text-link {
    background: transparent;
    color: var(--theme-color-15);
    box-shadow: none;
}

/* Filter tabs and choice pills: one style everywhere */
.skill-filter button,
.project-toolbar .project-filters button,
.message-kind-list button {
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    font: 500 14.5px / 1.2 var(--font-sans);
}

.skill-filter button[aria-selected="true"],
.project-toolbar .project-filters button[aria-pressed="true"],
:root[data-theme="light"] .project-toolbar .project-filters button[aria-pressed="true"],
.message-kind-list button[aria-checked="true"] {
    background: var(--ds-accent-tint);
    border-color: var(--ds-accent-line);
    color: var(--theme-color-17);
}

/* Tags: one small mono pill everywhere */
.skill-tags li,
.skill-card .skill-tags li,
.tile-meta .tile-tags li,
.tile-tags li,
.term-tags span {
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--ds-card-border);
    border-radius: 999px;
    color: var(--theme-color-16);
    font: 500 11.5px / 1.6 var(--font-mono);
}

/* Page headers ("$ ls projects/"): one size on every page */
.page-heading .eyebrow,
.page-heading .about-command,
.page-heading .command-prompt {
    font-size: 20px;
    letter-spacing: 0.5px;
}

/* The old colored edge on the "Other experiences" cards, also in light mode */
:root .exp-file,
:root .exp-file.exp-file-alt,
:root[data-theme="light"] .exp-file,
:root[data-theme="light"] .exp-file.exp-file-alt {
    border: 1px solid var(--ds-card-border);
    box-shadow: none;
}

:root[data-theme="light"] .exp-file {
    background: var(--lm-surface-2);
}

/* 20. LANGUAGE SWITCHER (EN / FR)
   Each language has its own pages; the switcher links to the same page in the
   other language. */
.language-switch {
    display: inline-flex;
    align-items: center;
}

.language-switch .language-option {
    color: inherit;
    text-decoration: none;
}

.language-switch .language-option:focus-visible {
    outline: 2px solid var(--theme-color-17);
    outline-offset: 2px;
}

/* 21. LIGHT MODE: PREMIUM FINISH
   Every rule here is scoped to :root[data-theme="light"], so dark mode is
   untouched. Colours come only from the --lm-* tokens (style.css). The idea:
   - a soft off-white page with a faint accent glow at the top, and a quieter
     network background;
   - white cards with a hairline border and a soft two-layer shadow that lifts a
     little on hover;
   - ink-coloured headings, grey body text, one teal accent;
   - one focus ring, one input style, one tag style, one button style. */

:root[data-theme="light"] {
    --ds-card-bg: var(--lm-surface);
    --ds-card-border: var(--lm-border);
    --ds-card-shadow: var(--lm-shadow-sm);
    --ds-accent-tint: var(--lm-accent-soft);
    --ds-accent-line: var(--lm-accent-line);
    --lm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    scrollbar-color: #d0d5dd transparent;
}

:root[data-theme="light"] ::selection {
    background: rgba(11, 122, 108, 0.16);
    color: var(--lm-text);
}

/* Typography: ink headings, calm body text */
:root[data-theme="light"] :is(h1, h2, h3, h4) {
    color: var(--lm-text);
}

:root[data-theme="light"] :is(h1, h2) {
    letter-spacing: -0.02em;
}

:root[data-theme="light"] main p {
    color: var(--lm-text-2);
}

:root[data-theme="light"] :is(.panel-label, .eyebrow, .footer-kicker, .skill-hash) {
    color: var(--lm-accent);
}

/* One focus ring everywhere */
:root[data-theme="light"] :is(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--lm-accent);
    outline-offset: 2px;
}

/* Top bar: search, language and theme controls as one quiet group */
:root[data-theme="light"] :is(.appearance-controls .language-toggle, .appearance-controls .theme-toggle) {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    box-shadow: var(--lm-shadow-xs);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

:root[data-theme="light"] .appearance-controls .theme-toggle:hover {
    border-color: var(--lm-border-strong);
    background: var(--lm-surface);
    box-shadow: var(--lm-shadow-sm);
}

:root[data-theme="light"][lang="en"] .language-option[data-language="en"],
:root[data-theme="light"][lang="fr"] .language-option[data-language="fr"] {
    background: var(--lm-text);
    color: #ffffff;
    box-shadow: var(--lm-shadow-xs);
}

:root[data-theme="light"][lang="en"] .language-option:not([data-language="en"]),
:root[data-theme="light"][lang="fr"] .language-option:not([data-language="fr"]) {
    color: var(--lm-text-2);
}

:root[data-theme="light"][lang="en"] .language-option:not([data-language="en"]):hover,
:root[data-theme="light"][lang="fr"] .language-option:not([data-language="fr"]):hover {
    color: var(--lm-text);
    background: var(--lm-surface-3);
}

/* Main menu: grey words, the current page in the accent colour */
:root[data-theme="light"] header nav a {
    color: var(--lm-text-2);
    transition: color 0.18s ease;
}

:root[data-theme="light"] header nav a:hover {
    color: var(--lm-text);
}

:root[data-theme="light"] header nav a[aria-current="page"] {
    color: var(--lm-accent);
}

/* Cards: white, hairline border, soft shadow, gentle lift on hover */
:root[data-theme="light"] :is(.panel, .service-card, .skill-card, .project-tile > article, .journey-card, .explore-grid a,
    .contact-v2 .reach-form, .contact-v2 .reach-side, .contact-v2 .reach-feedback) {
    background-color: var(--lm-surface);
    border-color: var(--lm-border);
    box-shadow: var(--lm-shadow-sm);
}

:root[data-theme="light"] :is(.service-card, .skill-card, .project-tile > article, .explore-grid a, .journey-card) {
    transition: border-color 0.2s ease, box-shadow 0.25s var(--lm-ease), transform 0.25s var(--lm-ease);
}

:root[data-theme="light"] :is(.service-card, .skill-card, .project-tile > article, .explore-grid a, .journey-card):hover {
    border-color: var(--lm-border-strong);
    box-shadow: var(--lm-shadow-md);
}

/* Cards inside cards and quiet wells */
:root[data-theme="light"] :is(.exp-file, .reach-row, .reach-link) {
    background: var(--lm-surface-2);
    border-color: var(--lm-border);
}

:root[data-theme="light"] :is(.reach-row, .reach-link):hover {
    background: var(--lm-surface);
    border-color: var(--lm-border-strong);
    box-shadow: var(--lm-shadow-xs);
}

/* Icon tiles in cards */
:root[data-theme="light"] :is(.skill-icon, .explore-icon, .reach-icon, .feedback-icon) {
    background: var(--lm-accent-soft);
    border-color: var(--lm-accent-line);
    color: var(--lm-accent);
}

/* Project cards: the illustration sits in a framed "screen" */
:root[data-theme="light"] .project-tile .tile-cover {
    border-bottom: 1px solid var(--lm-border);
}

:root[data-theme="light"] .project-tile .tile-badge:not(.tile-status) {
    background: color-mix(in srgb, var(--lm-surface) 94%, transparent);
    border: 1px solid var(--lm-border);
    color: var(--lm-text);
    box-shadow: var(--lm-shadow-xs);
}

:root[data-theme="light"] :is(.tile-title, .tile-title a, .tile-title .tile-open) {
    color: var(--lm-text);
}

:root[data-theme="light"] :is(.tile-arrow, .reach-arrow, .explore-arrow) {
    color: var(--lm-text-3);
    transition: color 0.18s ease, transform 0.2s var(--lm-ease);
}

:root[data-theme="light"] :is(.project-tile > article, .reach-link, .explore-grid a):hover :is(.tile-arrow, .reach-arrow, .explore-arrow) {
    color: var(--lm-accent);
}

/* Tags: one neutral pill */
:root[data-theme="light"] :is(.skill-tags li, .skill-card .skill-tags li, .tile-meta .tile-tags li, .tile-tags li, .term-tags span, .preview-stack li) {
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border);
    color: #344054;
}

/* Filter tabs and choice pills: white pills, the selected one in ink */
:root[data-theme="light"] :is(.skill-filter button, .project-toolbar .project-filters button, .message-kind-list button) {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-2);
    box-shadow: var(--lm-shadow-xs);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

:root[data-theme="light"] :is(.skill-filter button, .project-toolbar .project-filters button, .message-kind-list button):hover {
    border-color: var(--lm-border-strong);
    color: var(--lm-text);
}

:root[data-theme="light"] :is(.skill-filter button[aria-selected="true"], .project-toolbar .project-filters button[aria-pressed="true"], .message-kind-list button[aria-checked="true"]) {
    background: var(--lm-text);
    border-color: var(--lm-text);
    color: #ffffff;
    box-shadow: var(--lm-shadow-sm);
}

:root[data-theme="light"] .project-toolbar .project-filters button[aria-pressed="true"] .filter-count {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

:root[data-theme="light"] .project-toolbar .project-filters button:not([aria-pressed="true"]) .filter-count {
    background: var(--lm-surface-3);
    color: var(--lm-text-2);
}

/* Buttons: primary teal with a soft inner highlight; secondary white */
:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send) {
    background: var(--lm-accent);
    border-color: var(--lm-accent);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(16, 24, 40, 0.08), 0 4px 12px -4px rgba(11, 122, 108, 0.4);
    transition: background-color 0.18s ease, box-shadow 0.2s ease, transform 0.2s var(--lm-ease);
}

:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send):hover {
    background: var(--lm-accent-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 4px rgba(16, 24, 40, 0.08), 0 10px 22px -8px rgba(11, 122, 108, 0.5);
}

:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send):active {
    transform: translateY(0) scale(0.98);
}

:root[data-theme="light"] :is(.button.secondary, .hero-actions .text-link) {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    color: var(--lm-text);
    box-shadow: var(--lm-shadow-xs);
}

:root[data-theme="light"] :is(.button.secondary, .hero-actions .text-link):hover {
    background: var(--lm-surface-2);
    border-color: var(--lm-border-strong);
}

:root[data-theme="light"] :is(button, .button):disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* Inputs: white field, clear border, accent ring on focus */
:root[data-theme="light"] :is(input[type="text"], input[type="email"], input[type="search"], input[type="password"], textarea, select) {
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border-strong);
    color: var(--lm-text);
    box-shadow: var(--lm-shadow-xs);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

:root[data-theme="light"] :is(input, textarea)::placeholder {
    color: #98a2b3;
}

:root[data-theme="light"] :is(input[type="text"], input[type="email"], input[type="search"], input[type="password"], textarea, select):hover {
    border-color: #98a2b3;
}

:root[data-theme="light"] :is(input[type="text"], input[type="email"], input[type="search"], input[type="password"], textarea, select):focus {
    background: var(--lm-surface);
    border-color: var(--lm-accent);
    outline: none;
    box-shadow: 0 0 0 4px var(--lm-accent-ring);
}

/* Search window (Ctrl K) */
:root[data-theme="light"] .palette {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    box-shadow: var(--lm-shadow-lg);
}

:root[data-theme="light"] .palette::backdrop {
    background: rgba(16, 24, 40, 0.28);
}

:root[data-theme="light"] .palette-field {
    border-bottom-color: var(--lm-border);
}

:root[data-theme="light"] .palette-field input,
:root[data-theme="light"] .palette-field input:hover,
:root[data-theme="light"] .palette-field input:focus {
    background: transparent;
    border: 0;
    box-shadow: none;
}

:root[data-theme="light"] .palette-group {
    color: var(--lm-text-3);
}

:root[data-theme="light"] .palette-item {
    color: var(--lm-text);
}

:root[data-theme="light"] .palette-item[aria-selected="true"] {
    background: var(--lm-surface-3);
    color: var(--lm-text);
}

:root[data-theme="light"] .palette-item[aria-selected="true"] .palette-mark {
    color: var(--lm-accent);
}

:root[data-theme="light"] .palette kbd {
    background: var(--lm-surface-3);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-2);
}

/* Theme menu and project preview window */
:root[data-theme="light"] :is(.theme-options, .project-preview) {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    box-shadow: var(--lm-shadow-lg);
}

:root[data-theme="light"] .project-preview::backdrop {
    background: rgba(16, 24, 40, 0.28);
}

:root[data-theme="light"] .preview-close {
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-2);
}

:root[data-theme="light"] .preview-close:hover {
    background: var(--lm-surface-3);
    color: var(--lm-text);
}

/* "Ask about Zaid" assistant: an ink launcher, a white panel */
:root[data-theme="light"] .assistant-panel {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    box-shadow: var(--lm-shadow-lg);
}

:root[data-theme="light"] .assistant-launch {
    background: var(--lm-text);
    border-color: var(--lm-text);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.1), 0 12px 28px -10px rgba(16, 24, 40, 0.45);
}

:root[data-theme="light"] .assistant-launch:hover {
    background: #1d2939;
}

/* Footer */
:root[data-theme="light"] .portfolio-footer {
    border-top-color: var(--lm-border);
}

:root[data-theme="light"] :is(.footer-links a, .footer-copyright, .footer-baseline) {
    color: var(--lm-text-2);
}

:root[data-theme="light"] .footer-links a:hover {
    color: var(--lm-text);
}

/* Top bar on phones: frosted white */
@media (max-width: 600px) {
    :root[data-theme="light"] .theme-toolbar {
        background: color-mix(in srgb, var(--lm-surface) 88%, transparent);
        border-bottom: 1px solid var(--lm-border);
        -webkit-backdrop-filter: saturate(1.6) blur(14px);
        backdrop-filter: saturate(1.6) blur(14px);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root[data-theme="light"] * {
        transition-duration: 0.01ms !important;
    }
}

/* Light mode fixes after review */

/* The terminal prompt is plain text on the terminal, not a boxed field */
:root[data-theme="light"] input.terminal-input,
:root[data-theme="light"] input.terminal-input:hover,
:root[data-theme="light"] input.terminal-input:focus {
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* The search button in the top bar (the bottom-bar diamond keeps its own style) */
:root[data-theme="light"] .search-open {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-2);
    box-shadow: var(--lm-shadow-xs);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

:root[data-theme="light"] .search-open:hover {
    border-color: var(--lm-border-strong);
    color: var(--lm-text);
    box-shadow: var(--lm-shadow-sm);
}

:root[data-theme="light"] .search-open kbd {
    background: var(--lm-surface-3);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-2);
}

/* Phone bar: the search diamond in the site's teal instead of the dark-mode cyan */
@media (max-width: 600px) {
    :root[data-theme="light"] .nav-search span {
        background: linear-gradient(135deg, #0f8f7e, var(--lm-accent));
        color: #ffffff;
        box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08), 0 10px 22px -8px rgba(11, 122, 108, 0.55);
    }
}

/* "Next steps" goals are rows split by a line, not grey boxes */
:root[data-theme="light"] .goal-list li {
    background: transparent;
}

/* "Let's talk": a soft lift instead of the dark-mode glow */
:root[data-theme="light"] footer.portfolio-footer a.footer-hello {
    background: var(--lm-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 20px -8px rgba(11, 122, 108, 0.5);
}

:root[data-theme="light"] footer.portfolio-footer a.footer-hello:hover {
    background: var(--lm-accent-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 4px rgba(16, 24, 40, 0.08), 0 14px 28px -10px rgba(11, 122, 108, 0.55);
}

/* 22. PROJECT GRIDS: NO LONELY LAST CARD
   With two columns, an odd last card used to sit alone next to an empty space.
   It now spans both columns, picture on the left and text on the right. */
@media (min-width: 681px) and (max-width: 1100px) {
    .projects-grid > .project-tile:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .projects-grid > .project-tile:last-child:nth-child(odd) > article {
        flex-direction: row;
    }

    .projects-grid > .project-tile:last-child:nth-child(odd) .tile-cover {
        flex: 0 0 48%;
        aspect-ratio: auto;
        min-height: 100%;
    }

    .projects-grid > .project-tile:last-child:nth-child(odd) .tile-cover img {
        height: 100%;
        object-fit: cover;
    }

    .projects-grid > .project-tile:last-child:nth-child(odd) .tile-body {
        flex: 1;
        justify-content: center;
    }

    :root[data-theme="light"] .projects-grid > .project-tile:last-child:nth-child(odd) .tile-cover {
        border-bottom: 0;
        border-right: 1px solid var(--lm-border);
    }
}

/* 23. CALL-TO-ACTION CARDS IN THE "WHAT'S NEXT?" STYLE
   The boxes that end with one action (About -> "My CV", Contact -> "Worked with me?")
   use the same design as the "What's next?" card: large rounded corners, soft cyan
   and violet light, a mono label and a pill button with a round arrow. */
:is(.about-page, .contact-page) .cta-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 40px 44px;
    border: 1px solid var(--theme-color-21);
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 10%, rgba(99, 234, 211, 0.16), transparent 42%),
        radial-gradient(circle at 42% 120%, rgba(176, 160, 255, 0.12), transparent 48%),
        var(--theme-color-18);
    box-shadow: 0px 20px 50px -24px rgba(0, 0, 0, 0.7);
}

:root[data-theme="light"] :is(.about-page, .contact-page) .cta-card {
    border-color: var(--lm-border);
    background:
        radial-gradient(circle at 92% 10%, rgba(8, 124, 107, 0.1), transparent 42%),
        radial-gradient(circle at 42% 120%, rgba(112, 81, 186, 0.08), transparent 48%),
        var(--theme-color-18);
    box-shadow: 0px 16px 40px -24px rgba(25, 43, 64, 0.35);
}

/* Label in the "WHAT'S NEXT?" style */
.about-page .cta-card .panel-label {
    margin: 0 0 12px;
    color: var(--theme-color-17);
    font: 600 12px/1.5 var(--font-mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.about-page .cta-card h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.contact-page .cta-card h3 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.contact-page .cta-card .feedback-icon {
    color: var(--theme-color-17);
}

/* The pill button, same as "Let's talk" */
:is(.about-page, .contact-page) .cta-card .cta-pill {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 12px 12px 12px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--theme-color-17);
    color: var(--theme-color-19);
    font: 600 16px/1 var(--font-sans);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0px 0px 40px -10px var(--theme-color-17);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, background-color 0.18s;
}

.contact-page .cta-card .cta-pill {
    align-self: flex-start;
    margin-top: 20px;
}

:is(.about-page, .contact-page) .cta-card .cta-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0px 0px 48px -8px var(--theme-color-17);
}

:is(.about-page, .contact-page) .cta-card .cta-pill:focus-visible {
    outline: 2px solid var(--theme-color-17);
    outline-offset: 3px;
}

.cta-pill .cta-arrow {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.14);
    font-size: 16px;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cta-pill:hover .cta-arrow {
    transform: rotate(45deg);
}

:root[data-theme="light"] :is(.about-page, .contact-page) .cta-card .cta-pill {
    background: var(--lm-accent);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 20px -8px rgba(11, 122, 108, 0.5);
}

:root[data-theme="light"] :is(.about-page, .contact-page) .cta-card .cta-pill:hover {
    background: var(--lm-accent-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 4px rgba(16, 24, 40, 0.08), 0 14px 28px -10px rgba(11, 122, 108, 0.55);
}

:root[data-theme="light"] .cta-pill .cta-arrow {
    background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 700px) {
    :is(.about-page, .contact-page) .cta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 22px;
        padding: 28px 24px;
        border-radius: 20px;
    }

    .contact-page .cta-card {
        gap: 0;
    }

    .cta-pill .cta-arrow {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cta-pill,
    .cta-pill .cta-arrow {
        transition: none;
    }
}


/* 24. MENU BOX (tablets and computers, from 601px wide)
   The page links sit in one rounded box with a fine teal border and a background
   that shades from deep blue to violet. The current page is a green-to-cyan pill
   with a soft glow; the others light up softly on hover. From 901px the search,
   language and theme buttons follow on the same line, 22px after the menu.
   Phones keep their bottom bar. */
@media (min-width: 601px) {
    body header nav,
    body header nav:hover {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: auto;
        padding: 8px;
        border: 1px solid rgba(99, 234, 211, 0.42);
        border-radius: 16px;
        background: linear-gradient(100deg, rgba(14, 22, 40, 0.92), rgba(30, 24, 52, 0.92));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    }

    body header nav a,
    body header nav a:hover,
    body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"] {
        display: inline-flex;
        align-items: center;
        height: 42px;
        padding: 0 16px;
        border-radius: 10px;
        font: 400 16px/1 var(--font-mono);
        letter-spacing: 0;
        text-transform: none;
        white-space: nowrap;
        transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    }

    body header nav a {
        color: #dbe4f3;
        background: transparent;
        box-shadow: none;
    }

    body header nav a::before,
    body header nav a::after {
        content: none;
    }

    body header nav a:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.05);
    }

    body header nav a[aria-current="page"],
    body header nav a[aria-current="page"]:hover {
        color: #062a22;
        background: linear-gradient(135deg, #34f5a4, #47e5ff);
        box-shadow: 0 0 18px -4px rgba(71, 229, 255, 0.55);
    }

    body header nav a:focus-visible {
        outline: 2px solid #47e5ff;
        outline-offset: 2px;
    }

    /* Light mode: a pale box with a teal border, the current page in deep teal */
    :root[data-theme="light"] body header nav {
        border-color: var(--lm-accent-line);
        background: linear-gradient(100deg, var(--lm-surface), #f1effa);
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 24px -18px rgba(16, 24, 40, 0.3);
    }

    :root[data-theme="light"] body header nav a {
        color: var(--lm-text-2);
    }

    :root[data-theme="light"] body header nav a:hover {
        color: var(--lm-text);
        background: rgba(16, 24, 40, 0.05);
    }

    :root[data-theme="light"] body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"]:hover {
        color: #ffffff;
        background: linear-gradient(135deg, #0a7062, #0b7f8c);
        box-shadow: 0 6px 14px -6px rgba(10, 112, 98, 0.55);
    }

    :root[data-theme="light"][lang="en"] .language-option[data-language="en"],
    :root[data-theme="light"][lang="fr"] .language-option[data-language="fr"] {
        color: #ffffff;
        background: var(--lm-accent);
    }
}

/* From 901px: menu, then 22px, then search, language and theme, all on one line */
@media (min-width: 901px) {
    header,
    header:has(nav) {
        flex-wrap: nowrap;
        gap: 22px;
        padding-right: 30px;
    }

    header .theme-toolbar {
        position: static;
        order: 0;
        align-self: center;
        transform: none;
    }
}

/* Between 901px and 1180px the search keeps only its icon and the links are a bit
   tighter, so everything fits on one line (French words are longer) */
@media (min-width: 901px) and (max-width: 1180px) {
    header .search-open .search-label,
    header .search-open kbd {
        display: none;
    }

    header .search-open {
        width: 44px;
        padding: 0;
        justify-content: center;
    }

    body header nav a,
    body header nav a:hover,
    body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"] {
        padding: 0 12px;
        font-size: 15px;
    }
}

/* Tablets (601px to 900px): the same box, a little more compact */
@media (min-width: 601px) and (max-width: 900px) {
    body header nav,
    body header nav:hover {
        gap: 4px;
        padding: 6px;
    }

    body header nav a,
    body header nav a:hover,
    body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"] {
        height: 38px;
        padding: 0 11px;
        font-size: 14.5px;
    }
}

/* 25. SETTINGS BOX IN THE MENU STYLE (tablets and computers, from 601px wide)
   Search, language and theme sit together in one box that matches the menu box:
   same teal border, corners, blue-to-violet background and height. Inside, each
   control is a soft pill; the chosen language uses the same green-to-cyan glow as
   the current page. Phones keep their own top bar. */
@media (min-width: 601px) {
    body header .theme-toolbar .appearance-controls,
    body header nav,
    body header nav:hover {
        box-sizing: border-box;
        height: 60px;
    }

    body header .theme-toolbar .appearance-controls {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px;
        border: 1px solid rgba(99, 234, 211, 0.42);
        border-radius: 16px;
        background: linear-gradient(100deg, rgba(14, 22, 40, 0.92), rgba(30, 24, 52, 0.92));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    }

    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle),
    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle):hover {
        height: 42px;
        min-height: 42px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    body header .appearance-controls .search-open {
        gap: 10px;
        padding: 0 8px 0 14px;
        color: #dbe4f3;
        font: 400 15px/1 var(--font-mono);
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    body header .appearance-controls .search-open kbd {
        padding: 4px 7px;
        border: 1px solid rgba(99, 234, 211, 0.3);
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.04);
        color: #c2cee0;
        font: 400 12px/1 var(--font-mono);
    }

    body header .appearance-controls .language-toggle {
        gap: 4px;
        padding: 0;
    }

    body header .appearance-controls .language-toggle .language-option {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 50px;
        height: 42px;
        padding: 0 14px;
        border-radius: 10px;
        color: #dbe4f3;
        background: transparent;
        box-shadow: none;
        font: 400 15px/1 var(--font-mono);
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    body header .appearance-controls .theme-toggle {
        width: 42px;
        padding: 0;
        color: #dbe4f3;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    body header .appearance-controls .search-open:hover,
    body header .appearance-controls .theme-toggle:hover,
    body header .appearance-controls .language-toggle .language-option:not([aria-current]):hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.05);
    }

    body header .appearance-controls .language-toggle .language-option[aria-current="true"],
    body header .appearance-controls .language-toggle:hover .language-option[aria-current="true"] {
        color: #062a22;
        background: linear-gradient(135deg, #34f5a4, #47e5ff);
        box-shadow: 0 0 18px -4px rgba(71, 229, 255, 0.55);
    }

    body header .appearance-controls :is(.search-open, .theme-toggle, .language-option):focus-visible {
        outline: 2px solid #47e5ff;
        outline-offset: 2px;
    }

    /* Light mode: the same pale box as the light menu */
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        border-color: var(--lm-accent-line);
        background: linear-gradient(100deg, var(--lm-surface), #f1effa);
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 24px -18px rgba(16, 24, 40, 0.3);
    }

    :root[data-theme="light"] body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle),
    :root[data-theme="light"] body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle):hover {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    :root[data-theme="light"] body header .appearance-controls :is(.search-open, .theme-toggle),
    :root[data-theme="light"] body header .appearance-controls .language-toggle .language-option {
        color: var(--lm-text-2);
    }

    :root[data-theme="light"] body header .appearance-controls .search-open kbd {
        border-color: var(--lm-accent-line);
        background: rgba(255, 255, 255, 0.6);
        color: var(--lm-text-2);
    }

    :root[data-theme="light"] body header .appearance-controls .search-open:hover,
    :root[data-theme="light"] body header .appearance-controls .theme-toggle:hover,
    :root[data-theme="light"] body header .appearance-controls .language-toggle .language-option:not([aria-current]):hover {
        color: var(--lm-text);
        background: rgba(16, 24, 40, 0.05);
    }

    :root[data-theme="light"] body header .appearance-controls .language-toggle .language-option[aria-current="true"],
    :root[data-theme="light"] body header .appearance-controls .language-toggle:hover .language-option[aria-current="true"] {
        color: #ffffff;
        background: linear-gradient(135deg, #0a7062, #0b7f8c);
        box-shadow: 0 6px 14px -6px rgba(10, 112, 98, 0.55);
    }
}

/* Between 901px and 1180px the search shows only its icon: a square pill */
@media (min-width: 901px) and (max-width: 1180px) {
    body header .appearance-controls .search-open {
        width: 42px;
        padding: 0;
        justify-content: center;
    }
}

/* Tablets: the same box, a little more compact, like the menu */
@media (min-width: 601px) and (max-width: 900px) {
    body header .theme-toolbar .appearance-controls,
    body header nav,
    body header nav:hover {
        height: 52px;
    }

    body header .theme-toolbar .appearance-controls {
        gap: 4px;
        padding: 6px;
    }

    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle),
    body header .appearance-controls .language-toggle .language-option {
        height: 38px;
        min-height: 38px;
    }

    body header .appearance-controls .theme-toggle {
        width: 38px;
    }
}

/* The theme button sits in its own wrapper (.theme-picker): match the other pills */
@media (min-width: 601px) {
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        width: 42px;
        height: 42px;
        min-width: 0;
        min-height: 0;
        border: 0;
        box-shadow: none;
    }

    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle {
        background: transparent;
    }

    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        background: rgba(16, 24, 40, 0.05);
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle {
        width: 38px;
        height: 38px;
    }
}

/* 26. ONE BAR (computers, from 901px wide)
   The menu box and the settings box are joined into one bar: no gap between them,
   no inner borders or corners, the background continues from one to the other, and
   a short glowing line separates the pages from the settings. Tablets keep two boxes
   (settings above the menu) and phones keep their own bars. */
@media (min-width: 901px) {
    header,
    header:has(nav) {
        gap: 0;
    }

    body header nav,
    body header nav:hover {
        padding-right: 10px;
        border-right: 0;
        border-radius: 16px 0 0 16px;
        background: linear-gradient(100deg, rgba(14, 22, 40, 0.92), rgba(24, 23, 47, 0.92));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), -6px 10px 30px -18px rgba(0, 0, 0, 0.8);
    }

    body header .theme-toolbar .appearance-controls {
        position: relative;
        padding-left: 21px;
        border-left: 0;
        border-radius: 0 16px 16px 0;
        background: linear-gradient(100deg, rgba(24, 23, 47, 0.92), rgba(30, 24, 52, 0.92));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 6px 10px 30px -18px rgba(0, 0, 0, 0.8);
    }

    /* The glowing line between the pages and the settings */
    body header .theme-toolbar .appearance-controls::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        width: 1px;
        height: 26px;
        transform: translateY(-50%);
        background: linear-gradient(180deg, transparent, #47e5ff, transparent);
        box-shadow: 0 0 8px rgba(71, 229, 255, 0.7);
        pointer-events: none;
    }

    :root[data-theme="light"] body header nav {
        border-right: 0;
        background: linear-gradient(100deg, var(--lm-surface), #f3f3f9);
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), -6px 10px 24px -18px rgba(16, 24, 40, 0.3);
    }

    :root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        border-left: 0;
        background: linear-gradient(100deg, #f3f3f9, #f1effa);
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 6px 10px 24px -18px rgba(16, 24, 40, 0.3);
    }

    :root[data-theme="light"] body header .theme-toolbar .appearance-controls::before {
        background: linear-gradient(180deg, transparent, var(--lm-accent), transparent);
        box-shadow: none;
    }
}

/* One bar, a little bigger on large screens (from 1181px), and the glowing line
   exactly halfway between the last page and the search */
@media (min-width: 901px) {
    body header .theme-toolbar .appearance-controls {
        padding-left: 12px;
    }
}

@media (min-width: 1181px) {
    body header .theme-toolbar .appearance-controls,
    body header nav,
    body header nav:hover {
        height: 68px;
    }

    body header nav,
    body header nav:hover {
        gap: 10px;
        padding: 9px 10px 9px 9px;
    }

    body header .theme-toolbar .appearance-controls {
        gap: 8px;
        padding: 9px 9px 9px 14px;
    }

    body header nav a,
    body header nav a:hover,
    body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"] {
        height: 48px;
        padding: 0 20px;
        border-radius: 12px;
        font-size: 17px;
    }

    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle),
    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle):hover,
    body header .appearance-controls .language-toggle .language-option {
        height: 48px;
        min-height: 48px;
        border-radius: 12px;
        font-size: 16px;
    }

    body header .appearance-controls .search-open {
        padding: 0 10px 0 16px;
    }

    body header .appearance-controls .search-open kbd {
        font-size: 12.5px;
    }

    body header .appearance-controls .language-toggle .language-option {
        min-width: 56px;
    }

    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    body header .theme-toolbar .appearance-controls::before {
        height: 30px;
    }
}

/* The bar sits in the middle of the space above the page content: the same gap above
   and below it (45px on the home page, 57px on the other pages) */
@media (min-width: 901px) {
    header,
    header:has(nav) {
        padding-top: 57px;
        padding-bottom: 11px;
    }

    :root:has(.home-layout) header {
        padding-top: 45px;
        padding-bottom: 0;
    }
}

/* One bar, one step bigger again on large screens (from 1400px: 76px high, 54px
   buttons). Between 1181px and 1399px the 68px size stays, so French fits. */
@media (min-width: 1400px) {
    body header .theme-toolbar .appearance-controls,
    body header nav,
    body header nav:hover {
        height: 76px;
        border-radius: 18px;
    }

    body header nav,
    body header nav:hover {
        gap: 12px;
        padding: 10px 12px 10px 10px;
        border-radius: 18px 0 0 18px;
    }

    body header .theme-toolbar .appearance-controls {
        gap: 10px;
        padding: 10px 10px 10px 16px;
        border-radius: 0 18px 18px 0;
    }

    body header nav a,
    body header nav a:hover,
    body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"] {
        height: 54px;
        padding: 0 22px;
        border-radius: 13px;
        font-size: 18px;
    }

    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle),
    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle):hover,
    body header .appearance-controls .language-toggle .language-option {
        height: 54px;
        min-height: 54px;
        border-radius: 13px;
        font-size: 17px;
    }

    body header .appearance-controls .search-open {
        padding: 0 12px 0 18px;
    }

    body header .appearance-controls .search-open kbd {
        font-size: 13px;
    }

    body header .appearance-controls .language-toggle .language-option {
        min-width: 62px;
    }

    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        width: 54px;
        height: 54px;
        font-size: 20px;
    }

    body header .theme-toolbar .appearance-controls::before {
        height: 34px;
    }
}

/* The page links never wrap to a second line */
@media (min-width: 601px) {
    body header nav,
    body header nav:hover {
        flex-wrap: nowrap;
    }
}

/* 27. NAV BAR: SMALLER AND MORE REFINED (computers, from 901px)
   A slightly smaller bar (64px on large screens) with a quieter, more premium finish:
   - frosted glass: the page shows through, softly blurred, with a fine light edge on top;
   - a calmer active pill (same green-to-cyan, a softer glow and a light inner shine);
   - hover: a soft lift of the text and a faint pill, no hard colours. */
@media (min-width: 901px) {
    body header nav,
    body header nav:hover,
    body header .theme-toolbar .appearance-controls {
        border-color: rgba(99, 234, 211, 0.22);
        -webkit-backdrop-filter: blur(14px) saturate(150%);
        backdrop-filter: blur(14px) saturate(150%);
    }

    body header nav,
    body header nav:hover {
        background: linear-gradient(100deg, rgba(13, 20, 37, 0.72), rgba(22, 21, 43, 0.72));
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.07),
            -8px 18px 40px -24px rgba(0, 0, 0, 0.9);
    }

    body header .theme-toolbar .appearance-controls {
        background: linear-gradient(100deg, rgba(22, 21, 43, 0.72), rgba(28, 22, 50, 0.72));
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.07),
            8px 18px 40px -24px rgba(0, 0, 0, 0.9);
    }

    body header nav a {
        color: #b9c6db;
        font-weight: 500;
    }

    body header nav a:hover,
    body header .appearance-controls .search-open:hover,
    body header .appearance-controls .language-toggle .language-option:not([aria-current]):hover,
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.045);
    }

    body header nav a[aria-current="page"],
    body header nav a[aria-current="page"]:hover,
    body header .appearance-controls .language-toggle .language-option[aria-current="true"],
    body header .appearance-controls .language-toggle:hover .language-option[aria-current="true"] {
        color: #052620;
        font-weight: 600;
        background: linear-gradient(135deg, #3ff0b0, #4fdcf5);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.45),
            0 4px 14px -6px rgba(79, 220, 245, 0.55);
    }

    body header .appearance-controls .search-open,
    body header .appearance-controls .language-toggle .language-option {
        color: #b9c6db;
        font-weight: 500;
    }

    body header .appearance-controls .search-open kbd {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        color: #9fb0c8;
    }

    body header .theme-toolbar .appearance-controls::before {
        background: linear-gradient(180deg, transparent, rgba(79, 220, 245, 0.8), transparent);
        box-shadow: 0 0 6px rgba(79, 220, 245, 0.45);
    }

    /* Light mode: milky glass */
    :root[data-theme="light"] body header nav,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        border-color: rgba(16, 24, 40, 0.1);
    }

    :root[data-theme="light"] body header nav {
        background: linear-gradient(100deg, rgba(255, 255, 255, 0.62), rgba(246, 245, 252, 0.62));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), -8px 16px 32px -24px rgba(16, 24, 40, 0.35);
    }

    :root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        background: linear-gradient(100deg, rgba(246, 245, 252, 0.62), rgba(242, 239, 250, 0.62));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 8px 16px 32px -24px rgba(16, 24, 40, 0.35);
    }

    :root[data-theme="light"] body header nav a,
    :root[data-theme="light"] body header .appearance-controls .search-open,
    :root[data-theme="light"] body header .appearance-controls .language-toggle .language-option {
        color: var(--lm-text-2);
    }

    :root[data-theme="light"] body header nav a:hover,
    :root[data-theme="light"] body header .appearance-controls .search-open:hover,
    :root[data-theme="light"] body header .appearance-controls .language-toggle .language-option:not([aria-current]):hover,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        color: var(--lm-text);
        background: rgba(16, 24, 40, 0.045);
    }

    :root[data-theme="light"] body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"]:hover,
    :root[data-theme="light"] body header .appearance-controls .language-toggle .language-option[aria-current="true"],
    :root[data-theme="light"] body header .appearance-controls .language-toggle:hover .language-option[aria-current="true"] {
        color: #ffffff;
        background: linear-gradient(135deg, #0a7062, #0b7f8c);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px -6px rgba(10, 112, 98, 0.55);
    }
}

/* Sizes: 64px bar on large screens (from 1181px), 46px buttons */
@media (min-width: 1181px) {
    body header .theme-toolbar .appearance-controls,
    body header nav,
    body header nav:hover {
        height: 64px;
    }

    body header nav,
    body header nav:hover {
        gap: 6px;
        padding: 8px 12px 8px 8px;
        border-radius: 16px 0 0 16px;
    }

    body header .theme-toolbar .appearance-controls {
        gap: 6px;
        padding: 8px 8px 8px 14px;
        border-radius: 0 16px 16px 0;
    }

    body header nav a,
    body header nav a:hover,
    body header nav a[aria-current="page"],
    :root[data-theme="light"] body header nav a[aria-current="page"] {
        height: 46px;
        padding: 0 18px;
        border-radius: 11px;
        font-size: 16px;
    }

    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle),
    body header .appearance-controls :is(.search-open, .language-toggle, .theme-toggle):hover,
    body header .appearance-controls .language-toggle .language-option {
        height: 46px;
        min-height: 46px;
        border-radius: 11px;
        font-size: 15px;
    }

    body header .appearance-controls .search-open {
        padding: 0 9px 0 16px;
    }

    body header .appearance-controls .search-open kbd {
        font-size: 12px;
    }

    body header .appearance-controls .language-toggle .language-option {
        min-width: 52px;
    }

    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle,
    :root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        width: 46px;
        height: 46px;
        font-size: 17px;
    }

    body header .theme-toolbar .appearance-controls::before {
        height: 26px;
    }
}

@media (prefers-reduced-transparency: reduce) {
    body header nav,
    body header .theme-toolbar .appearance-controls {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* 28. "VIEW ALL PROJECTS" (home page): a gradient pill like the active menu item,
   with the arrow in a small circle that turns on hover */
.section-heading > a.view-all {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    height: 42px;
    padding: 0 6px 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3ff0b0, #4fdcf5);
    color: #052620;
    font: 600 15px/1 var(--font-sans);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 18px -8px rgba(79, 220, 245, 0.6);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
}

.view-all .view-all-arrow {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(5, 38, 32, 0.14);
    font-size: 15px;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.section-heading > a.view-all:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 24px -8px rgba(79, 220, 245, 0.7);
}

.view-all:hover .view-all-arrow {
    transform: rotate(45deg);
}

.section-heading > a.view-all:focus-visible {
    outline: 2px solid #4fdcf5;
    outline-offset: 3px;
}

:root[data-theme="light"] .section-heading > a.view-all {
    background: linear-gradient(135deg, #0a7062, #0b7f8c);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px -8px rgba(10, 112, 98, 0.55);
}

:root[data-theme="light"] .view-all .view-all-arrow {
    background: rgba(255, 255, 255, 0.2);
}

:root[data-theme="light"] .section-heading > a.view-all:focus-visible {
    outline-color: var(--lm-accent);
}

@media (prefers-reduced-motion: reduce) {
    .section-heading > a.view-all,
    .view-all .view-all-arrow {
        transition: none;
    }
}

/* 29. PROFILE "DECRYPT" REVEAL (profile-decrypt.js): the canvas that covers the
   photo while it resolves from pixel blocks; removed when the reveal ends */
.photo-orbit .photo-decrypt {
    position: absolute;
    z-index: 2;
    border-radius: 50%;
    pointer-events: none;
}

/* 30. PROFILE PARTICLE HALO (profile-halo.js): small stars drift around the photo
   in place of the two coloured rings, which are switched off here */
.photo-orbit::before,
.photo-orbit::after {
    content: none;
}

.photo-orbit .photo-halo {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}


/* 31. LIGHT MODE: THE LIGHT TWIN OF THE DARK DESIGN
   Light mode keeps exactly the dark mode's design (the joined menu bar, the
   green-to-cyan pills, the round-arrow buttons, the cards, terminals and glows) and
   only swaps the colours: a cool white page, white cards with a fine teal-grey border
   and a soft teal shadow, dark navy text, and a deeper teal for highlighted words so
   they stay readable on white. Dark mode is not touched: every rule is light-only.
   The ":root:root" prefix outranks the earlier light rules. */
:root:root[data-theme="light"] {
    --lm-canvas: #f4f8fa;
    --lm-surface: #ffffff;
    --lm-surface-2: #f6f9fb;
    --lm-surface-3: #eef4f7;
    --lm-border: #d9e6ec;
    --lm-border-strong: #c3d4dc;
    --lm-text: #0b1a2a;
    --lm-text-2: #475467;
    --lm-text-3: #5b6475;
    --lm-accent: #0f766e;
    --lm-accent-hover: #115e59;
    --lm-accent-soft: #e6f7f4;
    --lm-accent-line: #99e2d6;
    --lm-accent-ring: rgba(15, 118, 110, 0.2);
    --lm-shadow-sm: 0 1px 2px rgba(11, 26, 42, 0.04), 0 8px 20px -14px rgba(13, 148, 136, 0.35);
    --lm-shadow-md: 0 2px 4px rgba(11, 26, 42, 0.05), 0 18px 36px -18px rgba(13, 148, 136, 0.45);
    --ds-card-shadow: var(--lm-shadow-sm);
}

:root:root[data-theme="light"] body {
    background: linear-gradient(180deg, #f8fbfd 0, #f1f6f9 640px);
    background-color: #f1f6f9;
}

/* Cards: white, fine border, soft teal shadow, a clear lift on hover */
:root:root[data-theme="light"] :is(.panel, .service-card, .skill-card, .project-tile > article, .journey-card, .explore-grid a,
    .contact-v2 .reach-form, .contact-v2 .reach-side, .contact-v2 .reach-feedback, .terminal, .footer-invitation) {
    background-color: #ffffff;
    border-color: #d9e6ec;
    box-shadow: var(--lm-shadow-sm);
}

:root:root[data-theme="light"] :is(.service-card, .skill-card, .project-tile > article, .explore-grid a, .journey-card):hover {
    border-color: #c3d4dc;
    box-shadow: var(--lm-shadow-md);
}

:root:root[data-theme="light"] .terminal :is(.terminal-header, .terminal-footer) {
    background: #f3f8fa;
    border-color: #e3edf1;
}

/* Highlighted words: the dark mode's cyan becomes a deeper teal on white */
:root:root[data-theme="light"] :is(.panel-label, .eyebrow, .footer-kicker, .skill-hash, .text-link, .about-link) {
    color: #0f766e;
}

:root:root[data-theme="light"] .footer-invitation h2 span {
    background: linear-gradient(100deg, #0f766e, #0e7490);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:root:root[data-theme="light"] .footer-invitation {
    background:
        radial-gradient(circle at 92% 10%, rgba(20, 184, 166, 0.12), transparent 42%),
        radial-gradient(circle at 42% 120%, rgba(139, 123, 255, 0.08), transparent 48%),
        #ffffff;
}

/* Buttons: the same bright green-to-cyan pill as in dark mode, dark text */
:root:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send),
:root:root[data-theme="light"] footer.portfolio-footer a.footer-hello,
:root:root[data-theme="light"] :is(.about-page, .contact-page) .cta-card .cta-pill,
:root:root[data-theme="light"] .section-heading > a.view-all {
    background: linear-gradient(135deg, #3ff0b0, #4fdcf5);
    border-color: transparent;
    color: #052620;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 20px -10px rgba(13, 148, 136, 0.55);
}

:root:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send):hover,
:root:root[data-theme="light"] footer.portfolio-footer a.footer-hello:hover,
:root:root[data-theme="light"] :is(.about-page, .contact-page) .cta-card .cta-pill:hover,
:root:root[data-theme="light"] .section-heading > a.view-all:hover {
    background: linear-gradient(135deg, #2ee6a4, #3fd3ef);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 26px -10px rgba(13, 148, 136, 0.65);
}

:root:root[data-theme="light"] :is(.footer-arrow, .cta-pill .cta-arrow, .view-all .view-all-arrow) {
    background: rgba(5, 38, 32, 0.12);
}

/* Secondary buttons and links keep their quiet style */
:root:root[data-theme="light"] :is(.button.secondary, .hero-actions .text-link) {
    background: transparent;
    color: #0f766e;
    box-shadow: none;
}

/* The menu bar (tablets and computers): the dark bar's twin in white */
@media (min-width: 601px) {
    :root:root[data-theme="light"] body header nav,
    :root:root[data-theme="light"] body header nav:hover {
        border-color: rgba(13, 148, 136, 0.28);
        background: linear-gradient(100deg, #ffffff, #f8f7fd);
        box-shadow: inset 0 1px 0 #ffffff, -8px 14px 30px -22px rgba(13, 148, 136, 0.55);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    :root:root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        border-color: rgba(13, 148, 136, 0.28);
        background: linear-gradient(100deg, #f8f7fd, #f3f1fb);
        box-shadow: inset 0 1px 0 #ffffff, 8px 14px 30px -22px rgba(13, 148, 136, 0.55);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    :root:root[data-theme="light"] body header nav a,
    :root:root[data-theme="light"] body header .appearance-controls :is(.search-open, .theme-toggle),
    :root:root[data-theme="light"] body header .appearance-controls .language-toggle .language-option {
        color: #475467;
    }

    :root:root[data-theme="light"] body header nav a:hover,
    :root:root[data-theme="light"] body header .appearance-controls .search-open:hover,
    :root:root[data-theme="light"] body header .appearance-controls .language-toggle .language-option:not([aria-current]):hover,
    :root:root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        color: #0b1a2a;
        background: rgba(13, 148, 136, 0.07);
    }

    :root:root[data-theme="light"] body header nav a[aria-current="page"],
    :root:root[data-theme="light"] body header nav a[aria-current="page"]:hover,
    :root:root[data-theme="light"] body header .appearance-controls .language-toggle .language-option[aria-current="true"],
    :root:root[data-theme="light"] body header .appearance-controls .language-toggle:hover .language-option[aria-current="true"] {
        color: #052620;
        background: linear-gradient(135deg, #3ff0b0, #4fdcf5);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 14px -6px rgba(13, 148, 136, 0.5);
    }

    :root:root[data-theme="light"] body header .appearance-controls .search-open kbd {
        border-color: rgba(13, 148, 136, 0.3);
        background: rgba(255, 255, 255, 0.7);
        color: #475467;
    }

    :root:root[data-theme="light"] body header .theme-toolbar .appearance-controls::before {
        background: linear-gradient(180deg, transparent, #14b8a6, transparent);
        box-shadow: 0 0 6px rgba(20, 184, 166, 0.4);
    }
}

/* Phones: the top bar and bottom bar in white, same pills */
@media (max-width: 600px) {
    :root:root[data-theme="light"] .theme-toolbar {
        background: rgba(255, 255, 255, 0.92);
        border-bottom: 1px solid #d9e6ec;
    }

    :root:root[data-theme="light"] header nav {
        background: #ffffff;
        border-color: #d9e6ec;
        box-shadow: 0 12px 30px -16px rgba(13, 148, 136, 0.45);
    }

    :root:root[data-theme="light"] .theme-toolbar .language-option[aria-current="true"] {
        color: #052620;
        background: linear-gradient(135deg, #3ff0b0, #4fdcf5);
    }
}

/* Selected filter tabs and message types: the teal pill of dark mode, in light */
:root:root[data-theme="light"] :is(.skill-filter button[aria-selected="true"], .project-toolbar .project-filters button[aria-pressed="true"], .message-kind-list button[aria-checked="true"]) {
    background: #e6f7f4;
    border-color: #5fd0c0;
    color: #0f766e;
    box-shadow: none;
}

:root:root[data-theme="light"] .project-toolbar .project-filters button[aria-pressed="true"] .filter-count {
    background: #0f766e;
    color: #ffffff;
}

/* 32. LIGHT MODE PALETTE: "APPLE GREY"
   Same design as section 31; only the light colours change: a soft grey page
   (#f5f5f7) where the white cards and the white menu bar stand out, near-black
   text, and neutral shadows instead of teal ones. Light mode only. */
:root:root[data-theme="light"] {
    --lm-canvas: #f5f5f7;
    --lm-surface: #ffffff;
    --lm-surface-2: #f5f5f7;
    --lm-surface-3: #ececf0;
    --lm-border: #e5e5ea;
    --lm-border-strong: #d2d2d7;
    --lm-text: #1d1d1f;
    --lm-text-2: #515154;
    --lm-text-3: #6e6e73;
    --lm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 20px -14px rgba(0, 0, 0, 0.16);
    --lm-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 36px -18px rgba(0, 0, 0, 0.22);
    --ds-card-shadow: var(--lm-shadow-sm);
}

:root:root[data-theme="light"] body {
    background: #f5f5f7;
}

:root:root[data-theme="light"] :is(.panel, .service-card, .skill-card, .project-tile > article, .journey-card, .explore-grid a,
    .contact-v2 .reach-form, .contact-v2 .reach-side, .contact-v2 .reach-feedback, .terminal, .footer-invitation) {
    border-color: #e5e5ea;
}

:root:root[data-theme="light"] :is(.service-card, .skill-card, .project-tile > article, .explore-grid a, .journey-card):hover {
    border-color: #d2d2d7;
}

:root:root[data-theme="light"] .terminal :is(.terminal-header, .terminal-footer) {
    background: #f9f9fb;
    border-color: #ececf0;
}

:root:root[data-theme="light"] .footer-invitation {
    background:
        radial-gradient(circle at 92% 10%, rgba(20, 184, 166, 0.08), transparent 42%),
        #ffffff;
}

/* Buttons keep the green-to-cyan pill, with a neutral shadow on grey */
:root:root[data-theme="light"] :is(.button, a.button, .cv-btn, .contact-v2 button.message-send),
:root:root[data-theme="light"] footer.portfolio-footer a.footer-hello,
:root:root[data-theme="light"] :is(.about-page, .contact-page) .cta-card .cta-pill,
:root:root[data-theme="light"] .section-heading > a.view-all {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px -8px rgba(0, 0, 0, 0.22);
}

/* The menu bar: white, light grey border, soft neutral shadow */
@media (min-width: 601px) {
    :root:root[data-theme="light"] body header nav,
    :root:root[data-theme="light"] body header nav:hover,
    :root:root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        border-color: #e2e2e7;
        background: rgba(255, 255, 255, 0.92);
    }

    :root:root[data-theme="light"] body header nav,
    :root:root[data-theme="light"] body header nav:hover {
        box-shadow: -8px 12px 28px -20px rgba(0, 0, 0, 0.25);
    }

    :root:root[data-theme="light"] body header .theme-toolbar .appearance-controls {
        box-shadow: 8px 12px 28px -20px rgba(0, 0, 0, 0.25);
    }

    :root:root[data-theme="light"] body header nav a,
    :root:root[data-theme="light"] body header .appearance-controls :is(.search-open, .theme-toggle),
    :root:root[data-theme="light"] body header .appearance-controls .language-toggle .language-option {
        color: #515154;
    }

    :root:root[data-theme="light"] body header nav a:hover,
    :root:root[data-theme="light"] body header .appearance-controls .search-open:hover,
    :root:root[data-theme="light"] body header .appearance-controls .language-toggle .language-option:not([aria-current]):hover,
    :root:root[data-theme="light"] body header .theme-toolbar .appearance-controls .theme-picker .theme-toggle:hover {
        color: #1d1d1f;
        background: rgba(0, 0, 0, 0.05);
    }

    :root:root[data-theme="light"] body header .appearance-controls .search-open kbd {
        border-color: #d2d2d7;
        background: #f5f5f7;
        color: #515154;
    }
}

@media (max-width: 600px) {
    :root:root[data-theme="light"] .theme-toolbar {
        border-bottom-color: #e5e5ea;
    }

    :root:root[data-theme="light"] header nav {
        border-color: #e5e5ea;
        box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.25);
    }
}

/* 33. "ASK ABOUT ZAID" ASSISTANT, APPLE STYLE
   A frosted-glass capsule button opens a frosted-glass window with large rounded
   corners, a "Chat / Quick facts" switch, iMessage bubbles (questions in blue on the
   right, answers in grey on the left) and a round message field with a blue send
   button. Dark and light mode use the same shapes; only the glass tint changes. */
body .assistant-launch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(28, 34, 52, 0.62);
    color: #ffffff;
    font: 500 14.5px/1 var(--font-sans);
    letter-spacing: -0.01em;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}

body .assistant-launch:hover {
    transform: translateY(-2px);
    background: rgba(38, 46, 68, 0.72);
}

body .assistant-launch.is-open {
    background: rgba(10, 132, 255, 0.9);
    border-color: transparent;
}

body .assistant-panel {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: rgba(20, 26, 42, 0.92);
    color: #eef2f8;
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    font-family: var(--font-sans);
}

body .assistant-panel[hidden] {
    display: none;
}

body .assistant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px 18px;
    border: 0;
    background: none;
}

body .assistant-title {
    margin: 0;
    color: inherit;
    font: 600 17px/1.2 var(--font-sans);
    letter-spacing: -0.02em;
}

body .assistant-dot {
    display: none;
}

body .assistant-close {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(235, 240, 248, 0.85);
    cursor: pointer;
}

body .assistant-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* The segmented switch */
body .assistant-tabs {
    display: flex;
    gap: 2px;
    margin: 0 16px 6px;
    padding: 2px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

body .assistant-tabs button {
    flex: 1;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(235, 240, 248, 0.72);
    font: 500 13px/1.2 var(--font-sans);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body .assistant-tabs button[aria-selected="true"] {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

body .assistant-tabs button:focus-visible,
body .assistant-close:focus-visible,
body .assistant-launch:focus-visible {
    outline: 2px solid #0a84ff;
    outline-offset: 2px;
}

body .assistant-view {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

body .assistant-view[hidden] {
    display: none;
}

/* Messages */
body .assistant-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body .assistant-msg {
    max-width: 82%;
    padding: 9px 13px;
    border: 0;
    font: 400 14.5px/1.45 var(--font-sans);
    letter-spacing: -0.01em;
}

body .assistant-msg p {
    margin: 0;
}

body .assistant-msg p + p,
body .assistant-msg ul + p,
body .assistant-msg p + ul {
    margin-top: 6px;
}

body .assistant-msg.is-assistant {
    align-self: flex-start;
    border-radius: 20px 20px 20px 6px;
    background: rgba(255, 255, 255, 0.11);
    color: #eef2f8;
}

body .assistant-msg.is-user {
    align-self: flex-end;
    border-radius: 20px 20px 6px 20px;
    background: #0a84ff;
    color: #ffffff;
}

body .assistant-msg a {
    color: #64b5ff;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body .assistant-msg.is-error {
    background: rgba(255, 69, 58, 0.16);
    color: #ffb4ae;
}

/* Suggestions */
body .assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 14px 8px;
}

body .assistant-suggestions:empty {
    display: none;
}

body .assistant-suggestions button {
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbe3ef;
    font: 500 12.5px/1.2 var(--font-sans);
    cursor: pointer;
}

body .assistant-suggestions button:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* The message field */
body .assistant-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 4px 12px 6px;
    padding: 5px 5px 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

body .assistant-form:focus-within {
    border-color: rgba(10, 132, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

body .assistant-form textarea,
body .assistant-form textarea:hover,
body .assistant-form textarea:focus {
    flex: 1;
    min-height: 32px;
    padding: 6px 0;
    border: 0;
    outline: none;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: 400 14.5px/1.4 var(--font-sans);
    resize: none;
}

body .assistant-form textarea::placeholder {
    color: rgba(235, 240, 248, 0.5);
}

body .assistant-send {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0a84ff;
    color: #ffffff;
    box-shadow: none;
    cursor: pointer;
}

body .assistant-send:hover {
    background: #2b95ff;
}

body .assistant-note {
    margin: 0;
    padding: 0 16px 12px;
    color: rgba(235, 240, 248, 0.5);
    font: 400 11px/1.4 var(--font-sans);
    text-align: center;
}

/* Quick facts: grouped list like the iOS Settings app */
body .assistant-facts {
    overflow-y: auto;
    padding: 6px 16px 16px;
}

body .assistant-group {
    overflow: hidden;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

body .assistant-group-title {
    margin: 16px 4px 6px;
    color: rgba(235, 240, 248, 0.55);
    font: 500 11.5px/1.2 var(--font-sans);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body .assistant-fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 14px;
    color: #eef2f8;
    font: 400 13.5px/1.4 var(--font-sans);
    text-decoration: none;
}

body .assistant-fact + .assistant-fact {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body .assistant-fact span {
    flex-shrink: 0;
    color: rgba(235, 240, 248, 0.6);
}

body .assistant-fact strong {
    font-weight: 500;
    text-align: right;
}

body .assistant-fact.is-link {
    color: #64b5ff;
    font-weight: 500;
}

body .assistant-fact.is-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Light mode: white frosted glass, same shapes */
:root:root[data-theme="light"] body .assistant-launch {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.72);
    color: #1d1d1f;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.25), inset 0 1px 0 #ffffff;
}

:root:root[data-theme="light"] body .assistant-launch:hover {
    background: rgba(255, 255, 255, 0.9);
}

:root:root[data-theme="light"] body .assistant-launch.is-open {
    background: #007aff;
    color: #ffffff;
}

:root:root[data-theme="light"] body .assistant-panel {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.94);
    color: #1d1d1f;
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.3), inset 0 1px 0 #ffffff;
}

:root:root[data-theme="light"] body .assistant-close {
    background: rgba(0, 0, 0, 0.06);
    color: #6e6e73;
}

:root:root[data-theme="light"] body .assistant-tabs {
    background: rgba(0, 0, 0, 0.06);
}

:root:root[data-theme="light"] body .assistant-tabs button {
    color: #515154;
}

:root:root[data-theme="light"] body .assistant-tabs button[aria-selected="true"] {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

:root:root[data-theme="light"] body .assistant-msg.is-assistant {
    background: #e9e9eb;
    color: #1d1d1f;
}

:root:root[data-theme="light"] body .assistant-msg.is-user {
    background: #007aff;
}

:root:root[data-theme="light"] body .assistant-msg a {
    color: #0062cc;
}

:root:root[data-theme="light"] body .assistant-suggestions button {
    border-color: rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #1d1d1f;
}

:root:root[data-theme="light"] body .assistant-form {
    border-color: rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

:root:root[data-theme="light"] body .assistant-form textarea::placeholder {
    color: #8e8e93;
}

:root:root[data-theme="light"] body .assistant-send {
    background: #007aff;
}

:root:root[data-theme="light"] body .assistant-note,
:root:root[data-theme="light"] body .assistant-group-title {
    color: #6e6e73;
}

:root:root[data-theme="light"] body .assistant-group {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

:root:root[data-theme="light"] body .assistant-fact {
    color: #1d1d1f;
}

:root:root[data-theme="light"] body .assistant-fact + .assistant-fact {
    border-top-color: rgba(0, 0, 0, 0.07);
}

:root:root[data-theme="light"] body .assistant-fact span {
    color: #6e6e73;
}

:root:root[data-theme="light"] body .assistant-fact.is-link {
    color: #0062cc;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body .assistant-panel { background: #161c2e; }
    :root:root[data-theme="light"] body .assistant-panel { background: #ffffff; }
}

/* The panel's top bar is a <header>, so the site's phone rules for the page header
   also reach it; keep it a single row. The message field keeps its own look on
   phones and in light mode, where the generic form-field rules would box it. */
:root:root body .assistant-panel > header.assistant-head {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    width: auto;
    padding: 16px 16px 10px 18px;
}

:root:root body .assistant-panel .assistant-form textarea,
:root:root[data-theme="light"] body .assistant-panel .assistant-form textarea {
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
}
