:root {
    --bg: #070b14;
    --bg-soft: #0b1220;
    --card: rgba(13, 22, 38, 0.78);
    --card-solid: #0e1728;
    --text: #eef6ff;
    --muted: #91a4bd;
    --primary: #38f8b8;
    --primary-2: #52a7ff;
    --warning: #f7c948;
    --border: rgba(129, 232, 255, 0.16);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius: 24px;
    --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Consolas, monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--sans);
    background: radial-gradient(circle at top left, rgba(56, 248, 184, 0.16), transparent 32%),
                radial-gradient(circle at 80% 10%, rgba(82, 167, 255, 0.18), transparent 28%),
                var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

body.light-mode {
    --bg: #eef4fb;
    --bg-soft: #f8fbff;
    --card: rgba(255, 255, 255, 0.86);
    --card-solid: #ffffff;
    --text: #101828;
    --muted: #617089;
    --border: rgba(15, 23, 42, 0.12);
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

body.light-mode .site-grid {
    opacity: 0.28;
}

body.light-mode .terminal-body,
body.light-mode .terminal-footer {
    background: #0c1220;
    color: #eaf6ff;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1160px, 92%);
    margin: 0 auto;
}

.site-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(82, 167, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(82, 167, 255, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
    z-index: -3;
}

.orb {
    position: fixed;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.22;
    pointer-events: none;
    z-index: -2;
}

.orb-one {
    top: 12%;
    left: -130px;
    background: var(--primary);
}

.orb-two {
    right: -140px;
    bottom: 10%;
    background: var(--primary-2);
}


.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
    background: rgba(7, 11, 20, 0.72);
    border-bottom: 1px solid var(--border);
}

body.light-mode .topbar {
    background: rgba(248, 251, 255, 0.76);
}

.nav-container {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.logo-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    color: #06110e;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-family: var(--mono);
    font-size: 0.95rem;
    box-shadow: 0 0 32px rgba(56, 248, 184, 0.24);
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.nav a {
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    transition: 0.2s ease;
}

.nav a:hover {
    color: var(--text);
    background: rgba(56, 248, 184, 0.1);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--shadow);
}


.hero {
    padding: 108px 0 86px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    align-items: center;
    gap: 44px;
}

.eyebrow,
.section-header p,
.card-label,
.period {
    color: var(--primary);
    font-family: var(--mono);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
}

.hero h1 {
    max-width: 860px;
    margin: 12px 0 14px;
    font-size: clamp(3rem, 8vw, 6.8rem);
    line-height: 0.92;
    letter-spacing: -0.08em;
}

.hero h2 {
    color: var(--primary-2);
    font-family: var(--mono);
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    font-weight: 800;
}

.hero-text {
    max-width: 620px;
    margin: 24px 0 32px;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions,
.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-family: var(--mono);
    font-weight: 900;
    letter-spacing: -0.02em;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-3px);
}

.btn.primary {
    color: var(--primary);
    background: rgba(56, 248, 184, 0.06);
    border-color: rgba(56, 248, 184, 0.42);
    box-shadow: inset 0 0 0 1px rgba(56, 248, 184, 0.08), 0 0 28px rgba(56, 248, 184, 0.12);
}

.btn.primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.16), transparent);
    transform: translateX(-110%);
    transition: transform 0.45s ease;
}

.btn.primary:hover {
    color: #eafff8;
    border-color: rgba(56, 248, 184, 0.85);
    background: rgba(56, 248, 184, 0.11);
    box-shadow: 0 0 34px rgba(56, 248, 184, 0.2);
}

.btn.primary:hover::before {
    transform: translateX(110%);
}

.btn-prompt {
    color: var(--primary-2);
}

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


.availability-status {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    padding: 10px 14px;
    border: 1px solid rgba(56, 248, 184, 0.28);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(56, 248, 184, 0.08), rgba(76, 201, 240, 0.06));
    box-shadow: inset 0 0 0 1px rgba(56, 248, 184, 0.05), 0 0 26px rgba(56, 248, 184, 0.08);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.86rem;
}

.availability-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(56, 248, 184, 0.6), 0 0 16px rgba(56, 248, 184, 0.85);
    animation: availabilityPulse 2.1s ease-out infinite;
}

.availability-code {
    color: var(--primary-2);
}

.availability-status strong {
    color: var(--primary);
}

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

