/*
===================================================================
   ABDUL WAHAB — PORTFOLIO DESIGN SYSTEM
   Neutral graphite surfaces, off-white type, one restrained accent.
   Geist / Geist Mono. Quiet borders instead of glows.
===================================================================
*/

/* ===== DESIGN TOKENS ===== */
:root {
    /* Surfaces */
    --bg-void: #0a0a0b;
    --bg-primary: #0e0e10;
    --bg-secondary: #141416;
    --bg-tertiary: #1b1b1e;
    --bg-surface: #111113;
    --bg-surface-elevated: #18181b;

    /* Text */
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-muted: #8b8b94;   /* 5.8:1 on --bg-void */
    --text-faint: #63636b;   /* decorative only (indices) */

    /* Accent — used sparingly: focus rings, active states, data */
    --accent: #7c9cff;
    --accent-soft: rgba(124, 156, 255, 0.12);
    --success: #4ade80;
    --danger: #f87171;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --glass-blur: blur(16px);
    --glass-blur-lg: blur(28px);

    /* Typography */
    --font-display: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

    /* Layout & spacing */
    --container-max: 1440px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2.4rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6.4rem;
    --spacing-2xl: 12rem;
    /* Side gutter: 24px on phones, up to 80px on wide screens */
    --gutter: clamp(2.4rem, 5vw, 8rem);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    /* Layers */
    --z-bg: 0;
    --z-content: 10;
    --z-header: 100;
    --z-dock: 150;
    --z-modal: 1000;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;
    background-color: var(--bg-void);
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: #3f3f46 var(--bg-void);
}

body {
    font-family: var(--font-body);
    font-size: 1.6rem;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-void);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
}

::selection {
    background: rgba(124, 156, 255, 0.28);
    color: #fff;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: var(--radius-pill);
    border: 3px solid var(--bg-void);
}
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

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

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

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

.studio-ambient-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-bg);
    background: var(--bg-void);
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    position: relative;
    z-index: var(--z-content);
}

section {
    position: relative;
    padding: var(--spacing-2xl) 0;
    z-index: var(--z-content);
}

main > section + section {
    border-top: 1px solid var(--border-subtle);
}

/* ===== SECTION HEADER ===== */
.section-header {
    margin-bottom: var(--spacing-xl);
    max-width: 760px;
}

.section-header.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-header-split {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4rem;
}

.section-header-split > div:first-child {
    max-width: 680px;
}

.section-header-split .section-description {
    max-width: 42ch;
    margin-bottom: 0.6rem;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 4.2vw, 5.6rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    text-wrap: balance;
}

.section-header .section-title + .section-description {
    margin-top: 2rem;
}

.section-description {
    font-size: clamp(1.6rem, 1.4vw, 1.8rem);
    color: var(--text-secondary);
    max-width: 60ch;
    line-height: 1.6;
}

.section-header.center .section-description {
    margin-left: auto;
    margin-right: auto;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 1.35rem;
    color: var(--text-secondary);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-medium);
    margin-bottom: 0.6rem;
}

.section-link .fa-arrow-up-right-from-square {
    font-size: 1.1rem;
}

.section-link:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

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

.contact-title .text-muted {
    color: #71717a;
}

/* Legacy utility kept for any JS-injected markup */
.gradient-text {
    color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 4.8rem;
    padding: 0 2.4rem;
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #ffffff;
    color: #000;
}

.btn-primary i,
.btn-secondary i {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.btn-primary:hover .fa-arrow-right {
    transform: translateX(3px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: progress;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.btn-block {
    width: 100%;
}

.status-dot,
.status-pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

/* ===== TOP NAVIGATION ===== */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-header);
    border-bottom: 1px solid transparent;
    transition: background var(--transition-base), border-color var(--transition-base), backdrop-filter var(--transition-base);
}

.nav-header.scrolled {
    background: rgba(10, 10, 11, 0.72);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom-color: var(--border-subtle);
}

.nav-container {
    max-width: var(--container-max);
    height: 6.8rem;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.4rem;
}

.nav-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 1.1rem;
    color: var(--text-primary);
}

.nav-monogram {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: var(--bg-void);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: transform var(--transition-fast);
}

/* Logo mark inside the tile: ink follows the tile's text colour */
.nav-monogram {
    --logo-dot: #3b5bdb;
}

.logo-mark {
    width: 88%;
    height: 88%;
    display: block;
}

.nav-on-light .nav-monogram {
    --logo-dot: #7c9cff;
}

.nav-logo-link:hover .nav-monogram {
    transform: rotate(-6deg);
}

.nav-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    list-style: none;
}

.nav-link {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 450;
    color: var(--text-secondary);
    padding: 0.6rem 1.3rem;
    border-radius: var(--radius-pill);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

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

.btn-nav-ghost,
.btn-nav-contact {
    display: inline-flex;
    align-items: center;
    height: 3.6rem;
    padding: 0 1.6rem;
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn-nav-ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-nav-ghost:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.28);
}

.btn-nav-contact {
    color: var(--bg-void);
    background: var(--text-primary);
}

.btn-nav-contact:hover {
    background: #ffffff;
    color: #000;
}

.nav-toggle-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-pill);
    cursor: pointer;
}

.nav-toggle-btn span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--text-primary);
    transition: transform var(--transition-fast);
}

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

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

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    padding: 14rem 0 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

/* Engineering grid, masked so it only reads around the scene */
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 72%);
    mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 72%);
}

.hero-spotlight {
    position: absolute;
    z-index: -2;
    top: 8%;
    right: 4%;
    width: 760px;
    height: 760px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 156, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 68%);
    pointer-events: none;
}

.hero {
    /* Width of the content container, so the scene lines up with the text
       column on any screen instead of drifting with the viewport */
    --hero-cw: calc(min(100%, var(--container-max)) - 2 * var(--gutter));
    --hero-left: calc((100% - var(--hero-cw)) / 2);
}

/* The scene owns the right ~42% of the container; the sphere is sized to
   that column in hero-scene.js, so it never runs into the headline */
.hero-canvas {
    position: absolute;
    z-index: -1;
    top: 0;
    left: calc(var(--hero-left) + var(--hero-cw) * 0.585);
    width: calc(var(--hero-cw) * 0.5);
    height: 100%;
    opacity: 0;
    transition: opacity 1.6s var(--ease-out-expo) 0.2s;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}

.hero-canvas.is-ready {
    opacity: 1;
}

.hero-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.hero-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.hero-content {
    width: 100%;
    padding-bottom: 6rem;
}

