:root {
    font-family: 'Space Grotesk', sans-serif;
    color-scheme: dark;
    --ink: #0a0a0c;
    --panel: #111216;
    --panel-soft: rgba(255, 255, 255, .035);
    --line: rgba(255, 255, 255, .12);
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --subtle: #71717a;
    --accent: #00ff66;
    --accent-soft: #6ee7b7;
    /* Foreground colour for text drawn on top of an --accent surface. The accent
       stays bright in both themes, so its label must stay dark in both. */
    --on-accent: #0a0a0c;
    /* The accent used as *foreground text*. Aliases --accent here; the light
       theme darkens it, because #00ff66 on a light background is unreadable. */
    --accent-text: var(--accent);
    /* Text-bearing surfaces. The light theme overrides these so card copy does
       not end up dark-on-dark. */
    --surface: rgba(17, 18, 22, .72);
    --surface-soft: rgba(17, 18, 22, .58);
    --surface-strong: rgba(10, 10, 12, .82);
    --text-xs: .75rem;
    --text-sm: .875rem;
    --text-md: 1rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.35rem;
    --text-2xl: 2rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    overflow-x: hidden;
}

body.overflow-hidden {
    overflow: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: -1;
    background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 42px 42px;
}

body::after {
    z-index: -2;
    background: radial-gradient(circle at 75% 20%, rgba(0, 255, 102, .06), transparent 25%), radial-gradient(circle at 10% 70%, rgba(16, 185, 129, .04), transparent 28%);
}

main,
footer {
    position: relative;
    z-index: 1;
}

a,
button,
input {
    transition: color .2s, background-color .2s, border-color .2s, opacity .2s, transform .2s;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

.mono,
.tech-stack,
.hero-kicker {
    font-family: 'JetBrains Mono', monospace;
}

.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: .75rem;
    left: .75rem;
    z-index: 100;
    padding: .7rem 1rem;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    transform: translateY(calc(-100% - 1.5rem));
}

.skip-link:focus {
    transform: translateY(0);
}

#bg-3d-canvas {
    position: fixed;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .8;
}

.content-shell {
    width: min(100% - 2rem, 1160px);
    margin-inline: auto;
}

.bg-grid {
    background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 42px 42px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
    backdrop-filter: blur(16px);
    transition: background-color .3s, border-color .3s, box-shadow .3s;
}

.site-header.is-scrolled {
    background: var(--surface-strong);
    border-color: rgba(0, 255, 102, .28);
    box-shadow: 0 12px 42px rgba(0, 0, 0, .38);
}

.site-nav {
    width: min(100% - 2rem, 1160px);
    min-height: 72px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-brand .brand-name {
    display: inline-block;
    min-width: 0;
    color: var(--text);
    opacity: 1;
    filter: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: auto;
    -webkit-transform: none;
    transform: none;
}

.site-brand b {
    color: var(--accent-text);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0, 255, 102, .55);
    color: var(--accent-text);
    font: 700 var(--text-xs) 'JetBrains Mono', monospace;
}

.desktop-navigation {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
}

.nav-link {
    position: relative;
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: .55rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: .01em;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .045);
}

.nav-link.active {
    color: var(--accent-text);
    background: rgba(0, 255, 102, .07);
}

.nav-link::after {
    content: '';
    position: absolute;
    right: .7rem;
    bottom: 3px;
    left: .7rem;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    opacity: 0;
    transform: scaleX(.35);
    transition: opacity .2s ease, transform .2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.mobile-menu {
    display: none;
    width: min(100% - 2rem, 1160px);
    margin-inline: auto;
    padding: .5rem 0 1rem;
}

.mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem .25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--text);
    border-bottom-color: var(--accent-text);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
}

.button-primary,
.button-secondary,
.button-inverse,
.icon-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: .72rem 1.1rem;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1;
    letter-spacing: .01em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.button-primary i,
.button-secondary i,
.button-inverse i {
    transition: transform .2s ease;
}

.button-primary {
    border-color: var(--accent-text);
    background: linear-gradient(135deg, var(--accent), #72ffab);
    color: var(--on-accent);
}

.button-primary:hover {
    border-color: #8affb9;
    background: linear-gradient(135deg, #72ffab, var(--accent));
    box-shadow: 0 12px 32px rgba(0, 255, 102, .25);
    transform: translateY(-2px);
}

.button-primary:hover i.fa-arrow-right,
.button-inverse:hover i.fa-arrow-right {
    transform: translateX(3px);
}

.button-secondary {
    border: 2px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    backdrop-filter: blur(8px);
}

.button-secondary:hover {
    border-color: rgba(0, 255, 102, .55);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .07);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
    transform: translateY(-2px);
}

.button-inverse {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--text);
}

.button-inverse:hover {
    border-color: #27272a;
    background: #18181b;
    color: var(--accent-text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
    transform: translateY(-2px);
}

.icon-button {
    width: 44px;
    padding: 0;
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
}

.icon-button:hover {
    border-color: var(--accent-text);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .06);
}

.section-eyebrow {
    margin: 0 0 .8rem;
    color: var(--accent-soft);
    font: 600 var(--text-xs)/1.5 'JetBrains Mono', monospace;
    letter-spacing: .04em;
}

.section-eyebrow-dark {
    color: var(--on-accent);
}

.page-hero {
    padding: clamp(5rem, 12vw, 9rem) 0 5rem;
    border-bottom: 1px solid var(--line);
}

.page-hero.compact {
    padding-block: 6rem 4rem;
}