@keyframes availabilityPulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 248, 184, 0.55), 0 0 16px rgba(56, 248, 184, 0.85); }
    70% { box-shadow: 0 0 0 8px rgba(56, 248, 184, 0), 0 0 16px rgba(56, 248, 184, 0.85); }
    100% { box-shadow: 0 0 0 0 rgba(56, 248, 184, 0), 0 0 16px rgba(56, 248, 184, 0.85); }
}

.status-row {
    margin-top: 18px;
}

.status-row span {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.92rem;
}

.status-row strong {
    color: var(--text);
}

.terminal-card,
.content-card,
.experience-card,
.project-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.terminal-card::before,
.project-card::before,
.content-card::before,
.experience-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(56, 248, 184, 0.12), transparent 36%, rgba(82, 167, 255, 0.1));
    opacity: 0.7;
}

.terminal-top {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.terminal-top span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--warning);
}

.terminal-top span:first-child {
    background: #ff5f56;
}

.terminal-top span:nth-child(2) {
    background: #ffbd2e;
}

.terminal-top span:nth-child(3) {
    background: #27c93f;
}

.terminal-top p {
    margin-left: 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.terminal-body {
    position: relative;
    padding: 24px;
    font-family: var(--mono);
    overflow-x: auto;
}

.terminal-body pre {
    white-space: pre-wrap;
}

.terminal-body code {
    color: #eaf6ff;
    font-size: clamp(0.82rem, 1.5vw, 0.98rem);
}

.terminal-body .muted {
    color: #8aa4c4;
}

.terminal-body .string {
    color: var(--primary);
}

.terminal-body .boolean {
    color: var(--warning);
}

.terminal-footer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.pulse {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(56, 248, 184, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 10px rgba(56, 248, 184, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 248, 184, 0); }
}


.section {
    padding: 82px 0;
    content-visibility: auto;
    contain-intrinsic-size: 700px;
}

.section-panel {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.two-column {
    display: grid;
    grid-template-columns: 0.42fr 1fr;
    gap: 40px;
    align-items: start;
}

.sticky-title {
    position: sticky;
    top: 100px;
}

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

.section-header.centered {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 36px;
}

.section-header h2 {
    margin-top: 8px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.content-card {
    padding: 30px;
}

.content-card p,
.project-card p,
.experience-card li,
.experience-company,
.contact-box p {
    color: var(--muted);
}


/* Project card scan-line hover animation */
.project-card {
    isolation: isolate;
}

.project-card > *:not(.project-scan):not(.project-scan-label) {
    position: relative;
    z-index: 2;
}

.project-scan {
    position: absolute;
    z-index: 1;
    left: -18%;
    right: -18%;
    top: 0;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.95), rgba(82, 167, 255, 0.85), transparent);
    box-shadow: 0 0 20px rgba(56, 248, 184, 0.65), 0 0 42px rgba(82, 167, 255, 0.35);
    transform: translateY(-18px);
}

.project-card:hover .project-scan {
    opacity: 1;
    animation: projectScanLine 1.15s ease-in-out infinite;
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(180deg, transparent, rgba(56, 248, 184, 0.08), transparent),
        repeating-linear-gradient(180deg, rgba(56, 248, 184, 0.05) 0 1px, transparent 1px 8px);
    transform: translateY(-12px);
    transition: opacity 0.18s ease;
}

.project-card:hover::after {
    opacity: 1;
    animation: projectScanOverlay 1.15s ease-in-out infinite;
}

.project-scan-label {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 3;
    pointer-events: none;
    padding: 5px 9px;
    border: 1px solid rgba(56, 248, 184, 0.26);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(7, 11, 20, 0.72);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.project-card:hover .project-scan-label {
    opacity: 1;
    transform: translateY(0);
}

@keyframes projectScanLine {
    0% { transform: translateY(-18px); opacity: 0; }
    14% { opacity: 1; }
    86% { opacity: 1; }
    100% { transform: translateY(360px); opacity: 0; }
}

@keyframes projectScanOverlay {
    0% { transform: translateY(-18px); }
    100% { transform: translateY(18px); }
}

body.light-mode .project-scan-label {
    background: rgba(255, 255, 255, 0.82);
}

.mini-card h4 {
    color: var(--muted);
}

.code-card {
    font-size: 1.02rem;
}

.card-label {
    margin-bottom: 16px;
}


.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.skill-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 17px 16px;
    background: var(--card);
    font-family: var(--mono);
    font-weight: 900;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
    transition: 0.2s ease;
}

.skill-item:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 248, 184, 0.55);
}

.skill-item span {
    color: var(--primary);
    margin-right: 4px;
}


.experience-list {
    display: grid;
    gap: 18px;
}