/* Identity row */
.hero-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem 1.4rem;
    margin-bottom: 3.6rem;
}

.hero-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 18%;
    border: 1px solid var(--border-medium);
    background: var(--bg-tertiary);
}

.hero-identity-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.hero-identity-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hero-identity-role {
    font-size: 1.35rem;
    color: var(--text-muted);
}

.hero-availability {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    height: 2.8rem;
    padding: 0 1.2rem;
    margin-left: 0.6rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.02);
}

.hero-availability-dot {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
}

.hero-availability-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid #4ade80;
    opacity: 0;
    animation: availabilityPing 2.4s var(--ease-out-expo) infinite;
}

@keyframes availabilityPing {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Headline */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4.6rem, 5.6vw, 8.4rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--text-primary);
    margin-bottom: 3.2rem;
}

.hero-title-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.hero-title-line > span {
    display: inline-block;
    transform: translateY(110%);
    animation: heroLineUp 1.1s var(--ease-out-expo) forwards;
}

.hero-title-line:nth-child(1) > span { animation-delay: 0.15s; }
.hero-title-line:nth-child(2) > span { animation-delay: 0.27s; }

.hero-title-muted {
    /* Deliberately deeper than --text-muted: large type, 4:1 is enough */
    color: #71717a;
}

@keyframes heroLineUp {
    to { transform: translateY(0); }
}

.hero-lead {
    max-width: 56ch;
    font-size: clamp(1.65rem, 1.45vw, 1.9rem);
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 4rem;
}

/* Actions */
.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 5.6rem;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 4.8rem;
    padding: 0 2.4rem;
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.hero-btn i {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

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

.hero-btn-primary:hover {
    background: #ffffff;
    color: #000;
}

.hero-btn-primary:hover i {
    transform: translateX(3px);
}

.hero-btn-secondary {
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    background: rgba(255, 255, 255, 0.02);
}

.hero-btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

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

.hero-icon-links {
    display: flex;
    gap: 0.4rem;
    margin-left: 0.8rem;
}

.hero-icon-link {
    width: 4.4rem;
    height: 4.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: var(--text-muted);
    border-radius: 50%;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.hero-icon-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.hero-btn:focus-visible,
.hero-icon-link:focus-visible,
.nav-link:focus-visible,
.btn-nav-contact:focus-visible,
.btn-nav-ghost:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: 2.4rem;
    max-width: 560px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.6rem;
    padding-right: 4rem;
    margin-right: 4rem;
    border-right: 1px solid var(--border-subtle);
}

.hero-stat:last-child {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
}

.hero-stat dt {
    font-size: 1.3rem;
    color: var(--text-muted);
}

.hero-stat dd {
    order: -1;
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.hero-stat dd span {
    color: var(--text-muted);
    font-weight: 500;
}

/* Bottom strip */
.hero-footer {
    border-top: 1px solid var(--border-subtle);
    position: relative;
    z-index: 2;
}

.hero-footer-inner {
    display: flex;
    align-items: center;
    gap: 2.4rem;
    height: 7.2rem;
}

.hero-footer-label {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hero-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 2.4rem;
    list-style: none;
    flex: 1;
    min-width: 0;
}

.hero-stack li {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.hero-scroll {
    flex-shrink: 0;
    display: inline-flex;
    padding: 0.8rem;
}

.hero-scroll-track {
    position: relative;
    width: 2px;
    height: 32px;
    border-radius: 2px;
    background: var(--border-medium);
    overflow: hidden;
}

.hero-scroll-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 40%;
    background: var(--text-primary);
    animation: heroScroll 2.2s var(--ease-out-expo) infinite;
}

@keyframes heroScroll {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(260%); }
}

/* "Hear my intro" — sits under the sphere so the sphere reads as the speaker */
.hero-voice {
    position: absolute;
    /* Above .hero-container (z-index: --z-content), which spans the full width */
    z-index: calc(var(--z-content) + 1);
    /* Centred under the sphere: canvas left + half its width */
    left: calc(var(--hero-left) + var(--hero-cw) * 0.835);
    bottom: 11rem;
    transform: translateX(-50%);
    width: min(44rem, calc(var(--hero-cw) * 0.4));
    pointer-events: none;
}

.hero-voice-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}

.hero-voice-caption {
    max-width: 100%;
    padding: 1.2rem 1.6rem;
    font-size: 1.5rem;
    line-height: 1.55;
    text-align: center;
    color: var(--text-muted);
    background: rgba(14, 14, 16, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo);
    pointer-events: auto;
}

.hero-voice-caption.is-visible {
    opacity: 1;
    transform: none;
}

.hero-voice-caption span {
    transition: color 0.2s ease;
}

.hero-voice-caption span.is-spoken {
    color: var(--text-primary);
}

.hero-voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    height: 4.4rem;
    padding: 0 1.6rem 0 0.6rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(17, 17, 19, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-pill);
    pointer-events: auto;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.hero-voice-btn:hover {
    border-color: var(--border-strong);
    background: rgba(30, 30, 34, 0.85);
}

.hero-voice-icon {
    width: 3.2rem;
    height: 3.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-void);
    font-size: 1.1rem;
}

.hero-voice-icon .fa-play {
    margin-left: 2px;
}

.hero-voice-meta {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Muted preview: invite the visitor to turn sound on */
.hero-voice-btn.is-muted {
    border-color: rgba(124, 156, 255, 0.45);
    animation: voiceInvite 2s var(--ease-out-expo) infinite;
}

.hero-voice-btn.is-muted .hero-voice-icon {
    background: var(--accent);
    color: #0a0a0b;
}

@keyframes voiceInvite {
    0% { box-shadow: 0 0 0 0 rgba(124, 156, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(124, 156, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 156, 255, 0); }
}

/* Equaliser bars, animated while speaking */
.hero-voice-bars {
    display: none;
    align-items: center;
    gap: 3px;
    height: 1.6rem;
}

.hero-voice-bars i {
    width: 2px;
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transform-origin: center;
    animation: voiceBar 0.9s ease-in-out infinite;
}

.hero-voice-bars i:nth-child(2) { animation-delay: -0.2s; }
.hero-voice-bars i:nth-child(3) { animation-delay: -0.45s; }
.hero-voice-bars i:nth-child(4) { animation-delay: -0.1s; }
.hero-voice-bars i:nth-child(5) { animation-delay: -0.6s; }

@keyframes voiceBar {
    0%, 100% { transform: scaleY(0.25); }
    50% { transform: scaleY(1); }
}

.hero-voice-btn.is-playing .hero-voice-bars {
    display: inline-flex;
}

.hero-voice-btn.is-playing .hero-voice-meta {
    display: none;
}

/* Staggered entrance */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: heroReveal 1s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--d, 0) * 0.09s + 0.15s);
}

