/* Fonts are self-hosted (latin subset, variable weights) and preloaded from each page's <head>,
   so text is laid out once instead of reflowing when third-party fonts arrive mid-animation */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url(assets/fonts/inter-latin-var.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url(assets/fonts/outfit-latin-var.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(assets/fonts/jetbrains-mono-latin-var.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Nader Khalil — Portfolio
   Design language: dark terminal.
   Near-black base, navy surfaces, white type, monospace labels, thin grid,
   sharp corners, inversion on hover.
   ========================================================================== */

:root {
    /* Palette */
    --bg: #05080f;
    --surface: #0b1420;
    --surface-2: #0f1c2e;
    --navy: #12263f;
    --border: #1d3550;
    --border-strong: #2f4c73;
    --text: #f4f7fb;
    --muted: #8ea3c0;
    --steel: #78a6d8;
    --accent-warm: #ff8a3d;
    --accent-text: #ff8a3d;
    --available: #22c55e;

    /* Theme-aware surfaces */
    --grid-line: rgba(120, 166, 216, 0.05);
    --vignette: rgba(5, 8, 15, 0.9);
    --nav-bg: rgba(5, 8, 15, 0.92);
    --band-a: rgba(120, 166, 216, 0.05);
    --band-b: rgba(120, 166, 216, 0.018);
    --band-shadow: rgba(0, 0, 0, 0.16);
    --icon-bg: #12263f;
    --icon-fg: #78a6d8;
    --portrait-offset: #12263f;

    color-scheme: dark;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Layout */
    --max-width: 1140px;
    --section-padding: 64px 20px;
    --radius: 4px;

    /* Motion */
    --transition-smooth: all 0.18s ease;

    /* Hover for small outlined controls: a faint wash, and the edge and ink
       they turn to (white in dark mode, the site's blue in light mode) */
    --hover-tint: color-mix(in srgb, var(--text) 8%, transparent);
    --hover-edge: var(--text);
    --hover-ink: var(--text);
}

/* Light theme */
[data-theme="light"] {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #eaeff6;
    --navy: #12263f;
    --border: #d7dfe9;
    --border-strong: #b4c3d6;
    --text: #0e1b2b;
    --muted: #56657a;
    --steel: #2f6fb0;
    /* Vibrant orange for titles, dots, borders, and hover states */
    --accent-warm: #d9671d;
    /* Deeper orange for small text, which needs 4.5:1 on light surfaces */
    --accent-text: #ad5217;
    --available: #16a34a;

    --grid-line: rgba(18, 38, 63, 0.06);
    --vignette: rgba(244, 246, 250, 0.9);
    --nav-bg: rgba(244, 246, 250, 0.92);
    --band-a: rgba(47, 111, 176, 0.038);
    --band-b: rgba(47, 111, 176, 0.012);
    --band-shadow: rgba(18, 38, 63, 0.07);
    --icon-bg: #e3ecf7;
    --icon-fg: #2f6fb0;
    --portrait-offset: #bcd4ee;
    --hover-tint: rgba(47, 111, 176, 0.08);
    --hover-edge: #2f6fb0;
    --hover-ink: #2f6fb0;

    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-primary);
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* Grid backdrop */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 0%, transparent 0%, var(--vignette) 78%);
    pointer-events: none;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

a {
    color: var(--steel);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--accent-text);
}

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

/* Large display text keeps the vibrant orange */
.section-title .hl,
.page-title .hl,
.highlight-number .hl {
    color: var(--accent-warm);
}

ul {
    list-style: none;
}

/* Surfaces */
.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Hover emphasis follows the control's role, so orange stays a signal:
   - primary buttons keep the site's signature inversion: the fill clears and
     the text and border turn orange
   - secondary buttons get the same quiet wash as small controls, so they never
     look like the primary beside them
   - small outlined controls (Details, icon links, close buttons, theme toggle):
     a faint tint and a full-strength border, no colour change
   - the live-demo globe: its resting orange edge becomes full orange, so orange
     keeps meaning "live"
   - text links: orange text (see `a:hover`)
   Cards lift instead; see their own rules. */
.btn-primary:hover {
    background: transparent;
    color: var(--accent-warm);
    border-color: var(--accent-warm);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--hover-tint);
    color: var(--hover-ink);
    border-color: var(--hover-edge);
}