.experience-card {
    padding: 28px;
}

.experience-top {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.experience-year,
.experience-duration {
    border-radius: 999px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 900;
    color: var(--primary);
    background: rgba(56, 248, 184, 0.08);
}

.experience-duration {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.experience-card h3,
.project-card h3,
.mini-card h3 {
    position: relative;
    margin-bottom: 8px;
    font-size: 1.25rem;
    line-height: 1.25;
}

.experience-company {
    position: relative;
    font-weight: 800;
    margin-bottom: 12px;
}

.experience-card ul {
    position: relative;
    display: grid;
    gap: 7px;
    padding-left: 1.1rem;
}

.experience-card li::marker {
    color: var(--primary);
}


.projects-grid,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card,
.mini-card {
    padding: 28px;
    transition: 0.2s ease;
}

.project-card:hover,
.mini-card:hover {
    transform: translateY(-5px);
    border-color: rgba(82, 167, 255, 0.42);
}

.project-icon {
    position: relative;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 16px;
    color: #06110e;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-family: var(--mono);
    font-weight: 900;
}

.tag-list {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tag-list span {
    border: 1px solid rgba(56, 248, 184, 0.22);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--primary);
    background: rgba(56, 248, 184, 0.07);
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 800;
}

.project-links {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid rgba(56, 248, 184, 0.3);
    border-radius: 12px;
    color: var(--primary);
    background: rgba(56, 248, 184, 0.07);
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
    transition: 0.2s ease;
}

.project-link:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 248, 184, 0.65);
    background: rgba(56, 248, 184, 0.12);
    box-shadow: 0 0 24px rgba(56, 248, 184, 0.12);
}

.project-link span {
    color: var(--primary-2);
}

.project-link.disabled {
    cursor: not-allowed;
    color: var(--muted);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.project-link.disabled:hover {
    transform: none;
    box-shadow: none;
}

.secondary-link {
    color: var(--muted);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.secondary-link:hover {
    color: var(--text);
    border-color: rgba(82, 167, 255, 0.45);
    background: rgba(82, 167, 255, 0.08);
}



/* Project card scan-line hover animation */
.project-card {
    isolation: isolate;
}

.project-card > *:not(.project-scan):not(.project-scan-label) {
    position: relative;
    z-index: 2;
}

.project-scan {
    position: absolute;
    z-index: 1;
    left: -18%;
    right: -18%;
    top: 0;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.95), rgba(82, 167, 255, 0.85), transparent);
    box-shadow: 0 0 20px rgba(56, 248, 184, 0.65), 0 0 42px rgba(82, 167, 255, 0.35);
    transform: translateY(-18px);
}

.project-card:hover .project-scan {
    opacity: 1;
    animation: projectScanLine 1.15s ease-in-out infinite;
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(180deg, transparent, rgba(56, 248, 184, 0.08), transparent),
        repeating-linear-gradient(180deg, rgba(56, 248, 184, 0.05) 0 1px, transparent 1px 8px);
    transform: translateY(-12px);
    transition: opacity 0.18s ease;
}

.project-card:hover::after {
    opacity: 1;
    animation: projectScanOverlay 1.15s ease-in-out infinite;
}