@keyframes heroReveal {
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .hero-title-line > span {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .hero-scroll-thumb,
    .hero-availability-dot::after,
    .hero-voice-bars i,
    .hero-voice-btn.is-muted {
        animation: none;
    }
    .hero-canvas {
        transition: none;
    }
}

@media (max-width: 991px) {
    .hero {
        padding-top: 11rem;
    }
    .hero-canvas {
        top: 4rem;
        left: auto;
        right: -40%;
        width: 120%;
        height: 70%;
        opacity: 0;
    }
    .hero-canvas.is-ready {
        opacity: 0.45;
    }
    .hero-canvas {
        -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 95%);
        mask-image: linear-gradient(180deg, #000 40%, transparent 95%);
    }
    .hero-grid {
        -webkit-mask-image: radial-gradient(ellipse 90% 50% at 70% 30%, #000 10%, transparent 70%);
        mask-image: radial-gradient(ellipse 90% 50% at 70% 30%, #000 10%, transparent 70%);
    }
    .hero-footer-label {
        display: none;
    }
    .hero-voice {
        position: static;
        transform: none;
        width: auto;
        margin: -2.4rem var(--gutter) 4rem;
    }
    .hero-voice-inner {
        align-items: flex-start;
    }
    .hero-voice-caption {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .hero-identity {
        margin-bottom: 3.2rem;
    }
    .hero-availability {
        margin-left: 0;
    }
    .hero-title {
        font-size: clamp(3.6rem, 10.5vw, 5.4rem);
    }
    .hero-title-line {
        white-space: normal;
    }
    .hero-actions {
        margin-bottom: 4.4rem;
    }
    .hero-btn {
        flex: 1 1 100%;
    }
    .hero-icon-links {
        margin-left: 0;
    }
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .hero-stat {
        padding-right: 1.6rem;
        margin-right: 1.6rem;
    }
    .hero-stat dd {
        font-size: 2.6rem;
    }
    .hero-stat dt {
        font-size: 1.2rem;
    }
    /* Two classes so the later `.container { padding: 0 … }` phone rule can't reset it */
    .hero-footer .hero-footer-inner {
        height: auto;
        padding-top: 2.2rem;
        padding-bottom: 2.8rem;
    }
    /* Match the 1.8rem container gutter used on phones */
    .hero-voice {
        margin-left: 1.8rem;
        margin-right: 1.8rem;
    }
    .hero-scroll {
        display: none;
    }
    .hero-stack {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
        mask-image: linear-gradient(90deg, #000 85%, transparent);
        padding-right: 3.2rem;
    }
    .hero-stack::-webkit-scrollbar {
        display: none;
    }
    .hero-stat dt {
        line-height: 1.35;
    }
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
    gap: 5.6rem;
    align-items: start;
}

.about-visual {
    min-width: 0;
}

.about-portrait {
    position: relative;
    margin: 0;
}

/* Soft halo so the card sits in the page instead of on top of it */
.about-portrait::before {
    content: '';
    position: absolute;
    inset: 8% -6% 18% -6%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(124, 156, 255, 0.10), transparent);
    filter: blur(30px);
    pointer-events: none;
}

.about-portrait-frame {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #101114;
    box-shadow:
        0 0 0 1px var(--border-subtle),
        0 30px 60px -20px rgba(0, 0, 0, 0.7);
    transition: transform 0.5s var(--ease-out-expo), box-shadow var(--transition-base);
    will-change: transform;
    transform-style: preserve-3d;
}

.about-portrait-frame:hover {
    box-shadow:
        0 0 0 1px var(--border-medium),
        0 40px 80px -24px rgba(0, 0, 0, 0.8);
}

/* Fade the photo's lower edge into the caption plate */
.about-portrait-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 10, 11, 0) 50%, rgba(10, 10, 11, 0.85) 100%),
        radial-gradient(120% 80% at 50% 30%, transparent 55%, rgba(10, 10, 11, 0.35) 100%);
    pointer-events: none;
}

.about-portrait-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 22%;
    filter: saturate(0.92) contrast(1.04);
    transition: transform 0.6s var(--ease-out-expo);
}