/* "See my work": a down arrow says the button scrolls to the projects */
.btn-scroll {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-scroll svg {
    width: 14px;
    height: 14px;
    flex: none;
}

.btn-primary.lg,
.btn-secondary.lg {
    padding: 0.85rem 1.5rem;
    font-size: 0.82rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.1rem 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
}

.nav-content {
    width: 100%;
    padding: 0 clamp(16px, 2vw, 24px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.logo .highlight {
    color: var(--accent-warm);
}

.nav-links {
    display: flex;
    gap: 1.6rem;
    align-items: center;
    margin-left: auto;
}

.nav-links a:not(.btn-primary) {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links a:not(.btn-primary):hover {
    color: var(--accent-text);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--text);
    transition: var(--transition-smooth);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 1.5rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    background: var(--hover-tint);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: inline;
}

/* Main Layout */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    counter-reset: section;
}

/* Hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3.5rem;
    padding: 128px 0 72px;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.greeting {
    font-family: var(--font-mono);
    color: var(--steel);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 0.9rem;
}

.name {
    font-size: clamp(2.6rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    margin-bottom: 0.6rem;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: currentColor;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .name .i-tittle {
        background: linear-gradient(to bottom, var(--accent-warm) 0 38%, var(--text) 38% 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.title {
    letter-spacing: -0.01em; /* what the h2 rule gave it before it became a paragraph */
    font-family: var(--font-mono);
    font-size: clamp(0.95rem, 1.8vw, 1.25rem);
    font-weight: 500;
    color: var(--steel);
    line-height: 1.6;
    margin-bottom: 1.4rem;
}

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

.bio {
    font-size: 1.02rem;
    color: var(--muted);
    max-width: 600px;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.3rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.hero-tag svg {
    width: 15px;
    height: 15px;
    color: var(--steel);
    flex-shrink: 0;
}

.social-links {
    display: flex;
    gap: 0.6rem;
}

.social-links a {
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.social-links a:hover {
    color: var(--hover-ink);
    background: var(--hover-tint);
    border-color: var(--hover-edge);
}

.social-links svg {
    width: 18px;
    height: 18px;
}

.hero-image-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

.hero-image-wrapper {
    position: relative;
    width: 320px;
    height: 443px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: radial-gradient(circle at 50% 25%, var(--surface-2) 0%, var(--bg) 75%);
    overflow: hidden;
    box-shadow: 16px 16px 0 0 var(--portrait-offset);
}

.hero-image-wrapper picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Sections */
.section {
    padding: var(--section-padding);
    counter-increment: section;
}

.section-title {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
}

.section-title::before {
    content: counter(section, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--steel);
    margin-right: 0.7rem;
    vertical-align: 0.15em;
}

.section-intro {
    color: var(--muted);
    max-width: 680px;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.1rem;
}

.about-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.highlight-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    transition: var(--transition-smooth);
}

.highlight-item:hover {
    border-color: var(--border-strong);
}

.highlight-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.highlight-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* Skills: a plain definition list, label column + items, filled column by column */
.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    column-gap: 3rem;
    border-top: 1px solid var(--border);
}

.skills-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.skills-row dt {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.2rem;
}

.skills-row dd {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Experience */
.timeline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: none;
    margin: 0;
}

.timeline::before,
.timeline-dot {
    display: none;
}

.timeline-item {
    margin: 0;
    padding: 1.4rem;
    transition: var(--transition-smooth);
}

.timeline-item:hover {
    border-color: var(--border-strong);
}

.timeline-date {
    font-family: var(--font-mono);
    color: var(--steel);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.timeline-role {
    font-size: 1.15rem;
    margin-bottom: 0.15rem;
}

.timeline-company {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.timeline-details {
    padding-left: 1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.timeline-details li {
    position: relative;
    margin-bottom: 0.4rem;
}

.timeline-details li::before {
    content: '>';
    font-family: var(--font-mono);
    position: absolute;
    left: -1rem;
    color: var(--steel);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.project-card {
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.project-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.project-header h3 {
    margin-bottom: 0;
}

.project-links {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.5rem;
}

.project-link {
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.project-link:hover {
    color: var(--hover-ink);
    background: var(--hover-tint);
    border-color: var(--hover-edge);
}

/* Live-demo link: same icon as its neighbours, only the border hints at it */
.demo-link {
    border-color: color-mix(in srgb, var(--accent-warm) 85%, var(--border));
}

.project-link.demo-link:hover {
    color: var(--accent-text);
    border-color: var(--accent-warm);
}

.project-link svg {
    width: 16px;
    height: 16px;
}

.project-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-subtitle {
    font-family: var(--font-mono);
    color: var(--steel);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 1.4rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-tags span {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

/* Featured projects */
.featured-projects {
    display: grid;
    gap: 1.25rem;
}

.feature-card {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 2rem;
    padding: 1.4rem;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    border-color: var(--border-strong);
}

.feature-card--solo {
    grid-template-columns: minmax(0, 1fr);
}

/* Two landscape screenshots stacked in a tinted panel, each in a plain window frame */
.feature-media {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.55rem;
    background: var(--band-a);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.feature-media figure {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg);
    box-shadow: 0 6px 18px var(--band-shadow);
}

/* Window bar: three neutral dots, no browser branding */
.feature-media figure::before {
    content: "";
    display: block;
    height: 22px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 12px 50%, var(--border-strong) 3px, transparent 3.5px),
        radial-gradient(circle at 26px 50%, var(--border-strong) 3px, transparent 3.5px),
        radial-gradient(circle at 40px 50%, var(--border-strong) 3px, transparent 3.5px),
        var(--surface);
}

.shot {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.shot:focus-visible {
    outline-offset: -3px;
}

.shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transition: var(--transition-smooth);
}

.shot:hover img {
    filter: brightness(0.94);
}

.feature-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.feature-body .project-header h3 {
    margin-bottom: 0;
}

.feature-body .project-desc {
    margin-bottom: 1.1rem;
}

.feature-body .project-metrics {
    margin-bottom: 1.1rem;
}

/* Call to action to the projects page */
.projects-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding: 1.3rem 1.6rem;
}

.projects-more h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.projects-more p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 720px;
}

.projects-more .btn-primary {
    flex-shrink: 0;
}

/* Projects page header */
.page-head {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px 20px 0;
}

.back-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.2rem;
}

.page-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-head + .projects-band,
.page-head + .section {
    margin-top: 1.5rem;
}

.nav-links a[aria-current]:not(.btn-primary) {
    color: var(--accent-text);
}

/* Screenshot viewer */
.lightbox {
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    max-width: 94vw;
    max-height: 92vh;
    overflow: auto;
}

.lightbox::backdrop {
    background: rgba(2, 5, 10, 0.78);
}

.lightbox img {
    display: block;
    width: min(1100px, 92vw);
    height: auto;
}

.lightbox-close {
    position: sticky;
    top: 0.5rem;
    float: right;
    margin: 0.5rem 0.5rem -2.6rem 0;
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.project-try {
    margin: -0.4rem 0 1.1rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.project-try strong {
    color: var(--text);
}

.project-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}

.project-metrics--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-metrics li {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--band-a);
    padding: 0.6rem 0.7rem;
}

.project-metrics strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

.project-metrics span {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted);
}


.project-highlights {
    margin-bottom: 1.1rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--accent-warm);
}

.project-highlights-title {
    margin-bottom: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-text);
}

.project-highlights ul {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.project-highlights li {
    position: relative;
    padding-left: 1.1rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--muted);
}

.project-highlights li::before {
    content: '>';
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    color: var(--steel);
}

.project-highlights li strong {
    color: var(--text);
    font-weight: 600;
}

.project-desc a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.projects-more-heading {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 2.2rem 0 0.8rem;
}

/* Projects band (groups Featured + 42 sections) */
.projects-band {
    background: linear-gradient(180deg, var(--band-a) 0%, var(--band-b) 100%);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 24px 48px var(--band-shadow);
}

.projects-band .section:first-of-type {
    padding-bottom: 34px;
}

.projects-band .section:last-of-type {
    padding-top: 34px;
}

.projects-band .section:only-of-type {
    padding: 52px 20px;
}

/* 42 Projects */
.sys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.sys-card {
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.sys-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.sys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.sys-header h3 {
    font-size: 1.1rem;
}

.sys-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sys-tag {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--steel);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
}

.sys-desc code,
.sys-learned code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--text);
}