.project-scan-label {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 3;
    pointer-events: none;
    padding: 5px 9px;
    border: 1px solid rgba(56, 248, 184, 0.26);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(7, 11, 20, 0.72);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.project-card:hover .project-scan-label {
    opacity: 1;
    transform: translateY(0);
}

@keyframes projectScanLine {
    0% { transform: translateY(-18px); opacity: 0; }
    14% { opacity: 1; }
    86% { opacity: 1; }
    100% { transform: translateY(360px); opacity: 0; }
}

@keyframes projectScanOverlay {
    0% { transform: translateY(-18px); }
    100% { transform: translateY(18px); }
}

body.light-mode .project-scan-label {
    background: rgba(255, 255, 255, 0.82);
}

.mini-card h4 {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.period {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}


.contact-section {
    background: linear-gradient(135deg, rgba(56, 248, 184, 0.12), rgba(82, 167, 255, 0.12));
    border-top: 1px solid var(--border);
}

.contact-box {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 36px;
    align-items: center;
}

.contact-box h2 {
    margin: 10px 0 14px;
    font-size: clamp(2.2rem, 5vw, 4.3rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.contact-links {
    display: grid;
    gap: 12px;
}

.contact-links a {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    color: var(--text);
    font-weight: 800;
    word-break: break-word;
    transition: 0.2s ease;
}

.contact-links a:hover {
    transform: translateX(5px);
    border-color: rgba(56, 248, 184, 0.52);
}

.contact-links span {
    flex: 0 0 auto;
    min-width: 54px;
    color: var(--primary);
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.footer {
    padding: 28px 0;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
}

body.light-mode .footer {
    background: rgba(255, 255, 255, 0.62);
}


@media (max-width: 980px) {
    .hero-grid,
    .two-column,
    .contact-box {
        grid-template-columns: 1fr;
    }

    .sticky-title {
        position: static;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .projects-grid,
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav {
        display: none;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 72px 0 58px;
    }

    .section {
        padding: 58px 0;
    }

    .hero-grid {
        gap: 28px;
    }

    .terminal-card {
        min-width: 0;
    }

    .skills-grid,
    .projects-grid,
    .cards-grid {
        grid-template-columns: 1fr;
    }

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

    .contact-links a {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .content-card,
    .experience-card,
    .project-card,
    .mini-card,
    .terminal-body {
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.typewriter-code {
    position: relative;
    display: inline-block;
    min-height: 172px;
    white-space: pre-wrap;
}

.typewriter-code::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 1.1em;
    margin-left: 3px;
    background: var(--primary);
    vertical-align: -0.16em;
    box-shadow: 0 0 14px rgba(56, 248, 184, 0.7);
    animation: cursorBlink 0.82s steps(1) infinite;
}

@keyframes cursorBlink {
    0%, 48% { opacity: 1; }
    49%, 100% { opacity: 0; }
}

@media (max-width: 640px) {
    .typewriter-code {
        min-height: 156px;
    }
}

.typewriter-code.boot-mode {
    color: #cfe5ff;
}

.terminal-card.booting::after {
    content: "";
    position: absolute;
    left: -40%;
    right: -40%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.9), transparent);
    animation: terminalScan 2.8s linear infinite;
}

@keyframes terminalScan {
    0% { transform: translateY(0); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateY(330px); opacity: 0; }
}

.typewriter-code.boot-mode {
    color: #cfe5ff;
}

.terminal-card.booting::after {
    content: "";
    position: absolute;
    left: -40%;
    right: -40%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.9), transparent);
    animation: terminalScan 2.8s linear infinite;
}

@keyframes terminalScan {
    0% { transform: translateY(0); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateY(330px); opacity: 0; }
}


/* Scroll reveal animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    filter: blur(8px);
    transition:
        opacity 0.32s ease,
        transform 0.32s ease,
        filter 0.32s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform, filter;
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.project-card.scroll-reveal,
.skill-item.scroll-reveal,
.experience-card.scroll-reveal,
.mini-card.scroll-reveal {
    transform: translateY(34px) scale(0.97);
}

.project-card.scroll-reveal.is-visible,
.skill-item.scroll-reveal.is-visible,
.experience-card.scroll-reveal.is-visible,
.mini-card.scroll-reveal.is-visible {
    transform: translateY(0) scale(1);
}

.scroll-reveal.is-visible::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.16), transparent);
    transform: translateX(-120%);
    animation: revealScan 0.45s ease forwards;
}

.section-header.scroll-reveal::after,
.skill-item.scroll-reveal::after,
.contact-box.scroll-reveal::after {
    display: none;
}

@keyframes revealScan {
    to { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

.hero-content.scroll-reveal::after {
    display: none;
}


.project-card.scroll-reveal.is-visible::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    background:
        linear-gradient(180deg, transparent, rgba(56, 248, 184, 0.08), transparent),
        repeating-linear-gradient(180deg, rgba(56, 248, 184, 0.05) 0 1px, transparent 1px 8px);
    transform: translateY(-12px);
    animation: none;
    transition: opacity 0.18s ease;
}

.project-card.scroll-reveal.is-visible:hover::after {
    opacity: 1;
    animation: projectScanOverlay 1.15s ease-in-out infinite;
}


/* Animated tech stack */
.stack-chip {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 58px;
    letter-spacing: -0.02em;
}

.stack-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.16), rgba(82, 167, 255, 0.12), transparent),
        repeating-linear-gradient(90deg, transparent 0 12px, rgba(56, 248, 184, 0.045) 12px 13px, transparent 13px 24px);
    transform: translateX(-110%);
    opacity: 0;
}

.stack-chip::after {
    content: "loaded";
    position: absolute;
    top: 7px;
    right: 9px;
    z-index: 2;
    display: block !important;
    color: var(--primary-2);
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.stack-chip.is-visible::before {
    opacity: 1;
    animation: techStackBoot 0.72s ease var(--stack-delay, 0ms) forwards;
}

.stack-chip.is-visible::after {
    animation: techLoadedLabel 0.28s ease calc(var(--stack-delay, 0ms) + 0.42s) forwards;
}

.stack-chip > span {
    position: relative;
    z-index: 2;
}

.tech-led {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 12px rgba(56, 248, 184, 0.7);
    opacity: 0.55;
    animation: techLedBlink 2.1s steps(1) infinite;
}

.skill-hash {
    color: var(--primary);
    margin-right: 0;
}

.skill-name {
    color: var(--text);
}

.stack-chip:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(56, 248, 184, 0.72);
    box-shadow: 0 18px 44px rgba(56, 248, 184, 0.1), inset 0 0 0 1px rgba(56, 248, 184, 0.12);
}

.stack-chip:hover .tech-led {
    opacity: 1;
    animation-duration: 0.55s;
}

.stack-chip:hover::before {
    opacity: 1;
    animation: techStackHoverScan 0.85s ease infinite;
}

@keyframes techStackBoot {
    0% { transform: translateX(-110%); opacity: 0; }
    18% { opacity: 1; }
    100% { transform: translateX(110%); opacity: 0.35; }
}

@keyframes techStackHoverScan {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(110%); }
}