.about-portrait-glare {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(520px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.10), transparent 45%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.about-portrait-frame.is-tilting .about-portrait-glare {
    opacity: 1;
}

/* Viewfinder corner marks */
.frame-corner {
    position: absolute;
    z-index: 3;
    width: 18px;
    height: 18px;
    border-color: rgba(255, 255, 255, 0.45);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
    transition: transform var(--transition-base), border-color var(--transition-base);
}

.frame-corner-tl { top: 16px; left: 16px; border-top-width: 1px; border-left-width: 1px; }
.frame-corner-tr { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
.frame-corner-bl { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }
.frame-corner-br { bottom: 16px; right: 16px; border-bottom-width: 1px; border-right-width: 1px; }

.about-portrait-frame:hover .frame-corner { border-color: rgba(255, 255, 255, 0.8); }
.about-portrait-frame:hover .frame-corner-tl { transform: translate(-4px, -4px); }
.about-portrait-frame:hover .frame-corner-tr { transform: translate(4px, -4px); }
.about-portrait-frame:hover .frame-corner-bl { transform: translate(-4px, 4px); }
.about-portrait-frame:hover .frame-corner-br { transform: translate(4px, 4px); }

/* Glass caption plate */
.about-portrait-plate {
    position: absolute;
    z-index: 4;
    left: 2.4rem;
    right: 2.4rem;
    bottom: 4.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.2rem 1.4rem 1.2rem 1.6rem;
    background: rgba(18, 18, 21, 0.62);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
}

.about-portrait-identity {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    min-width: 0;
}

.about-portrait-identity strong {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.about-portrait-identity span {
    font-size: 1.3rem;
    color: var(--text-secondary);
}

.about-portrait-status {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
    height: 2.6rem;
    padding: 0 1rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
}

.about-portrait-meta {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 1.6rem;
    padding: 0 0.4rem;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.about-bio {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    font-size: 1.65rem;
    line-height: 1.7;
    color: var(--text-secondary);
    padding-top: 0.4rem;
}

.about-lead {
    font-size: clamp(2rem, 1.8vw, 2.4rem);
    line-height: 1.45;
    letter-spacing: -0.015em;
    font-weight: 450;
    color: var(--text-primary);
    text-wrap: pretty;
}

.about-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1.2rem;
}

/* Daily stack: a strip of brand marks under the bio */
.about-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.6rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.about-stack-label {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.about-stack ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.about-stack li {
    width: 4rem;
    height: 4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.about-stack li:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.2);
}

/* LangChain's mark is white (for dark UIs); darken it on the white tile */
.about-stack li img[src*="langchain"] {
    filter: invert(1);
}

.about-stack img {
    width: 2rem;
    height: 2rem;
}

/* Facts card */
.about-facts {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 2.4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow, none);
}

.about-facts > div {
    display: grid;
    grid-template-columns: 3.6rem 1fr;
    column-gap: 1.4rem;
    align-items: start;
    padding: 1.8rem 0;
}

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

.fact-icon {
    grid-row: span 2;
    width: 3.6rem;
    height: 3.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.4rem;
}

.about-facts dt {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.about-facts dd {
    display: flex;
    flex-direction: column;
    font-size: 1.55rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.about-facts dd span {
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Architecture panel: a dark block inside the light About section, with the
   3D layer stack (js/stack-scene.js) linked to the list on the left */
.architecture-panel {
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-muted: #8b8b94;
    --accent: #7c9cff;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2.4rem;
    align-items: center;
    margin-top: 8rem;
    padding: 4.8rem 4.8rem 4.8rem 5.6rem;
    background-color: #0e0e10;
    background-image:
        radial-gradient(70% 90% at 85% 40%, rgba(124, 156, 255, 0.08), transparent 60%),
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: auto, 20px 20px;
    border-radius: 2.4rem;
    color: var(--text-primary);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.architecture-eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.6rem;
}

.architecture-title {
    font-size: clamp(2.6rem, 2.6vw, 3.4rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.035em;
    margin-bottom: 2.8rem;
    text-wrap: balance;
}

.stack-layers {
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stack-layer {
    display: grid;
    grid-template-columns: 3.6rem 1fr;
    gap: 1.2rem;
    padding: 1.6rem 1.2rem;
    margin: 0 -1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.stack-layer:hover,
.stack-layer.is-active {
    background: rgba(124, 156, 255, 0.08);
}

.stack-layer:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.stack-layer-index {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-muted);
    padding-top: 0.3rem;
    transition: color var(--transition-fast);
}

.stack-layer.is-active .stack-layer-index {
    color: var(--accent);
}

.stack-layer h4 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stack-layer p {
    font-size: 1.4rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.architecture-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.92;
    cursor: grab;
    touch-action: pan-y;
    opacity: 0;
    transition: opacity 0.8s var(--ease-out-expo);
}

.architecture-scene.is-ready {
    opacity: 1;
}

.architecture-scene:active {
    cursor: grabbing;
}

.architecture-scene canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ===== PROJECTS ===== */
.projects-filter-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.4rem;
    margin-bottom: 4rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
}

.filter-pill {
    height: 3.6rem;
    padding: 0 1.8rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.filter-pill:hover {
    color: var(--text-primary);
}

.filter-pill.active {
    color: var(--bg-void);
    background: var(--text-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}

.project-item.hidden-project {
    display: none;
}

.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-base), transform var(--transition-base);
}

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

.project-card-visual {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    padding: 2rem 2rem 0;
    background-color: var(--bg-tertiary);
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 16px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.project-card-visual .browser-frame {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transform: translateY(6px);
    transition: transform 0.6s var(--ease-out-expo);
}

.project-card:hover .project-card-visual .browser-frame {
    transform: translateY(0);
}

.project-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.4rem;
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.project-card-title {
    font-size: 1.95rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.project-card-summary {
    font-size: 1.45rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tech-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    margin-bottom: 2.4rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.project-tech-chips .tech-chip {
    flex-shrink: 0;
}

.tech-chip {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.project-card-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.8rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-inspect-blueprint {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.45rem;
    font-weight: 500;
    color: var(--text-primary);
}

.btn-inspect-blueprint i {
    font-size: 1.15rem;
    transition: transform var(--transition-fast);
}

.btn-inspect-blueprint:hover i {
    transform: translateX(3px);
}

.btn-project-link {
    width: 3.6rem;
    height: 3.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 1.35rem;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.btn-project-link:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.projects-cta {
    display: flex;
    justify-content: center;
    margin-top: 4.8rem;
}

/* Featured case studies */
.projects-featured {
    display: grid;
    gap: 3.2rem;
    margin-bottom: 9.6rem;
}

.featured-project {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 5.6rem;
    align-items: center;
    padding: 4rem;
    background: var(--bg-surface);
    background-image: radial-gradient(120% 90% at 0% 0%, rgba(124, 156, 255, 0.07), transparent 55%);
    border: 1px solid var(--border-subtle);
    border-radius: 2.4rem;
}

.featured-project.is-reversed {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    background-image: radial-gradient(120% 90% at 100% 0%, rgba(124, 156, 255, 0.07), transparent 55%);
}

.featured-project.is-reversed .featured-visual {
    order: 2;
}

.featured-visual {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    transition: transform 0.6s var(--ease-out-expo);
}

.featured-visual:hover {
    transform: translateY(-4px) scale(1.01);
}

.featured-eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.6rem;
}

.featured-title {
    font-size: clamp(2.8rem, 2.8vw, 3.8rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin-bottom: 1.6rem;
}

.featured-summary {
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.8rem;
}

.featured-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2.4rem;
}

.featured-highlights > div {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 1.8rem 1.6rem 1.8rem 0;
}

.featured-highlights > div + div {
    padding-left: 1.6rem;
    border-left: 1px solid var(--border-subtle);
}

.featured-highlights dd {
    order: -1;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}

.featured-highlights dt {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.featured-stack {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.8rem;
}

.featured-stack li {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.featured-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

/* Browser-window frame */
.browser-frame {
    border-radius: 1.2rem;
    overflow: hidden;
    background: #1b1b1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 3.2rem;
    padding: 0 1.2rem;
    background: #232327;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-bar span {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #3f3f46;
}

.browser-bar span:nth-child(1) { background: #ff5f57; }
.browser-bar span:nth-child(2) { background: #febc2e; }
.browser-bar span:nth-child(3) { background: #28c840; }

.browser-bar em {
    flex: 1;
    margin: 0 4rem 0 1.2rem;
    padding: 0.3rem 1rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-style: normal;
    text-align: center;
    color: #a1a1aa;
    background: #18181b;
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.browser-frame.is-compact {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0.8rem;
    box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.8);
}

.browser-frame.is-compact .browser-bar {
    height: 2.2rem;
    padding: 0 0.9rem;
    gap: 0.4rem;
}

.browser-frame.is-compact .browser-bar span {
    width: 0.7rem;
    height: 0.7rem;
}

.browser-frame.is-compact .browser-bar em {
    display: none;
}

.browser-frame.is-compact img {
    flex: 1;
    min-height: 0;
    object-fit: cover;
    object-position: top center;
}

.projects-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3.2rem;
}

.projects-more-head h3 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.projects-more-head .projects-filter-bar {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .featured-project,
    .featured-project.is-reversed {
        grid-template-columns: 1fr;
        gap: 3.2rem;
    }
    .featured-project.is-reversed .featured-visual {
        order: 0;
    }
}

@media (max-width: 640px) {
    .featured-project {
        padding: 2rem;
        border-radius: var(--radius-xl);
    }
    .featured-highlights {
        grid-template-columns: 1fr;
    }
    .featured-highlights > div + div {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--border-subtle);
    }
    .projects-featured {
        margin-bottom: 6.4rem;
    }
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.4rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 860px;
    max-height: calc(100vh - 4.8rem);
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.45s var(--ease-out-expo);
}

.modal.open .modal-content {
    transform: none;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem 2.8rem;
    background: rgba(14, 14, 16, 0.92);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.modal-close {
    width: 3.6rem;
    height: 3.6rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.modal-body {
    padding: 2.8rem;
}

.modal-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    margin-bottom: 2.8rem;
    background: var(--bg-tertiary);
}

.modal-image img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    object-position: top center;
}

.modal-description {
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.8rem;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border-subtle);
    margin-bottom: 2.8rem;
}

.meta-field {
    padding: 2rem 2rem 2rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.meta-field-wide {
    grid-column: 1 / -1;
}

.meta-field h4 {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.meta-field p {
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
}

/* Contact form response modal (markup injected by contact.js) */
#formResponseModal .modal-content {
    max-width: 440px;
}

/* ===== EXPERIENCE ===== */
.timeline-nav-tabs {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.4rem;
    padding: 0.4rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    margin-bottom: 0.6rem;
}

.timeline-tab-btn {
    height: 3.6rem;
    padding: 0 1.8rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    transition: color var(--transition-fast), background var(--transition-fast);
}

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

.timeline-tab-btn.active {
    color: var(--bg-void);
    background: var(--text-primary);
}

/* Grouped by company: company column + vertical role timeline */
.xp-list {
    border-top: 1px solid var(--border-subtle);
}

.xp-company {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 4rem;
    padding: 4.8rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.xp-company-head {
    display: flex;
    align-items: flex-start;
    gap: 1.6rem;
    align-self: start;
    position: sticky;
    top: 10rem;
}

.xp-logo {
    width: 5.6rem;
    height: 5.6rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: #0e0e10;
    color: #fafaf9;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
}

.xp-company-head h3 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.xp-company-head p {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.2rem;
    padding: 0.3rem 1rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: #15803d;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--radius-pill);
}

.xp-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.xp-roles {
    list-style: none;
    position: relative;
    display: grid;
    gap: 4rem;
    padding-left: 3.6rem;
}

/* Vertical rail */
.xp-roles::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    top: 0.9rem;
    bottom: 0.9rem;
    width: 1px;
    background: var(--border-medium);
}

.xp-role {
    position: relative;
}

.xp-node {
    position: absolute;
    left: -3.6rem;
    top: 0.55rem;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: var(--bg-void);
    border: 2px solid var(--text-faint);
}

.xp-role.is-current .xp-node {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.xp-role.is-current .xp-node::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    animation: xpPulse 2.4s var(--ease-out-expo) infinite;
}

@keyframes xpPulse {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

.xp-role h4 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.xp-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.2rem;
    margin: 0.6rem 0 1.4rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-muted);
}

.xp-dates .xp-duration:not(:empty) {
    padding: 0.1rem 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-pill);
}

.xp-desc {
    font-size: 1.55rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 68ch;
    margin-bottom: 1.6rem;
}

.xp-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.xp-chips li {
    font-size: 1.25rem;
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
}

@media (prefers-reduced-motion: reduce) {
    .xp-role.is-current .xp-node::after { animation: none; opacity: 0; }
}

@media (max-width: 991px) {
    .xp-company {
        grid-template-columns: 1fr;
        gap: 3.2rem;
        padding: 4rem 0;
    }
    .xp-company-head {
        position: static;
    }
}

/* ===== SKILLS ===== */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border-subtle);
    border-left: 1px solid var(--border-subtle);
}

.capability-card {
    padding: 3.6rem 3.2rem;
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-base);
}

.capability-card:hover {
    background: rgba(255, 255, 255, 0.015);
}

.capability-index {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-faint);
    margin-bottom: 3.2rem;
}

.capability-card h3 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.capability-description {
    font-size: 1.45rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2.8rem;
    min-height: 4.6em;
}

.capability-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.capability-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 4.4rem;
    min-width: 0;
    padding: 0 1.2rem;
    font-size: 1.4rem;
    font-weight: 450;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.capability-list li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Official brand mark (Simple Icons), brand colour baked into the SVG */
.skill-icon {
    width: 1.8rem;
    height: 1.8rem;
    flex-shrink: 0;
    object-fit: contain;
}

.skill-icon-fa {
    width: 1.8rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.45rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.capability-list li:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.capability-list li:hover .skill-icon-fa {
    color: var(--text-primary);
}

/* ===== SERVICES =====
   Bento grid: wide/narrow cards alternate, each with a small animated
   visual of the service instead of an icon. */
.services-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2rem;
}

.svc-wide { grid-column: span 7; }
.svc-narrow { grid-column: span 5; }

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.service-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-3px);
}

/* Pointer-follow light, position fed by --mx / --my from script.js */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.service-card:hover::before {
    opacity: 1;
}

.svc-visual {
    position: relative;
    height: 20rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    background-image: radial-gradient(var(--border-medium) 1px, transparent 1px);
    background-size: 18px 18px;
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
}

.svc-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 3.2rem;
}

.svc-index {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}

.service-title {
    font-size: clamp(2.2rem, 2vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 1.2rem;
}

.service-description {
    font-size: 1.55rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 54ch;
    margin-bottom: 2.4rem;
}

.svc-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: auto;
}

.svc-chips li {
    font-size: 1.3rem;
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-secondary);
}

.svc-pill {
    position: absolute;
    left: 1.6rem;
    bottom: 1.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1.2rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.svc-pill-mono {
    font-family: var(--font-mono);
    font-weight: 400;
}

.svc-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    animation: svcBlink 1.4s ease-in-out infinite;
}

@keyframes svcBlink {
    50% { opacity: 0.3; }
}

/* 01 · Voice waveform */
.svc-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 9rem;
}

.svc-wave i {
    width: 4px;
    height: 100%;
    border-radius: 4px;
    background: var(--text-primary);
    opacity: 0.85;
    transform: scaleY(var(--h));
    animation: svcWave 1.3s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.09s);
}

.svc-wave i:nth-child(n+15):nth-child(-n+30) {
    background: var(--accent);
    opacity: 1;
}

@keyframes svcWave {
    0%, 100% { transform: scaleY(calc(var(--h) * 0.35)); }
    50% { transform: scaleY(var(--h)); }
}

/* 02 · API terminal */
.svc-terminal {
    width: min(34rem, 86%);
    padding: 1.4rem 1.6rem;
    display: grid;
    gap: 0.9rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    background: #0e0e10;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.45);
}

.svc-req {
    position: relative;
    display: grid;
    grid-template-columns: 4.6rem 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.2rem 0.6rem;
    margin: 0 -0.6rem;
    border-radius: 4px;
    color: #d4d4d8;
    animation: svcReq 3.2s ease-out infinite;
    animation-delay: calc(var(--i) * 0.8s);
}

.svc-req span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svc-req b { font-weight: 600; }
.svc-req .m-get { color: #4ade80; }
.svc-req .m-post { color: #7c9cff; }
.svc-req .m-put { color: #fbbf24; }
.svc-req em { font-style: normal; color: #a1a1aa; }

/* A "request in flight" highlight sweeps down the log */
@keyframes svcReq {
    0% { background: rgba(124, 156, 255, 0.22); }
    25%, 100% { background: transparent; }
}

/* 03 · Vector space */
.svc-rag svg,
.svc-flow svg {
    width: 92%;
    height: 88%;
}

.svc-dot { fill: var(--text-faint); }
.svc-dot-near { fill: var(--text-primary); }
.svc-query { fill: var(--accent); }

.svc-query-ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    transform-origin: 170px 88px;
    animation: svcRing 2.4s var(--ease-out-expo) infinite;
}

@keyframes svcRing {
    0% { transform: scale(0.4); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

.svc-link {
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: svcLink 3.6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.25s);
}

@keyframes svcLink {
    0% { stroke-dashoffset: 120; }
    35%, 75% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -120; }
}

/* 04 · Workflow pipeline */
.svc-node rect {
    fill: var(--bg-surface);
    stroke: var(--border-strong);
    stroke-width: 1;
}

.svc-node text {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    fill: var(--text-primary);
    text-anchor: middle;
}

.svc-node-ai rect {
    fill: var(--accent);
    stroke: var(--accent);
}

.svc-node-ai text {
    fill: #ffffff;
}

.svc-node {
    animation: svcNode 4s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.5s);
}

@keyframes svcNode {
    0%, 70%, 100% { opacity: 1; }
    15% { opacity: 0.55; }
}

.svc-path {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    stroke-dasharray: 4 6;
    animation: svcFlow 1s linear infinite;
}

@keyframes svcFlow {
    to { stroke-dashoffset: -10; }
}

@media (prefers-reduced-motion: reduce) {
    .svc-wave i,
    .svc-req,
    .svc-query-ring,
    .svc-link,
    .svc-node,
    .svc-path,
    .svc-live {
        animation: none;
    }
    .svc-link { stroke-dashoffset: 0; }
}

@media (max-width: 991px) {
    .svc-wide,
    .svc-narrow {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .svc-visual {
        height: 16rem;
    }
    .svc-body {
        padding: 2.4rem;
    }
}

/* ===== TESTIMONIALS =====
   One featured quote at a time; author tabs below switch it and show
   auto-advance progress (js/script.js → initTestimonials). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.testimonial-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.testimonial-counter {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-right: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.testimonial-counter span {
    color: var(--text-primary);
}

.testimonial-nav {
    width: 4.4rem;
    height: 4.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 1.3rem;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.testimonial-nav:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-void);
}

.testimonial-stage {
    position: relative;
    display: grid;
    padding: 1.6rem 0 5.6rem 9.6rem;
    min-height: 26rem;
}

.testimonial-mark {
    position: absolute;
    left: -0.4rem;
    top: -2.4rem;
    font-family: var(--font-display);
    font-size: 16rem;
    font-weight: 600;
    line-height: 1;
    color: var(--accent);
    opacity: 0.9;
    pointer-events: none;
    user-select: none;
}

.testimonial-slide {
    grid-area: 1 / 1;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.6s var(--ease-out-expo), visibility 0s linear 0.5s;
}

.testimonial-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.6s var(--ease-out-expo) 0.1s, transform 0.7s var(--ease-out-expo) 0.1s, visibility 0s;
}

.testimonial-quote {
    max-width: 30ch;
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 3.1vw, 4.2rem);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-wrap: balance;
}

/* Author tabs */
.testimonial-authors {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border-subtle);
}

.testimonial-author {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    min-width: 0;
    padding: 2.4rem 1.6rem 0 0;
    text-align: left;
    opacity: 0.5;
    transition: opacity var(--transition-base);
}

.testimonial-author:hover,
.testimonial-author.is-active {
    opacity: 1;
}

/* Progress line sits on the tab row's top border */
.testimonial-progress {
    position: absolute;
    top: -1px;
    left: 0;
    right: 1.6rem;
    height: 2px;
    overflow: hidden;
}

.testimonial-progress::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--text-primary);
    transform: scaleX(0);
    transform-origin: left;
}

.testimonial-author.is-active .testimonial-progress::after {
    animation: testimonialProgress var(--testimonial-duration, 7s) linear forwards;
}

/* Pause only for keyboard users reading a tab (not on mouse hover, which
   would freeze the rotation whenever the pointer rests on the section) */
.testimonial-authors:has(:focus-visible) .testimonial-author.is-active .testimonial-progress::after {
    animation-play-state: paused;
}

.testimonial-author.is-active .testimonial-progress {
    background: var(--border-medium);
}

@keyframes testimonialProgress {
    to { transform: scaleX(1); }
}

.testimonial-avatar {
    width: 4.8rem;
    height: 4.8rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.testimonial-author.is-active .testimonial-avatar {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.testimonial-author-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.testimonial-author-text strong {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.testimonial-author-text span {
    font-size: 1.3rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .testimonial-slide,
    .testimonial-slide.is-active {
        transition: none;
        transform: none;
    }
    .testimonial-author.is-active .testimonial-progress::after {
        animation: none;
        transform: scaleX(1);
    }
}

@media (max-width: 991px) {
    .testimonial-stage {
        padding-left: 6.4rem;
        min-height: 0;
    }
    .testimonial-mark {
        font-size: 11rem;
        top: -1.6rem;
    }
    .testimonial-authors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 2.4rem;
    }
}

@media (max-width: 640px) {
    .testimonial-stage {
        padding: 7.2rem 0 4rem;
    }
    .testimonial-mark {
        top: -2rem;
    }
    .testimonial-quote {
        font-size: 2.4rem;
    }
    .testimonial-author {
        gap: 1rem;
    }
    .testimonial-avatar {
        width: 4rem;
        height: 4rem;
    }
}

/* ===== CONTACT ===== */
.contact-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 4rem;
    align-items: center;
    margin-bottom: 6.4rem;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 6.4vw, 8.4rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 2.8rem;
    text-wrap: balance;
}

.contact-hero-text .section-description {
    margin-bottom: 3.6rem;
}

.contact-email-link {
    display: inline-flex;
    align-items: center;
    gap: 1.4rem;
    font-size: clamp(2rem, 2.4vw, 2.8rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-strong);
}

.contact-email-link i {
    font-size: 0.7em;
    transition: transform var(--transition-fast);
}

.contact-email-link:hover {
    border-color: var(--text-primary);
}

.contact-email-link:hover i {
    transform: translateX(4px);
}

.contact-hero-visual {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
    max-width: 440px;
    justify-self: end;
}

.contact-hero-visual::before {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 156, 255, 0.10), transparent 70%);
    pointer-events: none;
}