.sys-desc {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 0.9rem;
}

.sys-learned {
    color: var(--text);
    font-size: 0.82rem;
    border-left: 2px solid var(--accent-warm);
    padding-left: 0.7rem;
    margin-top: auto;
}

.sys-learned strong {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.skills-practices {
    margin-top: 1.4rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* "AI" in the hero tagline is bold orange text. From 1040px up the tagline is large text, so it can
   use the vibrant orange; below that the deeper --accent-text keeps small text readable. */
.title .hl {
    font-weight: 700;
}

@media (min-width: 1040px) {
    .title .hl {
        color: var(--accent-warm);
    }
}

/* Education */
.edu-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.edu-featured-card {
    padding: 1.5rem;
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    transition: var(--transition-smooth);
}

.edu-featured-card:hover {
    border-color: var(--border-strong);
}

.edu-featured-icon {
    width: 44px;
    height: 44px;
    background: var(--icon-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--icon-fg);
}

.edu-featured-icon svg {
    width: 22px;
    height: 22px;
}

.edu-featured-details h3 {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.edu-institution {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.edu-desc {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

/* Certifications */
.edu-certs {
    margin-top: 0.5rem;
}

.certs-heading {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.certs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.edu-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-text);
    border-bottom: 1px solid transparent;
    transition: var(--transition-smooth);
}

.edu-link::after {
    content: " \2197";
}

.edu-link:hover {
    border-bottom-color: currentColor;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    color: var(--text);
    transition: var(--transition-smooth);
}

a.cert-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.cert-link-icon {
    width: 15px !important;
    height: 15px !important;
    margin-left: auto;
    color: var(--muted) !important;
    opacity: 0.7;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

a.cert-card:hover .cert-link-icon {
    opacity: 1;
    color: var(--accent-warm) !important;
}

.cert-card svg {
    width: 20px;
    height: 20px;
    color: var(--steel);
    flex-shrink: 0;
}

.cert-card div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cert-card strong {
    font-size: 0.9rem;
}

.cert-card span {
    color: var(--muted);
    font-size: 0.8rem;
}

/* Contact */
.contact-section {
    margin-bottom: 2rem;
}

.contact-box {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    border-color: var(--accent-warm);
    box-shadow: 0 0 40px rgba(255, 138, 61, 0.1);
}

.contact-box p {
    color: var(--muted);
    margin-bottom: 1.6rem;
}

.availability {
    display: inline-flex;
    align-items: center;
    margin: 0.2rem 0 1.4rem;
    padding: 0.4rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--available);
    border-radius: 999px;
}

/* Full project details (one dialog per featured project) */
.details-btn {
    height: 34px;
    padding: 0 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.details-btn:hover {
    background: var(--hover-tint);
    color: var(--hover-ink);
    border-color: var(--hover-edge);
}

a.details-btn {
    display: inline-flex;
    align-items: center;
}

.details-dialog {
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    width: min(960px, 94vw);
    max-height: 90vh;
    overflow: auto;
    overscroll-behavior: contain;
}

.details-dialog::backdrop {
    background: rgba(2, 5, 10, 0.78);
}

.details-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.details-kicker {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-text);
    margin-bottom: 0.2rem;
}

.details-head h2 {
    font-size: 1.35rem;
    line-height: 1.25;
}

.details-close,
.lightbox-close {
    transition: var(--transition-smooth);
}

.details-close:hover,
.lightbox-close:hover {
    background: var(--hover-tint);
    color: var(--hover-ink);
    border-color: var(--hover-edge);
}

.details-close {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.details-body {
    padding: 1.25rem;
}

.details-summary {
    color: var(--muted);
    margin-bottom: 1rem;
}

.details-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.details-section + .details-section {
    margin-top: 1.75rem;
}

.details-section > h3 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-text);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.75rem;
}

.details-group h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.details-group ul {
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.details-group li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}

.details-group li::before {
    content: ">";
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    color: var(--accent-text);
}

.details-group li strong {
    color: var(--text);
}

.details-group code {
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.details-dialog[open] {
    animation: lightbox-in 0.22s ease-out;
}

.details-dialog[open]::backdrop {
    animation: lightbox-fade 0.22s ease-out;
}

html:has(dialog[open]) {
    overflow: hidden;
}

@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    .details-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
        border: 0;
    }
    .details-head,
    .details-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .details-dialog[open],
    .details-dialog[open]::backdrop {
        animation: none;
    }
}

@media (max-width: 480px) {
    /* .skills-list raises specificity over the 768px rule, which sits later in the file */
    .skills-list .skills-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.35rem;
    }
    .availability {
        border-radius: 14px;
    }
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.contact-item:hover {
    border-color: var(--accent-warm);
}

/* Profile and résumé links: one row that wraps to fit the card */
.contact-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
}

.contact-row .contact-item {
    width: auto;
    justify-content: center;
}

.contact-item svg {
    width: 18px;
    height: 18px;
    color: var(--steel);
    flex-shrink: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.6rem 20px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    border-top: 1px solid var(--border);
}

/* Entrance animations. Small blocks (headings, text, cards) fade and rise on their own; whole
   sections are not animated, because fading a tall container around animating cards stacked two
   fades and forced the browser to composite a huge layer on every frame. Blocks only start hidden
   when the page script (.js) can reveal them again. will-change is set only while waiting. */
.js .fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}

