:root {
    /* Ink Dark Ramp (derived from cyber-samurai artwork) */
    --bg-deep: #070a0f;
    --bg-page: #0a0f16;
    --bg-card: rgba(13, 19, 28, 0.88);
    --bg-raised: rgba(20, 29, 42, 0.92);

    /* Text Roles */
    --text-primary: #eef0f5;
    --text-secondary: #a4b0c2;
    --text-muted: #7b889c;

    /* Single Steel-Cyan Accent */
    --accent: #22d3ee;
    --accent-dim: rgba(34, 211, 238, 0.14);
    --accent-border: rgba(34, 211, 238, 0.34);

    /* Hairline Borders */
    --hairline: rgba(238, 240, 245, 0.09);
    --hairline-strong: rgba(238, 240, 245, 0.18);

    /* Typography & Motion */
    --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --nav-height: 72px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    color-scheme: dark;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: clip;
    overscroll-behavior-y: contain;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

a {
    color: inherit;
    touch-action: manipulation;
}

button,
select {
    font-family: inherit;
    color: inherit;
    touch-action: manipulation;
}

video {
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-deep);
    font-weight: 600;
    text-decoration: none;
    transition: top 160ms var(--ease-out);
}

.skip-link:focus {
    top: 16px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.icon-sm {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Header & Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(7, 10, 15, 0.94) 0%, rgba(7, 10, 15, 0.6) 65%, rgba(7, 10, 15, 0) 100%);
    transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.site-header.scrolled {
    background: rgba(7, 10, 15, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline);
}

.navbar {
    max-width: 1360px;
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-height: 44px;
}

.brand-emblem {
    display: block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.nav-logo-sub {
    color: var(--text-secondary);
    font-weight: 500;
}

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

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.nav-links a:hover,
.nav-links a.is-current {
    color: var(--text-primary);
    background-color: rgba(238, 240, 245, 0.06);
}

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

.nav-cta {
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.875rem;
    background-color: var(--text-primary);
    color: var(--bg-deep);
    border: 1px solid transparent;
}

.nav-cta:hover {
    background-color: #ffffff;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--hairline-strong);
    background: var(--bg-card);
    cursor: pointer;
    position: relative;
    align-items: center;
    justify-content: center;
    transition: border-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.menu-toggle:active {
    transform: scale(0.96);
}

.menu-line {
    position: absolute;
    width: 18px;
    height: 1.75px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 200ms var(--ease-out);
}

.menu-line-top {
    transform: translateY(-3.5px);
}

.menu-line-bottom {
    transform: translateY(3.5px);
}

.menu-toggle[aria-expanded="true"] .menu-line-top {
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-line-bottom {
    transform: rotate(-45deg);
}

.mobile-nav {
    background: rgba(7, 10, 15, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--hairline);
    padding: 12px 24px 20px;
}

.mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.mobile-nav-list a:hover {
    color: var(--text-primary);
    background: rgba(238, 240, 245, 0.06);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.btn:active {
    transform: scale(0.97);
}

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

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

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--hairline-strong);
}

.btn-secondary:hover {
    border-color: var(--accent-border);
    background-color: var(--bg-raised);
}

.btn-with-badge {
    padding-right: 10px;
}

.btn-trail {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(7, 10, 15, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 180ms var(--ease-out);
}

.btn-with-badge:hover .btn-trail {
    transform: translate(2px, -2px);
}

/* Hero */
.hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: flex-end;
    padding: calc(var(--nav-height) + 48px) 0 64px;
    overflow: hidden;
    background-color: var(--bg-deep);
    border-bottom: 1px solid var(--hairline);
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-video,
.ascii-canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
}

.ascii-canvas {
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms var(--ease-out);
}

.hero.is-ascii .ascii-canvas {
    opacity: 1;
    pointer-events: auto;
    cursor: crosshair;
}

.hero.is-ascii .hero-video {
    opacity: 0;
}

.video-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(7, 10, 15, 0.72) 0%, transparent 18%),
        linear-gradient(95deg, rgba(7, 10, 15, 0.94) 0%, rgba(7, 10, 15, 0.68) 44%, rgba(7, 10, 15, 0.18) 100%),
        linear-gradient(to top, rgba(7, 10, 15, 0.88) 0%, transparent 42%);
}

.hero-grid {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    max-width: 580px;
    pointer-events: auto;
}

.eyebrow-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(13, 19, 28, 0.78);
    border: 1px solid var(--hairline);
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--accent);
}

