/* =========================================================================
   Engineering Editorial — Abdallah Bader portfolio
   Design tokens, light + auto dark mode, editorial typography.
   ========================================================================= */

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

:root {
    color-scheme: light dark;

    /* Core tokens — light */
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #eef2f9;
    --ink: #0b0f18;
    --muted: #5b6476;
    --rule: #dde2ec;
    --accent: #5b5dff;
    --accent-2: #00c8ff;
    --accent-ink: #0b0f18;
    --shadow-strong: 0 22px 55px -28px rgba(14, 20, 48, 0.45);
    --radius: 18px;

    /* Typography */
    --font-display: 'Instrument Serif', 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Layout */
    --container: 1440px;
    --gutter: clamp(1rem, 3vw, 2.5rem);
    --header-h: 4.25rem;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Aliases (so legacy class names still resolve) */
    --primary-color: var(--accent);
    --secondary-color: var(--ink);
    --text-color: var(--ink);
    --text-light: var(--muted);
    --bg-color: var(--bg);
    --bg-light: var(--surface);
    --shadow: var(--shadow-strong);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d12;
        --surface: #141824;
        --surface-2: #0f1420;
        --ink: #eef1f8;
        --muted: #9aa3b6;
        --rule: #232a3a;
        --accent: #7c7bff;
        --accent-2: #31d1ff;
        --accent-ink: #0b0d12;
        --shadow-strong: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
    }
}

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

body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--ink);
    background:
        radial-gradient(900px 560px at 8% -20%, color-mix(in srgb, var(--accent) 25%, transparent) 0%, transparent 60%),
        radial-gradient(760px 520px at 92% 0%, color-mix(in srgb, var(--accent-2) 20%, transparent) 0%, transparent 65%),
        var(--bg);
    font-feature-settings: 'cv02', 'cv11', 'ss01';
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--rule) 60%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--rule) 60%, transparent) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

a { color: inherit; }

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

/* =========================================================================
   Sticky Left Hero Layout
   ========================================================================= */


/* =========================================================================
    Skip link & focus
    ========================================================================= */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    background: var(--ink);
    color: var(--bg);
    padding: 0.625rem 1rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: top 0.18s var(--ease);
}
.skip-link:focus {
    top: 1rem;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

/* =========================================================================
   Header
   ========================================================================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}

nav { padding: 0; }

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-h);
}

.logo {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
}
.logo::before {
    content: '◆ ';
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.75rem;
    align-items: center;
}

.nav-links a {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    padding: 0.5rem 0;
    transition: color 0.18s var(--ease);
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: right 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }
.nav-links a.active {
    color: var(--ink);
}
.nav-links a.active::after { right: 0; }

/* =========================================================================
   Section header pattern (00 ─── ABOUT)
   ========================================================================= */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
}
.section-num {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    flex: 0 0 auto;
}
.section-label {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

section h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 4.2vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 2.5rem;
}

/* =========================================================================
   Hero
   ========================================================================= */
.featured-projects {
    padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) clamp(240px, 28vw, 360px);
    grid-template-areas: "text photo";
    gap: clamp(1.75rem, 5vw, 4rem);
    align-items: center;
    margin-bottom: clamp(3rem, 7vw, 5rem);
}
.hero-text { grid-area: text; min-width: 0; }
.hero-photo {
    grid-area: photo;
    margin: 0;
    justify-self: end;
    width: 100%;
}
.hero-photo picture {
    display: block;
    width: 100%;
}
.hero-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius) + 8px);
    border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
    box-shadow: var(--shadow-strong);
    background: var(--surface);
}
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        grid-template-areas: "photo" "text";
        align-items: start;
        gap: 1.5rem;
    }
    .hero-photo { max-width: 200px; justify-self: start; }
}
.hero .section-num {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}
.hero h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3.25rem, 9vw, 7rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 1.5rem;
}
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    line-height: 1.35;
    color: var(--muted);
    max-width: 38ch;
    margin-bottom: 2rem;
}
.hero-meta {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 2.25rem;
}
.hero-meta .dot { color: var(--accent); margin: 0 0.5rem; }
.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.hero-highlights span {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}
.hero-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.35rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid color-mix(in srgb, var(--ink) 70%, transparent);
    background: transparent;
    border-radius: 999px;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.hero-cta a:first-child {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    border-color: transparent;
}
.hero-cta a:hover {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    border-color: transparent;
    transform: translateY(-2px);
}

