/* ==========================================================================
   philgarweg.com — one stylesheet, no @imports (fewer files to cache-bust)
   1. Fonts   2. Tokens (light / dark)   3. Base   4. Header + docking name
   5. Hero    6. Sections   7. Projects   8. Timeline   9. Toolbox + contact
   10. Robot buddy   11. Motion + responsive
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, no Google requests) ---------- */
@font-face {
    font-family: "Fraunces";
    src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

/* ---------- 2. Tokens ---------- */
:root {
    /* calm denim/petrol blue instead of saturated royal blue, warm apricot as second accent */
    --hue: 225;
    --bg: oklch(0.977 0.008 85);            /* warm paper */
    --bg-tint: oklch(0.955 0.014 220);       /* tinted sections */
    --surface: oklch(0.995 0.003 85);
    --text: oklch(0.27 0.03 250);
    --text-muted: oklch(0.47 0.025 250);
    --border: oklch(0.27 0.03 250 / 0.11);
    --primary: oklch(0.5 0.085 var(--hue));
    --primary-hover: oklch(0.44 0.085 var(--hue));
    --primary-soft: oklch(0.915 0.038 var(--hue));
    --on-primary: oklch(0.99 0.005 85);
    --accent: oklch(0.74 0.13 55);           /* apricot */
    --accent-soft: oklch(0.93 0.045 65);
    --blob-a: oklch(0.86 0.06 220 / 0.55);
    --blob-b: oklch(0.9 0.07 65 / 0.6);
    --blob-c: oklch(0.88 0.05 170 / 0.45);
    --shadow-s: 0 1px 2px oklch(0.3 0.03 250 / 0.06), 0 2px 6px oklch(0.3 0.03 250 / 0.05);
    --shadow-m: 0 2px 4px oklch(0.3 0.03 250 / 0.05), 0 10px 28px oklch(0.3 0.03 250 / 0.09);
    --header-bg: oklch(0.977 0.008 85 / 0.82);

    /* robot drawing */
    --bot-body: oklch(0.995 0.003 85);
    --bot-deck: oklch(0.86 0.06 var(--hue));
    --bot-line: oklch(0.32 0.04 250);
    --bot-led: var(--accent);

    /* type + layout */
    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --wrap: 70rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --header-h: 4.25rem;
    --radius: 1.25rem;
    --radius-s: 0.75rem;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: light;
}

.dark {
    --bg: oklch(0.205 0.022 245);
    --bg-tint: oklch(0.235 0.026 240);
    --surface: oklch(0.255 0.026 242);
    --text: oklch(0.95 0.008 240);
    --text-muted: oklch(0.77 0.02 240);
    --border: oklch(0.95 0.01 240 / 0.1);
    --primary: oklch(0.8 0.085 215);
    --primary-hover: oklch(0.86 0.075 215);
    --primary-soft: oklch(0.33 0.05 225);
    --on-primary: oklch(0.2 0.03 245);
    --accent: oklch(0.82 0.11 62);
    --accent-soft: oklch(0.34 0.05 60);
    --blob-a: oklch(0.42 0.08 225 / 0.45);
    --blob-b: oklch(0.45 0.08 55 / 0.25);
    --blob-c: oklch(0.42 0.06 175 / 0.3);
    --shadow-s: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-m: 0 2px 4px oklch(0 0 0 / 0.2), 0 12px 32px oklch(0 0 0 / 0.3);
    --header-bg: oklch(0.205 0.022 245 / 0.82);

    --bot-body: oklch(0.32 0.03 240);
    --bot-deck: oklch(0.45 0.07 var(--hue));
    --bot-line: oklch(0.92 0.02 240);

    color-scheme: dark;
}

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

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

body {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

img,
svg {
    display: block;
}

a {
    color: var(--primary);
    text-underline-offset: 0.2em;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.15;
    text-wrap: balance;
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 2.9rem);
    font-weight: 600;
    letter-spacing: -0.015em;
}

h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.005em;
}

p {
    color: var(--text-muted);
    text-wrap: pretty;
}

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-s);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
}

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

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.eyebrow::before {
    content: "";
    width: 1.5rem;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.lead {
    font-size: 1.2rem;
    color: var(--text);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-s);
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.75rem 1.4rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 1rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 6px 18px -6px var(--primary);
}

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

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--primary);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s var(--ease);
}

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

.icon-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn[data-bot-toggle] svg {
    width: 1.6rem;
    height: 1.6rem;
    stroke: none;
}

