/* =========================================================
   Aya Briksine – Portfolio
   ---------------------------------------------------------
   1. Colors & settings (change the colors here)
   2. Base
   3. Buttons & shared pieces
   4. Header & menu
   5. Hero
   6. Sections
   7. Background (experience / education / certifications)
   8. Services
   9. Skills
   10. Projects
   11. Contact
   12. Footer
   13. Animations
   14. Tablet & phone
   ========================================================= */

/* ---------- 1. Colors & settings ---------- */
:root {
    --bg: #0b0b10;
    --bg-alt: #101017;
    --surface: #16161f;
    --surface-2: #1e1e29;
    --surface-rgb: 22, 22, 31;
    --border: rgba(255, 255, 255, 0.08);
    --text: #ededf2;
    --heading: #c4c8d0;           /* titles: light gray */
    --muted: #a4a4b3;
    --accent: #dfe2e8;            /* brand color: silver gray */
    --accent-rgb: 223, 226, 232;  /* same color, used for glows */
    --accent-strong: #e4e6eb;     /* buttons */
    --on-accent: #111217;         /* text on buttons */
    --accent-soft: rgba(223, 226, 232, 0.1);
    --header-bg: rgba(11, 11, 16, 0.78);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --logo-tile: #ffffff;
    --signal: #8fb8d4;            /* muted steel blue: tiny engineering accents only */
    --signal-rgb: 143, 184, 212;

    /* neon "lights" used in dark mode */
    --glow: 0 0 22px rgba(223, 226, 232, 0.3);
    --glow-strong: 0 0 22px rgba(223, 226, 232, 0.55), 0 0 44px rgba(223, 226, 232, 0.25);
    --glow-photo: 0 0 25px rgba(223, 226, 232, 0.45), 0 0 60px rgba(223, 226, 232, 0.22), 0 0 110px rgba(223, 226, 232, 0.12);
    --text-glow: 0 0 22px rgba(223, 226, 232, 0.35);

    --radius: 18px;
    --radius-sm: 12px;
    --header-h: 64px;
    --container: 1160px;
}

/* Light mode: soft light gray instead of white */
.light-mode {
    --bg: #e8e9ed;
    --bg-alt: #dfe1e6;
    --surface: #f3f4f6;
    --surface-2: #e9eaee;
    --surface-rgb: 243, 244, 246;
    --border: rgba(20, 20, 40, 0.1);
    --text: #17171e;
    --heading: #17171e;
    --muted: #545766;
    --accent: #3a3e47;            /* charcoal gray, readable on the light gray */
    --accent-rgb: 58, 62, 71;
    --accent-strong: #2e3139;
    --on-accent: #ffffff;
    --accent-soft: rgba(58, 62, 71, 0.08);
    --header-bg: rgba(232, 233, 237, 0.85);
    --shadow: 0 18px 40px rgba(30, 30, 60, 0.1);
    --logo-tile: #ffffff;
    --signal: #4d7a99;
    --signal-rgb: 77, 122, 153;

    /* no neon in light mode: soft pink shadows instead */
    --glow: 0 8px 22px rgba(30, 32, 40, 0.14);
    --glow-strong: 0 10px 28px rgba(30, 32, 40, 0.22);
    --glow-photo: 0 20px 50px rgba(30, 32, 40, 0.18);
    --text-glow: none;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

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

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.container {
    width: min(var(--container), 100% - 48px);
    margin-inline: auto;
}

.accent {
    color: var(--accent);
}

h1,
h2,
h3 {
    color: var(--heading);
}

/* ---------- 3. Buttons & shared pieces ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn i {
    font-size: 19px;
}

.btn-primary {
    background: var(--accent-strong);
    color: var(--on-accent);
    box-shadow: 0 8px 24px var(--accent-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.35);
}

.btn-outline {
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 14px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-btn i {
    font-size: 20px;
}

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

.icon-box {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.socials {
    display: flex;
    gap: 12px;
}

.socials a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 20px;
    transition: all 0.2s ease;
}

.socials a:hover {
    color: var(--on-accent);
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    transform: translateY(-3px);
}

/* ---------- 4. Header & menu ---------- */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--border);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.logo-mark {
    width: 32px;
    height: 32px;
    flex: none;
    transition: transform 0.5s cubic-bezier(.3, 1.4, .5, 1);
}