/* =========================================================================
   Featured videos grid
   ========================================================================= */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1.25rem, 2.5vw, 2rem);
}
@media (min-width: 1200px) {
    .featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .featured-grid { grid-template-columns: 1fr; }
}
.featured-grid .project {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 12px 30px -24px rgba(10, 16, 40, 0.35);
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.featured-grid .project h3 {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    order: 2;
}
.featured-grid .project-video { order: 1; width: 100%; }

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    overflow: hidden;
    border-radius: calc(var(--radius) - 6px);
    border: 1px solid var(--rule);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.featured-grid .project:hover .video-wrapper {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}
.featured-grid .project:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--rule));
}
.video-wrapper video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 0;
    padding: 0;
}
.video-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%);
}
.video-placeholder .play-btn {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.94);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.video-placeholder:hover .play-btn {
    transform: scale(1.06);
    background: var(--accent);
}
.video-placeholder:hover .play-btn svg { fill: var(--accent-ink); }
.video-placeholder .play-btn svg {
    width: 26px;
    height: 26px;
    fill: #0e0e10;
    margin-left: 3px;
    transition: fill 0.2s var(--ease);
}

/* =========================================================================
   About
   ========================================================================= */
.about {
    padding: clamp(3rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--rule);
}
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
}
.about-text {
    max-width: 880px;
}
.about-panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 18px 40px -32px rgba(10, 16, 40, 0.4);
}
.about-panel h3 {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.85rem;
}
.about-panel p {
    margin-bottom: 1rem;
    color: var(--ink);
    font-size: 1.0625rem;
    line-height: 1.55;
}
.pill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}
.pill-list li {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
}
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-text { max-width: none; }
}
.about p {
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--ink);
    margin: 0 0 1.25rem;
}
.about p:last-child { margin-bottom: 0; }
.about p + p { margin-top: 0; }
.about a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    transition: border-color 0.2s var(--ease);
}
.about a:hover { border-bottom-color: var(--accent); }

/* =========================================================================
   Experience & Education
   ========================================================================= */
.experience {
    padding: clamp(3rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--rule);
}
.exp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.experience-list h3,
.education-list h3 {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
}

.timeline, .education {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.timeline::before,
.education::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: color-mix(in srgb, var(--rule) 80%, transparent);
}
.timeline-item, .education-item {
    position: relative;
    display: grid;
    grid-template-columns: 11px 1fr 60px;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 1rem;
    box-shadow: 0 14px 32px -26px rgba(10, 16, 40, 0.35);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.timeline-item::before,
.education-item::before {
    content: '';
    grid-column: 1;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--muted);
    margin-top: 0.4rem;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.timeline-item:hover::before,
.education-item:hover::before {
    background: var(--accent);
    border-color: var(--accent);
}
.timeline-item:hover, .education-item:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--rule));
    box-shadow: 0 20px 36px -24px rgba(10, 16, 40, 0.45);
}

.timeline-content, .edu-content {
    grid-column: 2;
    min-width: 0;
}
.timeline-content h4,
.education-item .degree {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 0.3rem;
}
.time {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.education-item .desc {
    margin-top: 0.55rem;
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.55;
}

.timeline-logo-wrap, .edu-logo-wrap {
    grid-column: 3;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--rule);
    padding: 6px;
    transition: border-color 0.2s var(--ease);
}
.timeline-item:hover .timeline-logo-wrap,
.education-item:hover .edu-logo-wrap {
    border-color: var(--muted);
}
.timeline-logo-wrap.is-empty {
    background: transparent;
    border: 1px dashed var(--rule);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}
.timeline-logo-wrap.is-empty::after { content: '—'; }

.timeline-logo, .edu-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 1;
    transition: transform 0.25s var(--ease);
}
@media (prefers-color-scheme: dark) {
    .timeline-logo, .edu-logo {
        filter: brightness(1.05);
    }
}
.timeline-item:hover .timeline-logo,
.education-item:hover .edu-logo {
    transform: scale(1.04);
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* =========================================================================
   Partners marquee strip
   ========================================================================= */
.partners {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    border-top: 1px solid var(--rule);
}
.partners .section-head { margin-bottom: 2rem; }
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
}
.partners-grid .partner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    padding: 1.1rem;
    border: 1px solid var(--rule);
    border-radius: calc(var(--radius) - 8px);
    text-decoration: none;
    background: var(--surface);
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.partners-grid .partner:hover {
    background: color-mix(in srgb, var(--surface) 90%, var(--accent) 10%);
    border-color: color-mix(in srgb, var(--accent) 30%, var(--rule));
    transform: translateY(-3px);
}
.partners-grid img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%) contrast(0.9);
    opacity: 0.7;
    transition: filter 0.25s var(--ease), opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