.icon-btn[data-bot-toggle][aria-pressed="false"] {
    opacity: 0.5;
}

.icon-btn[data-bot-toggle][aria-pressed="false"]::after {   /* strike-through when off */
    content: "";
    position: absolute;
    width: 1.7rem;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transform: rotate(-40deg);
}

.icon-btn[data-bot-toggle] {
    position: relative;
}

.i-sun { display: none !important; }
.dark .i-sun { display: block !important; }
.dark .i-moon { display: none !important; }

/* ---------- 4. Header + docking name ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.site-header.is-scrolled {
    background: var(--header-bg);
    border-bottom-color: var(--border);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
}

.brand-icon {
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    transform: rotate(-90deg);           /* robot looks "up", towards the name */
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;              /* same as .hero-name, so the docked name fits the slot */
    white-space: nowrap;
}

/* With JS the flying name lands here, the header copy only reserves the spot */
.dock-ready .brand-name {
    visibility: hidden;
}

.js .brand-icon {
    opacity: 0;                           /* fades in as the name docks (animation or JS fallback) */
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.nav-links a {
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
    color: var(--text);
    background: var(--primary-soft);
}

.menu-btn {
    display: none;
}

/* ---------- 5. Hero ---------- */
.hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: calc(var(--header-h) + 2rem) var(--gutter) 6rem;
    text-align: center;
}

.hero-bg {                                /* clips the blobs, the name itself must not be clipped */
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background-image: radial-gradient(var(--border) 1.2px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
    mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

/* soft color clouds: radial gradients instead of filter: blur(), which is expensive on phones */
.blob {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--c), transparent);
    animation: drift 18s ease-in-out infinite alternate;
    will-change: transform;
}

.blob-a { --c: var(--blob-a); width: 52rem; height: 52rem; left: -18rem; top: -16rem; }
.blob-b { --c: var(--blob-b); width: 44rem; height: 44rem; right: -15rem; top: 10%; animation-delay: -6s; }
.blob-c { --c: var(--blob-c); width: 40rem; height: 40rem; left: 25%; bottom: -17rem; animation-delay: -12s; }

@keyframes drift {
    to { transform: translate(3rem, 2rem) scale(1.08); }
}

.hero-inner {
    position: relative;
    max-width: 44rem;
}

.hello {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: wave 2.6s ease-in-out 0.6s 2;
}

@keyframes wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
}

.hero-name {
    width: fit-content;
    margin: 0 auto;
    font-family: var(--font-display);
    font-size: clamp(3rem, 12.5vw, 7rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.name-ghost {
    display: block;
}

.name-fly {
    display: none;
}

/* the fixed copy that flies into the header (positions come from main.js measure()) */
.dock-ready .name-ghost {
    opacity: 0;                           /* still read by screen readers, the fly copy is aria-hidden */
}

.dock-ready .name-fly {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;                          /* above the fixed header once it docks */
    pointer-events: none;                 /* clicks go to the header link under it */
    translate: var(--x0) var(--y0);
    will-change: translate;
}

.dock-ready.menu-over-name .name-fly {
    z-index: 40;                          /* under the open mobile menu while still in the hero */
}

.name-fly-inner {
    display: block;
    transform-origin: 0 0;
    will-change: translate, scale;
}

@supports (animation-timeline: scroll()) {
    .dock-ready .name-fly,
    .dock-ready .name-fly-inner,
    .dock-ready .brand-icon {
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: scroll(root);
        animation-range: 0px var(--dist);
    }

    .dock-ready .name-fly { animation-name: fly-up; }
    .dock-ready .name-fly-inner { animation-name: fly-over; }
    .dock-ready .brand-icon { animation-name: icon-in; }
}

@keyframes fly-up {                       /* linear: moves exactly as fast as the page scrolls */
    to { translate: var(--x0) var(--y1); }
}

@keyframes fly-over {
    from { translate: 0 0; scale: 1; animation-timing-function: ease-in-out; }
    to { translate: var(--dx) 0; scale: var(--s); }
}

@keyframes icon-in {
    from { opacity: 0; scale: 0.6; }
    to { opacity: 1; scale: 1; }
}

.hero-role {
    margin-top: 1.25rem;
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    font-weight: 600;
    color: var(--primary);
}

.hero-lead {
    margin: 1rem auto 0;
    max-width: 36rem;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
}

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

/* ---------- 6. Sections ---------- */
.section {
    padding-block: clamp(4.5rem, 10vw, 7.5rem);
}

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

.section-head {
    max-width: 38rem;
    margin-bottom: 2.75rem;
}

.section-head h2 + p {
    margin-top: 0.85rem;
    font-size: 1.1rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.about-text h2 {
    margin-bottom: 1.25rem;
}

.about-text p + p {
    margin-top: 1rem;
}

.facts {
    padding: 0.5rem 1.5rem;
}

.facts dl > div {
    padding-block: 1rem;
}

.facts dl > div + div {
    border-top: 1px solid var(--border);
}

.facts dt {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.facts dd {
    margin-top: 0.15rem;
    font-weight: 600;
}

.values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: clamp(3.5rem, 8vw, 5.5rem);
}

.value {
    padding: 1.75rem;
    border-radius: var(--radius);
    background: var(--bg-tint);
}

.value h3 {
    margin: 1rem 0 0.5rem;
}

.value-icon,
.project-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-s);
}

.value:nth-child(2) .value-icon {
    color: oklch(0.6 0.13 50);
}

.dark .value:nth-child(2) .value-icon {
    color: var(--accent);
}

.value-icon svg,
.project-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tags li {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- 7. Projects ---------- */
.projects {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
}

.project {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-s);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}

.project:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-m);
    border-color: color-mix(in oklch, var(--primary) 35%, transparent);
}