@keyframes techLoadedLabel {
    to { opacity: 0.78; transform: translateY(0); }
}

@keyframes techLedBlink {
    0%, 58% { opacity: 0.45; }
    59%, 100% { opacity: 1; }
}

body.light-mode .stack-chip::after {
    color: #2563eb;
}

@media (prefers-reduced-motion: reduce) {
    .stack-chip::before,
    .stack-chip::after,
    .tech-led {
        animation: none !important;
    }

    .stack-chip::after {
        opacity: 0.78;
        transform: none;
    }
}

/* Command palette / terminal menu */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.command-open {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid rgba(56, 248, 184, 0.32);
    border-radius: 14px;
    background: rgba(56, 248, 184, 0.06);
    color: var(--primary);
    font-family: var(--mono);
    font-weight: 900;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(56, 248, 184, 0.06);
    transition: 0.2s ease;
}

.command-open:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 248, 184, 0.72);
    box-shadow: 0 0 26px rgba(56, 248, 184, 0.14);
}

.command-open kbd {
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--mono);
    font-size: 0.66rem;
}

.command-palette {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: start center;
    padding: 105px 18px 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.command-palette.is-open {
    pointer-events: auto;
    opacity: 1;
}

.command-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 14, 0.72);
    backdrop-filter: blur(12px);
}

.command-shell {
    position: relative;
    width: min(720px, 100%);
    border: 1px solid rgba(56, 248, 184, 0.28);
    border-radius: 22px;
    background: rgba(7, 11, 20, 0.94);
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.52), 0 0 45px rgba(56, 248, 184, 0.12);
    overflow: hidden;
    transform: translateY(-16px) scale(0.98);
    transition: transform 0.18s ease;
}

.command-palette.is-open .command-shell {
    transform: translateY(0) scale(1);
}

.command-shell::after {
    content: "";
    position: absolute;
    left: -25%;
    right: -25%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.9), transparent);
    animation: commandScan 2.2s linear infinite;
    pointer-events: none;
}

.command-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.command-top span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ff5f56;
}

.command-top span:nth-child(2) {
    background: #ffbd2e;
}

.command-top span:nth-child(3) {
    background: #27c93f;
}

.command-top p {
    flex: 1;
    margin-left: 6px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.86rem;
}

.command-top button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.command-body {
    padding: 20px;
}

.command-body label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary);
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.command-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid rgba(56, 248, 184, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.command-input-wrap span {
    color: var(--primary);
    font-family: var(--mono);
    font-weight: 900;
}

.command-input-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: 900 0.98rem var(--mono);
}

.command-input-wrap input::placeholder {
    color: var(--muted);
}

.command-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.command-suggestions button,
.filter-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-family: var(--mono);
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s ease;
}

.command-suggestions button {
    padding: 8px 12px;
}

.command-suggestions button:hover,
.filter-btn:hover,
.filter-btn.active {
    color: var(--primary);
    border-color: rgba(56, 248, 184, 0.58);
    background: rgba(56, 248, 184, 0.08);
    box-shadow: 0 0 22px rgba(56, 248, 184, 0.1);
}

.command-output {
    min-height: 58px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.9rem;
}

.command-output span {
    color: var(--primary);
    font-weight: 900;
}