.logo-mark .lm-hex { fill: var(--accent); }
.logo-mark .lm-a {
    fill: none;
    stroke: var(--bg);
    stroke-width: 3.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.logo-mark .lm-joint { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.logo-mark .lm-pin { fill: var(--accent); }

.logo:hover .logo-mark {
    transform: rotate(-8deg) scale(1.06);
}

.logo-text span {
    color: var(--muted);
}

.navbar {
    display: flex;
    gap: 1px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.07);
}

.navbar a {
    position: relative;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar a::after {
    display: none;
}

.navbar a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.navbar a.active {
    color: var(--on-accent);
    background: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
}

/* ---------- 5. Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    padding: calc(var(--header-h) + 56px) 0 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 64px;
    overflow: hidden;
}

/* soft brand glow in the background */
.hero::before {
    content: "";
    position: absolute;
    top: -160px;
    right: -160px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 65%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    align-items: center;
    gap: 64px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
}

.badge i {
    color: var(--accent);
    font-size: 16px;
}

.hero h1 .accent {
    white-space: nowrap;
}

.hero h1 {
    margin-top: 22px;
    font-size: clamp(38px, 5.6vw, 64px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -1.5px;
}

.hero-role {
    margin-top: 14px;
    min-height: 1.5em;
    font-size: clamp(19px, 2.2vw, 25px);
    font-weight: 600;
    color: var(--accent);
}

.caret {
    display: inline-block;
    width: 2px;
    height: 1.05em;
    margin-left: 3px;
    vertical-align: -0.15em;
    background: currentColor;
    animation: blink 1s steps(1) infinite;
}

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

.hero-intro {
    margin-top: 20px;
    max-width: 580px;
    color: var(--muted);
    font-size: 16.5px;
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.hero .socials {
    margin-top: 32px;
}

.hero-photo {
    display: flex;
    justify-content: center;
}

.photo-frame {
    position: relative;
    width: min(470px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    background: linear-gradient(145deg, var(--accent), transparent 55%, var(--accent-soft));
}

/* light mode: a solid pink border that matches the site's pink */
.light-mode .photo-frame {
    padding: 8px;
    background: var(--accent);
    box-shadow: 0 20px 50px rgba(var(--accent-rgb), 0.2);
}

.photo-frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.stats li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
}

.stats li + li {
    border-left: 1px solid var(--border);
}

.stats strong {
    white-space: nowrap;
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    position: relative;
    padding-bottom: 12px;
}

.stats strong::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
    opacity: 0.55;
}

.stats span {
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

/* ---------- 6. Sections ---------- */
.section {
    padding: 110px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-head {
    max-width: 640px;
    margin: 0 auto 56px;
    text-align: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}

.section-title {
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -1px;
}

.section-sub {
    margin-top: 14px;
    color: var(--muted);
    font-size: 16.5px;
}

.org {
    color: var(--accent);
    font-size: 14.5px;
    font-weight: 500;
}

.date {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* ---------- 7. Background ---------- */
.tabs {
    display: flex;
    width: fit-content;
    margin: 0 auto 48px;
    padding: 5px;
    gap: 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.tab {
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--accent-strong);
    color: var(--on-accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeUp 0.45s ease;
}

.timeline {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding-left: 36px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(var(--accent), var(--border));
}

.timeline-item {
    position: relative;
}

.timeline-item + .timeline-item {
    margin-top: 24px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -34px;
    top: 28px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 3px solid var(--accent);
}

.timeline-card {
    padding: 26px 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.timeline-card:hover {
    border-color: var(--accent-soft);
    transform: translateX(4px);
}

.timeline-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.timeline-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.timeline-card ul li {
    position: relative;
    padding-left: 20px;
    color: var(--muted);
    font-size: 15px;
}

.timeline-card ul li + li {
    margin-top: 6px;
}

.timeline-card ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.edu-card {
    padding: 28px;
}

.edu-card:hover,
.service-card:hover,
.project-card:hover,
.cert-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-soft);
    box-shadow: var(--shadow);
}

.edu-card h3 {
    margin-top: 16px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.edu-card .org {
    margin-top: 4px;
}

.edu-card p:last-child {
    margin-top: 12px;
    color: var(--muted);
    font-size: 15px;
}

.cert-card {
    overflow: hidden;
}

.cert-image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.cert-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.cert-card:hover .cert-image img {
    transform: scale(1.04);
}

.cert-body {
    padding: 22px 24px 24px;
}

.cert-body h3 {
    font-size: 18px;
    font-weight: 600;
}

.cert-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
}

.cert-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    transition: color 0.2s ease;
}

.cert-links a i {
    font-size: 18px;
    color: var(--accent);
}

.cert-links a:hover {
    color: var(--accent);
}

/* ---------- 8. Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    padding: 34px;
}

.service-card h3 {
    margin: 22px 0 10px;
    font-size: 20px;
    font-weight: 600;
}

.service-card p {
    color: var(--muted);
    font-size: 15.5px;
}

/* ---------- 9. Skills ---------- */
/* cards flow into columns like a masonry wall, so there are no empty gaps */
.skills-grid {
    columns: 3 300px;
    column-gap: 24px;
}

.skill-group {
    padding: 28px;
    margin-bottom: 24px;
    break-inside: avoid;
}

.skill-group h3 {
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 600;
}

.skill-group .sub-heading {
    margin-top: 26px;
}

.tool-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-list li {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.tool-list li:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tool-list img {
    width: 28px;
    height: 28px;
    padding: 3px;
    border-radius: 50%;
    background: var(--logo-tile);
    object-fit: contain;
}

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

.chip-list li {
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 500;
}

.lang-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lang-list li {
    flex: 1 1 90px;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.lang-list span {
    font-weight: 600;
    font-size: 15px;
}

.lang-list small {
    color: var(--muted);
    font-size: 13px;
}

/* ---------- 10. Projects ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter i {
    font-size: 18px;
}

.filter span {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 600;
}

.filter:hover {
    color: var(--text);
    border-color: var(--accent);
}

.filter.active {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--on-accent);
    box-shadow: var(--glow);
}

.filter.active span {
    background: rgba(127, 127, 127, 0.28);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* card picture: a blueprint grid with the project's icon (or a photo if "image" is set) */
.project-visual {
    position: relative;
    display: grid;
    place-items: center;
    height: 170px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
        radial-gradient(circle at 50% 55%, var(--cat-soft), transparent 70%),
        var(--surface-2);
    --grid-line: rgba(255, 255, 255, 0.05);
}

.light-mode .project-visual {
    --grid-line: rgba(20, 20, 40, 0.06);
}

.project-visual > i {
    font-size: 64px;
    color: var(--cat);
    filter: drop-shadow(0 0 18px var(--cat));
    transition: transform 0.35s ease;
}

.light-mode .project-visual > i {
    filter: none;
}

.project-visual.has-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-visual > i {
    transform: scale(1.1) rotate(-4deg);
}

.project-card:hover .project-visual img {
    transform: scale(1.05);
}

.project-cat {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--cat);
    font-size: 12.5px;
    font-weight: 600;
}

/* one color per category */
.cat-robotics { --cat: #f2f3f6; --cat-soft: rgba(242, 243, 246, 0.2); }
.cat-control  { --cat: #c6cbd4; --cat-soft: rgba(198, 203, 212, 0.18); }
.cat-software { --cat: #a4aab5; --cat-soft: rgba(164, 170, 181, 0.18); }
.cat-automation  { --cat: #d9dce3; --cat-soft: rgba(217, 220, 227, 0.18); }
.cat-signal      { --cat: #b4bac5; --cat-soft: rgba(180, 186, 197, 0.18); }
.cat-iot         { --cat: #9aa1ad; --cat-soft: rgba(154, 161, 173, 0.18); }
.cat-programming { --cat: #c0c5ce; --cat-soft: rgba(192, 197, 206, 0.18); }
.cat-digital  { --cat: #878e9a; --cat-soft: rgba(135, 142, 154, 0.18); }
.cat-electrotechnique { --cat: #cfd3db; --cat-soft: rgba(207, 211, 219, 0.18); }

.light-mode .cat-robotics { --cat: #1b1d22; --cat-soft: rgba(27, 29, 34, 0.12); }
.light-mode .cat-control  { --cat: #3d424c; --cat-soft: rgba(61, 66, 76, 0.12); }
.light-mode .cat-software { --cat: #5a606b; --cat-soft: rgba(90, 96, 107, 0.12); }
.light-mode .cat-automation  { --cat: #2b2f37; --cat-soft: rgba(43, 47, 55, 0.12); }
.light-mode .cat-signal      { --cat: #4a505b; --cat-soft: rgba(74, 80, 91, 0.12); }
.light-mode .cat-iot         { --cat: #646a75; --cat-soft: rgba(100, 106, 117, 0.12); }
.light-mode .cat-programming { --cat: #3a3f48; --cat-soft: rgba(58, 63, 72, 0.12); }
.light-mode .cat-digital  { --cat: #767c87; --cat-soft: rgba(118, 124, 135, 0.12); }
.light-mode .cat-electrotechnique { --cat: #333841; --cat-soft: rgba(51, 56, 65, 0.12); }

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

.project-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

.project-meta span:last-child {
    white-space: nowrap;
}

.project-card h3 {
    margin: 10px 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.project-card h3 a:hover {
    color: var(--accent);
}

.project-summary {
    color: var(--muted);
    font-size: 14.5px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
}

.tags li {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-ghost {
    border: 1.5px dashed var(--border);
    color: var(--muted);
    cursor: default;
}

.project-more {
    align-items: flex-start;
    justify-content: center;
    padding: 32px;
    border-style: dashed;
}

.project-more h3 {
    margin-top: 18px;
}

.project-more p {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14.5px;
}

/* ---------- Redesigned project cards ---------- */
.project-card {
    position: relative;
    border-radius: 22px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
}

.project-card::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--accent);
    transition: width 0.4s ease;
}

.project-card:hover::before {
    width: 100%;
}

.project-body {
    position: relative;
}

.project-index {
    position: absolute;
    top: 14px;
    right: 22px;
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--border);
    pointer-events: none;
}

.project-meta {
    align-items: flex-start;
    padding-right: 60px;
}

.project-meta span:first-child {
    padding-left: 10px;
    border-left: 2px solid var(--accent);
}

/* the first project is shown wide, picture on the left */
.project-featured {
    grid-column: 1 / -1;
    flex-direction: row;
}

.project-featured .project-visual {
    flex: 0 0 46%;
    height: auto;
    min-height: 320px;
    border-bottom: none;
    border-right: 1px solid var(--border);
}

.project-featured .project-body {
    justify-content: center;
    padding: 36px 40px;
}

.project-featured h3 {
    font-size: 26px;
}

.project-featured .project-summary {
    font-size: 16px;
}

.project-featured .tags {
    margin-top: 0;
}

.project-more {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
}

.project-more h3,
.project-more p {
    margin: 0;
}

.project-more p {
    flex: 1 1 280px;
}

@media (max-width: 920px) {
    .project-featured {
        flex-direction: column;
    }

    .project-featured .project-visual {
        flex-basis: auto;
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .project-featured .project-body {
        padding: 24px;
    }
}

/* ---------- Project page (project.html) ---------- */
.project-hero {
    position: relative;
    padding: calc(var(--header-h) + 56px) 0 40px;
    overflow: hidden;
}

.project-hero::before {
    content: "";
    position: absolute;
    top: -200px;
    right: -120px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 65%);
    pointer-events: none;
}

.project-hero .container {
    position: relative;
    max-width: 900px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14.5px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

.project-cat-pill {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--cat);
    font-size: 13.5px;
    font-weight: 600;
}

.project-hero h1 {
    margin-top: 16px;
    font-size: clamp(30px, 4.6vw, 50px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -1px;
}

.project-lead {
    margin-top: 16px;
    max-width: 680px;
    color: var(--muted);
    font-size: 17.5px;
}

.project-content {
    padding: 20px 0 100px;
}

.project-content .container {
    max-width: 900px;
}

.project-banner {
    height: 300px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.project-banner > i {
    font-size: 110px;
}

.project-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    margin-top: 40px;
    align-items: start;
}

.project-main h2,
.project-side h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.project-main h2:not(:first-child) {
    margin-top: 36px;
}

.project-main > p {
    color: var(--muted);
}

.check-list {
    display: grid;
    gap: 12px;
}

.check-list li {
    display: flex;
    gap: 12px;
    color: var(--muted);
}

.check-list i {
    flex-shrink: 0;
    margin-top: 3px;
    font-size: 20px;
    color: var(--accent);
}

.project-gallery {
    margin-top: 48px;
}

.project-gallery h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 18px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;                 /* a short picture no longer leaves an empty block under it */
}

.gallery figure {
    display: flex;
    flex-direction: column;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery figure:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.gallery figure a {
    display: block;
    background: #fff;
    cursor: zoom-in;
}

.gallery img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

.gallery figcaption {
    padding: 12px 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    border-top: 1px solid var(--border);
}

.project-visual.fit-contain {
    background: #fff;
}

.project-visual.fit-contain img {
    object-fit: contain;
    padding: 8px;
}

.project-card:hover .project-visual.fit-contain img {
    transform: none;
}

@media (max-width: 700px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

.project-side {
    padding: 26px;
}

.project-side dl {
    display: grid;
    gap: 4px;
    margin-bottom: 26px;
}

.project-side dt {
    color: var(--muted);
    font-size: 13px;
}

.project-side dd {
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 15px;
}

.project-side .tags {
    padding-top: 0;
}

.project-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 48px;
    padding: 26px 30px;
    background:
        radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 60%),
        var(--surface);
}

.project-cta p {
    font-size: 17px;
    font-weight: 600;
}

.project-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.project-nav a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-nav a:hover {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.project-nav .next {
    text-align: right;
}

.project-nav small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
}

.project-nav .next small {
    justify-content: flex-end;
}

.project-nav span {
    font-weight: 600;
}

/* ---------- 11. Contact ---------- */
.contact-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 56px;
    padding: 56px;
    border-radius: 28px;
    border: 1px solid var(--border);
    /* slightly see-through, so the robots and equations behind it show softly */
    background:
        radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 55%),
        rgba(var(--surface-rgb), 0.5);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.contact-text .section-sub {
    margin-bottom: 30px;
}

.contact-list {
    display: grid;
    gap: 14px;
}

.contact-list a,
.contact-list div {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-list a:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.contact-list span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.contact-list small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

/* ---------- 12. Footer ---------- */
.footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer p {
    color: var(--muted);
    font-size: 14px;
}

.socials-sm a {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.back-top {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-strong);
    color: var(--on-accent);
    font-size: 22px;
    transition: transform 0.2s ease;
}

.back-top:hover {
    transform: translateY(-3px);
}

/* ---------- 13. Animations ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* sections fade in as you scroll (only when JavaScript is on) */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ---------- Hero badges, notes & small extras ---------- */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-live {
    color: var(--text);
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.live-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.live-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #22c55e;
    animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
    from { transform: scale(0.6); opacity: 1; }
    to { transform: scale(1.8); opacity: 0; }
}

.note {
    margin: -6px 0 12px;
    color: var(--muted);
    font-size: 13.5px;
    font-style: italic;
}

.edu-featured {
    grid-column: 1 / -1;
    border-color: var(--accent);
    box-shadow: var(--glow);
}

.tool-list li > i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 16px;
}

/* ---------- Dark mode "lights" (neon glow, like the original design) ---------- */
html:not(.light-mode) .logo-text span,
html:not(.light-mode) .hero h1 .accent,
html:not(.light-mode) .hero-role,
html:not(.light-mode) .stats strong {
    text-shadow: var(--text-glow);
}

html:not(.light-mode) .hero::after {
    content: "";
    position: absolute;
    left: -200px;
    bottom: -220px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.1), transparent 65%);
    pointer-events: none;
}

html:not(.light-mode) .photo-frame {
    padding: 6px;
    background: var(--accent);
    box-shadow: var(--glow-photo);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

html:not(.light-mode) .photo-frame:hover {
    transform: scale(1.02);
    box-shadow: 0 0 35px var(--accent), 0 0 70px rgba(var(--accent-rgb), 0.7), 0 0 140px rgba(var(--accent-rgb), 0.45);
}

html:not(.light-mode) .btn-primary {
    box-shadow: var(--glow);
}

html:not(.light-mode) .btn-primary:hover {
    box-shadow: var(--glow-strong);
}

html:not(.light-mode) .btn-outline:hover {
    box-shadow: var(--glow);
}

html:not(.light-mode) .hero .socials a {
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
}

html:not(.light-mode) .socials a:hover {
    color: var(--on-accent);
    background: var(--accent);
    box-shadow: var(--glow-strong);
    transform: scale(1.15) translateY(-3px);
}

html:not(.light-mode) .tab.active {
    box-shadow: var(--glow);
}

html:not(.light-mode) .timeline::before {
    background: var(--accent);
    box-shadow: var(--glow);
}

html:not(.light-mode) .timeline-item::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--glow-strong);
}

html:not(.light-mode) .timeline-card {
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.12);
}

html:not(.light-mode) .timeline-card:hover {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

html:not(.light-mode) .edu-card:hover,
html:not(.light-mode) .service-card:hover,
html:not(.light-mode) .project-card:hover,
html:not(.light-mode) .cert-card:hover,
html:not(.light-mode) .skill-group:hover {
    border-color: rgba(var(--accent-rgb), 0.6);
    box-shadow: var(--glow);
}

html:not(.light-mode) .service-card:hover .icon-box,
html:not(.light-mode) .contact-list a:hover .icon-box {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--glow-strong);
}

html:not(.light-mode) .contact-panel {
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.15);
}

html:not(.light-mode) .back-top {
    box-shadow: var(--glow);
}

/* ---------- 14. Tablet & phone ---------- */
@media (max-width: 1080px) {
    .header-cta {
        display: none;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar a {
        padding: 8px 10px;
    }
}

@media (max-width: 920px) {
    :root {
        --header-h: 68px;
    }

    .menu-toggle {
        display: inline-grid;
    }

    /* the menu drops down under the header */
    .navbar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 12px 24px 24px;
        background: var(--bg);
        border: 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        backdrop-filter: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    }

    .navbar.open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .navbar a {
        padding: 14px 4px;
        font-size: 16px;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }

    .navbar a:hover,
    .navbar a.active {
        background: none;
    }

    .navbar a:last-child {
        border-bottom: none;
    }

    .navbar a::after {
        display: none;
    }

    .navbar a.active {
        color: var(--text);
        font-weight: 700;
    }

    .header.menu-open {
        background: var(--bg);
        box-shadow: 0 1px 0 var(--border);
    }

    .hero {
        padding-top: calc(var(--header-h) + 36px);
        gap: 48px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-photo {
        order: -1;
    }

    .photo-frame {
        width: min(300px, 76vw);
    }

    .hero-intro {
        margin-inline: auto;
    }

    .hero-buttons,
    .hero .socials {
        justify-content: center;
    }

    .contact-panel {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 40px;
    }

    .section {
        padding: 88px 0;
    }
}

@media (max-width: 760px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .stats li + li {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .stats li {
        padding: 18px 22px;
    }

    .services-grid,
    .projects-grid,
    .card-grid,
    .project-layout,
    .project-nav {
        grid-template-columns: 1fr;
    }

    .project-banner {
        height: 200px;
    }


    .timeline-top {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-top .date {
        order: -1;
    }
}

@media (max-width: 520px) {
    .container {
        width: calc(100% - 32px);
    }

    .section {
        padding: 72px 0;
    }

    .section-head {
        margin-bottom: 40px;
    }

    .header-actions {
        gap: 8px;
    }

    .logo { font-size: 18px; }
    .logo-mark { width: 34px; height: 34px; }

    .hero-buttons .btn {
        flex: 1;
    }

    /* long titles take two lines on small phones: keep the space so the page doesn't jump */
    .hero-role {
        min-height: 3.3em;
        line-height: 1.65;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1;
        padding: 10px 8px;
        font-size: 13.5px;
    }

    .timeline {
        padding-left: 26px;
    }

    .timeline::before {
        left: 5px;
    }

    .timeline-item::before {
        left: -26px;
        width: 14px;
        height: 14px;
    }

    .timeline-card,
    .edu-card,
    .service-card,
    .project-card,
    .skill-group {
        padding: 22px;
    }

    .contact-panel {
        padding: 28px 20px;
        border-radius: var(--radius);
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .header-inner {
        gap: 10px;
    }

    .header-actions {
        gap: 6px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .logo {
        font-size: 17px;
    }
}


/* ===== Project page: meta chips, numbered steps, results, lightbox ===== */
.project-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.project-meta-chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13.5px;
}

.project-meta-chips i {
    color: var(--accent);
    font-size: 17px;
}

.steps {
    display: grid;
    gap: 14px;
    counter-reset: step;
}

.steps li {
    position: relative;
    padding: 16px 18px 16px 62px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    counter-increment: step;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.steps li:hover {
    border-color: var(--accent);
    transform: translateX(3px);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 14px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg, #0b0b0f);
    font-size: 14px;
    font-weight: 700;
}

.results-callout {
    margin-top: 36px;
    padding: 22px 24px;
    border: 1px solid var(--accent);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.results-callout h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px !important;
}

.results-callout i {
    color: var(--accent);
}

.results-callout p {
    color: var(--muted);
}

.project-side {
    position: sticky;
    top: calc(var(--header-h, 72px) + 20px);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: rgba(5, 5, 10, 0.92);
}

.lightbox.open {
    display: flex;
}

.lightbox figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: min(1100px, 100%);
    margin: 0;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-sm);
    background: #fff;
}

.lightbox figcaption {
    color: #d8dbe2;
    font-size: 15px;
    text-align: center;
}

.lb-close,
.lb-nav {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

.lb-close {
    position: absolute;
    top: 18px;
    right: 18px;
}

@media (max-width: 700px) {
    .lightbox {
        flex-wrap: wrap;
    }

    .lightbox figure {
        order: -1;
        width: 100%;
    }
}

@media (max-width: 860px) {
    .project-side {
        position: static;
    }
}


/* ===== Projects grouped by category ===== */
.project-groups {
    display: grid;
    gap: 56px;
}

.group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.group-head i {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--cat-soft);
    color: var(--cat);
    font-size: 22px;
}

.group-head h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.group-head span {
    margin-left: auto;
    padding: 3px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
}


/* ===== Mobile: one-line scrollable filters, smaller card number ===== */
@media (max-width: 700px) {
    .filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 8px;
        margin: 0 -16px 32px;
        padding: 4px 16px 8px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .filters::-webkit-scrollbar {
        display: none;
    }

    .filter {
        flex-shrink: 0;
        white-space: nowrap;
        scroll-snap-align: center;
    }

    .project-index {
        top: 12px;
        right: 18px;
        font-size: 32px;
    }

    .project-meta {
        padding-right: 64px;
    }
}


/* ===== Project video player ===== */
.project-video {
    display: flex;
    justify-content: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.project-video video {
    display: block;
    width: 100%;
    max-height: 72vh;
    border-radius: var(--radius-sm);
    background: #000;
    object-fit: contain;
}


/* =========================================================
   Robotics / control touch (kept subtle and professional)
   - blueprint grid behind the hero
   - encoder-dial ring around the portrait
   - ruler ticks under section titles, monospace eyebrow
   - corner brackets on project cards
   ========================================================= */

/* blueprint grid fading out behind the hero content */
.hero-grid::before {
    content: "";
    position: absolute;
    inset: -90px -60px;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(var(--signal-rgb), 0.07) 1px, transparent 1px) 0 0 / 36px 36px,
        linear-gradient(90deg, rgba(var(--signal-rgb), 0.07) 1px, transparent 1px) 0 0 / 36px 36px;
    -webkit-mask-image: radial-gradient(ellipse 70% 65% at 55% 45%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 65% at 55% 45%, #000 15%, transparent 75%);
}

.hero-text,
.hero-photo {
    position: relative;
    z-index: 1;
}

/* rotary-encoder dial around the portrait: dashed orbit + tick marks */
.photo-frame::before,
.photo-frame::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.photo-frame::before {
    inset: -16px;
    border: 1px dashed rgba(var(--signal-rgb), 0.45);
    animation: dial-spin 90s linear infinite;
}

.photo-frame::after {
    inset: -30px;
    background: repeating-conic-gradient(from 0deg, rgba(var(--signal-rgb), 0.55) 0 0.5deg, transparent 0.5deg 5deg);
    -webkit-mask-image: radial-gradient(circle, transparent calc(100% - 9px), #000 calc(100% - 8px));
    mask-image: radial-gradient(circle, transparent calc(100% - 9px), #000 calc(100% - 8px));
    animation: dial-spin 240s linear infinite reverse;
}

@keyframes dial-spin {
    to { transform: rotate(360deg); }
}

/* section titles: monospace label and a small ruler */
.eyebrow {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 2.5px;
}

.eyebrow::before {
    content: "// ";
    color: var(--signal);
}

.section-head::after {
    content: "";
    display: block;
    width: 96px;
    height: 9px;
    margin: 20px auto 0;
    background:
        linear-gradient(rgba(var(--signal-rgb), 0.7), rgba(var(--signal-rgb), 0.7)) 0 100% / 100% 1px no-repeat,
        repeating-linear-gradient(90deg, rgba(var(--signal-rgb), 0.7) 0 1px, transparent 1px 8px) 0 0 / 100% 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

/* project cards: corner brackets, like a camera / targeting frame, on hover */
.project-card:not(.project-more)::after {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    --b: rgba(var(--signal-rgb), 0.85);
    background:
        linear-gradient(var(--b), var(--b)) 0 0 / 16px 1.5px,
        linear-gradient(var(--b), var(--b)) 0 0 / 1.5px 16px,
        linear-gradient(var(--b), var(--b)) 100% 0 / 16px 1.5px,
        linear-gradient(var(--b), var(--b)) 100% 0 / 1.5px 16px,
        linear-gradient(var(--b), var(--b)) 0 100% / 16px 1.5px,
        linear-gradient(var(--b), var(--b)) 0 100% / 1.5px 16px,
        linear-gradient(var(--b), var(--b)) 100% 100% / 16px 1.5px,
        linear-gradient(var(--b), var(--b)) 100% 100% / 1.5px 16px;
    background-repeat: no-repeat;
}

.project-card:not(.project-more):hover::after {
    opacity: 1;
}

@media (max-width: 700px) {
    .photo-frame::before { inset: -10px; }
    .photo-frame::after { inset: -20px; }
}



/* =========================================================
   Faint robot line-art in the background of each section
   (SVG files in /bg, coloured by the theme through a mask)
   ========================================================= */
.hero,
.section {
    position: relative;
    overflow: hidden;
}

.hero > .container,
.section > .container {
    position: relative;
    z-index: 1;
}

.bg-symbols {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.sym {
    position: absolute;
    width: var(--s, 260px);
    aspect-ratio: 1;
    background: var(--signal);
    opacity: 0.15;
    -webkit-mask-image: var(--img);
    mask-image: var(--img);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transform: rotate(var(--r, 0deg));
    animation: sym-float 16s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s);
}

.light-mode .sym {
    opacity: 0.2;
}

.sym-arm, .art-arm { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2264%22 y=%22212%22 width=%22112%22 height=%2214%22 rx=%223%22/%3E %3Cpath d=%22M84 212 v-18 h72 v18%22/%3E %3Cpath d=%22M126.9 182.0 L88.9 116.0 A8 8 0 0 1 75.1 124.0 L113.1 190.0 A8 8 0 0 1 126.9 182.0 Z%22/%3E %3Ccircle cx=%22120%22 cy=%22186%22 r=%2211%22/%3E %3Ccircle cx=%2282%22 cy=%22120%22 r=%2210%22/%3E %3Cpath d=%22M86.3 125.6 L154.3 73.6 A7 7 0 0 1 145.7 62.4 L77.7 114.4 A7 7 0 0 1 86.3 125.6 Z%22/%3E %3Ccircle cx=%22150%22 cy=%2268%22 r=%229%22/%3E %3Cpath d=%22M147.1 72.7 L189.1 98.7 A5.5 5.5 0 0 1 194.9 89.3 L152.9 63.3 A5.5 5.5 0 0 1 147.1 72.7 Z%22/%3E %3Ccircle cx=%22192%22 cy=%2294%22 r=%226.5%22/%3E %3Ccircle cx=%22120%22 cy=%22186%22 r=%224%22/%3E %3Ccircle cx=%2282%22 cy=%22120%22 r=%223.5%22/%3E %3Ccircle cx=%22150%22 cy=%2268%22 r=%223.5%22/%3E %3Cpath d=%22M197 99 l10 18 l-6 3 M187 100 l-8 20 l6 2%22/%3E %3Cpath d=%22M30 226 H214%22 stroke-dasharray=%222 8%22/%3E %3C/svg%3E"); }
.sym-rover, .art-rover { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2240%22 y=%22112%22 width=%22160%22 height=%2242%22 rx=%2212%22/%3E %3Crect x=%2292%22 y=%2284%22 width=%2264%22 height=%2228%22 rx=%226%22/%3E %3Ccircle cx=%22124%22 cy=%2270%22 r=%229%22/%3E %3Cpath d=%22M124 61 v-14 M112 52 h24%22/%3E %3Cpath d=%22M170 112 l10 -30%22/%3E %3Ccircle cx=%22181%22 cy=%2278%22 r=%224%22/%3E %3Ccircle cx=%2278%22 cy=%22166%22 r=%2218%22/%3E %3Ccircle cx=%2278%22 cy=%22166%22 r=%226%22/%3E %3Ccircle cx=%22162%22 cy=%22166%22 r=%2218%22/%3E %3Ccircle cx=%22162%22 cy=%22166%22 r=%226%22/%3E %3Ccircle cx=%22186%22 cy=%22132%22 r=%224%22/%3E %3Cpath d=%22M56 126 h28 M56 138 h28%22/%3E %3Cpath d=%22M24 190 H216%22 stroke-dasharray=%222 8%22/%3E %3C/svg%3E"); }
.sym-drone, .art-drone { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%22102%22 y=%22102%22 width=%2236%22 height=%2236%22 rx=%229%22/%3E %3Ccircle cx=%22120%22 cy=%22120%22 r=%228%22/%3E %3Cpath d=%22M106 106 L62 62 M134 106 L178 62 M106 134 L62 178 M134 134 L178 178%22/%3E %3Cellipse cx=%2254%22 cy=%2254%22 rx=%2230%22 ry=%228%22/%3E %3Ccircle cx=%2254%22 cy=%2254%22 r=%224%22/%3E %3Cellipse cx=%22186%22 cy=%2254%22 rx=%2230%22 ry=%228%22/%3E %3Ccircle cx=%22186%22 cy=%2254%22 r=%224%22/%3E %3Cellipse cx=%2254%22 cy=%22186%22 rx=%2230%22 ry=%228%22/%3E %3Ccircle cx=%2254%22 cy=%22186%22 r=%224%22/%3E %3Cellipse cx=%22186%22 cy=%22186%22 rx=%2230%22 ry=%228%22/%3E %3Ccircle cx=%22186%22 cy=%22186%22 r=%224%22/%3E %3Cpath d=%22M120 140 v12 M110 152 h20%22/%3E %3C/svg%3E"); }
.sym-chip, .art-chip { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2288%22 y=%2288%22 width=%2264%22 height=%2264%22 rx=%226%22/%3E %3Ccircle cx=%22104%22 cy=%22104%22 r=%224%22/%3E %3Cpath d=%22M100 88 v-14 M100 152 v14 M88 100 h-14 M152 100 h14%22/%3E %3Cpath d=%22M114 88 v-14 M114 152 v14 M88 114 h-14 M152 114 h14%22/%3E %3Cpath d=%22M128 88 v-14 M128 152 v14 M88 128 h-14 M152 128 h14%22/%3E %3Cpath d=%22M142 88 v-14 M142 152 v14 M88 142 h-14 M152 142 h14%22/%3E %3Cpath d=%22M100 74 V50 H60 V30 M114 74 V40 H150 V28 M128 74 V58 H186 V36 M142 74 V64 H200 V90%22/%3E %3Cpath d=%22M100 166 V196 H56 V214 M114 166 V206 H140 V222 M128 166 V190 H190 V212 M142 166 V180 H212 V150%22/%3E %3Cpath d=%22M74 100 H40 V70 M74 114 H30 M74 128 H50 V160 M74 142 H36 V184%22/%3E %3Cpath d=%22M166 100 H206 V130 M166 114 H220%22/%3E %3Ccircle cx=%2260%22 cy=%2230%22 r=%224%22/%3E %3Ccircle cx=%22150%22 cy=%2228%22 r=%224%22/%3E %3Ccircle cx=%22186%22 cy=%2236%22 r=%224%22/%3E %3Ccircle cx=%22200%22 cy=%2290%22 r=%224%22/%3E %3Ccircle cx=%2256%22 cy=%22214%22 r=%224%22/%3E %3Ccircle cx=%22140%22 cy=%22222%22 r=%224%22/%3E %3Ccircle cx=%22190%22 cy=%22212%22 r=%224%22/%3E %3Ccircle cx=%22212%22 cy=%22150%22 r=%224%22/%3E %3Ccircle cx=%2240%22 cy=%2270%22 r=%224%22/%3E %3Ccircle cx=%2230%22 cy=%22114%22 r=%224%22/%3E %3Ccircle cx=%2250%22 cy=%22160%22 r=%224%22/%3E %3Ccircle cx=%2236%22 cy=%22184%22 r=%224%22/%3E %3Ccircle cx=%22206%22 cy=%22130%22 r=%224%22/%3E %3Ccircle cx=%22220%22 cy=%22114%22 r=%224%22/%3E %3C/svg%3E"); }
.sym-head, .art-head { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2268%22 y=%2276%22 width=%22104%22 height=%2282%22 rx=%2218%22/%3E %3Cpath d=%22M120 76 V54%22/%3E %3Ccircle cx=%22120%22 cy=%2248%22 r=%226%22/%3E %3Crect x=%2254%22 y=%22102%22 width=%2214%22 height=%2232%22 rx=%225%22/%3E %3Crect x=%22172%22 y=%22102%22 width=%2214%22 height=%2232%22 rx=%225%22/%3E %3Ccircle cx=%2296%22 cy=%22110%22 r=%2212%22/%3E %3Ccircle cx=%22144%22 cy=%22110%22 r=%2212%22/%3E %3Ccircle cx=%2296%22 cy=%22110%22 r=%224%22/%3E %3Ccircle cx=%22144%22 cy=%22110%22 r=%224%22/%3E %3Cpath d=%22M98 140 H142 M108 136 v8 M120 136 v8 M132 136 v8%22/%3E %3Crect x=%22104%22 y=%22158%22 width=%2232%22 height=%2214%22 rx=%223%22/%3E %3Cpath d=%22M62 214 q8 -34 58 -38 q50 4 58 38 Z%22/%3E %3C/svg%3E"); }
.sym-gear, .art-gear { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Cpath d=%22M197.2 108.8 L215.7 112.5 L215.7 127.5 L197.2 131.2 L192.4 148.9 L206.6 161.3 L199.1 174.4 L181.3 168.3 L168.3 181.3 L174.4 199.1 L161.3 206.6 L148.9 192.4 L131.2 197.2 L127.5 215.7 L112.5 215.7 L108.8 197.2 L91.1 192.4 L78.7 206.6 L65.6 199.1 L71.7 181.3 L58.7 168.3 L40.9 174.4 L33.4 161.3 L47.6 148.9 L42.8 131.2 L24.3 127.5 L24.3 112.5 L42.8 108.8 L47.6 91.1 L33.4 78.7 L40.9 65.6 L58.7 71.7 L71.7 58.7 L65.6 40.9 L78.7 33.4 L91.1 47.6 L108.8 42.8 L112.5 24.3 L127.5 24.3 L131.2 42.8 L148.9 47.6 L161.3 33.4 L174.4 40.9 L168.3 58.7 L181.3 71.7 L199.1 65.6 L206.6 78.7 L192.4 91.1 Z%22/%3E %3Ccircle cx=%22120%22 cy=%22120%22 r=%2234%22/%3E %3Ccircle cx=%22120%22 cy=%22120%22 r=%2258%22/%3E %3Cpath d=%22M154.0 120.0 L178.0 120.0%22/%3E %3Cpath d=%22M137.0 149.4 L149.0 170.2%22/%3E %3Cpath d=%22M103.0 149.4 L91.0 170.2%22/%3E %3Cpath d=%22M86.0 120.0 L62.0 120.0%22/%3E %3Cpath d=%22M103.0 90.6 L91.0 69.8%22/%3E %3Cpath d=%22M137.0 90.6 L149.0 69.8%22/%3E %3C/svg%3E"); }
.sym-cobot, .art-cobot { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2292%22 y=%22214%22 width=%2256%22 height=%2212%22 rx=%223%22/%3E %3Crect x=%2298%22 y=%22184%22 width=%2244%22 height=%2230%22 rx=%228%22/%3E %3Cpath d=%22M129.5 178.4 L79.5 94.4 A11 11 0 0 1 60.5 105.6 L110.5 189.6 A11 11 0 0 1 129.5 178.4 Z%22/%3E %3Ccircle cx=%2270%22 cy=%22100%22 r=%2214%22/%3E %3Ccircle cx=%2270%22 cy=%22100%22 r=%225%22/%3E %3Cpath d=%22M74.0 108.0 L154.0 68.0 A9 9 0 0 1 146.0 52.0 L66.0 92.0 A9 9 0 0 1 74.0 108.0 Z%22/%3E %3Ccircle cx=%22150%22 cy=%2260%22 r=%2211%22/%3E %3Ccircle cx=%22150%22 cy=%2260%22 r=%224%22/%3E %3Crect x=%22141%22 y=%2272%22 width=%2218%22 height=%2222%22 rx=%224%22/%3E %3Cpath d=%22M150 94 v12 M138 114 q12 -12 24 0 Z%22/%3E %3Crect x=%22130%22 y=%22120%22 width=%2240%22 height=%2230%22 rx=%223%22/%3E %3Cpath d=%22M24 226 H216%22 stroke-dasharray=%222 8%22/%3E %3C/svg%3E"); }
.sym-lidar, .art-lidar { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2278%22 y=%22152%22 width=%2284%22 height=%2240%22 rx=%227%22/%3E %3Crect x=%2294%22 y=%22120%22 width=%2252%22 height=%2232%22 rx=%229%22/%3E %3Cpath d=%22M104 136 H136%22/%3E %3Cpath d=%22M106 120 q14 -10 28 0%22/%3E %3Cpath d=%22M96.0 192.0 L96.0 206.0%22/%3E %3Cpath d=%22M144.0 192.0 L144.0 206.0%22/%3E %3Cpath d=%22M70 206 H170%22/%3E %3Cpath d=%22M72.9 108.0 A52 52 0 0 1 167.1 108.0%22/%3E %3Cpath d=%22M47.5 96.2 A80 80 0 0 1 192.5 96.2%22/%3E %3Cpath d=%22M22.1 84.4 A108 108 0 0 1 217.9 84.4%22/%3E %3Ccircle cx=%2268.577%22 cy=%2268.7164%22 r=%223.2%22/%3E %3Ccircle cx=%2299.2945%22 cy=%2252.7259%22 r=%223.2%22/%3E %3Ccircle cx=%22140.706%22 cy=%2252.7259%22 r=%223.2%22/%3E %3Ccircle cx=%2269.2971%22 cy=%2234.6417%22 r=%223.2%22/%3E %3Ccircle cx=%22170.703%22 cy=%2234.6417%22 r=%223.2%22/%3E %3Ccircle cx=%22120%22 cy=%2278%22 r=%223.2%22/%3E %3C/svg%3E"); }
.sym-delta, .art-delta { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Cellipse cx=%22120%22 cy=%2252%22 rx=%2262%22 ry=%2212%22/%3E %3Cpath d=%22M69.0 58.0 L41.0 104.0%22/%3E %3Cpath d=%22M75.0 58.0 L47.0 104.0%22/%3E %3Cpath d=%22M41.0 104.0 L103.0 166.0%22/%3E %3Cpath d=%22M47.0 104.0 L109.0 166.0%22/%3E %3Ccircle cx=%2272%22 cy=%2250%22 r=%226%22/%3E %3Ccircle cx=%2244%22 cy=%22104%22 r=%224%22/%3E %3Cpath d=%22M117.0 64.0 L117.0 112.0%22/%3E %3Cpath d=%22M123.0 64.0 L123.0 112.0%22/%3E %3Cpath d=%22M117.0 112.0 L117.0 172.0%22/%3E %3Cpath d=%22M123.0 112.0 L123.0 172.0%22/%3E %3Ccircle cx=%22120%22 cy=%2256%22 r=%226%22/%3E %3Ccircle cx=%22120%22 cy=%22112%22 r=%224%22/%3E %3Cpath d=%22M165.0 58.0 L193.0 104.0%22/%3E %3Cpath d=%22M171.0 58.0 L199.0 104.0%22/%3E %3Cpath d=%22M193.0 104.0 L131.0 166.0%22/%3E %3Cpath d=%22M199.0 104.0 L137.0 166.0%22/%3E %3Ccircle cx=%22168%22 cy=%2250%22 r=%226%22/%3E %3Ccircle cx=%22196%22 cy=%22104%22 r=%224%22/%3E %3Cellipse cx=%22120%22 cy=%22172%22 rx=%2226%22 ry=%227%22/%3E %3Cpath d=%22M120 179 v18 M110 208 l10 -11 l10 11%22/%3E %3C/svg%3E"); }
.sym-loop, .art-loop { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Ccircle cx=%2236%22 cy=%22112%22 r=%2213%22/%3E %3Cpath d=%22M30.0 106.0 L42.0 106.0%22/%3E %3Cpath d=%22M36.0 100.0 L36.0 112.0%22/%3E %3Cpath d=%22M30.0 122.0 L42.0 122.0%22/%3E %3Cpath d=%22M49.0 112.0 L70.0 112.0%22/%3E %3Crect x=%2270%22 y=%2286%22 width=%2248%22 height=%2252%22 rx=%225%22/%3E %3Cpath d=%22M80 124 h10 v-24 h10 h8%22/%3E %3Cpath d=%22M118.0 112.0 L142.0 112.0%22/%3E %3Crect x=%22142%22 y=%2286%22 width=%2248%22 height=%2252%22 rx=%225%22/%3E %3Cpath d=%22M150 112 q8 -22 16 0 t16 0%22/%3E %3Cpath d=%22M190.0 112.0 L222.0 112.0%22/%3E %3Cpath d=%22M214.0 106.0 L222.0 112.0 L214.0 118.0%22/%3E %3Cpath d=%22M204.0 112.0 L204.0 176.0 L36.0 176.0 L36.0 125.0%22/%3E %3Cpath d=%22M30.0 133.0 L36.0 125.0 L42.0 133.0%22/%3E %3Ccircle cx=%22204%22 cy=%22112%22 r=%223.5%22/%3E %3Cpath d=%22M62.0 106.0 L70.0 112.0 L62.0 118.0%22/%3E %3Cpath d=%22M134.0 106.0 L142.0 112.0 L134.0 118.0%22/%3E %3C/svg%3E"); }
.sym-motor, .art-motor { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2246%22 y=%2286%22 width=%2214%22 height=%2268%22 rx=%223%22/%3E %3Crect x=%2260%22 y=%2292%22 width=%22100%22 height=%2256%22 rx=%228%22/%3E %3Crect x=%22160%22 y=%22104%22 width=%2218%22 height=%2232%22 rx=%223%22/%3E %3Cpath d=%22M178.0 120.0 L206.0 120.0%22/%3E %3Ccircle cx=%22210%22 cy=%22120%22 r=%225%22/%3E %3Cpath d=%22M80.0 92.0 L80.0 148.0%22/%3E %3Cpath d=%22M100.0 92.0 L100.0 148.0%22/%3E %3Cpath d=%22M120.0 92.0 L120.0 148.0%22/%3E %3Cpath d=%22M140.0 92.0 L140.0 148.0%22/%3E %3Cpath d=%22M46 120 H26 q-10 0 -10 10 V172%22/%3E %3Ccircle cx=%2216%22 cy=%22176%22 r=%224%22/%3E %3Cpath d=%22M24 196 H216%22 stroke-dasharray=%222 8%22/%3E %3C/svg%3E"); }
.sym-tank, .art-tank { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Cpath d=%22M24 50 v78 q0 8 8 8 h30 q8 0 8 -8 v-78 Z%22/%3E %3Cpath d=%22M24.0 72.0 L70.0 72.0%22/%3E %3Cpath d=%22M24 96 q11 -6 23 0 t23 0%22/%3E %3Cpath d=%22M78 50 v78 q0 8 8 8 h30 q8 0 8 -8 v-78 Z%22/%3E %3Cpath d=%22M78.0 72.0 L124.0 72.0%22/%3E %3Cpath d=%22M78 96 q11 -6 23 0 t23 0%22/%3E %3Cpath d=%22M132 50 v78 q0 8 8 8 h30 q8 0 8 -8 v-78 Z%22/%3E %3Cpath d=%22M132.0 72.0 L178.0 72.0%22/%3E %3Cpath d=%22M132 96 q11 -6 23 0 t23 0%22/%3E %3Cpath d=%22M55.0 136.0 L55.0 160.0 L120.0 160.0 L120.0 176.0%22/%3E %3Cpath d=%22M101.0 136.0 L101.0 160.0%22/%3E %3Cpath d=%22M155.0 136.0 L155.0 160.0 L120.0 160.0%22/%3E %3Cpath d=%22M96 176 h48 v38 q0 8 -8 8 h-32 q-8 0 -8 -8 Z%22/%3E %3Cpath d=%22M120.0 176.0 L120.0 196.0%22/%3E %3Cpath d=%22M104.0 200.0 L136.0 200.0%22/%3E %3Cpath d=%22M106 205 q14 -8 28 0%22/%3E %3Ccircle cx=%22200%22 cy=%22150%22 r=%2216%22/%3E %3Cpath d=%22M190.0 150.0 L210.0 150.0%22/%3E %3Cpath d=%22M200.0 134.0 L200.0 166.0%22/%3E %3Cpath d=%22M176.0 150.0 L184.0 150.0%22/%3E %3Cpath d=%22M216.0 150.0 L224.0 150.0%22/%3E %3Cpath d=%22M54.0 50.0 L54.0 36.0 L200.0 36.0 L200.0 134.0%22/%3E %3Ccircle cx=%22200%22 cy=%2236%22 r=%224%22/%3E %3C/svg%3E"); }
.sym-grafcet, .art-grafcet { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2240%22 y=%2222%22 width=%2240%22 height=%2230%22/%3E %3Crect x=%2246%22 y=%2228%22 width=%2228%22 height=%2218%22/%3E %3Cpath d=%22M60.0 52.0 L60.0 70.0%22/%3E %3Cpath d=%22M48.0 70.0 L72.0 70.0%22/%3E %3Crect x=%2242%22 y=%2274%22 width=%2236%22 height=%2228%22/%3E %3Cpath d=%22M60.0 102.0 L60.0 118.0%22/%3E %3Cpath d=%22M48.0 118.0 L72.0 118.0%22/%3E %3Cpath d=%22M78.0 88.0 L108.0 88.0%22/%3E %3Crect x=%22108%22 y=%2277%22 width=%2296%22 height=%2222%22 rx=%222%22/%3E %3Cpath d=%22M118.0 88.0 L150.0 88.0%22/%3E %3Crect x=%2242%22 y=%22126%22 width=%2236%22 height=%2228%22/%3E %3Cpath d=%22M60.0 154.0 L60.0 170.0%22/%3E %3Cpath d=%22M48.0 170.0 L72.0 170.0%22/%3E %3Cpath d=%22M78.0 140.0 L108.0 140.0%22/%3E %3Crect x=%22108%22 y=%22129%22 width=%2296%22 height=%2222%22 rx=%222%22/%3E %3Cpath d=%22M118.0 140.0 L150.0 140.0%22/%3E %3Crect x=%2242%22 y=%22178%22 width=%2236%22 height=%2228%22/%3E %3Cpath d=%22M60.0 206.0 L60.0 222.0%22/%3E %3Cpath d=%22M48.0 222.0 L72.0 222.0%22/%3E %3Cpath d=%22M78.0 192.0 L108.0 192.0%22/%3E %3Crect x=%22108%22 y=%22181%22 width=%2296%22 height=%2222%22 rx=%222%22/%3E %3Cpath d=%22M118.0 192.0 L150.0 192.0%22/%3E %3Cpath d=%22M60.0 206.0 L60.0 224.0 L22.0 224.0 L22.0 37.0 L40.0 37.0%22/%3E %3Cpath d=%22M34.0 31.0 L40.0 37.0 L34.0 43.0%22/%3E %3C/svg%3E"); }
.sym-dashboard, .art-dashboard { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Crect x=%2222%22 y=%2230%22 width=%22196%22 height=%22180%22 rx=%2210%22/%3E %3Cpath d=%22M22.0 62.0 L218.0 62.0%22/%3E %3Ccircle cx=%2238%22 cy=%2246%22 r=%224%22/%3E %3Ccircle cx=%2252%22 cy=%2246%22 r=%224%22/%3E %3Ccircle cx=%2266%22 cy=%2246%22 r=%224%22/%3E %3Crect x=%2244%22 y=%22160%22 width=%2216%22 height=%2230%22 rx=%222%22/%3E %3Crect x=%2270%22 y=%22134%22 width=%2216%22 height=%2256%22 rx=%222%22/%3E %3Crect x=%2296%22 y=%22148%22 width=%2216%22 height=%2242%22 rx=%222%22/%3E %3Crect x=%22122%22 y=%22112%22 width=%2216%22 height=%2278%22 rx=%222%22/%3E %3Crect x=%22148%22 y=%22130%22 width=%2216%22 height=%2260%22 rx=%222%22/%3E %3Cpath d=%22M36.0 190.0 L170.0 190.0%22/%3E %3Cpath d=%22M36.0 76.0 L36.0 190.0%22/%3E %3Cpath d=%22M52 150 L88 126 L120 138 L150 98%22/%3E %3Ccircle cx=%22150%22 cy=%2298%22 r=%224%22/%3E %3Ccircle cx=%22190%22 cy=%22100%22 r=%2222%22/%3E %3Cpath d=%22M190 100 V78 A22 22 0 0 1 209 111 Z%22/%3E %3Cpath d=%22M176.0 150.0 L206.0 150.0%22/%3E %3Cpath d=%22M176.0 166.0 L198.0 166.0%22/%3E %3Cpath d=%22M176.0 182.0 L206.0 182.0%22/%3E %3C/svg%3E"); }
.sym-network, .art-network { --img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 240 240%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E %3Cpath d=%22M120.0 120.0 L54.0 66.0%22/%3E %3Cpath d=%22M120.0 120.0 L186.0 66.0%22/%3E %3Cpath d=%22M120.0 120.0 L40.0 150.0%22/%3E %3Cpath d=%22M120.0 120.0 L200.0 152.0%22/%3E %3Cpath d=%22M120.0 120.0 L100.0 208.0%22/%3E %3Cpath d=%22M120.0 120.0 L150.0 200.0%22/%3E %3Cpath d=%22M120.0 120.0 L120.0 40.0%22/%3E %3Cpath d=%22M54.0 66.0 L120.0 40.0 L186.0 66.0%22/%3E %3Cpath d=%22M40.0 150.0 L100.0 208.0%22/%3E %3Cpath d=%22M200.0 152.0 L150.0 200.0%22/%3E %3Cpath d=%22M100.0 208.0 L150.0 200.0%22/%3E %3Ccircle cx=%22120%22 cy=%22120%22 r=%2216%22/%3E %3Ccircle cx=%22120%22 cy=%22120%22 r=%226%22/%3E %3Ccircle cx=%2254%22 cy=%2266%22 r=%229%22/%3E %3Ccircle cx=%2254%22 cy=%2266%22 r=%223%22/%3E %3Ccircle cx=%22186%22 cy=%2266%22 r=%229%22/%3E %3Ccircle cx=%22186%22 cy=%2266%22 r=%223%22/%3E %3Ccircle cx=%2240%22 cy=%22150%22 r=%229%22/%3E %3Ccircle cx=%2240%22 cy=%22150%22 r=%223%22/%3E %3Ccircle cx=%22200%22 cy=%22152%22 r=%229%22/%3E %3Ccircle cx=%22200%22 cy=%22152%22 r=%223%22/%3E %3Ccircle cx=%22100%22 cy=%22208%22 r=%229%22/%3E %3Ccircle cx=%22100%22 cy=%22208%22 r=%223%22/%3E %3Ccircle cx=%22150%22 cy=%22200%22 r=%229%22/%3E %3Ccircle cx=%22150%22 cy=%22200%22 r=%223%22/%3E %3Ccircle cx=%22120%22 cy=%2240%22 r=%229%22/%3E %3Ccircle cx=%22120%22 cy=%2240%22 r=%223%22/%3E %3C/svg%3E"); }

@keyframes sym-float {
    from { translate: 0 -8px; }
    to   { translate: 0 10px; }
}

@media (max-width: 700px) {
    .sym {
        width: calc(var(--s, 260px) * 0.6);
        opacity: 0.1;
    }

    .sym.hide-mobile {
        display: none;
    }
}



/* =========================================================
   Creative hero background + status badge
   (radar sweep, robot trajectory, aurora, circuit-trace dividers)
   ========================================================= */

/* --- status badge: glass chip with a light sweep and a radar-ping dot --- */
.badge-live {
    position: relative;
    overflow: hidden;
    padding: 8px 18px 8px 14px;
    gap: 10px;
    font-weight: 500;
    letter-spacing: 0.2px;
    border: 1px solid rgba(var(--signal-rgb), 0.55);
    background: linear-gradient(135deg, rgba(var(--signal-rgb), 0.16), rgba(var(--accent-rgb), 0.04));
    box-shadow: 0 0 0 4px rgba(var(--signal-rgb), 0.06), 0 10px 30px rgba(var(--signal-rgb), 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.badge-live::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
    transform: translateX(-130%);
    animation: badge-sweep 5.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badge-sweep {
    0%, 55% { transform: translateX(-130%); }
    100%    { transform: translateX(130%); }
}

.badge-live .live-dot {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 0 14px rgba(34, 197, 94, 0.8);
}

/* --- aurora blobs and robot trajectory, inserted by script.js --- */
.hero-fx {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.fx-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: blob-drift 26s ease-in-out infinite alternate;
}

.fx-blob-a {
    width: 520px;
    height: 520px;
    left: -140px;
    bottom: -120px;
    background: rgba(var(--signal-rgb), 0.2);
}

.fx-blob-b {
    width: 460px;
    height: 460px;
    right: 12%;
    top: -160px;
    background: rgba(var(--accent-rgb), 0.1);
    animation-delay: -9s;
}

@keyframes blob-drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, -40px) scale(1.15); }
}

.fx-trajectory {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.fx-trajectory .path {
    fill: none;
    stroke: rgba(var(--signal-rgb), 0.45);
    stroke-width: 1.5;
    stroke-dasharray: 4 9;
    stroke-linecap: round;
}

.fx-trajectory .wp {
    fill: none;
    stroke: rgba(var(--signal-rgb), 0.6);
    stroke-width: 1.5;
}

.fx-trajectory .wp-dot {
    fill: rgba(var(--signal-rgb), 0.7);
}

.fx-trajectory text {
    fill: rgba(var(--signal-rgb), 0.7);
    font: 500 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 1px;
}

.fx-trajectory .tool {
    fill: var(--signal);
    filter: drop-shadow(0 0 8px rgba(var(--signal-rgb), 0.9));
}

.fx-trajectory .tool-halo {
    fill: none;
    stroke: rgba(var(--signal-rgb), 0.5);
    stroke-width: 1.5;
}

/* --- radar / lidar sweep behind the portrait --- */
.hero-photo::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: -1;
    width: 760px;
    aspect-ratio: 1;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}


.hero-photo::after {
    background: repeating-radial-gradient(circle, transparent 0 62px, rgba(var(--signal-rgb), 0.16) 62px 63px);
    -webkit-mask-image: radial-gradient(circle, transparent 24%, #000 28%, #000 40%, transparent 70%);
    mask-image: radial-gradient(circle, transparent 24%, #000 28%, #000 40%, transparent 70%);
}

/* --- circuit-trace divider at the top of every section, with a travelling pulse --- */
.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(var(--signal-rgb), 0.9), transparent) -40% 0 / 28% 100% no-repeat,
        linear-gradient(90deg, transparent, rgba(var(--signal-rgb), 0.25) 20%, rgba(var(--signal-rgb), 0.25) 80%, transparent);
    animation: trace-pulse 7s linear infinite;
}

@keyframes trace-pulse {
    from { background-position: -40% 0, 0 0; }
    to   { background-position: 140% 0, 0 0; }
}

@media (max-width: 700px) {
    .hero-photo::after {
        width: 520px;
    }

    .fx-blob {
        filter: blur(70px);
    }
}



/* =========================================================
   Faint maths: signal / control equations and curves
   ========================================================= */
.eq {
    position: absolute;
    z-index: 0;
    font-family: "Cambria Math", "STIX Two Math", Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: var(--fs, 24px);
    line-height: 1.3;
    white-space: nowrap;
    color: var(--signal);
    opacity: 0.22;
    transform: rotate(var(--r, 0deg));
    animation: sym-float 18s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s);
}

.eq sub,
.eq sup {
    font-size: 0.65em;
    line-height: 0;
}

.light-mode .eq {
    opacity: 0.3;
}

.curve {
    position: absolute;
    z-index: 0;
    width: var(--w, 320px);
    height: auto;
    overflow: visible;
    opacity: 0.32;
    animation: sym-float 20s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s);
}

.light-mode .curve {
    opacity: 0.42;
}

.curve .axis {
    fill: none;
    stroke: var(--signal);
    stroke-width: 1;
    opacity: 0.55;
}

.curve .trace {
    fill: none;
    stroke: var(--signal);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: curve-draw 11s ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

.curve .ref {
    fill: none;
    stroke: var(--signal);
    stroke-width: 1;
    stroke-dasharray: 3 5;
    opacity: 0.6;
}

.curve .stem {
    stroke: var(--signal);
    stroke-width: 2.4;
    stroke-linecap: round;
}

@keyframes curve-draw {
    0%   { stroke-dashoffset: 1; }
    45%, 80% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1; }
}

@media (max-width: 700px) {
    .eq {
        font-size: calc(var(--fs, 24px) * 0.7);
        opacity: 0.18;
    }

    .curve {
        width: calc(var(--w, 320px) * 0.65);
        opacity: 0.2;
    }

    .eq.hide-mobile,
    .curve.hide-mobile {
        display: none;
    }
}



/* =========================================================
   Projects: line-art covers, search, badges, empty state
   ========================================================= */
.cover-art {
    position: absolute;
    inset: 12% 0 6%;
    margin: auto;
    width: min(78%, 230px);
    aspect-ratio: 1;
    background: var(--cat);
    opacity: 0.9;
    -webkit-mask: var(--img) center / contain no-repeat;
    mask: var(--img) center / contain no-repeat;
    filter: drop-shadow(0 0 14px rgba(var(--signal-rgb), 0.35));
    transition: transform 0.4s ease;
}

.light-mode .cover-art {
    filter: none;
}

.project-card:hover .cover-art {
    transform: scale(1.06);
}

.project-banner .cover-art {
    inset: 0;
    width: min(60%, 240px);
}

.project-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    background: rgba(8, 8, 12, 0.78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.project-badge i {
    font-size: 16px;
    color: var(--signal);
}

.tag-more {
    border-style: dashed;
    opacity: 0.8;
}

.project-tools {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.project-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(560px, 100%);
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-search:focus-within {
    border-color: rgba(var(--signal-rgb), 0.7);
    box-shadow: 0 0 0 4px rgba(var(--signal-rgb), 0.12);
}

.project-search > i {
    color: var(--signal);
    font-size: 20px;
}

.project-search input {
    flex: 1;
    min-width: 0;
    padding: 14px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
}

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

.project-count {
    flex-shrink: 0;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.project-empty {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 56px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.project-empty i {
    font-size: 40px;
    color: var(--signal);
}

/* the filter row stays reachable while scrolling a long list */
@media (min-width: 701px) {
    #project-filters {
        position: sticky;
        top: calc(var(--header-h) + 8px);
        z-index: 5;
        padding: 10px 0;
        margin-bottom: 30px;
        background: linear-gradient(var(--bg) 70%, transparent);
    }
}

@media (max-width: 700px) {
    .project-count {
        display: none;
    }
}

/* =========================================================
   Hero fits the screen (EN text is wider than FR on laptops)
   ========================================================= */
@media (min-width: 921px) and (max-height: 980px) {
    .hero {
        min-height: 100svh;
        padding: calc(var(--header-h) + 2vh) 0 2.2vh;
        gap: 2vh;
    }

    .hero h1 {
        margin-top: 1.4vh;
        font-size: clamp(34px, 6.4vh, 62px);
        line-height: 1.05;
    }

    .hero-intro {
        margin-top: 1.4vh;
        font-size: clamp(13.5px, 1.95vh, 16.5px);
        line-height: 1.55;
    }

    .hero-role {
        margin-top: 1vh;
    }

    .hero-buttons {
        margin-top: 2.2vh;
    }

    .hero .socials {
        margin-top: 2vh;
    }

    .hero-grid {
        gap: 48px;
    }

    .photo-frame {
        width: min(470px, 100%, 50vh);
    }

    .stats li {
        padding: 1.5vh 28px;
    }
}

/* =========================================================
   Scroll companion: a small robot riding a progress rail
   ========================================================= */
.scroll-rail {
    position: fixed;
    top: 84px;
    right: 26px;
    bottom: 90px;
    z-index: 40;
    width: 2px;
    border-radius: 2px;
    background: var(--border);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.scroll-rail.visible {
    opacity: 1;
}

.scroll-fill {
    display: block;
    width: 100%;
    height: 0;
    border-radius: 2px;
    background: linear-gradient(var(--signal), rgba(var(--signal-rgb), 0.3));
}

.scroll-bot {
    position: fixed;
    top: 0;
    right: 8px;
    z-index: 41;
    width: 38px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--signal);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translate(0, var(--y, 84px)) scaleX(var(--dir, 1));
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.scroll-bot.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-bot svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.scroll-bot rect,
.scroll-bot circle,
.scroll-bot path {
    fill: var(--bg);
}

.scroll-bot .bot-eye,
.scroll-bot .bot-led {
    fill: currentColor;
}

.scroll-bot .bot-wheel {
    transform-box: fill-box;
    transform-origin: center;
    transform: rotate(var(--spin, 0deg));
}

.scroll-bot .bot-wheel path {
    fill: none;
}

.scroll-bot:hover {
    color: var(--text);
}

.scroll-bot .bot-led {
    animation: bot-blink 2.4s ease-in-out infinite;
}

.scroll-bot.moving .bot-led {
    animation-duration: 0.6s;
}

@keyframes bot-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

@media (max-width: 700px) {
    .scroll-rail { right: 14px; }
    .scroll-bot  { right: -2px; width: 32px; height: 40px; }
}



/* =========================================================
   Projects carousel: one swipeable row per category
   ========================================================= */
.group-head .group-count {
    margin-left: auto;
}

.car-controls {
    display: flex;
    gap: 8px;
}

.project-group.no-scroll .car-controls {
    display: none;
}

.car-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.car-btn:hover:not(:disabled) {
    border-color: var(--signal);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.car-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.carousel {
    --fl: 0px;
    --fr: 0px;
}

.carousel-track {
    display: flex;
    gap: 22px;
    margin: 0 -6px;
    padding: 10px 6px 18px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 6px;
    scrollbar-width: none;
    outline: none;
    cursor: grab;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track:focus-visible {
    box-shadow: 0 0 0 2px rgba(var(--signal-rgb), 0.5);
    border-radius: var(--radius);
}

.carousel-track.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
}

.carousel-track.dragging a {
    pointer-events: none;
}

.carousel-track > .project-card {
    flex: 0 0 calc((100% - 44px) / 3);
    min-width: 290px;
    scroll-snap-align: start;
}

.car-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 8px;
}

.car-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--border);
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.car-dots button.on {
    width: 26px;
    background: var(--signal);
}

.project-group.no-scroll .car-dots {
    display: none;
}

@media (max-width: 1000px) {
    .carousel-track > .project-card {
        flex-basis: calc((100% - 22px) / 2);
    }
}

@media (max-width: 700px) {
    .carousel-track {
        gap: 16px;
        cursor: auto;
    }

    .carousel-track > .project-card {
        flex-basis: 84%;
        min-width: 0;
    }

    .car-controls {
        display: none;
    }

    .project-groups {
        gap: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        scroll-behavior: auto;
    }
}


/* the carousel must scroll inside its box instead of widening the page */
.project-groups {
    grid-template-columns: minmax(0, 1fr);
}

.project-group,
.carousel {
    min-width: 0;
}


/* =========================================================
   Contact: clearer frosted glass
   ========================================================= */
.contact-panel {
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--accent-rgb), 0.12), transparent 55%),
        rgba(var(--surface-rgb), 0.04);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-color: rgba(var(--accent-rgb), 0.28);
}

.contact-list a,
.contact-list div {
    background: rgba(var(--surface-rgb), 0.35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* =========================================================
   Projects section: compact, so the whole carousel fits on one screen
   ========================================================= */
#projects.section {
    padding: 70px 0 54px;
}

#projects .section-head {
    margin-bottom: 26px;
}

#projects .section-sub {
    margin-top: 8px;
    font-size: 15px;
}

#projects .section-head::after {
    margin-top: 14px;
}

#projects .project-tools {
    margin-bottom: 14px;
}

#projects .project-search input {
    padding: 11px 0;
}

/* all the category buttons on one scrollable line */
#projects .filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 8px;
    margin: 0 0 18px;
    padding: 4px 2px 8px;
    scrollbar-width: none;
}

#projects .filters::-webkit-scrollbar {
    display: none;
}

#projects .filter {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 7px 14px;
    font-size: 13.5px;
}

@media (min-width: 701px) {
    #project-filters {
        position: static;
        padding: 4px 2px 8px;
        background: none;
    }

    #projects .filters {
        justify-content: center;
    }
}

#projects .group-head {
    margin-bottom: 8px;
    padding-bottom: 10px;
}

/* shorter cards */
#projects .project-visual {
    height: 132px;
}

#projects .project-body {
    padding: 16px 18px 18px;
}

#projects .project-card h3 {
    margin: 6px 0 6px;
    font-size: 16.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#projects .project-summary {
    font-size: 13.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#projects .project-meta {
    font-size: 11.5px;
    padding-right: 44px;
}

#projects .project-meta span:first-child {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#projects .project-index {
    font-size: 30px;
    top: 10px;
    right: 16px;
}

#projects .project-card .tags {
    margin-top: 10px;
    gap: 6px;
}

#projects .project-card .tags li {
    padding: 3px 9px;
    font-size: 11.5px;
}

#projects .project-actions {
    margin-top: 12px;
}

#projects .carousel-track {
    padding-bottom: 12px;
}

/* four cards per view on wide screens */
@media (min-width: 1100px) {
    #projects .carousel-track > .project-card {
        flex-basis: calc((100% - 66px) / 4);
        min-width: 240px;
    }
}

#projects .projects-grid .project-more {
    padding: 14px 22px;
}


/* single-line tags, no subtitle: the section fits on one screen */
#projects .section-sub {
    display: none;
}

#projects .project-card .tags {
    flex-wrap: nowrap;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}

#projects .project-card .tags li {
    flex-shrink: 0;
    white-space: nowrap;
}

/* the "more projects" slide at the end of the carousel */
.carousel-track > .project-more {
    grid-column: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 22px;
    border-style: dashed;
}

#projects .projects-grid .project-more,
.carousel-track > .project-more {
    padding: 22px;
}

.carousel-track > .project-more h3,
.carousel-track > .project-more p {
    margin: 0;
}

.carousel-track > .project-more p {
    flex: 0 0 auto;
}

.carousel-track > .project-more {
    align-self: center;
}

/* cards: a single action row (the "code coming soon" note stays on the project page) */
#projects .project-actions {
    flex-wrap: nowrap;
}

#projects .project-actions .btn-ghost {
    display: none;
}

/* category buttons: wrap on two centred lines on desktop so no label is cut off
   (the single scrolling line is kept for phones) */
@media (min-width: 701px) {
    #projects .filters {
        flex-wrap: wrap;
        justify-content: center;
        overflow: visible;
        gap: 8px;
        padding: 2px 0 6px;
    }
}


/* six certificates: three per row on wide screens */
@media (min-width: 1000px) {
    #certifications .card-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1160px;
    }
}


/* =========================================================
   Hero: gripper on the trajectory, roaming robot, self-typing code
   ========================================================= */
.fx-trajectory .gripper {
    color: var(--signal);
}

.fx-trajectory .g-arm,
.fx-trajectory .g-jaw {
    fill: none;
    stroke: var(--signal);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(var(--signal-rgb), 0.7));
}

.fx-trajectory .cube {
    fill: rgba(var(--signal-rgb), 0.25);
    stroke: var(--signal);
    stroke-width: 1.6;
}

.roam-floor {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    border-top: 2px dashed rgba(var(--signal-rgb), 0.35);
}

.roam-crate {
    position: absolute;
    bottom: 14px;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    border: 2px solid rgba(var(--signal-rgb), 0.7);
    border-radius: 3px;
    background: rgba(var(--signal-rgb), 0.12);
}

.roam-bot {
    position: absolute;
    left: 0;
    bottom: 12px;
    width: 58px;
    color: var(--signal);
}

.roam-bot svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 0 6px rgba(var(--signal-rgb), 0.45));
}

.roam-wheel {
    transform-box: fill-box;
    transform-origin: center;
}

.roam-eye,
.roam-led {
    fill: currentColor;
}

.roam-led {
    animation: bot-blink 1.6s ease-in-out infinite;
}

.roam-sweep {
    opacity: 0.35;
    stroke-dasharray: 3 5;
}

.roam-bot.alert .roam-led,
.roam-bot.alert .roam-eye {
    animation: bot-blink 0.25s linear infinite;
}

.roam-bot.alert .roam-sweep {
    opacity: 0.9;
}

/* code typed and erased in the background of each section */
.code-bg {
    position: absolute;
    z-index: 0;
    margin: 0;
    width: calc(var(--cols, 30) * 1ch + 2px);
    height: calc(var(--rows, 5) * 1.6em);
    overflow: hidden;
    font: 500 var(--fs, 14px) / 1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    white-space: pre;
    color: var(--signal);
    opacity: 0.38;
    pointer-events: none;
}

.light-mode .code-bg {
    opacity: 0.5;
}

.code-live::after {
    content: "";
    display: inline-block;
    width: 0.55ch;
    height: 1.1em;
    margin-left: 1px;
    vertical-align: text-bottom;
    background: currentColor;
    animation: blink 1s steps(1) infinite;
}

@media (max-width: 700px) {
    .code-bg {
        font-size: calc(var(--fs, 14px) * 0.8);
        opacity: 0.28;
    }

    .code-bg.hide-mobile {
        display: none;
    }

    .roam-bot {
        width: 44px;
    }
}


/* =========================================================
   Kinematic-diagram robot arm, spinning gears, click effects
   ========================================================= */
.kin-host {
    position: absolute;
    pointer-events: none;
    color: var(--signal);
}

.kin-hero {
    right: -30px;
    bottom: 2%;
    z-index: 2;
    width: min(520px, 45vw);
}

.kin-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    opacity: 0.6;
}

.light-mode .kin-svg {
    opacity: 0.75;
}

.kin-svg path,
.kin-svg line,
.kin-svg circle,
.kin-svg rect,
.kin-svg polyline {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kin-ground {
    stroke-width: 2;
    stroke-dasharray: 3 8;
    opacity: 0.7;
}

.kin-base {
    stroke-width: 2.4;
}

.kin-link {
    stroke-width: 5;
}

.kin-joint {
    stroke-width: 2.6;
    fill: var(--bg) !important;
}

.kin-dot {
    fill: currentColor !important;
    stroke: none !important;
}

.kin-axis {
    stroke-width: 1.8;
    opacity: 0.85;
}

.kin-ext {
    stroke-width: 1.4;
    stroke-dasharray: 4 5;
    opacity: 0.7;
}

.kin-arc {
    stroke-width: 1.8;
}

.kin-trace {
    stroke-width: 2;
    stroke-dasharray: 2 6;
    opacity: 0.8;
}

.kin-g {
    stroke-width: 3;
}

.kin-t {
    fill: currentColor;
    font: 600 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.5px;
}

/* gears turn, the drone tilts */
.sym-gear {
    animation: sym-float 16s ease-in-out infinite alternate, sym-spin 38s linear infinite;
    animation-delay: var(--d, 0s), 0s;
}

.sym-drone {
    animation: sym-float 16s ease-in-out infinite alternate, sym-tilt 6s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s), var(--d, 0s);
}

@keyframes sym-spin {
    to { rotate: 360deg; }
}

@keyframes sym-tilt {
    from { rotate: -5deg; }
    to   { rotate: 5deg; }
}

/* click effects: a ripple wherever you click, and a burst on the portrait */
.click-ripple {
    position: fixed;
    z-index: 9999;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid var(--signal);
    border-radius: 50%;
    pointer-events: none;
    animation: ripple-out 0.7s ease-out forwards;
}

@keyframes ripple-out {
    from { transform: scale(0.4); opacity: 0.9; }
    to   { transform: scale(7); opacity: 0; }
}

.photo-ring,
.photo-spark {
    position: absolute;
    pointer-events: none;
}

.photo-ring {
    inset: 0;
    border: 2px solid var(--signal);
    border-radius: 50%;
    animation: photo-ring 1.1s ease-out forwards;
    animation-delay: var(--rd, 0s);
}

@keyframes photo-ring {
    from { transform: scale(1); opacity: 0.9; }
    to   { transform: scale(1.5); opacity: 0; }
}

.photo-spark {
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 10px var(--signal);
    animation: photo-spark 0.9s ease-out forwards;
}

@keyframes photo-spark {
    from { transform: rotate(var(--a)) translateX(48%); opacity: 1; }
    to   { transform: rotate(var(--a)) translateX(78%); opacity: 0; }
}

.photo-frame.bump {
    animation: photo-bump 0.5s ease-out;
}

@keyframes photo-bump {
    30% { transform: scale(1.045) rotate(-1.5deg); }
    60% { transform: scale(0.99) rotate(1deg); }
}

/* animated decoration behind the project pages */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

body.project-page main,
body.project-page .footer {
    position: relative;
    z-index: 1;
}

.page-bg .kin-host {
    position: absolute;
    right: 1%;
    bottom: 4%;
    width: 330px;
}

.page-bg .sym {
    opacity: 0.12;
}

@media (max-width: 1180px) {
    .page-bg > :not(.keep) {
        display: none;
    }
}

@media (max-width: 900px) {
    .kin-hero {
        width: 70vw;
        right: -8vw;
        z-index: 0;
        opacity: 0.55;
    }
}


/* =========================================================
   Every background symbol moves a little (all sections)
   ========================================================= */
.sym-rover, .sym-tank {
    animation: sym-float 16s ease-in-out infinite alternate, sym-drive 8s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s), var(--d, 0s);
}

.sym-arm, .sym-cobot, .sym-delta {
    transform-origin: 50% 88%;
    animation: sym-float 16s ease-in-out infinite alternate, sym-swing 5s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s), var(--d, 0s);
}

.sym-head {
    animation: sym-float 16s ease-in-out infinite alternate, sym-nod 3.2s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s), var(--d, 0s);
}

.sym-lidar {
    animation: sym-float 16s ease-in-out infinite alternate, sym-spin 26s linear infinite;
    animation-delay: var(--d, 0s), 0s;
}

.sym-chip, .sym-network, .sym-dashboard, .sym-grafcet, .sym-loop, .sym-motor {
    animation: sym-float 16s ease-in-out infinite alternate, sym-pulse 4s ease-in-out infinite alternate;
    animation-delay: var(--d, 0s), var(--d, 0s);
}

@keyframes sym-drive {
    from { margin-left: -40px; }
    to   { margin-left: 40px; }
}

@keyframes sym-swing {
    from { rotate: -6deg; }
    to   { rotate: 6deg; }
}

@keyframes sym-nod {
    from { rotate: -5deg; }
    to   { rotate: 5deg; }
}

@keyframes sym-pulse {
    from { opacity: 0.1; }
    to   { opacity: 0.26; }
}

.kin-sec {
    width: min(400px, 34vw);
    opacity: 0.85;
}

.kin-sec .kin-svg {
    opacity: 0.4;
}

.light-mode .kin-sec .kin-svg {
    opacity: 0.55;
}

@media (max-width: 900px) {
    .kin-sec {
        display: none;
    }
}


/* =========================================================
   Robot Lab: 3D cobot (lab3d.js)
   Colours follow the site theme (light and dark).
   ========================================================= */
.lab3d {
    /* the lab uses the colours of the site, in light and in dark mode */
    --lab-bg: var(--bg-alt);
    --lab-panel: rgba(var(--surface-rgb), 0.86);
    --lab-line: var(--border);
    --lab-cyan: var(--accent);
    --lab-text: var(--text);
    --lab-muted: var(--muted);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: stretch;
    color: var(--lab-text);
}

.lab3d-stage {
    position: relative;
    height: clamp(440px, 68vh, 600px);
    overflow: hidden;
    background: radial-gradient(circle at 50% 40%, var(--surface) 0%, var(--bg-alt) 85%);
    border: 1px solid var(--lab-line);
    border-radius: 22px;
}

.lab3d-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.lab3d-canvas:active {
    cursor: grabbing;
}

.lab3d-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--lab-muted);
    font-size: 12.5px;
    pointer-events: none;
    white-space: nowrap;
}