@media (prefers-color-scheme: dark) {
    .partners-grid img {
        filter: grayscale(100%) brightness(1.4) contrast(0.85) invert(0.92);
    }
}
.partners-grid .partner:hover img,
.partners-grid .partner:focus-visible img {
    filter: none;
    opacity: 1;
    transform: translateY(-2px);
}
@media (prefers-color-scheme: dark) {
    .partners-grid .partner:hover img,
    .partners-grid .partner:focus-visible img {
        filter: brightness(1.05);
    }
}

/* =========================================================================
   Currently shipping — Milano Cerco Affitto feature block
   ========================================================================= */
.shipping {
    padding: clamp(3rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--rule);
}
.ship-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 340px);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}
@media (max-width: 820px) {
    .ship-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .ship-screenshot { justify-self: start; }
}
.ship-copy { min-width: 0; }
.ship-copy h2 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.05;
    margin: 0 0 1rem;
}
.ship-copy h2 .accent {
    color: var(--accent);
    font-style: italic;
}
.ship-pitch {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.125rem, 1.7vw, 1.5rem);
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 1.75rem;
    max-width: 42ch;
}
.ship-pitch em {
    color: var(--accent-2, var(--accent));
    font-style: italic;
}
.ship-stack {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0;
}
.ship-stack li {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2, var(--surface));
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
}
.ship-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 0.875rem;
    align-items: center;
}
.ship-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.ship-link.primary {
    padding: 0.9rem 1.6rem;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 999px;
}
.ship-link.primary:hover {
    background: var(--ink);
    color: var(--bg);
    transform: translateY(-2px);
}
.ship-link.store {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 12px;
    padding: 0.625rem 1.125rem 0.625rem 0.875rem;
    gap: 0.625rem;
    line-height: 1;
}
.ship-link.store:hover { transform: translateY(-2px); }
.ship-link.store .apple { flex-shrink: 0; color: #fff; }
.ship-link.store span {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-family: var(--font-body);
    color: #fff;
    letter-spacing: 0;
    text-transform: none;
}
.ship-link.store small {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
    opacity: 0.95;
}
.ship-link.store strong {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
}

.ship-screenshot {
    margin: 0;
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.phone-frame {
    --frame: 12px;
    --inner-radius: 38px;
    width: 100%;
    max-width: 320px;
    padding: var(--frame);
    background: #0a0a0c;
    border-radius: calc(var(--inner-radius) + var(--frame));
    box-shadow:
        0 30px 60px -28px rgba(8, 12, 32, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 0 1px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    position: relative;
}
.phone-frame picture, .phone-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--inner-radius);
}
.ship-caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* =========================================================================
   Projects grid
   ========================================================================= */
.projects {
    padding: clamp(3rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--rule);
}
.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 2rem;
}
.filter-chip {
    padding: 0.55rem 0.95rem;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    color: var(--muted);
    border: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
    user-select: none;
    border-radius: 999px;
}
.filter-chip:hover {
    color: var(--ink);
    border-color: var(--muted);
}
.filter-chip.active {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    border-color: transparent;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
    transition: opacity 0.18s var(--ease);
}
.project-grid.is-fading { opacity: 0; }

.project-card {
    background: var(--surface);
    padding: 1.5rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    position: relative;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    transition: border-color 0.35s var(--ease);
    pointer-events: none;
}
.project-card:hover::before { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.project-card:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--rule));
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -28px rgba(10, 16, 40, 0.45);
}

.project-card picture {
    display: block;
    margin-bottom: 1rem;
    overflow: hidden;
}
.project-card picture + h3 { margin-top: 0; }
.project-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 1rem;
    background: var(--surface-2);
    border: 1px solid var(--rule);
    border-radius: calc(var(--radius) - 8px);
    transition: transform 0.4s var(--ease);
}
.project-card picture img { margin-bottom: 0; }
.project-card:hover img {
    transform: scale(1.02);
}
.project-card h3 {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.project-card .subtitle {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.875rem;
}
.project-card p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.project-card .contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
}
.project-card .contact-links a {
    padding: 0;
    background: transparent;
    color: var(--ink);
    border: 0;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
    transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.project-card .contact-links a::after {
    content: ' ↗';
    color: var(--accent);
}
.project-card .contact-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: none;
}