.eyebrow-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.hero-headline {
    font-size: clamp(3rem, 7vw, 5rem);
    line-height: 0.96;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 18px;
}

.typing-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 18px;
}

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

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: var(--accent);
    animation: cursor-blink 1.1s steps(1) infinite;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-desc {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 50ch;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.mini-socials {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-socials a {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.mini-socials a:hover {
    color: var(--accent);
    background-color: rgba(238, 240, 245, 0.06);
}

/* Interactive Video2ASCII Shader Controls */
.hero-shader-bar {
    position: absolute;
    right: 24px;
    bottom: 24px;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(10, 15, 22, 0.86);
    border: 1px solid var(--hairline-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.shader-segmented {
    display: inline-flex;
    gap: 4px;
}

.shader-tab,
.shader-chip,
.shader-select {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.shader-tab:hover,
.shader-chip:hover {
    color: var(--text-primary);
    background: rgba(238, 240, 245, 0.06);
}

.shader-tab.is-active,
.shader-chip[aria-pressed="true"] {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

.shader-extra {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 6px;
    border-left: 1px solid var(--hairline);
}

.shader-extra[hidden] {
    display: none;
}

.shader-select {
    height: 36px;
    line-height: 36px;
    padding: 0 12px;
    background: var(--bg-deep);
    border-color: var(--hairline);
    color: var(--text-primary);
}

.shader-select option {
    background-color: #0a0f16;
    color: #eef0f5;
}

.shader-telemetry {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 6px;
}

/* Shared Section Layout & Zero-Gap Sticky Background */
.section-block {
    position: relative;
    overflow: clip;
    padding: 96px 0;
    border-bottom: 1px solid var(--hairline);
    scroll-margin-top: calc(var(--nav-height) + 8px);
}

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

.section-bg-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.section-video {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    opacity: 0.42;
}

.projects-video {
    object-position: left 20%;
    opacity: 0.48;
}

.section-overlay {
    position: absolute;
    inset: 0;
}

.section-overlay-radial {
    background:
        radial-gradient(circle at center, rgba(7, 10, 15, 0.28) 0%, rgba(7, 10, 15, 0.76) 65%, rgba(7, 10, 15, 0.94) 100%);
}

.section-overlay-split {
    background:
        linear-gradient(to right, rgba(7, 10, 15, 0.16) 0%, rgba(7, 10, 15, 0.72) 45%, rgba(7, 10, 15, 0.94) 82%);
}

.section-inner {
    position: relative;
    z-index: 1;
}

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

.section-header-center {
    text-align: center;
}

.section-header-right {
    text-align: right;
}

.section-kicker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 8px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
    color: var(--text-primary);
}

/* Double-Bezel Panel System (no scrolling backdrop-blur cost) */
.panel-shell {
    padding: 6px;
    border-radius: 20px;
    background: rgba(238, 240, 245, 0.03);
    border: 1px solid var(--hairline);
    transition: border-color 180ms var(--ease-out);
}

.panel-shell:hover {
    border-color: var(--accent-border);
}

.panel-core {
    height: 100%;
    padding: 28px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.terminal-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.panel-file {
    color: var(--text-secondary);
}

.yaml-block {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

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

.yaml-val {
    color: var(--text-primary);
}

.fact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fact-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.96875rem;
    color: var(--text-secondary);
}

.fact-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

.fact-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.inline-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.fbf-badge-row {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    gap: 12px;
}

.fbf-badge-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fbf-badge-title {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fbf-badge-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Tech Stack */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.card-heading {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stack-tag {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--hairline);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-primary);
}

/* Projects */
.projects-column {
    max-width: 660px;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.project-index {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.project-badge {
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

.project-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.project-subtitle {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    margin-bottom: 14px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.96875rem;
    margin-bottom: 20px;
}

.project-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.project-tags li {
    font-family: var(--font-mono);
    font-size: 0.78125rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(238, 240, 245, 0.04);
    border: 1px solid var(--hairline);
    color: var(--text-secondary);
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Remotion Showreel Section */
.showreel-section {
    background-color: var(--bg-page);
}

.showreel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.showreel-lead {
    color: var(--text-secondary);
    max-width: 52ch;
    margin-top: 8px;
}

.chapter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chapter-btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.chapter-btn:hover {
    color: var(--text-primary);
    border-color: var(--hairline-strong);
}

.chapter-btn:active {
    transform: scale(0.97);
}

.chapter-btn.is-active {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

.showreel-core {
    padding: 12px;
}

.showreel-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-deep);
    pointer-events: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.showreel-hud {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 2px;
}

.showreel-track {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: rgba(238, 240, 245, 0.09);
    overflow: hidden;
}

.showreel-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 120ms linear;
}

.showreel-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

#showreel-chapter-label {
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    background: var(--bg-deep);
    padding: 56px 0 40px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quote {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.social-links-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--hairline);
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

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

.social-btn:active {
    transform: scale(0.96);
}

.copyright {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Reveal Entrance (single subtle rise) */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile & Tablet Breakpoint */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

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

    .mobile-nav {
        padding: 12px 16px max(20px, env(safe-area-inset-bottom));
    }

    .hero {
        min-height: 100svh;
        align-items: flex-end;
        padding: calc(var(--nav-height) + 28px) 0 88px;
    }

    .hero.is-ascii {
        padding-bottom: 140px;
    }

    .hero-video,
    .ascii-canvas {
        object-position: 62% 15%;
    }

    .video-overlay {
        background:
            linear-gradient(to bottom, rgba(7, 10, 15, 0.76) 0%, transparent 20%),
            linear-gradient(to top, rgba(7, 10, 15, 0.96) 0%, rgba(7, 10, 15, 0.72) 55%, rgba(7, 10, 15, 0.25) 100%);
    }

    .hero-shader-bar {
        left: 24px;
        right: 24px;
        bottom: max(16px, env(safe-area-inset-bottom));
        justify-content: space-between;
    }

    .section-block {
        padding: 64px 0;
    }

    .section-bg-sticky {
        height: 100svh;
    }

    #about .section-video {
        object-position: 45% 42%;
    }

    #tech .section-video {
        object-position: 46% 38%;
    }

    #projects .section-video {
        object-position: 28% 22%;
        opacity: 0.34;
    }

    .section-overlay-split {
        background:
            linear-gradient(to bottom, rgba(7, 10, 15, 0.86) 0%, rgba(7, 10, 15, 0.62) 45%, rgba(7, 10, 15, 0.94) 100%);
    }

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

    .about-grid,
    .tech-grid {
        grid-template-columns: 1fr;
    }

    .projects-column {
        max-width: 100%;
    }

    .panel-core {
        padding: 20px;
    }

    .panel-core.showreel-core {
        padding: 8px;
    }
}

@media (max-width: 640px) {
    .showreel-header {
        gap: 18px;
        margin-bottom: 22px;
    }

    .chapter-pills {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .chapter-btn {
        min-height: 44px;
        padding: 6px 6px;
        font-size: 0.6875rem;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 520px) {
    .container,
    .navbar {
        padding: 0 16px;
    }

    .brand-link {
        gap: 8px;
        min-width: 0;
    }

    .brand-emblem {
        width: 24px;
        height: 24px;
    }

    .nav-logo {
        font-size: clamp(0.95rem, 4.3vw, 1.0625rem);
        white-space: nowrap;
    }

    .nav-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .nav-cta {
        min-height: 38px;
        padding: 0 11px;
        gap: 6px;
        font-size: 0.8125rem;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
    }

    .hero {
        padding: calc(var(--nav-height) + 16px) 0 84px;
    }

    .hero.is-ascii {
        padding-bottom: 144px;
    }

    .hero-headline {
        font-size: clamp(2.5rem, 11vw, 3.25rem);
        margin-bottom: 14px;
    }

    .hero-desc {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 18px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-shader-bar {
        left: 16px;
        right: 16px;
        bottom: max(14px, env(safe-area-inset-bottom));
    }

    .shader-extra {
        padding-left: 0;
        border-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .section-block {
        padding: 56px 0;
    }

    .section-header {
        margin-bottom: 24px;
    }

    .panel-shell {
        padding: 4px;
        border-radius: 16px;
    }

    .panel-core {
        padding: 18px;
        border-radius: 12px;
    }

    .panel-core.showreel-core {
        padding: 6px;
    }

    .yaml-block {
        font-size: 0.8125rem;
        line-height: 1.72;
    }

    .project-title {
        font-size: 1.45rem;
    }

    .project-actions {
        flex-direction: column;
    }

    .project-actions .btn {
        width: 100%;
    }

    .site-footer {
        padding: 44px 0 max(36px, calc(20px + env(safe-area-inset-bottom)));
    }
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

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