.project.is-featured {
    grid-column: span 3;
}

.project-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.6rem;
}

.project-body .tags {
    margin-top: auto;
    padding-top: 0.6rem;
}

.project-icon {
    margin-bottom: 0.4rem;
    background: var(--bg-tint);
    box-shadow: none;
}

.project-meta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.project h3 {
    font-size: 1.25rem;
}

.text-link {
    font-weight: 650;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* little line illustrations on the featured cards */
.project-art {
    aspect-ratio: 16 / 8;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 80% 20%, var(--accent-soft), transparent 55%),
        var(--primary-soft);
}

.project-art svg {
    width: 70%;
    height: 90%;
    overflow: visible;
}

.project-art .a-table { fill: color-mix(in oklch, var(--text) 15%, transparent); }
.project-art .a-base { fill: var(--text); }
.project-art .a-link { fill: none; stroke: var(--text); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.project-art .a-joint { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.project-art .a-grip { stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; }
.project-art .a-box { fill: var(--accent); }
.project-art .a-detect { fill: none; stroke: var(--primary); stroke-width: 2; stroke-dasharray: 5 4; }
.project-art .a-label { font: 600 9px var(--font-sans); fill: var(--primary); }
.project-art .a-label-mid { text-anchor: middle; fill: var(--text); }
.project-art .a-zone { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.project-art .a-label-accent { fill: color-mix(in oklch, var(--accent) 70%, var(--text)); }
.project-art .a-human { fill: none; stroke: var(--text-muted); stroke-width: 2.5; stroke-dasharray: 4 5; stroke-linecap: round; }
.project-art .a-assist { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.project-art .a-target { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-dasharray: 3 3; }

/* ---------- 8. Timeline ---------- */
.journey-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.journey-grid .section-head {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
}

.legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.3rem;
    border-radius: 50%;
    vertical-align: -0.05rem;
}

.dot-work { background: var(--primary); }
.dot-study { background: var(--accent); }

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--primary), var(--accent));
    opacity: 0.35;
}

.tl-item {
    position: relative;
    padding-bottom: 2.25rem;
}

.tl-item:last-child {
    padding-bottom: 0;
}

.tl-item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 0.3rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--primary);
}

.tl-item.is-study::before {
    border-color: var(--accent);
}

.tl-item.is-now::before {
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-soft);
}