.page-hero h1,
.hero-section h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(2.7rem, 7vw, 5.8rem);
    line-height: .98;
    letter-spacing: 0;
}

.page-hero h1 em,
.hero-section h1 em {
    color: var(--accent-text);
    font-style: normal;
}

.page-hero p:not(.section-eyebrow) {
    max-width: 650px;
    margin: 1.5rem 0 0;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.page-section {
    padding: clamp(4.5rem, 9vw, 7.5rem) 0;
}

.section-panel {
    border-block: 1px solid rgba(255, 255, 255, .07);
    background: rgba(255, 255, 255, .018);
}

.section-heading {
    display: flex;
    justify-content: flex-start;
    align-items: end;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.section-heading .text-link {
    margin-left: 0;
}

.section-heading h2,
.about-intro h2,
.timeline-layout h2,
.contact-layout h2,
.global-cta h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
}

.section-heading .muted-copy {
    max-width: 360px;
    margin: 0;
}

.text-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem 0;
    color: var(--accent-soft);
    font-size: var(--text-md);
    font-weight: 700;
}

.text-link::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: currentColor;
    opacity: .45;
    transform-origin: left;
    transition: transform .2s ease, opacity .2s ease;
}

.text-link i {
    font-size: .75rem;
    transition: transform .2s ease;
}

.text-link:hover {
    color: var(--accent-text);
}

.text-link:hover::after {
    opacity: 1;
    transform: scaleX(.72);
}

.text-link:hover i {
    transform: translateX(4px);
}

.muted-copy {
    color: var(--muted);
    line-height: 1.7;
}

.large-copy {
    color: #d4d4d8;
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    line-height: 1.6;
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: clamp(5rem, 13vw, 9rem) 0 4rem;
    border-bottom: 1px solid var(--line);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 7rem);
}

.hero-kicker {
    color: var(--accent-soft);
    font-size: var(--text-sm);
}

.hero-lead {
    max-width: 650px;
    margin: 1.5rem 0 0;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.75;
}

.availability-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1rem;
    border: 1px solid rgba(0, 255, 102, .25);
    padding: .45rem .7rem;
    color: var(--accent-soft);
    font: var(--text-sm) 'JetBrains Mono', monospace;
}

.availability-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem;
}

.hero-console {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 22px 24px 0 rgba(0, 255, 102, .06), 0 24px 70px rgba(0, 0, 0, .3);
    transform: perspective(900px) rotateY(-8deg) rotateX(3deg);
}

.console-bar {
    display: flex;
    align-items: center;
    gap: .4rem;
    border-bottom: 1px solid var(--line);
    padding: .75rem 1rem;
    color: var(--subtle);
    font: .7rem 'JetBrains Mono', monospace;
}

.console-bar span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .7;
}

.console-bar span:nth-child(2) {
    opacity: .45;
}

.console-bar span:nth-child(3) {
    opacity: .2;
}

.console-bar b {
    margin-left: auto;
    font-weight: 400;
}

.hero-console pre {
    margin: 0;
    padding: 1.5rem;
    overflow: auto;
    color: #a7f3d0;
    font: .78rem/1.8 'JetBrains Mono', monospace;
}

.hero-console pre span {
    color: #67e8f9;
}

.hero-console pre b {
    color: var(--accent-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 4rem;
}

.stat-card {
    min-height: 105px;
    border: 1px solid var(--line);
    border-left-color: rgba(0, 255, 102, .65);
    background: var(--surface-soft);
    padding: 1rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
}

.stat-card span {
    color: var(--muted);
    font: var(--text-sm) 'JetBrains Mono', monospace;
    line-height: 1.5;
}

.hero-orbit {
    position: absolute;
    border: 1px solid rgba(0, 255, 102, .16);
    border-radius: 50%;
    pointer-events: none;
}

.hero-orbit-one {
    width: min(58vw, 720px);
    height: min(58vw, 720px);
    right: -12%;
    top: -22%;
    transform: rotateX(68deg) rotateZ(-18deg);
    animation: orbit 18s linear infinite;
}

.hero-orbit-two {
    width: min(38vw, 470px);
    height: min(38vw, 470px);
    right: 5%;
    top: 8%;
    transform: rotateX(68deg) rotateZ(35deg);
    animation: orbitReverse 14s linear infinite;
}

@keyframes orbit {
    to {
        transform: rotateX(68deg) rotateZ(342deg);
    }
}

@keyframes orbitReverse {
    to {
        transform: rotateX(68deg) rotateZ(-325deg);
    }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.content-card {
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    transform-style: preserve-3d;
    transition: border-color .3s, background-color .3s, box-shadow .3s;
}

.card-grid .content-card {
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    border-color: rgba(0, 255, 102, .62);
    background: rgba(255, 255, 255, .055);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .28), 0 0 24px rgba(0, 255, 102, .16);
}

.card-visual {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(0, 255, 102, .12), rgba(255, 255, 255, .025));
    color: var(--accent-text);
    font-size: 2.2rem;
}

.card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-visual span {
    position: absolute;
    left: .75rem;
    bottom: .75rem;
    border: 1px solid rgba(0, 255, 102, .35);
    background: rgba(10, 10, 12, .85);
    padding: .35rem .5rem;
    color: var(--accent-soft);
    font: var(--text-xs) 'JetBrains Mono', monospace;
}

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem;
}

.card-label {
    margin: 0 0 .5rem;
    color: var(--accent-soft);
    font: var(--text-xs) 'JetBrains Mono', monospace;
}

.card-body h2,
.card-body h3 {
    margin: 0;
    font-size: var(--text-xl);
}