.command-output strong,
.command-output .success {
    color: var(--primary);
}

.command-output .error {
    color: #ff8a8a;
}

@keyframes commandScan {
    0% { transform: translateY(0); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateY(340px); opacity: 0; }
}

body.light-mode .command-backdrop {
    background: rgba(238, 244, 251, 0.64);
}

body.light-mode .command-shell {
    background: rgba(255, 255, 255, 0.94);
}

/* Project filter */
.project-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: -14px 0 30px;
}

.filter-btn {
    padding: 10px 14px;
}

.project-card.is-hidden {
    display: none;
}

/* Copy email button */
.copy-email-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(56, 248, 184, 0.3);
    border-radius: 16px;
    background: rgba(56, 248, 184, 0.06);
    color: var(--text);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    word-break: break-word;
    transition: 0.2s ease;
    text-align: left;
}

.copy-email-btn:hover {
    transform: translateX(5px);
    border-color: rgba(56, 248, 184, 0.62);
    box-shadow: 0 0 24px rgba(56, 248, 184, 0.1);
}

.copy-email-btn span {
    flex: 0 0 auto;
    min-width: 54px;
    color: var(--primary);
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.copy-email-btn strong {
    font-family: var(--mono);
    color: var(--primary);
}

.copy-email-btn.copied {
    border-color: rgba(56, 248, 184, 0.82);
    background: rgba(56, 248, 184, 0.12);
}

@media (max-width: 980px) {
    .command-open kbd {
        display: none;
    }
}

@media (max-width: 640px) {
    .nav-actions {
        gap: 8px;
    }

    .command-open {
        width: 44px;
        padding: 0;
        justify-content: center;
        font-size: 0;
    }

    .command-open span {
        font-size: 0.9rem;
    }

    .command-palette {
        padding-top: 88px;
    }

    .copy-email-btn {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

/* Live stats counters */
.stats-section {
    padding: 0 0 34px;
    margin-top: -34px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 22px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    isolation: isolate;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(56, 248, 184, 0.12), transparent 44%, rgba(82, 167, 255, 0.09));
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto 18px 16px 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 248, 184, 0.7), transparent);
    opacity: 0.55;
}

.stat-label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.stat-number {
    display: block;
    color: var(--text);
    font-family: var(--mono);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    text-shadow: 0 0 24px rgba(56, 248, 184, 0.16);
}

.stat-card p {
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 248, 184, 0.5);
    box-shadow: 0 22px 60px rgba(56, 248, 184, 0.08);
}

/* VS Code inspired about section */
.vscode-window {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(8, 14, 26, 0.9);
    box-shadow: var(--shadow);
}

body.light-mode .vscode-window {
    background: rgba(255, 255, 255, 0.9);
}

.vscode-titlebar,
.project-modal-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.vscode-titlebar p,
.project-modal-top p {
    flex: 1;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.86rem;
    font-weight: 900;
}

.vscode-dots {
    display: flex;
    gap: 7px;
}

.vscode-dots span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ff5f56;
}

.vscode-dots span:nth-child(2) {
    background: #ffbd2e;
}

.vscode-dots span:nth-child(3) {
    background: #27c93f;
}

.vscode-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}

.vscode-tab {
    padding: 12px 16px;
    border: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s ease;
}

.vscode-tab:hover,
.vscode-tab.active {
    color: var(--primary);
    background: rgba(56, 248, 184, 0.07);
}

.vscode-tab.active {
    box-shadow: inset 0 -2px 0 var(--primary);
}

.vscode-editor {
    padding: 0;
}

.vscode-pane {
    display: none;
    min-height: 280px;
    padding: 24px 28px;
}

.vscode-pane.active {
    display: block;
    animation: codePaneIn 0.22s ease both;
}

.code-lines {
    margin: 0;
    padding-left: 2.4rem;
    color: #d8e8ff;
    font-family: var(--mono);
    font-size: clamp(0.82rem, 1.4vw, 0.95rem);
    line-height: 1.9;
}

body.light-mode .code-lines {
    color: #172033;
}

.code-lines li {
    padding-left: 12px;
}

.code-lines li::marker {
    color: rgba(145, 164, 189, 0.55);
}

.code-muted {
    color: #8aa4c4;
}

.code-keyword {
    color: var(--primary-2);
}

.code-string {
    color: var(--primary);
}

.code-boolean {
    color: var(--warning);
}