.tl-when {
    display: inline-block;
    margin-bottom: 0.35rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: var(--bg-tint);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.is-now .tl-when {
    background: var(--accent-soft);
    color: var(--text);
}

.tl-where {
    margin: 0.15rem 0 0.4rem;
    font-weight: 600;
    color: var(--primary);
}

/* ---------- 9. Toolbox + contact ---------- */
.toolbox {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.tool-group {
    padding: 1.6rem;
}

.tool-group h3 {
    margin-bottom: 1rem;
}

.contact {
    position: relative;
    max-width: 48rem;
    margin-inline: auto;
    padding: clamp(2.25rem, 6vw, 4rem);
    text-align: center;
    background:
        radial-gradient(circle at 15% 0%, var(--primary-soft), transparent 60%),
        radial-gradient(circle at 90% 100%, var(--accent-soft), transparent 55%),
        var(--surface);
}

.dark .contact {
    background:
        radial-gradient(circle at 15% 0%, var(--primary-soft), transparent 60%),
        radial-gradient(circle at 90% 100%, oklch(0.5 0.07 60 / 0.18), transparent 55%),
        var(--surface);
}

.contact .eyebrow::before {
    display: none;
}

.contact .lead {
    max-width: 32rem;
    margin: 1rem auto 0;
    color: var(--text-muted);
}

.contact-bot {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    transform: rotate(-90deg);
    animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
    50% { transform: rotate(-90deg) translateX(6px); }
}

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

.site-footer {
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: 1.75rem;
}

/* ---------- 10. Robot buddy ---------- */
.bot-wheel { fill: var(--bot-line); }
.bot-body { fill: var(--bot-body); stroke: var(--bot-line); stroke-width: 1.8; }
.bot-deck { fill: var(--bot-deck); }
.bot-lidar { fill: var(--bot-line); }
.bot-lidar-eye { fill: var(--bot-led); }
.bot-eye { fill: var(--bot-line); }
.bot-smile { fill: none; stroke: var(--bot-line); stroke-width: 1.3; stroke-linecap: round; }

.bot {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    width: 38px;
    height: 38px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
    will-change: transform;
}

.bot svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 3px 4px oklch(0.2 0.03 250 / 0.25));
    transition: transform 0.25s var(--ease);
}

/* off unless main.js sets html.bot-on (ROBOT_CURSOR = true and a mouse is present) */
html:not(.bot-on) .bot,
html:not(.bot-on) .icon-btn[data-bot-toggle] {
    display: none;
}

/* HIDE_SYSTEM_CURSOR: no normal pointer, a dot marks the exact click point instead */
html.hide-cursor,
html.hide-cursor * {
    cursor: none !important;
}

.pointer-dot {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 91;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.pointer-dot::after {
    content: "";
    position: absolute;
    left: -7px;
    top: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    /* frosted white: half see-through, blurs what is behind it */
    background: oklch(1 0 0 / 0.45);
    border: 1px solid oklch(1 0 0 / 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    box-shadow: 0 0 10px 2px oklch(1 0 0 / 0.35), 0 1px 3px oklch(0.2 0.03 250 / 0.25);   /* soft glow + faint edge so it shows on the light theme too */
    transition: transform 0.2s var(--ease);
}

.pointer-dot.is-curious::after {
    transform: scale(1.6);
}

html.hide-cursor .pointer-dot.is-visible {
    opacity: 1;
}

.bot.is-visible {
    opacity: 1;
}

.bot.is-curious svg {                     /* hovering something clickable */
    transform: scale(1.18);
    --bot-led: oklch(0.72 0.17 145);
}

.bot.is-bump svg {
    transform: scale(0.85);
}

/* ---------- 11. Motion + responsive ---------- */
.js .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.js .reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    /* stop the decorative loops; the name flight stays because it follows the user's own scrolling */
    .blob, .wave, .contact-bot { animation: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
    .projects { grid-template-columns: repeat(2, 1fr); }
    .project,
    .project.is-featured { grid-column: span 1; }
    .project.is-featured { grid-column: span 2; }
    .values { grid-template-columns: 1fr; }
    .about-grid,
    .journey-grid { grid-template-columns: 1fr; }
    .journey-grid .section-head { position: static; margin-bottom: 0.5rem; }
}

@media (max-width: 760px) {
    :root { --header-h: 3.75rem; }

    .menu-btn { display: grid; }

    .nav-links {
        position: absolute;
        top: calc(var(--header-h) + 0.25rem);
        right: var(--gutter);
        left: var(--gutter);
        flex-direction: column;
        margin: 0;
        padding: 0.5rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-m);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
    }

    .nav-links.is-open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-links a {
        padding: 0.8rem 1rem;
        font-size: 1.05rem;
    }

    .brand-name { font-size: 1.2rem; }
    .brand-icon { width: 1.8rem; height: 1.8rem; }

    .projects { grid-template-columns: 1fr; }
    .project,
    .project.is-featured { grid-column: auto; }
    .toolbox { grid-template-columns: 1fr; }
    .hero-actions .btn { flex: 1 1 12rem; justify-content: center; }
    .contact-actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media (hover: none), (pointer: coarse) {
    .bot,
    .icon-btn[data-bot-toggle] { display: none; }
}