.card-body>p:not(.card-label):not(.tech-stack) {
    min-height: 4.8em;
    color: var(--muted);
    line-height: 1.6;
}

.services-grid,
.testimonials-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card .card-body {
    min-height: 12rem;
}

.service-icon {
    display: inline-grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(0, 255, 102, .35);
    color: var(--accent-text);
    font-size: 1.1rem;
}

.service-card h3 {
    margin-bottom: .75rem;
}

.testimonial-card blockquote {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.7;
}

.testimonial-card footer {
    display: grid;
    gap: .2rem;
    margin-top: 1.5rem;
    color: var(--muted);
}

.testimonial-card footer strong {
    color: var(--accent-soft);
}

.testimonial-logo {
    display: block;
    width: auto;
    max-width: 9rem;
    max-height: 2.75rem;
    margin-bottom: 1.25rem;
    object-fit: contain;
}

.tech-stack {
    color: var(--accent-soft);
    font-size: var(--text-xs);
    line-height: 1.6;
}

.card-actions,
.card-footer,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: 1.25rem;
}

.card-footer {
    justify-content: space-between;
}

.tech-badge,
.card-action-label {
    color: var(--muted);
    font: var(--text-sm) 'JetBrains Mono', monospace;
    line-height: 1.5;
}

.project-card,
.course-card {
    content-visibility: auto;
    contain-intrinsic-size: 520px;
}

.project-card.targeted,
.course-card.targeted {
    animation: targetPulse 1.2s ease-in-out 3;
    border-color: var(--accent-text);
}

@keyframes targetPulse {
    50% {
        box-shadow: 0 0 0 8px rgba(0, 255, 102, .12), 0 0 35px rgba(0, 255, 102, .3);
    }
}

.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.filter-button {
    border: 1px solid var(--line);
    background: transparent;
    padding: .65rem .8rem;
    color: var(--muted);
    font: .75rem 'JetBrains Mono', monospace;
}

.filter-button:hover,
.filter-button.active {
    border-color: var(--accent-text);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .06);
}

.search-control {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: min(100%, 280px);
    border: 1px solid var(--line);
    padding: .65rem .8rem;
    color: var(--subtle);
}

.search-control:focus-within {
    border-color: var(--accent-text);
}

.search-control input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.results-count {
    margin: 1rem 0;
    color: var(--subtle);
    font-size: .72rem;
}