@keyframes codePaneIn {
    from { opacity: 0; transform: translateY(8px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Project modal / case study */
body.modal-open {
    overflow: hidden;
}

.project-details-btn {
    cursor: pointer;
    font: inherit;
}

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.project-modal.is-open {
    pointer-events: auto;
    opacity: 1;
}

.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 14, 0.78);
    backdrop-filter: blur(14px);
}

.project-modal-shell {
    position: relative;
    width: min(760px, 100%);
    max-height: min(760px, 92vh);
    overflow: auto;
    border: 1px solid rgba(56, 248, 184, 0.3);
    border-radius: 24px;
    background: rgba(7, 11, 20, 0.96);
    box-shadow: 0 38px 100px rgba(0, 0, 0, 0.58), 0 0 48px rgba(56, 248, 184, 0.12);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.2s ease;
}

.project-modal.is-open .project-modal-shell {
    transform: translateY(0) scale(1);
}

.project-modal-top button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.project-modal-body {
    padding: 28px;
}

.project-modal-body h2 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.modal-description {
    color: var(--muted);
    font-size: 1.02rem;
}

.modal-code-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 24px 0;
}

.modal-code-grid div {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.modal-code-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-code-grid p {
    color: var(--muted);
}

body.light-mode .project-modal-backdrop {
    background: rgba(238, 244, 251, 0.72);
}

body.light-mode .project-modal-shell {
    background: rgba(255, 255, 255, 0.96);
}

@media (max-width: 980px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-section {
        margin-top: 0;
        padding: 18px 0 12px;
    }

    .stats-grid,
    .modal-code-grid {
        grid-template-columns: 1fr;
    }

    .vscode-pane,
    .project-modal-body {
        padding: 20px;
    }

    .code-lines {
        padding-left: 1.5rem;
        font-size: 0.76rem;
    }
}

/* =========================================================
   Performance optimizations
   Designet er bevaret, men tunge effekter bliver billigere
   på svagere enheder eller når fanen ikke er aktiv.
   ========================================================= */
.section,
.stats-section,
.footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 780px;
}

.project-card,
.experience-card,
.content-card,
.vscode-window,
.stat-card,
.skill-item,
.contact-box,
.terminal-card {
    contain: layout paint style;
}

html.page-hidden *,
html.page-hidden *::before,
html.page-hidden *::after {
    animation-play-state: paused !important;
}

html.performance-mode .orb {
    filter: blur(42px);
    opacity: 0.16;
}

html.performance-mode .topbar,
html.performance-mode .command-shell,
html.performance-mode .project-modal-shell {
    backdrop-filter: none;
}

html.performance-mode .site-grid {
    background-size: 58px 58px;
}

html.performance-mode .pulse,
html.performance-mode .skill-item::after {
    animation: none !important;
}

html.performance-mode .terminal-card::after,
html.performance-mode .terminal-card.booting::after {
    animation-duration: 5.5s;
}

html.performance-mode .project-card:hover::after {
    animation-duration: 1.8s;
}

html.performance-mode .skill-item {
    animation-duration: 0.42s;
}

@media (prefers-reduced-motion: reduce) {
    .section,
    .stats-section,
    .footer {
        content-visibility: visible;
        contain-intrinsic-size: auto;
    }
}

/* Project screenshots */
.project-screenshot {
    position: relative;
    z-index: 2;
    overflow: hidden;
    width: 100%;
    height: clamp(128px, 12vw, 158px);
    margin-bottom: 18px;
    border: 1px solid rgba(82, 167, 255, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 0 28px rgba(56, 248, 184, 0.05);
}

.project-screenshot::before {
    content: "preview()";
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 8px;
    border: 1px solid rgba(56, 248, 184, 0.22);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(7, 11, 20, 0.72);
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 900;
}

.project-screenshot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), transparent 42%, rgba(56, 248, 184, 0.05)),
        repeating-linear-gradient(180deg, rgba(56, 248, 184, 0.025) 0 1px, transparent 1px 9px);
}

.project-screenshot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: scale(1.001);
    transition: transform 0.22s ease, filter 0.22s ease;
}

.project-card:hover .project-screenshot img {
    transform: scale(1.025);
    filter: saturate(1.06) contrast(1.03);
}

.modal-project-screenshot {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin: 16px 0 18px;
    border: 1px solid rgba(82, 167, 255, 0.26);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.035);
}

.modal-project-screenshot[hidden] {
    display: none;
}

.modal-project-screenshot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(7, 11, 20, 0.72);
}

.modal-project-screenshot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), transparent 36%, rgba(56, 248, 184, 0.06)),
        repeating-linear-gradient(180deg, rgba(56, 248, 184, 0.035) 0 1px, transparent 1px 9px);
}