.js .fade-in.visible {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* Each card rises as it enters the screen (classes added by script.js), in sequence when several enter together */
.js .reveal-item {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    transition-delay: var(--delay, 0ms), var(--delay, 0ms), 0s, 0s, 0s;
    will-change: opacity, transform;
}

.js .reveal-item.in {
    opacity: 1;
    transform: none;
    will-change: auto;
}

.project-metrics strong {
    font-variant-numeric: tabular-nums;
}

/* Screenshot viewer: short fade and settle when it opens */
.lightbox[open] {
    animation: lightbox-in 0.22s ease-out;
}

.lightbox[open]::backdrop {
    animation: lightbox-fade 0.22s ease-out;
}

@keyframes lightbox-in {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes lightbox-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Accessibility */
main section[tabindex="-1"]:focus,
#hero:focus {
    outline: none;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.6rem 1rem;
    background: var(--accent-warm);
    color: #05080f;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
    color: #05080f;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-warm);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    /* Movement is off, but plain colour changes (hover, focus, theme) still ease in:
       they are not motion, and Windows reports "reduce" whenever its Animation effects
       setting is off, which hides every hover transition for people who never chose that */
    *,
    *::before,
    *::after {
        transition-property: color, background-color, border-color, outline-color, box-shadow, filter !important;
    }
    .js .fade-in {
        opacity: 1;
        transform: none;
    }
    .js .reveal-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .lightbox[open],
    .lightbox[open]::backdrop {
        animation: none;
    }
    .project-card:hover,
    .sys-card:hover {
        transform: none;
    }
}

/* Theme switch: script.js wraps the change in a view transition, so the whole page crossfades
   once. Per-element colour transitions are paused meanwhile; stacked on the crossfade (and on
   each other through inheritance) they made headings flash back mid-switch. */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: none !important;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.22s;
    animation-timing-function: ease;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2.5rem;
        padding: 120px 0 56px;
    }
    .hero-cta {
        justify-content: center;
    }
    /* The block stays centred under the name, but a long paragraph reads
       better ragged-right than centred */
    .bio {
        margin-left: auto;
        margin-right: auto;
        text-align: left;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero-image-wrapper {
        width: 280px;
        height: 387px;
    }
    .feature-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.4rem;
    }
    .projects-more {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .skills-list {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-flow: row;
    }
    .skills-row {
        grid-template-columns: 120px minmax(0, 1fr);
    }
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 1rem 20px 1.25rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a:not(.btn-primary) {
        width: 100%;
        padding: 0.5rem 0;
    }
    .nav-links .btn-primary {
        margin-top: 0.5rem;
    }
    .name {
        font-size: 2.6rem;
    }
    .section-title {
        font-size: 1.7rem;
    }
    .timeline {
        grid-template-columns: 1fr;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-metrics {
        grid-template-columns: 1fr;
    }
    .feature-card {
        padding: 1.2rem;
    }
    .feature-media {
        padding: 0.7rem;
    }
    .sys-grid {
        grid-template-columns: 1fr;
    }
    .edu-featured {
        grid-template-columns: 1fr;
    }
    .certs-grid {
        grid-template-columns: 1fr;
    }
    .hero-cta {
        gap: 0.8rem;
        justify-content: center;
    }
    /* Phones: a smaller portrait and the buttons right under the title, so the
       name, role, and both calls to action fit in the first screen */
    .hero {
        gap: 1.6rem;
        padding: 92px 0 40px;
    }
    .hero-image-wrapper {
        width: 172px;
        height: 238px;
        box-shadow: 9px 9px 0 0 var(--portrait-offset);
    }
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .bio {
        order: 2;
        margin: 1.6rem auto 0;
    }
}

/* Touch screens: comfortable tap targets (44px) */
@media (pointer: coarse) {
    .details-btn {
        height: 44px;
    }
    .project-link,
    .social-links a {
        width: 44px;
        height: 44px;
    }
    .nav-toggle,
    .theme-toggle {
        width: 44px;
        height: 44px;
    }
    .logo {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 0.35rem;
        margin-left: -0.35rem;
    }
    .project-desc a,
    .section-intro a {
        padding: 0.85rem 0.4rem;
        margin: -0.85rem -0.4rem;
    }
    .back-link {
        padding: 0.6rem 0;
        margin: -0.6rem 0 0.6rem;
    }
}

/* Case study page: one 760px text column (media runs full width) and tighter
   section spacing than the home page, because these sections are short. */
.case-section {
    padding: 40px 20px;
}

/* The page is an outline, not a sequence, so its headings carry no numbers. */
.case-section .section-title::before {
    display: none;
}

/* Two short sections side by side */
.case-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-lead {
    max-width: 760px;
    margin: 1rem 0 1.6rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--muted);
}