.empty-state {
    border: 1px solid var(--line);
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.empty-state i {
    color: var(--accent-text);
    font-size: 1.5rem;
}

.empty-state h2 {
    color: var(--text);
}

.about-intro,
.split-feature,
.contact-layout,
.timeline-layout {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr);
    gap: clamp(2rem, 8vw, 7rem);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.skill-item {
    border: 1px solid var(--line);
    padding: 1rem;
    background: var(--panel-soft);
}

.skill-item>div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.skill-item h3 {
    margin: .55rem 0 0;
}

.skill-item strong {
    color: var(--accent-text);
    font: 700 1.5rem 'JetBrains Mono', monospace;
}

.skill-item strong small {
    font-size: .7rem;
}

.tech-badge {
    display: inline-block;
    border: 1px solid rgba(0, 255, 102, .25);
    padding: .25rem .4rem;
    color: var(--accent-soft);
}

.skill-track {
    height: 4px;
    margin-top: 1rem;
    background: rgba(255, 255, 255, .09);
}

.skill-track span {
    display: block;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(0, 255, 102, .45);
}

.timeline {
    border-left: 1px solid rgba(0, 255, 102, .35);
    padding-left: 1.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.4rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.85rem;
    top: .25rem;
    width: 9px;
    height: 9px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.timeline-date {
    color: var(--accent-soft);
    font-size: .75rem;
}

.timeline-item h3 {
    margin: .45rem 0;
    font-size: 1.35rem;
}

.accent-text {
    color: var(--accent-soft);
}

.principle-list,
.brief-list {
    display: grid;
    gap: .75rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.principle-list li,
.brief-list li {
    display: flex;
    gap: .8rem;
    border-bottom: 1px solid var(--line);
    padding: .8rem 0;
    color: var(--muted);
}

.principle-list span,
.brief-list i {
    color: var(--accent-text);
    font-family: 'JetBrains Mono', monospace;
}

.contact-list {
    display: grid;
    gap: .7rem;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    border-bottom: 1px solid var(--line);
    padding: .8rem 0;
}

.contact-item>span:nth-child(2) {
    display: grid;
    gap: .2rem;
    flex: 1;
}

.contact-item small {
    color: var(--subtle);
    font: .65rem 'JetBrains Mono', monospace;
}

.contact-item strong {
    font-size: .95rem;
}

.contact-panel {
    border: 1px solid rgba(0, 255, 102, .28);
    background: rgba(0, 255, 102, .045);
    padding: clamp(1.4rem, 4vw, 2.5rem);
}

.contact-panel h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.global-cta {
    padding: 4rem 0;
    background: var(--accent);
    color: var(--on-accent);
}

.global-cta-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.global-cta p:not(.section-eyebrow) {
    max-width: 560px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.5rem 0 1.25rem;
    background: rgba(10, 10, 12, .9);
}

.footer-inner,
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-inner p,
.footer-bottom {
    color: var(--subtle);
    font-size: .8rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: .5rem;
    padding: .48rem .72rem;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

.footer-links a i {
    color: var(--accent-soft);
    font-size: .88rem;
}

.footer-links a:hover {
    border-color: rgba(0, 255, 102, .35);
    color: var(--text);
    background: rgba(0, 255, 102, .055);
    transform: translateY(-2px);
}

.footer-bottom a {
    display: inline-flex;
    align-items: center;
    padding: .35rem .55rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 600;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.footer-bottom a:hover {
    color: var(--accent-text);
    background: rgba(0, 255, 102, .06);
}

.scroll-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 80;
    height: 3px;
    pointer-events: none;
}

.scroll-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(0, 255, 102, .8);
}

.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 4.75rem;
    z-index: 45;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(0, 255, 102, .65);
    border-radius: var(--radius-md);
    background: var(--panel);
    color: var(--accent-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 70;
    max-width: calc(100vw - 2.5rem);
    border: 1px solid rgba(0, 255, 102, .45);
    background: var(--panel);
    padding: .75rem 1rem;
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-panel {
    position: relative;
    width: min(100%, 820px);
    max-height: min(88vh, 760px);
    overflow-y: auto;
    border: 1px solid rgba(0, 255, 102, .4);
    background: #111216;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .65);
    transform: translateY(28px) scale(.97);
    transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}

.modal-backdrop.open .modal-panel {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: rgba(10, 10, 12, .85);
    color: var(--text);
}

.modal-close:hover {
    color: var(--accent-text);
    border-color: var(--accent-text);
}

.detail-layout {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border: 1px solid var(--line);
}

.detail-placeholder {
    display: grid;
    place-items: center;
    background: rgba(0, 255, 102, .07);
    color: var(--accent-text);
    font-size: 3rem;
}

.detail-copy {
    padding: 1rem 0;
}

.detail-copy h2 {
    margin: 0 0 1rem;
    padding-right: 2rem;
    font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.detail-copy>p {
    color: var(--muted);
    line-height: 1.75;
}

.video-frame {
    aspect-ratio: 16/9;
    background: #050506;
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-unavailable {
    display: grid;
    place-items: center;
    align-content: center;
    gap: .5rem;
    color: var(--muted);
    text-align: center;
}

.video-unavailable i {
    color: var(--accent-text);
    font-size: 1.8rem;
}

.course-detail {
    padding: 1.5rem;
}

.course-detail .detail-copy {
    padding-bottom: 0;
}

.course-playlist {
    display: grid;
    gap: .5rem;
    margin-top: 1.25rem;
}

.playlist-item {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: .6rem;
    align-items: center;
    border: 1px solid var(--line);
    background: transparent;
    padding: .7rem;
    color: var(--muted);
    text-align: left;
}

.playlist-item:hover,
.playlist-item.active {
    border-color: var(--accent-text);
    background: rgba(0, 255, 102, .06);
    color: var(--text);
}

.playlist-item span {
    color: var(--accent-text);
}

.playlist-item small {
    color: var(--subtle);
}

/* Where a locked paid course sends a buyer: claim it into an account, or sign
   in if they already have one. */
.course-access-options {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.course-access-options .button-primary,
.course-access-options .button-secondary {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
}

/* The older device-bound unlock, kept working but demoted behind a disclosure
   so the account route is the obvious one. */
.redeem-fallback {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.redeem-fallback>summary {
    cursor: pointer;
    color: var(--muted);
    font-size: var(--text-sm);
}

.redeem-fallback>summary:hover {
    color: var(--accent-text, var(--accent));
}

.redeem-form {
    margin-top: 1.5rem;
    padding: 1.1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.redeem-form label {
    display: block;
    margin: 0 0 .5rem;
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.redeem-row {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.redeem-row .redeem-input {
    flex: 1 1 240px;
    min-width: 0;
}

.redeem-input {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    padding: .72rem .9rem;
    font-size: 1rem;
    letter-spacing: .06em;
}

.redeem-input:focus {
    outline: none;
    border-color: var(--accent-text);
    box-shadow: 0 0 0 3px rgba(0, 255, 102, .12);
}

.redeem-input:disabled {
    opacity: .6;
}

.redeem-error {
    margin: .75rem 0 0;
    color: #f87171;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.redeem-hint {
    margin: .75rem 0 0;
    color: var(--subtle);
    font-size: var(--text-sm);
    line-height: 1.6;
}

[data-reveal] {
    transform-style: preserve-3d;
    transform-origin: center top;
}

html:not(.has-gsap) [data-reveal] {
    opacity: 0;
    transform: translateY(22px) rotateX(10deg) scale(.95);
    transition: opacity .7s, transform .7s cubic-bezier(.2, .7, .2, 1);
}

html:not(.has-gsap) [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 767px) {

    .content-shell,
    .site-nav {
        width: min(100% - 1.5rem, 1160px);
    }

    .desktop-navigation,
    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .mobile-menu:not([hidden]) {
        display: block;
    }

    .hero-layout,
    .about-intro,
    .split-feature,
    .contact-layout,
    .timeline-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-console {
        transform: none;
    }

    .stats-grid,
    .card-grid,
    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section-heading,
    .global-cta-inner,
    .footer-inner,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-control {
        width: 100%;
    }

    .stats-grid {
        gap: .65rem;
    }

    .stat-card {
        min-height: 90px;
        padding: .75rem;
    }

    .stat-card strong {
        font-size: 1.5rem;
    }

    .detail-layout,
    .course-detail {
        padding: 1rem;
    }

    .modal-panel {
        max-height: 92vh;
    }

    .card-body>p:not(.card-label):not(.tech-stack) {
        min-height: 0;
    }
}

@media (max-width: 480px) {

    .stats-grid,
    .card-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .hero-actions>*,
    .detail-actions>* {
        width: 100%;
    }

    .icon-button {
        width: 44px;
    }

    .detail-actions .icon-button {
        width: 44px;
    }

    .page-hero h1,
    .hero-section h1 {
        font-size: 2.8rem;
    }
}

/* Responsive hardening for phones and touch-first tablets. */
@media (max-width: 767px) {
    html {
        scroll-padding-top: 72px;
    }

    body {
        min-width: 0;
    }

    img,
    iframe,
    pre {
        max-width: 100%;
    }

    p,
    h1,
    h2,
    h3,
    a,
    strong,
    small,
    .mono,
    .tech-stack {
        overflow-wrap: anywhere;
    }

    .site-nav {
        min-height: 64px;
        gap: .75rem;
    }

    .site-brand {
        min-width: 0;
        gap: .5rem;
        font-size: .95rem;
    }

    .site-brand .brand-name {
        flex: 1 1 auto;
        line-height: 1.2;
        white-space: nowrap;
    }

    .site-brand>span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
    }

    .header-actions {
        margin-left: auto;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .mobile-menu {
        width: min(100% - 1.5rem, 1160px);
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .mobile-nav-link {
        min-height: 48px;
        padding-inline: .35rem;
    }

    .hero-section {
        padding: clamp(3.75rem, 14vw, 5.5rem) 0 3rem;
    }

    .page-hero,
    .page-hero.compact {
        padding: 4.5rem 0 3.25rem;
    }

    .page-section {
        padding: clamp(3.5rem, 12vw, 5rem) 0;
    }

    .page-hero h1,
    .hero-section h1 {
        font-size: clamp(2.35rem, 12vw, 4rem);
        line-height: 1.02;
    }

    .page-hero p:not(.section-eyebrow),
    .hero-lead {
        margin-top: 1.15rem;
        font-size: 1rem;
        line-height: 1.65;
    }

    .availability-pill {
        max-width: 100%;
        align-items: flex-start;
        white-space: normal;
        line-height: 1.5;
    }

    .availability-pill span {
        flex: 0 0 7px;
        margin-top: .25rem;
    }

    .hero-layout {
        gap: 2.5rem;
    }

    .hero-console {
        min-width: 0;
        box-shadow: 10px 12px 0 rgba(0, 255, 102, .05), 0 18px 50px rgba(0, 0, 0, .28);
    }

    .console-bar {
        min-width: 0;
        padding-inline: .8rem;
    }

    .console-bar b {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero-console pre {
        width: 100%;
        padding: 1rem;
        font-size: var(--text-xs);
        line-height: 1.7;
        overscroll-behavior-inline: contain;
    }

    .hero-orbit {
        display: none;
    }

    .section-heading {
        gap: .75rem;
        margin-bottom: 1.75rem;
    }

    .section-heading h2,
    .about-intro h2,
    .timeline-layout h2,
    .contact-layout h2,
    .global-cta h2 {
        font-size: clamp(1.75rem, 8vw, 2.35rem);
    }

    .section-heading .muted-copy {
        max-width: none;
    }

    .card-grid,
    .services-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 1rem;
    }

    .card-body h2,
    .card-body h3 {
        font-size: var(--text-lg);
    }

    .card-footer {
        align-items: flex-start;
    }

    .card-actions,
    .card-footer,
    .detail-actions {
        gap: .65rem;
    }

    .filter-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-button {
        min-height: 44px;
    }

    .detail-layout {
        gap: .75rem;
    }

    .detail-copy {
        min-width: 0;
        padding: .25rem 0;
    }

    .detail-copy h2 {
        padding-right: 2.75rem;
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }

    .modal-backdrop {
        align-items: end;
        padding: max(.5rem, env(safe-area-inset-top)) .5rem max(.5rem, env(safe-area-inset-bottom));
    }

    .modal-panel {
        width: 100%;
        max-height: calc(100dvh - max(1rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
        overscroll-behavior: contain;
    }

    .modal-close {
        position: sticky;
        float: right;
        top: .5rem;
        right: .5rem;
        margin: .5rem .5rem -3rem 0;
    }

    .video-frame {
        clear: both;
    }

    .playlist-item {
        grid-template-columns: 1.75rem minmax(0, 1fr);
        align-items: start;
    }

    .playlist-item small {
        grid-column: 2;
        justify-self: start;
    }

    .global-cta {
        padding: 3rem 0;
    }

    .global-cta-inner>.button-inverse {
        width: 100%;
    }

    .footer-links {
        row-gap: .75rem;
    }

    .back-to-top {
        right: .75rem;
        bottom: calc(4.25rem + env(safe-area-inset-bottom));
    }

    .toast {
        right: .75rem;
        bottom: calc(3.75rem + env(safe-area-inset-bottom));
        max-width: calc(100vw - 1.5rem);
    }
}

@media (max-width: 560px) {

    .content-shell,
    .site-nav,
    .mobile-menu {
        width: min(100% - 1.25rem, 1160px);
    }

    .stats-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        margin-top: 2.5rem;
    }

    .stat-card {
        min-height: 84px;
    }

    .hero-actions,
    .hero-actions>*,
    .detail-actions> :not(.icon-button) {
        width: 100%;
    }

    .card-footer {
        flex-direction: column;
    }

    .card-footer> :not(.icon-button),
    .card-actions> :not(.icon-button) {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .site-brand .brand-name {
        max-width: 180px;
    }

    .page-hero h1,
    .hero-section h1 {
        font-size: 2.2rem;
    }

    .filter-buttons {
        grid-template-columns: 1fr;
    }

    .hero-console pre {
        font-size: var(--text-xs);
    }
}

@media (hover: none),
(pointer: coarse) {
    .content-card {
        transform: none !important;
    }

    .content-card:hover {
        box-shadow: none;
    }
}

/* Advanced floating glass navigation. */
.site-header {
    top: .85rem;
    width: min(100% - 2rem, 1210px);
    margin-inline: auto;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    perspective: 1000px;
}

.site-nav {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 68px;
    padding: .65rem .7rem .65rem 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(22, 24, 29, .88), rgba(10, 10, 12, .72));
    box-shadow: 0 18px 55px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .09);
    backdrop-filter: blur(24px) saturate(150%);
}

.site-nav::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -1px;
    background: linear-gradient(110deg, transparent 8%, rgba(0, 255, 102, .18) 32%, transparent 52%, rgba(103, 232, 249, .12) 72%, transparent 92%);
    opacity: .7;
    pointer-events: none;
}

.site-nav::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 220px;
    height: 100px;
    right: -50px;
    top: -70px;
    border-radius: 50%;
    background: rgba(0, 255, 102, .12);
    filter: blur(35px);
    pointer-events: none;
}

.site-nav>* {
    position: relative;
    z-index: 1;
}

.site-header.is-scrolled .site-nav {
    border-color: rgba(0, 255, 102, .34);
    background: linear-gradient(135deg, rgba(17, 18, 22, .96), rgba(7, 8, 9, .92));
    box-shadow: 0 20px 60px rgba(0, 0, 0, .46), 0 0 32px rgba(0, 255, 102, .07), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.site-brand {
    gap: .7rem;
    letter-spacing: 0;
}

.site-brand .brand-name {
    font-weight: 800;
    text-shadow: none;
}

.brand-mark {
    position: relative;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 102, .6);
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(0, 255, 102, .16), rgba(0, 255, 102, .02));
    box-shadow: inset 0 0 18px rgba(0, 255, 102, .08), 0 0 18px rgba(0, 255, 102, .08);
}

.desktop-navigation {
    gap: .2rem;
    padding: .3rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .025);
}

.nav-link {
    padding: .62rem .8rem;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
}

.nav-link::after {
    left: 50%;
    right: 50%;
    bottom: .3rem;
    height: 2px;
    border-radius: 99px;
}

.nav-link:hover::after,
.nav-link.active::after {
    left: .8rem;
    right: .8rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .04);
}

.nav-link.active {
    color: var(--accent-text);
    background: transparent;
    box-shadow: none;
}

.header-cta {
    min-height: 46px;
    padding-inline: 1.1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 25px rgba(0, 255, 102, .16);
}

.menu-toggle {
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .035);
}

.menu-toggle[aria-expanded='true'] {
    border-color: var(--accent-text);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .08);
    box-shadow: 0 0 20px rgba(0, 255, 102, .12);
}

.notif-toggle[hidden] {
    display: none;
}

.notif-toggle {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    font-size: 1.05rem;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.notif-toggle:hover {
    border-color: var(--accent-text);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .08);
    transform: translateY(-1px);
}

.notif-toggle[aria-pressed='true'] {
    border-color: var(--accent-text);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .1);
    box-shadow: 0 0 18px rgba(0, 255, 102, .18);
}

.theme-light .notif-toggle {
    border-color: rgba(0, 0, 0, .12);
    background: rgba(0, 0, 0, .035);
    color: var(--text);
}

.theme-light .notif-toggle:hover,
.theme-light .notif-toggle[aria-pressed='true'] {
    border-color: var(--accent-text);
    color: var(--accent-text);
}

.mobile-menu {
    width: 100%;
    margin-top: .6rem;
    padding: .55rem;
    border: 1px solid rgba(0, 255, 102, .2);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(19, 21, 25, .97), rgba(9, 10, 12, .96));
    box-shadow: 0 22px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(24px) saturate(150%);
}

.mobile-nav-link {
    min-height: 48px;
    padding: .8rem .9rem;
    border: 0;
    border-radius: var(--radius-md);
}

.mobile-nav-link+.mobile-nav-link {
    margin-top: .2rem;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    border: 0;
    color: var(--accent-text);
    background: rgba(0, 255, 102, .07);
}

.mobile-nav-link i {
    transform: none;
}

@media (max-width: 960px) and (min-width: 768px) {
    .site-nav {
        gap: .7rem;
    }

    .desktop-navigation {
        gap: 0;
    }

    .nav-link {
        padding-inline: .55rem;
        font-size: var(--text-xs);
    }

    .header-cta span {
        display: none;
    }

    .header-cta {
        width: 46px;
        padding: 0;
    }
}

@media (max-width: 767px) {
    .site-header {
        top: .5rem;
        width: min(100% - 1rem, 1210px);
    }

    .site-nav,
    .site-header.is-scrolled .site-nav {
        min-height: 60px;
        padding: .55rem .6rem .55rem .7rem;
        border-radius: var(--radius-xl);
        transform: none;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: var(--radius-md);
    }

    .mobile-menu {
        margin-top: .5rem;
        border-radius: var(--radius-xl);
    }
}

/* Error pages */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 75% 35%, rgba(0, 255, 102, .1), transparent 28%),
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: auto, 42px 42px, 42px 42px;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .65) 70%, transparent 100%);
}