body.light-mode .project-screenshot::before {
    background: rgba(255, 255, 255, 0.82);
}

html.performance-mode .project-screenshot img,
html.performance-mode .project-card:hover .project-screenshot img {
    transform: none;
    filter: none;
}


/* === Project screenshot polish / responsive cards === */
.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    align-items: stretch;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.project-screenshot {
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 190px;
    padding: 10px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(7, 15, 27, 0.92), rgba(7, 15, 27, 0.72)),
        rgba(255, 255, 255, 0.035);
}

.project-screenshot::before {
    content: "preview()";
    top: 12px;
    left: 12px;
}

.project-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 12px;
    background: rgba(3, 8, 16, 0.9);
    transform: none;
}

.project-card:hover .project-screenshot img {
    transform: none;
    filter: saturate(1.06) contrast(1.03);
}

.project-card .project-actions {
    margin-top: auto;
}

.modal-project-screenshot {
    max-height: min(58vh, 520px);
}

.modal-project-screenshot img {
    object-fit: contain;
    object-position: center center;
}

@media (max-width: 760px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-screenshot {
        max-height: 220px;
    }
}

/* === Final project screenshot fit fix === */
.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 24px;
}

.project-card {
    overflow: hidden;
}

.project-screenshot {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(170px, 18vw, 245px);
    max-height: none;
    aspect-ratio: auto;
    padding: 12px;
    margin: 0 0 18px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(82, 167, 255, 0.24);
    background:
        radial-gradient(circle at 50% 0%, rgba(56, 248, 184, 0.08), transparent 40%),
        linear-gradient(180deg, rgba(7, 15, 27, 0.96), rgba(7, 15, 27, 0.76));
}

.project-screenshot-window {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 13px;
    background: rgba(3, 8, 16, 0.9);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.project-screenshot img,
.project-screenshot-window img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 10px;
    background: transparent;
    transform: none !important;
}

.project-card:hover .project-screenshot img,
.project-card:hover .project-screenshot-window img {
    transform: none !important;
    filter: saturate(1.04) contrast(1.02);
}

.project-screenshot::before {
    z-index: 4;
}

.project-screenshot::after {
    z-index: 3;
}

.project-card h3 {
    margin-top: 0;
}

.modal-project-screenshot {
    display: grid;
    place-items: center;
    height: min(52vh, 520px);
    aspect-ratio: auto;
    padding: 12px;
}

.modal-project-screenshot img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 14px;
}

@media (max-width: 760px) {
    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-screenshot {
        height: 210px;
    }
}


/* === Larger project screenshots === */
.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

.project-screenshot {
    height: clamp(235px, 24vw, 335px);
    padding: 10px;
}

.project-screenshot-window {
    border-radius: 15px;
}

.project-screenshot img,
.project-screenshot-window img {
    border-radius: 12px;
}

.modal-project-screenshot {
    height: min(62vh, 650px);
}

@media (max-width: 760px) {
    .project-screenshot {
        height: 260px;
    }
}

@media (max-width: 430px) {
    .project-screenshot {
        height: 235px;
    }
}


/* === Runtime performance polish, no visual layout changes === */
.site-grid,
.orb {
    will-change: auto;
}

.project-screenshot img,
.modal-project-screenshot img {
    content-visibility: auto;
}

.project-card,
.project-screenshot,
.modal-project-screenshot {
    transform: translateZ(0);
}

@media (update: slow), (prefers-reduced-data: reduce) {
    html:not(.light-mode) .orb {
        filter: blur(42px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .availability-dot {
        animation: none;
    }
}

/* 404 developer error page */
.error-page-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.error-page {
    width: min(920px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 56px 0;
    position: relative;
    z-index: 2;
}

.error-card {
    width: 100%;
    overflow: hidden;
}

.error-terminal-body {
    padding: clamp(28px, 5vw, 52px);
}

.error-kicker {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.error-terminal-body h1 {
    margin: 0 0 20px;
    font-family: var(--mono);
    font-size: clamp(5rem, 16vw, 10rem);
    line-height: 0.85;
    letter-spacing: -0.08em;
    color: var(--text);
    text-shadow: 0 0 34px rgba(45, 242, 189, 0.18);
}

.error-terminal-body pre {
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
}

.error-text {
    max-width: 680px;
    margin: 24px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

@media (max-width: 640px) {
    .error-page {
        width: min(100% - 20px, 920px);
        padding: 28px 0;
    }

    .error-actions,
    .error-actions .btn {
        width: 100%;
    }
}