/* =========================================================================
   Contact
   ========================================================================= */
.contact {
    padding: clamp(5rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 6rem);
    border-top: 1px solid var(--rule);
}
.contact-hero {
    margin-bottom: clamp(3rem, 6vw, 5rem);
    max-width: 1100px;
}
.contact-status {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.55rem 0.95rem 0.55rem 0.8rem;
    background: var(--surface-2, var(--surface));
    border: 1px solid var(--rule);
    border-radius: 999px;
    margin-bottom: 2.5rem;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: pulse-dot 2.2s var(--ease) infinite;
}
@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.contact-headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.75rem, 9vw, 7rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin: 0 0 2rem;
    max-width: 14ch;
}
.contact-headline .accent {
    color: var(--accent);
    font-style: italic;
}
.contact-blurb {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.4;
    color: var(--muted);
    max-width: 52ch;
    margin: 0;
}
.contact-blurb strong {
    color: var(--ink);
    font-weight: 400;
    font-style: normal;
}

.contact-channels {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--rule);
}
.contact-channels li {
    border-bottom: 1px solid var(--rule);
}
.contact-channel {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 0.5rem;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.22s var(--ease), padding 0.22s var(--ease), color 0.22s var(--ease);
}
.contact-channel:hover,
.contact-channel:focus-visible {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.channel-key {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}
.channel-value {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.6vw, 2rem);
    color: var(--ink);
    line-height: 1.2;
    transition: color 0.22s var(--ease);
    overflow-wrap: anywhere;
}
.contact-channel:hover .channel-value,
.contact-channel:focus-visible .channel-value {
    color: var(--accent);
}
.channel-arrow {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--muted);
    transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.contact-channel:hover .channel-arrow,
.contact-channel:focus-visible .channel-arrow {
    transform: translate(4px, -4px);
    color: var(--accent);
}

@media (max-width: 700px) {
    .contact-channel { grid-template-columns: 100px minmax(0, 1fr) auto; gap: 1rem; padding-block: 1.25rem; }
    .channel-value { font-size: 1.125rem; }
}
@media (max-width: 480px) {
    .contact-channel { grid-template-columns: minmax(0, 1fr) auto; }
    .channel-key { display: none; }
}

/* =========================================================================
   Footer
   ========================================================================= */
footer {
    background: transparent;
    color: var(--muted);
    border-top: 1px solid var(--rule);
    padding: 1.75rem 0;
    text-align: left;
}
footer p {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

/* =========================================================================
   Section reveal animation (opacity-only, no transform)
   ========================================================================= */
section {
    opacity: 1;
}
.js-reveal section {
    opacity: 0;
    transition: opacity 0.6s var(--ease);
}
.js-reveal section.is-visible {
    opacity: 1;
}

/* =========================================================================
   Helper text
   ========================================================================= */
.loading, .error {
    text-align: left;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: 1rem 0;
}
.error { color: #d04040; }
@media (prefers-color-scheme: dark) {
    .error { color: #ff7a6c; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
    .exp-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .contact-card { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    :root { --header-h: 3.75rem; }
    .partners-grid { grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); }
    .partners-grid .partner { height: 80px; padding: 0.875rem; }
    .partners-grid img { max-height: 32px; }
}

@media (max-width: 768px) {
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.8125rem; }
    .timeline-item, .education-item {
        grid-template-columns: 11px 1fr;
    }
    .timeline-logo-wrap, .edu-logo-wrap {
        display: none;
    }
    .timeline::before, .education::before { left: 5px; }
    .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    nav .container { gap: 0.5rem; }
    .nav-links { gap: 0.5rem; }
    .nav-links a { font-size: 0.75rem; padding: 0.25rem 0; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta a { justify-content: center; }
    .contact-links { flex-direction: column; align-items: stretch; }
    .contact-links a { justify-content: center; }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .js-reveal section { opacity: 1 !important; }
}

/* =========================================================================
   Print
   ========================================================================= */
@media print {
    header, footer, .featured-projects, .partners, .project-filters,
    .video-wrapper, video, .hero-cta, .contact-links { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
    section { page-break-inside: avoid; border: 0 !important; }
    .timeline-logo-wrap, .edu-logo-wrap { display: none; }
}