.error-header {
    border-bottom: 1px solid var(--line);
    background: rgba(10, 10, 12, .72);
    backdrop-filter: blur(16px);
}

.error-header-inner,
.error-footer-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.error-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.error-nav a {
    position: relative;
    padding: .45rem 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}

.error-nav a::after {
    content: '';
    position: absolute;
    right: 100%;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    transition: right .2s ease;
}

.error-nav a:hover,
.error-nav a:focus-visible {
    color: var(--text);
}

.error-nav a:hover::after,
.error-nav a:focus-visible::after {
    right: 0;
}

.error-status-pill {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
    font: 600 .72rem 'JetBrains Mono', monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.error-status-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 15px rgba(0, 255, 102, .8);
}

.error-main {
    flex: 1;
    display: grid;
    align-items: center;
    padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.error-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
    align-items: center;
    gap: clamp(2.5rem, 7vw, 7rem);
}

.error-kicker {
    margin: 0 0 1.2rem;
    color: var(--accent-text);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .16em;
}

.error-copy h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(3rem, 7vw, 6.8rem);
    line-height: .94;
    letter-spacing: -.065em;
}

.error-message {
    max-width: 650px;
    margin: 1.6rem 0 0;
    color: var(--text);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.65;
}

.error-hint {
    max-width: 590px;
    margin: .75rem 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem;
}