.contact-globe {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: pan-y;
}

.contact-globe:active {
    cursor: grabbing;
}

.contact-globe canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* City labels projected over the globe by js/globe-scene.js */
.globe-label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.3rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    background: rgba(17, 17, 19, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.globe-label.is-home {
    color: #0a0a0b;
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 500;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2.4rem;
    align-items: stretch;
}

.contact-info-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    overflow: hidden;
}

.contact-channel-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding: 2rem 2.4rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.contact-channel-card:last-child {
    border-bottom: 0;
}

.contact-channel-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.channel-icon {
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.6rem;
}

.channel-meta {
    flex: 1;
    min-width: 0;
}

.channel-meta h4 {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.channel-meta a {
    font-size: 1.55rem;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.channel-meta a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-strong);
}

.copy-email-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    height: 3.2rem;
    padding: 0 1.2rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.copy-email-badge:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Honeypot field for bots (see index.html / api/contact.js) */
.form-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form-terminal {
    padding: 3.2rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.form-group label {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    height: 4.8rem;
    padding: 0 1.6rem;
    font-family: var(--font-body);
    font-size: 1.55rem;
    color: var(--text-primary);
    background: var(--bg-void);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea.form-control {
    height: auto;
    min-height: 15rem;
    padding: 1.4rem 1.6rem;
    line-height: 1.6;
    resize: vertical;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-control:hover {
    border-color: var(--border-strong);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control.input-invalid {
    border-color: var(--danger);
}

.input-error {
    font-size: 1.3rem;
    color: var(--danger);
}

.contact-form .btn-primary {
    margin-top: 0.4rem;
}

/* ===== FOOTER ===== */
.site-footer {
    position: relative;
    z-index: var(--z-content);
    border-top: 1px solid var(--border-subtle);
    padding: 6.4rem 0 10rem;
}

.footer-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3.2rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.footer-brand .nav-monogram {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    border-radius: 10px;
}

.footer-brand-name {
    font-size: 1.6rem;
    font-weight: 600;
}

.footer-brand-title {
    font-size: 1.35rem;
    color: var(--text-muted);
}

.footer-links-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 2.8rem;
    list-style: none;
}

.footer-links-nav a {
    font-size: 1.4rem;
    color: var(--text-secondary);
}

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

.footer-social {
    display: flex;
    gap: 0.4rem;
}

.footer-social a {
    width: 3.8rem;
    height: 3.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.6rem;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.footer-social a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem 2.4rem;
    padding-top: 2.8rem;
    font-size: 1.35rem;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem 2.8rem;
}

.footer-bottom-links a {
    color: var(--text-secondary);
}

.footer-bottom-links a:hover {
    color: var(--text-primary);
}

.footer-back-top {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-back-top i {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.footer-back-top:hover i {
    transform: translateY(-2px);
}

/* ===== LIGHT SURFACE =====
   Applied per section (class="theme-light") to give the page a dark → light
   → dark rhythm. Components read tokens, so flipping them here re-themes
   everything inside; the overrides below cover hard-coded white tints. */
.theme-light {
    --bg-void: #fafaf9;
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #f1f1f2;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --text-primary: #0a0a0b;
    --text-secondary: #52525b;
    --text-muted: #63636b;   /* 5.9:1 on #fafaf9 */
    --text-faint: #8e8e96;   /* decorative only (indices) */
    --accent: #3b5bdb;
    --accent-soft: rgba(59, 91, 219, 0.12);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.24);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.10);
    --card-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.04), 0 18px 40px -16px rgba(0, 0, 0, 0.18);
    background: var(--bg-void);
    color: var(--text-primary);
    color-scheme: light;
}

.theme-light ::selection {
    background: rgba(59, 91, 219, 0.18);
    color: #0a0a0b;
}

/* Dark-on-light sections touching each other don't need a divider */
main > section.theme-light + section.theme-light {
    border-top-color: rgba(0, 0, 0, 0.06);
}

main > section.theme-light + section:not(.theme-light),
main > section:not(.theme-light) + section.theme-light {
    border-top: 0;
}

/* Buttons: hover must not turn white on a white page */
.theme-light .btn-primary:hover {
    background: #27272a;
    color: #fafaf9;
}

.theme-light .btn-secondary:hover,
.theme-light .btn-project-link:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Elevated cards get a soft shadow instead of a glow */
.theme-light .project-card,
.theme-light .repo-card,
.theme-light .testimonial-card,
.theme-light .service-card,
.theme-light .github-calendar-container {
    box-shadow: var(--card-shadow);
}

.theme-light .project-card:hover,
.theme-light .repo-card:hover,
.theme-light .testimonial-card:hover,
.theme-light .service-card:hover {
    box-shadow: var(--card-shadow-hover);
}

/* Pointer light reads as a soft shade on white */
.theme-light .service-card::before {
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(59, 91, 219, 0.06), transparent 60%);
}

.theme-light .service-icon-box {
    background: #f4f4f5;
    border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .tech-chip,
.theme-light .repo-topic-tag {
    background: #f6f6f7;
}

.theme-light .projects-filter-bar,
.theme-light .timeline-nav-tabs {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* The portrait card is a dark object on a light page: keep it dark inside */
.theme-light .about-portrait-frame {
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 30px 60px -24px rgba(0, 0, 0, 0.35);
}

.theme-light .about-portrait::before {
    background: radial-gradient(closest-side, rgba(59, 91, 219, 0.10), transparent);
}

/* Contribution heatmap on white */
.theme-light .legend-level[data-level="0"],
.theme-light .contribution-day[data-level="0"] { background: #ebebed; }
.theme-light .legend-level[data-level="1"],
.theme-light .contribution-day[data-level="1"] { background: rgba(59, 91, 219, 0.30); }
.theme-light .legend-level[data-level="2"],
.theme-light .contribution-day[data-level="2"] { background: rgba(59, 91, 219, 0.52); }
.theme-light .legend-level[data-level="3"],
.theme-light .contribution-day[data-level="3"] { background: rgba(59, 91, 219, 0.76); }
.theme-light .legend-level[data-level="4"],
.theme-light .contribution-day[data-level="4"] { background: #2b47c4; }
.theme-light .contribution-day:hover { outline-color: rgba(0, 0, 0, 0.5); }
.theme-light .year-btn:hover { background: rgba(0, 0, 0, 0.04); }
.theme-light .calendar-grid-wrapper::-webkit-scrollbar-thumb { background: #d4d4d8; }

.theme-light .testimonial-avatar {
    border-color: rgba(0, 0, 0, 0.08);
}

/* Nav over a light section (class toggled by script.js) */
.nav-header.nav-on-light.scrolled {
    background: rgba(250, 250, 249, 0.82);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.nav-header .nav-name,
.nav-header .nav-monogram,
.nav-header .btn-nav-ghost,
.nav-header .btn-nav-contact,
.nav-header .nav-toggle-btn span {
    transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base);
}

.nav-on-light .nav-name { color: #0a0a0b; }
.nav-on-light .nav-monogram { background: #0a0a0b; color: #fafaf9; }
.nav-on-light .btn-nav-ghost { color: #52525b; border-color: rgba(0, 0, 0, 0.14); }
.nav-on-light .btn-nav-ghost:hover { color: #0a0a0b; border-color: rgba(0, 0, 0, 0.3); }
.nav-on-light .btn-nav-contact { background: #0a0a0b; color: #fafaf9; }
.nav-on-light .btn-nav-contact:hover { background: #27272a; color: #fff; }
.nav-on-light .nav-toggle-btn { border-color: rgba(0, 0, 0, 0.14); }
.nav-on-light .nav-toggle-btn span { background: #0a0a0b; }

@media (min-width: 992px) {
    .nav-on-light .nav-link { color: #52525b; }
    .nav-on-light .nav-link:hover { color: #0a0a0b; }
    .nav-on-light .nav-link.active { color: #0a0a0b; background: rgba(0, 0, 0, 0.05); }
}

/* ===== SCROLL REVEAL (classes applied by script.js) ===== */
.sr {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
    transition-delay: var(--sr-delay, 0ms);
}

.sr.sr-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .sr {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .capabilities-grid {
        grid-template-columns: 1fr;
    }
    .capability-description {
        min-height: 0;
    }
    .capability-list {
        grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    }
    .about-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: 4.8rem;
    }
    .about-facts {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 3.2rem;
    }
    .about-facts > div:nth-child(2) {
        border-top: 0;
    }
}

@media (max-width: 991px) {
    :root {
        --spacing-2xl: 9rem;
    }

    .section-header-split {
        flex-direction: column;
        align-items: flex-start;
        gap: 2.4rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 4.8rem;
    }
    .about-visual {
        max-width: 420px;
    }
    .architecture-panel {
        grid-template-columns: 1fr;
        margin-top: 6.4rem;
        padding: 3.2rem 2.8rem;
    }
    .architecture-scene {
        order: -1;
        max-width: 520px;
        margin: 0 auto;
    }

    .capabilities-grid {
        grid-template-columns: 1fr;
    }
    .capability-description {
        min-height: 0;
    }
    .services-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }


    .contact-hero {
        grid-template-columns: 1fr;
    }
    .contact-hero-visual {
        justify-self: center;
        max-width: 400px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile navigation */
    .nav-toggle-btn {
        display: flex;
    }
    .nav-menu {
        position: fixed;
        top: 7.6rem;
        left: 1.6rem;
        right: 1.6rem;
        /* Solid fill: a backdrop-filter nested inside the blurred header
           renders see-through in Chromium */
        background: #111113;
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
        border-radius: var(--radius-lg);
        padding: 1.2rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity var(--transition-base), transform var(--transition-base);
    }
    .nav-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .nav-menu ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
    }
    .nav-link {
        display: block;
        padding: 1.3rem 1.6rem;
        border-radius: var(--radius-md);
        font-size: 1.6rem;
    }
    .btn-nav-contact,
    .btn-nav-ghost {
        display: none;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 56.25%; /* 1rem = 9px */
    }
    .container {
        padding: 0 1.8rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .projects-filter-bar {
        display: flex;
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .projects-filter-bar::-webkit-scrollbar {
        display: none;
    }
    .filter-pill {
        flex: 0 0 auto;
        padding: 0 1.4rem;
    }
    .about-facts {
        grid-template-columns: 1fr;
    }
    .about-facts > div:nth-child(2) {
        border-top: 1px solid var(--border-subtle);
    }

    .service-card,
    .testimonial-card,
    .contact-form-terminal {
        padding: 2.6rem;
    }
    .capability-card {
        padding: 2.8rem 2.4rem;
    }
    .capability-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .form-row-dual {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 1.2rem;
    }
    .modal-header,
    .modal-body {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    .modal-meta-grid {
        grid-template-columns: 1fr;
    }
    .modal-footer-actions .btn-primary {
        width: 100%;
    }
    .footer-top-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