.case-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.case-video {
    max-width: 900px;
    margin: 2rem 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.case-video video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    background: var(--bg);
}

.case-video figcaption {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.case-prose {
    max-width: 760px;
}

.case-prose p {
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 1.1rem;
}

.case-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--muted);
    line-height: 1.7;
}

.case-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    color: var(--steel);
}

.case-list strong {
    color: var(--text);
}

.case-diagram {
    margin-top: 1.6rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.case-svg {
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
    margin: 0 auto;
}

.svg-box rect {
    fill: var(--surface-2);
    stroke: var(--border-strong);
    stroke-width: 1.2;
}

.svg-box.svg-key rect {
    stroke: var(--accent-warm);
    stroke-width: 1.6;
}

.svg-title {
    fill: var(--text);
    font: 600 14px var(--font-primary);
    text-anchor: middle;
}

.svg-sub {
    fill: var(--muted);
    font: 11px var(--font-mono);
    text-anchor: middle;
}

.svg-lines path {
    fill: none;
    stroke: var(--steel);
    stroke-width: 1.5;
}

.svg-arrow {
    fill: var(--steel);
}

.svg-note {
    fill: var(--accent-text);
    font: 11px var(--font-mono);
}

.case-decisions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.case-decision {
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1.6rem;
}

.case-decision h3 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

.case-decision p {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 0.9rem;
}

.case-decision .case-tradeoff {
    margin-top: auto;
    margin-bottom: 0;
}

.case-tradeoff {
    color: var(--text);
    font-size: 0.9rem;
    border-left: 2px solid var(--accent-warm);
    padding-left: 0.8rem;
}

.case-tradeoff strong {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.case-end {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 760px;
    padding: 1.6rem;
}

.case-end h2 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.case-end p {
    color: var(--muted);
}

.case-flow {
    display: none;
    max-width: 760px;
    margin-top: 1.4rem;
    padding-left: 1.2rem;
    list-style: decimal;
}

.case-flow li {
    margin-bottom: 0.8rem;
    color: var(--muted);
    line-height: 1.7;
}

.case-flow strong {
    color: var(--text);
}

@media (max-width: 560px) {
    .case-diagram {
        display: none;
    }
    .case-flow {
        display: block;
    }
}

.case-end .case-cta {
    flex-wrap: nowrap;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .case-pair,
    .case-decisions {
        grid-template-columns: minmax(0, 1fr);
    }
    .case-end {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .case-end .case-cta {
        width: 100%;
        gap: 0.5rem;
    }
    .case-end .case-cta a {
        flex: 1 1 0;
        padding: 0.7rem 0.3rem;
        font-size: 0.68rem;
        letter-spacing: 0.02em;
        text-align: center;
    }
}

/* The first block on projects.html sits directly under the page title, so its
   heading is kept for the outline and screen readers but not shown, and it
   does not take a section number. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.section.no-count {
    counter-increment: none;
}

.projects-band .section.no-count {
    padding-top: 36px;
}