.error-actions .button-primary,
.error-actions .button-secondary {
    min-width: 156px;
    min-height: 50px;
    padding-inline: 1.2rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

.error-actions .button-primary {
    box-shadow: 0 12px 32px rgba(0, 255, 102, .14);
}

.error-actions .button-primary:hover,
.error-actions .button-secondary:hover {
    transform: translateY(-2px);
}

.error-actions .button-primary i,
.error-actions .button-secondary i {
    width: 1rem;
    text-align: center;
    transition: transform .2s ease;
}

.error-actions .button-primary:hover i {
    transform: translateY(-1px);
}

.error-actions .button-secondary:hover i.fa-arrow-right {
    transform: translateX(3px);
}

.error-actions .button-secondary:hover i.fa-rotate-right {
    transform: rotate(35deg);
}

.error-console {
    overflow: hidden;
    border: 1px solid rgba(0, 255, 102, .25);
    background: rgba(17, 18, 22, .88);
    box-shadow: 0 32px 90px rgba(0, 0, 0, .5), 0 0 50px rgba(0, 255, 102, .05);
}

.error-console .console-bar {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 46px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
}

.error-console .console-bar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3f3f46;
}

.error-console .console-bar span:first-child {
    background: #ef4444;
}

.error-console .console-bar span:nth-child(2) {
    background: #f59e0b;
}