.lab3d-tcp,
.lab3d-prog {
    position: absolute;
    top: 18px;
    padding: 14px 16px;
    background: var(--lab-panel);
    border: 1px solid var(--lab-line);
    border-radius: 12px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.lab3d-tcp {
    left: 18px;
    min-width: 232px;
}

.lab3d-prog {
    right: 18px;
    min-width: 200px;
}

.lab3d-tcp h4,
.lab3d-prog h4 {
    margin-bottom: 10px;
    color: var(--lab-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.lab3d-prog h4 b {
    color: var(--lab-cyan);
}

.lab3d-tcp dl > div {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.lab3d-tcp dt {
    color: var(--lab-cyan);
    font-weight: 700;
}

.lab3d-tcp dd {
    color: var(--heading);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.lab3d-vac {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--lab-line);
    color: var(--lab-muted);
}

.lab3d-vac b {
    color: var(--muted);
}

.lab3d-vac b.on {
    color: var(--heading);
}

.lab3d-prog ol {
    list-style: none;
}

.lab3d-prog li {
    display: flex;
    gap: 10px;
    padding: 2px 6px;
    margin: 0 -6px;
    border-radius: 5px;
    color: var(--muted);
    opacity: 0.75;
}

.lab3d-prog li span {
    min-width: 12px;
}

.lab3d-prog li.active {
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--heading);
    opacity: 1;
    font-weight: 700;
}

.lab3d-actions {
    position: absolute;
    left: 18px;
    bottom: 18px;
    display: flex;
    gap: 10px;
}

.lab3d-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--lab-panel);
    border: 1px solid var(--lab-line);
    border-radius: 999px;
    color: var(--lab-text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.lab3d-btn svg {
    width: 14px;
    height: 14px;
    fill: var(--accent);
}

.lab3d-btn:hover,
.lab3d-btn.running {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
}

.lab3d-override {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lab-muted);
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.lab3d-chip {
    padding: 8px 16px;
    background: var(--lab-panel);
    border: 1px solid var(--lab-line);
    border-radius: 999px;
    color: var(--lab-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
}

.lab3d-chip.active {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--on-accent);
}

.lab3d-panel {
    max-height: clamp(440px, 68vh, 600px);
    overflow-y: auto;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--lab-line);
    border-radius: 22px;
}

.lab3d-panel h3 {
    color: var(--heading);
    font-size: 17px;
    margin-bottom: 8px;
}

.lab3d-lead {
    margin-bottom: 12px;
    color: var(--lab-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.lab3d-slider {
    position: relative;
    display: block;
    margin-bottom: 6px;
}

.lab3d-jn {
    display: block;
    font-size: 14px;
}

.lab3d-jn b {
    margin-right: 6px;
    color: var(--lab-cyan);
}

.lab3d-slider input[type=range] {
    width: 100%;
    margin: 2px 0 0;
    accent-color: var(--lab-cyan);
}

.lab3d-slider output {
    position: absolute;
    top: 0;
    right: 0;
    display: block;
    color: var(--heading);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
}

.lab3d-note {
    margin-top: 18px;
    color: var(--lab-muted);
    font-size: 12px;
    line-height: 1.6;
}

.lab3d-fallback {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 1060px) {
    .lab3d {
        grid-template-columns: 1fr;
    }

    .lab3d-stage {
        height: 520px;
    }

    .lab3d-panel {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .lab3d-stage {
        height: 500px;
    }

    .lab3d-prog {
        display: none;
    }

    .lab3d-tcp {
        min-width: 0;
        padding: 8px 10px;
        font-size: 11px;
    }

    .lab3d-tcp h4,
    .lab3d-vac {
        display: none;
    }

    .lab3d-tcp dl {
        margin: 0;
    }

    .lab3d-hint {
        display: none;
    }

    .lab3d-override span {
        display: none;
    }

    /* phones: controls on two rows so nothing overlaps */
    .lab3d-actions {
        left: 14px;
        bottom: 66px;
    }

    .lab3d-override {
        left: 14px;
        right: 14px;
        bottom: 14px;
        justify-content: center;
    }

    .lab3d-tcp {
        left: 14px;
        top: 14px;
    }

    .lab3d-chip {
        padding: 7px 12px;
    }

    .lab3d-btn {
        padding: 10px 14px;
    }
}


/* =========================================================
   Robot Lab: live kinematic diagram (labkin)
   ========================================================= */
.labkin {
    margin-top: 40px;
}

.labkin-head h3 {
    font-size: 24px;
    margin-bottom: 6px;
}

.labkin-head p {
    max-width: 760px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.labkin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.labkin-card,
.labkin-use {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
}

.labkin-card h4,
.labkin-use > h4 {
    margin: 0 0 12px;
    font-size: 13.5px;
    letter-spacing: 0.3px;
}

.labkin-data h4:not(:first-child) {
    margin-top: 22px;
}

.labkin-card h5,
.labkin-cards h5 {
    margin-bottom: 6px;
    font-size: 13px;
}

#kin-svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    background: var(--bg-alt);
}

.kin-ground { stroke: var(--muted); stroke-width: 1.5; }
.kin-hatch { stroke: var(--muted); stroke-width: 1; opacity: 0.55; }
.kin-base { fill: var(--surface-2); stroke: var(--heading); stroke-width: 1.5; }
.kin-reach { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 6; opacity: 0.7; }
.kin-link { stroke: var(--heading); stroke-linecap: round; opacity: 0.85; }
.kin-link.l1, .kin-link.l2, .kin-link.l3 { stroke-width: 10; }
.kin-link.l4 { stroke-width: 7; }
.kin-link.l5 { stroke-width: 5; opacity: 0.7; }
.kin-axis { stroke: var(--heading); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.kin-axis-halo { stroke: var(--bg-alt); stroke-width: 5; fill: none; }
.kin-legend { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; fill: var(--muted); }
.kin-ax, .kin-ay, .kin-az { fill: none; stroke-linecap: round; }
.kin-ax { stroke: var(--muted); stroke-width: 2; }
.kin-ay { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 4; }
.kin-az { stroke: var(--heading); stroke-width: 2.6; }
.kin-ah-z { fill: var(--heading); }
.kin-ah-x { fill: var(--muted); }
.kin-joint { fill: var(--surface); stroke: var(--heading); stroke-width: 2.2; }
.kin-jdot { fill: var(--heading); }
.kin-tcp { fill: var(--surface); stroke: var(--heading); stroke-width: 2; }
.kin-tcpx { stroke: var(--heading); stroke-width: 1.4; }
.kin-arc { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.kin-sym { fill: var(--surface); stroke: var(--heading); stroke-width: 1.5; }
.kin-sym.tri { stroke-width: 2; }
.kin-sym-dot { fill: var(--heading); }
.kin-sym-x { stroke: var(--heading); stroke-width: 1.8; fill: none; }
.kin-t, .kin-dim, .kin-zt, .kin-jt, .kin-tri, .kin-fr {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    paint-order: stroke;
    stroke: var(--bg-alt);
    stroke-width: 3px;
    stroke-linejoin: round;
}
.kin-t { font-size: 12px; fill: var(--muted); }
.kin-dim { font-size: 11.5px; fill: var(--muted); }
.kin-zt { font-size: 12.5px; fill: var(--heading); font-weight: 700; }
.kin-jt { font-size: 12px; fill: var(--heading); font-weight: 700; }
.kin-tri { font-size: 13px; fill: var(--heading); font-weight: 700; }
.kin-fr { font-size: 13px; fill: var(--heading); font-weight: 700; }

.labkin-frames {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12.5px;
}

.labkin-frames span {
    margin-right: 4px;
}

.labkin-frames .lab3d-chip {
    padding: 5px 11px;
    font-size: 12px;
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
}

.labkin-frames .lab3d-chip.active {
    color: var(--on-accent);
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.labkin-cap {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.labkin-dh {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.labkin-dh th,
.labkin-dh td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.labkin-dh th {
    color: var(--muted);
    font-weight: 600;
}

.labkin-dh td:nth-child(5) {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-weight: 700;
    color: var(--heading);
}

.labkin-mat,
.labkin-jac {
    display: grid;
    gap: 3px;
    padding: 10px;
    background: var(--bg-alt);
    border-radius: 12px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.labkin-mat {
    grid-template-columns: repeat(4, 1fr);
}

.labkin-mat .p {
    color: var(--heading);
    font-weight: 700;
}

.labkin-jac {
    grid-template-columns: repeat(6, 1fr);
    font-size: 11.5px;
}

.labkin-jac .w {
    color: var(--muted);
}

.labkin-mat span,
.labkin-jac span {
    text-align: right;
}

.labkin-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.labkin-mono {
    white-space: pre;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--heading);
}

.labkin-small {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.labkin-meter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
}

.labkin-meter b {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--heading);
}

.labkin-meter em {
    flex: 1 0 100%;
    font-style: normal;
    font-size: 12.5px;
    color: var(--muted);
}

.labkin-meter em[data-level="warn"] {
    color: var(--heading);
    font-weight: 600;
}

.labkin-meter em[data-level="bad"] {
    color: #b3402a;
    font-weight: 700;
}

.labkin-track {
    flex: 1 1 120px;
    height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}

.labkin-track i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.15s ease;
}

.labkin-use {
    margin-top: 24px;
}

.labkin-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.labkin-cards > div {
    padding: 16px;
    background: var(--bg-alt);
    border-radius: 14px;
}

.labkin-cards p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.labkin-cards pre {
    margin-top: 8px;
    overflow-x: auto;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--heading);
}

@media (max-width: 1060px) {
    .labkin-grid {
        grid-template-columns: 1fr;
    }

    .labkin-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .labkin-card,
    .labkin-use {
        padding: 16px;
    }

    .labkin-cards {
        grid-template-columns: 1fr;
    }

    .labkin-dh {
        font-size: 11.5px;
    }

    .labkin-jac {
        font-size: 10.5px;
        padding: 8px 6px;
    }

    .labkin-mat {
        font-size: 11px;
    }
}


/* Robot Lab: button that opens the kinematic diagram */
.labkin-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--heading);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.labkin-toggle:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.labkin-toggle i {
    font-size: 22px;
    transition: transform 0.25s ease;
}

.labkin-toggle.open i {
    transform: rotate(180deg);
}

.labkin-toggle .lk-hide,
.labkin-toggle.open .lk-show {
    display: none;
}

.labkin-toggle.open .lk-hide {
    display: inline;
}

.labkin {
    margin-top: 18px;
}

.labkin[hidden] {
    display: none;
}