.error-console .console-bar span:nth-child(3) {
    background: var(--accent);
}

.error-console .console-bar b {
    margin-left: .5rem;
    color: var(--muted);
    font: 500 .72rem 'JetBrains Mono', monospace;
}

.error-console-body {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.error-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 255, 102, .35);
    color: var(--accent-text);
    font-size: 1.55rem;
    box-shadow: inset 0 0 30px rgba(0, 255, 102, .07);
}

.error-console pre {
    overflow-x: auto;
    margin: 0;
    color: var(--muted);
    font: 500 clamp(.72rem, 1.5vw, .88rem)/1.9 'JetBrains Mono', monospace;
}

.error-console code span,
.error-console code b {
    color: var(--accent-text);
}

.error-footer {
    border-top: 1px solid var(--line);
    color: var(--subtle);
    font-size: .82rem;
}

.error-report-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 600;
}

.error-report-link span {
    color: var(--subtle);
    font-weight: 400;
}

.error-report-link i {
    color: var(--accent-text);
    font-size: .72rem;
    transition: transform .2s ease;
}

.error-report-link:hover {
    border-color: rgba(0, 255, 102, .38);
    color: var(--accent-text);
    background: rgba(0, 255, 102, .05);
}

.error-report-link:hover i {
    transform: translate(2px, -2px);
}

@media (max-width: 820px) {
    .error-layout {
        grid-template-columns: 1fr;
    }

    .error-console {
        max-width: 560px;
    }
}

@media (max-width: 680px) {
    .error-nav {
        display: none;
    }

    .error-status-pill {
        margin-left: auto;
    }
}

@media (max-width: 520px) {

    .error-header-inner,
    .error-footer-inner {
        min-height: 66px;
    }

    .error-status-pill {
        font-size: .62rem;
    }

    .error-status-pill span {
        display: none;
    }

    .error-copy h1 {
        font-size: clamp(2.8rem, 15vw, 4.5rem);
    }

    .error-actions,
    .error-actions a,
    .error-actions button {
        width: 100%;
    }

    .error-actions .button-primary,
    .error-actions .button-secondary {
        min-height: 52px;
    }

    .error-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding-block: 1rem;
    }
}

/* Blog, search, and shared feature controls. */
.site-search-form {
    display: flex;
    align-items: center;
    gap: .75rem;
    max-width: 760px;
    margin-top: 2rem;
}

.search-control-large {
    flex: 1;
    min-height: 52px;
}

.blog-card .card-visual {
    min-height: 190px;
}

.article-shell {
    max-width: 840px;
}

.article-shell h1 {
    max-width: 780px;
    margin: .6rem 0 1.25rem;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    letter-spacing: -.06em;
    line-height: .98;
}

.article-lead {
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.65;
}

.article-cover {
    display: block;
    width: 100%;
    max-height: 520px;
    margin: 2.25rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    object-fit: cover;
}

.article-content {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.85;
    white-space: normal;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.search-results-group+.search-results-group {
    margin-top: 3rem;
}

.search-results-list {
    display: grid;
    gap: .75rem;
}

.search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel-soft);
}

.search-result:hover {
    border-color: rgba(0, 255, 102, .42);
    background: rgba(0, 255, 102, .05);
    transform: translateX(4px);
}

.search-result>span {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

.search-result small {
    color: var(--accent-text);
    font: 600 .68rem 'JetBrains Mono', monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.search-result strong {
    font-size: 1.05rem;
}

.search-result>span>span {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result>i {
    flex: 0 0 auto;
    color: var(--accent-text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 2.5rem;
    color: var(--muted);
    font-size: .85rem;
}

.back-link:hover {
    color: var(--accent-text);
}

.project-detail-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.project-detail-heading h1 {
    max-width: 850px;
    margin: .35rem 0 0;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.project-gallery-item,
.project-media-video {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-soft);
}

.project-gallery-featured {
    grid-column: 1 / -1;
}

.project-gallery-item img {
    display: block;
    width: 100%;
    max-height: 620px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.project-gallery-item figcaption {
    padding: .75rem 1rem;
    color: var(--muted);
    font-size: .8rem;
}

.project-media-video {
    grid-column: 1 / -1;
}

.project-detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .35fr);
    gap: 3rem;
    max-width: 980px;
}

.project-detail-stack {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
}

.project-detail-actions {
    margin-top: 2rem;
}

/* Work process timeline. */
.process-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.process-step {
    position: relative;
    display: grid;
    gap: 1rem;
    min-height: 13rem;
    padding: 1.35rem;
    border: 1px solid var(--line);
    background: var(--surface);
}

.process-step-marker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--accent-text);
}

.process-step-marker span {
    font-size: .75rem;
    letter-spacing: .08em;
}

.process-step-marker i {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid rgba(0, 255, 102, .3);
    border-radius: 50%;
    background: rgba(0, 255, 102, .06);
}

.process-step h3 {
    margin-bottom: .55rem;
}

.process-step p {
    color: var(--muted);
    line-height: 1.65;
}

/* Shared feature controls. */
.site-announcement {
    position: relative;
    z-index: 5;
    padding: .7rem 1rem;
    border-bottom: 1px solid rgba(0, 255, 102, .18);
    background: rgba(0, 255, 102, .08);
    color: var(--text);
    font-size: var(--text-md);
    text-align: center;
}

.site-announcement .content-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
}

.site-announcement i {
    color: var(--accent-text);
}

.theme-toggle {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 20;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    color: var(--accent-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.theme-toggle:hover {
    border-color: var(--accent-text);
    transform: translateY(-2px);
}

.privacy-banner {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 19;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: min(30rem, calc(100vw - 2rem));
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .3);
    backdrop-filter: blur(18px);
}

.privacy-banner p {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

.site-preloader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--ink);
    opacity: 1;
    visibility: visible;
    transition: opacity .35s ease, visibility .35s ease;
}

.site-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-preloader span {
    width: 2.8rem;
    height: 2.8rem;
    border: 2px solid rgba(0, 255, 102, .18);
    border-top-color: var(--accent-text);
    border-radius: 50%;
    animation: preloader-spin .8s linear infinite;
}

@keyframes preloader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Lightweight loading placeholders for async or progressive content. */
.skeleton {
    position: relative;
    overflow: hidden;
    min-height: 1rem;
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
}

.skeleton::after {
    position: absolute;
    inset: 0;
    content: '';
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
    transform: translateX(-100%);
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    to {
        transform: translateX(100%);
    }
}

html.theme-light {
    color-scheme: light;
    --ink: #f5f7f6;
    --panel: #ffffff;
    --panel-soft: rgba(15, 23, 42, .045);
    --line: rgba(15, 23, 42, .14);
    --text: #111827;
    --muted: #52606d;
    --subtle: #6b7280;
    /* #00ff66 scores ~1.3:1 against this background and #6ee7b7 ~1.6:1 — both
       effectively invisible. These darker greens score ~5.2:1 and ~7.2:1, so
       accent-coloured text and labels stay legible. --accent itself is left
       bright: it is only ever used as a fill, where --on-accent sits on it. */
    --accent-text: #047857;
    --accent-soft: #065f46;
    /* Light surfaces, so card copy is not dark-on-dark. */
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, .78);
    --surface-strong: rgba(255, 255, 255, .92);
}

html.theme-light body::before {
    background-image: linear-gradient(rgba(15, 23, 42, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, .045) 1px, transparent 1px);
}

html.theme-light body::after {
    background: radial-gradient(circle at 75% 20%, rgba(0, 180, 90, .1), transparent 25%), radial-gradient(circle at 10% 70%, rgba(16, 185, 129, .08), transparent 28%);
}

@media (max-width: 980px) {
    .process-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {

    .project-detail-heading,
    .project-detail-content {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
        gap: 1.5rem;
    }

    .project-detail-heading .button-secondary {
        align-self: flex-start;
    }

    .project-detail-stack {
        padding-top: 1.25rem;
        padding-left: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .site-search-form,
    .article-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .site-search-form .button-primary {
        width: 100%;
    }

    .search-result>span>span {
        white-space: normal;
    }

    .privacy-banner {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        max-width: none;
        align-items: stretch;
        flex-direction: column;
        gap: .75rem;
    }

    .privacy-banner .button-primary {
        width: 100%;
    }

    .theme-toggle {
        right: 1rem;
        bottom: 1rem;
    }

    .privacy-banner+.theme-toggle {
        bottom: 8.5rem;
    }
}

@media (max-width: 680px) {
    .process-timeline {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    #bg-3d-canvas {
        display: none;
    }

    .site-preloader span,
    .skeleton::after {
        animation: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}