﻿:root {
    --radius: 12px;
    --panel-w: 280px;
    --header-height-desktop: 84px;
    --header-height-tablet: 108px;
    --header-height-mobile: 156px;
    --header-h: var(--header-height-desktop);
    --tilt-max: 5; /* Maximum tilt in degrees for cards */
    --tilt-scale: 1; /* Multiplier applied on top of the base hover scale */
    --card-hover-lift: -2px; /* Default hover translateY for cards */
    --card-hover-scale: 1.005; /* Default hover scale for cards */

    /* Cards */
    --card-bg: #1e1e1e;
    --card-border: rgba(255,255,255,0.08);
    --card-radius: 14px;
    --card-shadow: 0 4px 9px rgba(0,0,0,0.35);
    --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.45);
    --skill-card-bg: var(--card-bg);
    --skill-card-border: var(--card-border);

    /* Modal */
    --modal-bg: linear-gradient(180deg, #161922, #10131a);
    --modal-border: rgba(255,255,255,0.08);
    --modal-shadow: 0 24px 60px rgba(0,0,0,0.60);
    --backdrop-tint: rgba(5,8,13,0.55);
    --modal-text: var(--text);
    --modal-muted: var(--muted);
}

:root[data-theme="dark"] {
    --center-color: #241c4f;
    --edge-color: #0f0d1e;
    --bg: radial-gradient(circle at center, #241c4f 0%, #0f0d1e 100%);
    --bg-solid: #121212;
    --panel: rgba(30, 24, 66);
    --text: #e0e0e0;
    --muted: #bbbbbb;
    --brand: #4fc3f7;
    --brand-2: #a0e7e5;
    --shadow: 0 2px 8px rgba(0,0,0,.3);
    
    --accent: #6ea8ff;
    --accent-2: #4d57c4;

    /* Cards */
    --card-bg: rgba(36, 28, 79, 1);
    --card-border: rgba(255,255,255,0.08);
    --card-shadow: 0 4px 9px rgba(0,0,0,0.35);
    --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.45);

    /* Modal */
    --modal-bg: linear-gradient(180deg, #161922, #10131a);
    --modal-border: rgba(255,255,255,0.08);
    --modal-shadow: 0 24px 60px rgba(0,0,0,0.60);
    --backdrop-tint: rgba(5,8,13,0.55);
    --modal-text: var(--text);
    --modal-muted: var(--muted);

    --modal-close-bg: #1a1533;         /* base */
    --modal-close-fg: #dcd6ff;         /* icon */
    --modal-close-border: rgba(255,255,255,.08);
    --modal-close-bg-hover: #2a2360;   /* hover */
    --modal-close-fg-hover: #ffffff;
    --modal-close-shadow: 0 8px 20px rgba(10,8,20,.55);

    /* Connect */
    --danger: #ff5c7a;
    --success: #2fd186;
    --border: rgba(255,255,255,0.08);
}

:root[data-theme="light"] {
    --center-color: #e9efff;
    --edge-color: #b3c7ff;
    --bg: radial-gradient(circle at 18% 18%, #f5f8ff 0%, #b3c7ff 100%);
    --bg-solid: #dae3ff;
    --panel: rgba(255, 255, 255);
    --text: #0f172a;
    --muted: #5f6b85;
    --brand: #2563eb;
    --brand-2: #38bdf8;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);

    --accent: #4f46e5;
    --accent-2: #6366f1;

    /* Cards */
    --card-bg: #ffffff;
    --card-border: rgba(15, 23, 42, 0.12);
    --card-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
    --card-shadow-hover: 0 28px 64px rgba(15, 23, 42, 0.18);

    --skill-card-bg: var(--card-bg);
    --skill-card-border: var(--card-border);

    /* Modal */
    --modal-bg: linear-gradient(180deg, #ffffff, #f0f4ff);
    --modal-border: rgba(15, 23, 42, 0.08);
    --modal-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
    --backdrop-tint: rgba(224, 232, 255, 0.6);
    --modal-text: var(--text);
    --modal-muted: var(--muted);

    --modal-close-bg: #eef2ff;         /* base */
    --modal-close-fg: #1e293b;         /* icon */
    --modal-close-border: rgba(15, 23, 42, 0.08);
    --modal-close-bg-hover: #dce4ff;   /* hover */
    --modal-close-fg-hover: #0f172a;
    --modal-close-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);

    --danger: #e11d48;
    --success: #16a34a;
    --border: rgba(15, 23, 42, 0.08);
    
}

.card{
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    color: var(--text);
    padding: 20px;
    text-decoration: none;
    display: block;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    will-change: transform, box-shadow;
}

/* Unified hover “lift/tilt” */
.card:hover{
    transform: translateY(var(--card-hover-lift)) scale(var(--card-hover-scale));
    box-shadow: var(--card-shadow-hover);
    border-color: var(--card-border);
}

/* Keyboard focus matches hover feel */
.card:focus-visible{
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #6ea8ff) 70%, transparent), var(--card-shadow-hover);
    transform: translateY(var(--card-hover-lift)) scale(var(--card-hover-scale));
}

/* Hide native browser scrollbars */
html {
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    min-height: 100%;
}

html::-webkit-scrollbar {
    display: none;
}

/* Base */
* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

/* Fluid images */
img {
    max-width: 100%;
    height: auto;
}

body {
    margin: 0;
    padding-top: var(--header-h);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    /* Full-page radial background that stays centered while scrolling */
    background: var(--bg) fixed;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text);
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    html:not(.allow-motion) {
        scroll-behavior: auto;
        --tilt-max: 0;
        --tilt-scale: 1;
    }

    html:not(.allow-motion) *,
    html:not(.allow-motion) *::before,
    html:not(.allow-motion) *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    html:not(.allow-motion) .role-subtitle {
        opacity: 1;
        transition: none !important;
    }

    html:not(.allow-motion) .role-subtitle::after {
        transition: none !important;
        transform: translateX(-50%) scaleX(1);
    }

    html:not(.allow-motion) .card,
    html:not(.allow-motion) .project-card,
    html:not(.allow-motion) .modal__dialog,
    html:not(.allow-motion) .modal__backdrop,
    html:not(.allow-motion) .modal__close,
    html:not(.allow-motion) .menu-toggle,
    html:not(.allow-motion) .menu-toggle::before,
    html:not(.allow-motion) .connect-btn,
    html:not(.allow-motion) .icon-button,
    html:not(.allow-motion) .panel-link,
    html:not(.allow-motion) .link-icon,
    html:not(.allow-motion) .badge,
    html:not(.allow-motion) .interest-card,
    html:not(.allow-motion) .interest-card::before,
    html:not(.allow-motion) .interest-icon,
    html:not(.allow-motion) #projects article,
    html:not(.allow-motion) #education .education-card,
    html:not(.allow-motion) #about-me .about-card,
    html:not(.allow-motion) #scrollProgress,
    html:not(.allow-motion) #scrollProgress::after,
    html:not(.allow-motion) .theme-widget .ui-label::before,
    html:not(.allow-motion) .theme-widget .ui-circle::before,
    html:not(.allow-motion) .theme-widget .ui-app::before,
    html:not(.allow-motion) .theme-widget .ui-circle,
    html:not(.allow-motion) .motion-toggle,
    html:not(.allow-motion) .motion-toggle__label,
    html:not(.allow-motion) .motion-toggle__switch,
    html:not(.allow-motion) .motion-toggle__thumb,
    html:not(.allow-motion) .motion-toggle__status {
        transition: none !important;
    }

    html:not(.allow-motion) .card:hover,
    html:not(.allow-motion) .card:focus-visible,
    html:not(.allow-motion) .icon-button:hover,
    html:not(.allow-motion) .panel-link:hover,
    html:not(.allow-motion) .connect-btn:hover,
    html:not(.allow-motion) .connect-btn:active,
    html:not(.allow-motion) .menu-toggle:hover,
    html:not(.allow-motion) .menu-toggle[aria-expanded="true"],
    html:not(.allow-motion) .link-icon:hover,
    html:not(.allow-motion) .badge:hover,
    html:not(.allow-motion) .modal__close:hover,
    html:not(.allow-motion) .project-card:hover,
    html:not(.allow-motion) .interest-card:hover,
    html:not(.allow-motion) .interest-card:focus-within {
        transform: none !important;
        filter: none !important;
    }
}

html.reduce-motion {
    scroll-behavior: auto;
    --tilt-max: 0;
    --tilt-scale: 1;
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
}

html.reduce-motion .role-subtitle {
    opacity: 1;
    transition: none !important;
}

html.reduce-motion .role-subtitle::after {
    transition: none !important;
    transform: translateX(-50%) scaleX(1);
}

html.reduce-motion .card,
html.reduce-motion .project-card,
html.reduce-motion .modal__dialog,
html.reduce-motion .modal__backdrop,
html.reduce-motion .modal__close,
html.reduce-motion .menu-toggle,
html.reduce-motion .menu-toggle::before,
html.reduce-motion .connect-btn,
html.reduce-motion .icon-button,
html.reduce-motion .panel-link,
html.reduce-motion .link-icon,
html.reduce-motion .badge,
html.reduce-motion .interest-card,
html.reduce-motion .interest-card::before,
html.reduce-motion .interest-icon,
html.reduce-motion #projects article,
html.reduce-motion #education .education-card,
html.reduce-motion #about-me .about-card,
html.reduce-motion #scrollProgress,
html.reduce-motion #scrollProgress::after,
html.reduce-motion .theme-widget .ui-label::before,
html.reduce-motion .theme-widget .ui-circle::before,
html.reduce-motion .theme-widget .ui-app::before,
html.reduce-motion .theme-widget .ui-circle,
html.reduce-motion .motion-toggle,
html.reduce-motion .motion-toggle__label,
html.reduce-motion .motion-toggle__switch,
html.reduce-motion .motion-toggle__thumb,
html.reduce-motion .motion-toggle__status {
    transition: none !important;
}

html.reduce-motion .about-cursor {
    opacity: 0 !important;
    animation: none !important;
}

html.reduce-motion .card:hover,
html.reduce-motion .card:focus-visible,
html.reduce-motion .icon-button:hover,
html.reduce-motion .panel-link:hover,
html.reduce-motion .connect-btn:hover,
html.reduce-motion .connect-btn:active,
html.reduce-motion .menu-toggle:hover,
html.reduce-motion .menu-toggle[aria-expanded="true"],
html.reduce-motion .link-icon:hover,
html.reduce-motion .badge:hover,
html.reduce-motion .modal__close:hover,
html.reduce-motion .project-card:hover,
html.reduce-motion .interest-card:hover,
html.reduce-motion .interest-card:focus-within {
    transform: none !important;
    filter: none !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at center, var(--center-color) 0%, var(--edge-color) 100%);
    filter: brightness(1.25);
}

/* remove the default slider thumb style */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;   /* or give it a custom size */
    height: 0;
    background: transparent;
    border: none;
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
}

*:focus {
    outline: none !important;
    box-shadow: none !important;
}

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

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.no-scroll {
    overflow: hidden;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand);
    color: #000;
    padding: .5rem .75rem;
    border-radius: 6px;
}

.skip-link:focus {
    left: .5rem;
    top: .5rem;
    z-index: 10000;
}

.profile-header {
    position: relative;
    z-index: 0;
}

/* Header */
.profile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--panel);
    color: var(--text);
    padding: 0.65rem 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;

    /* keep header compact and stable */
    height: var(--header-h);
    min-height: var(--header-h);
    max-height: var(--header-h);
}

.profile-header #heroBackground {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 0;
}

.profile-header > *:not(#heroBackground) {
    position: relative;
    z-index: 1;
}

.profile-header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 2.2vw + 1rem, 2rem);
    line-height: 1.2;
}

.left-header {
    display: flex;
    align-items: center;
    justify-self: start;
    align-self: center;
    min-width: 0;
    justify-content: center;
    text-align: center;
}

.logo-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(52px, 4vw, 64px);
    height: clamp(52px, 4vw, 64px);
    max-width: 64px;
    max-height: 64px;
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
}

.logo-slot:empty::after {
    content: "Logo";
}

.logo-slot img,
.logo-slot svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.center-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    margin: 0;
    justify-self: center;
    align-self: center;
}

#typed-name {
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

.role-subtitle {
    display: inline-block;
    font-size: .9rem;
    color: var(--muted);
    margin-top: .25rem;
    line-height: 1.2;
    min-height: 1.2em;
    padding-bottom: 6px;
    position: relative; 
    opacity: 0; 
    transition: opacity .25s ease;
    text-align: center;
}

/* Reveal when typing starts */
.role-subtitle.reveal { opacity: 1; }

/* Gradient underline */
.role-subtitle::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    height: 2px;
    width: 90%;
    max-width: 220px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    border-radius: 999px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center; 
    transition: transform .5s ease-in-out;
}

/* Animate the line in when typing finishes */
.role-subtitle.done::after {
    transform: translateX(-50%) scaleX(1);
}

.right-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    flex-wrap: wrap;
    gap: .75rem;
    min-width: 0;
}

.icon-button {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    transition: transform .2s ease, filter .2s ease;
}

.icon-button:hover {
    transform: scale(1.06);
    filter: brightness(1.2);
}

.resume-button {
    font-weight: 700;
    color: var(--brand);
    background: none;
    border: none;
    cursor: pointer;
}

.resume-button:hover {
    text-decoration: underline;
}

.resume-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    text-decoration: none;
}

.arrow {
    display: inline-block;
    transform: translateY(1px);
}

/* Hamburger */
.menu-toggle {
    /* layout */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;

    /* visuals */
    background: var(--card-bg); 
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    color: var(--text);  

    /* interaction */
    cursor: pointer;
    position: fixed;
    top: calc(var(--header-h) + 2rem);
    left: 1.25rem;
    overflow: hidden; 
    isolation: isolate;
    will-change: transform, opacity;
    transition: transform .18s ease-out, box-shadow .25s ease;
    transform: translateZ(0);
}

.menu-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

/* Gradient overlay that fades in/out smoothly */
.menu-toggle::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    opacity: 0;
    transition: opacity .22s ease;
    z-index: -1;
}

/* Show overlay on hover or when menu is open */
.menu-toggle:hover::before,
.menu-toggle[aria-expanded="true"]::before {
    opacity: 1;
}

/* Bars use currentColor so they adapt on overlay */
.menu-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    transition: color .2s ease, opacity .2s ease;
}

/* Improve contrast when overlay is visible */
.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
    color: #0d0d0d;
}

/* Side panel */
.side-panel {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100dvh - var(--header-h));
    width: var(--panel-w);
    background: var(--panel);
    box-shadow: var(--shadow);
    border-right: 1px solid var(--card-border);
    transform: translateX(-110%);
    transition: transform .22s ease-out;
    z-index: 998;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.side-panel.open {
    transform: translateX(0);
}

.panel-inner {
    padding: 2rem .75rem 1.25rem;
    flex: 1;
}

.panel-bottom {
    padding: 1rem .75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-controls {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: .75rem;
    flex-wrap: wrap;
}

.panel-controls .bb8-toggle {
    flex: 0 1 auto;
    --toggle-size: 10px;
}

.panel-controls .motion-toggle {
    flex: 1 1 0;
    min-width: 0;
    padding: .65rem .75rem;
}

.panel-controls .motion-toggle__label {
    gap: .75rem;
}

.panel-controls .motion-toggle__text {
    max-width: 7rem;
    flex: 1 1 auto;
    word-break: break-word;
}

.motion-toggle {
    padding: .65rem .85rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: color-mix(in srgb, var(--panel) 92%, var(--bg-solid) 8%);
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    position: relative;
}

.motion-toggle--active {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--card-border) 55%);
    background: color-mix(in srgb, var(--panel) 90%, var(--brand) 10%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 20%, transparent);
}

.motion-toggle:focus-within {
    border-color: color-mix(in srgb, var(--brand) 50%, var(--card-border) 50%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

.motion-toggle__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    width: 100%;
    cursor: pointer;
    border-radius: 12px;
}

.motion-toggle__text {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.motion-toggle__title {
    font-size: .85rem;
    font-weight: 600;
}

.motion-toggle__desc {
    font-size: .7rem;
    color: var(--muted);
    line-height: 1.3;
}

.motion-toggle__control {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
    min-width: 48px;
}

.motion-toggle__status {
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color .2s ease;
}

.motion-toggle__switch {
    position: relative;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--card-border) 75%, transparent 25%);
    background: color-mix(in srgb, var(--panel) 70%, var(--bg-solid) 30%);
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.motion-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: color-mix(in srgb, #ffffff 88%, var(--panel) 12%);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.motion-toggle__input:checked + .motion-toggle__label .motion-toggle__switch {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: color-mix(in srgb, var(--brand) 45%, transparent);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.motion-toggle__input:checked + .motion-toggle__label .motion-toggle__thumb {
    transform: translateX(20px);
    background: color-mix(in srgb, #ffffff 80%, var(--brand) 20%);
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

.motion-toggle__input:checked + .motion-toggle__label .motion-toggle__status,
.motion-toggle--active .motion-toggle__status {
    color: color-mix(in srgb, var(--brand) 65%, var(--muted) 35%);
}

.panel-title {
    margin: .25rem .25rem 1rem;
    font-size: .95rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.panel-link {
    display: block;
    padding: .55rem .5rem;
    margin: .15rem .25rem;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.panel-link:hover {
    transform : translateX(10px);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #0d0d0d;
}

.panel-link.active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #0d0d0d;
}

/* Backdrop */
.panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.25);
    z-index: 997;
}

.panel-open .panel-backdrop { display: block; }

/* Content layout */
.main-content {
    padding: 2rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    perspective: 800px;
}

.connect-btn {
    width: 90%;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: 0;
    cursor: pointer;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: transform 160ms ease, filter 160ms ease;
    margin: 10px;
    
}
.connect-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.connect-btn:active { transform: translateY(0); filter: brightness(0.98); }

/* Overlay */
.connect-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Dialog */
.connect-dialog {
    width: min(560px, 92vw);
    margin: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    color: var(--text);
    background: linear-gradient(180deg, var(--card-bg));
    box-shadow: var(--shadow);
}

.connect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.connect-desc {
    margin: 0;
    padding: 0 18px 8px 18px;
    color: var(--muted);
}

/* Icon button */
.icon-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
}
.icon-btn:hover { color: var(--text); }

/* Form */
form {
    padding: 12px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field .label {
    position: absolute;
    inset-inline-start: 16px;
    top: 30%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted);
    pointer-events: none;
    padding: 0 6px;
    line-height: 1;
    transition: top 160ms ease, transform 160ms ease, font-size 160ms ease, color 160ms ease;
    z-index: 1;
}

.field .label::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: var(--panel);
    border-radius: 999px;
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: -1;
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: 12px;
    padding: 16px 16px 12px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

.field:focus-within .label,
.field input:not(:placeholder-shown) + .label,
.field textarea:not(:placeholder-shown) + .label {
    top: 0;
    transform: translateY(-52%);
    font-size: 0.75rem;
}

.field:focus-within .label::after,
.field input:not(:placeholder-shown) + .label::after,
.field textarea:not(:placeholder-shown) + .label::after {
    opacity: 1;
}

.field:focus-within .label {
    color: var(--accent);
}

.field input:not(:placeholder-shown) + .label,
.field textarea:not(:placeholder-shown) + .label {
    color: var(--muted);
}

.field textarea {
    resize: vertical;
    min-height: 140px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.field--message textarea {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 88%, var(--brand) 12%),
        color-mix(in srgb, var(--panel) 94%, var(--brand-2) 6%)
    );
    border-color: color-mix(in oklab, var(--accent) 55%, var(--border));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.field--message .label {
    top: 15%;
}

.field--message textarea:focus {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 80%, var(--accent) 20%),
        color-mix(in srgb, var(--panel) 88%, var(--accent) 12%)
    );
}

.field--message .label::after {
    background: color-mix(in srgb, var(--panel) 90%, var(--brand) 10%);
}

/* Floating fieldset variant */
.floating-field {
    --floating-field-padding-inline: 16px;
    --floating-field-padding-top: 16px;
    --floating-field-padding-bottom: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.floating-field legend {
    position: absolute;
    inset-inline-start: var(--floating-field-padding-inline);
    top: 0;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted);
    pointer-events: none;
    padding: 0 6px;
    line-height: 1;
    transform: translateY(calc((var(--floating-field-padding-top) + var(--floating-field-padding-bottom)) / 2 + 0.4rem));
    transition: transform 160ms ease, font-size 160ms ease, color 160ms ease;
    z-index: 1;
}

.floating-field legend::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: var(--panel);
    border-radius: 999px;
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: -1;
}

.floating-field input[type="text"],
.floating-field input[type="email"],
.floating-field textarea {
    width: 100%;
    border: none;
    border-radius: inherit;
    background: transparent;
    color: var(--text);
    padding: var(--floating-field-padding-top) var(--floating-field-padding-inline) var(--floating-field-padding-bottom);
    outline: none;
    font: inherit;
}

.floating-field textarea {
    min-height: 140px;
    padding-top: calc(var(--floating-field-padding-top) + 6px);
    resize: vertical;
}

.floating-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

.floating-field:focus-within legend,
.floating-field:has(:is(input, textarea):not(:placeholder-shown)) legend {
    transform: translateY(-52%);
    font-size: 0.75rem;
}

.floating-field:focus-within legend {
    color: var(--accent);
}

.floating-field:has(:is(input, textarea):not(:placeholder-shown)) legend {
    color: var(--muted);
}

.floating-field:focus-within legend::after,
.floating-field:has(:is(input, textarea):not(:placeholder-shown)) legend::after {
    opacity: 1;
}

/* Floating fieldset variant */
.floating-field {
    --floating-field-padding-inline: 16px;
    --floating-field-padding-top: 16px;
    --floating-field-padding-bottom: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.floating-field legend {
    position: absolute;
    inset-inline-start: var(--floating-field-padding-inline);
    top: 0;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted);
    pointer-events: none;
    padding: 0 6px;
    line-height: 1;
    transform: translateY(calc((var(--floating-field-padding-top) + var(--floating-field-padding-bottom)) / 2 + 0.4rem));
    transition: transform 160ms ease, font-size 160ms ease, color 160ms ease;
    z-index: 1;
}

.floating-field legend::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: var(--panel);
    border-radius: 999px;
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: -1;
}

.floating-field input[type="text"],
.floating-field input[type="email"],
.floating-field textarea {
    width: 100%;
    border: none;
    border-radius: inherit;
    background: transparent;
    color: var(--text);
    padding: var(--floating-field-padding-top) var(--floating-field-padding-inline) var(--floating-field-padding-bottom);
    outline: none;
    font: inherit;
}

.floating-field textarea {
    min-height: 140px;
    padding-top: calc(var(--floating-field-padding-top) + 6px);
    resize: vertical;
}

.floating-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

.floating-field:focus-within legend,
.floating-field:has(:is(input, textarea):not(:placeholder-shown)) legend {
    transform: translateY(-52%);
    font-size: 0.75rem;
}

.floating-field:focus-within legend {
    color: var(--accent);
}

.floating-field:has(:is(input, textarea):not(:placeholder-shown)) legend {
    color: var(--muted);
}

.floating-field:focus-within legend::after,
.floating-field:has(:is(input, textarea):not(:placeholder-shown)) legend::after {
    opacity: 1;
}

/* Honeypot hidden */
.hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.captcha-field {
    margin: -0.2rem 0 0.5rem;
}

.captcha-field:empty {
    display: none;
}

/* Actions */
.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn.ghost:hover { color: var(--text); }

.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}
.btn.primary[disabled] {
    filter: grayscale(0.3) brightness(0.8);
    cursor: not-allowed;
}

/* Errors + Status */
.error {
    min-height: 1.1em;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0;
}

.status {
    margin-top: 0;
    font-size: 0.95rem;
}

.status.success { color: var(--success); }
.status.error { color: var(--danger); }

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
}

.card-section {
    padding: 1.25rem;
    margin: 2rem auto;
}

/* Section offsets */
.card-section,
#about-me,
#projects,
#education,
#skills,
#favorites {
    scroll-margin-top: calc(var(--header-h) + 12px);
}

.about-container {
    --about-avatar-size: 200px;
    --about-column-gap: 2rem;
    --about-offset: calc(var(--about-avatar-size) + var(--about-column-gap));
    display: flex;
    gap: var(--about-column-gap);
    align-items: center;
    flex-wrap: wrap;
    text-align: left;
}

.about-content {
    flex: 1 1 340px;
    min-width: min(340px, 100%);
    display: flex;
    flex-direction: column;
    gap: clamp(1.2rem, 2.2vw, 1.7rem);
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 1.8vw, 1.4rem);
}

.about-greeting {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text);
}

.about-headline {
    margin: 0;
    font-size: clamp(1.85rem, 4.8vw, 3rem);
    overflow-wrap: anywhere;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

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

.about-cursor {
    display: inline-block;
    margin-left: 0.08em;
    color: var(--accent);
    animation: about-cursor-blink 1.2s steps(1) infinite;
}

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

.about-description {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    line-height: 1.55;
    color: var(--text);
}

.about-intro {
    margin: 0;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    line-height: 1.35;
}

.about-text > p {
    margin: 0;
}

.about-section-header {
    align-self: flex-start;
}

.currently-into {
    margin-top: clamp(1.75rem, 2vw, 2.25rem);
    display: grid;
    gap: clamp(1.25rem, 2.2vw, 1.85rem);
    flex: 1 1 100%;
}

@media (min-width: 641px) {
    .about-section-header {
        margin-left: calc(-1 * var(--about-offset));
        width: calc(100% + var(--about-offset));
    }

    .about-section-header {
        margin-left: calc(-1 * var(--about-offset));
        width: calc(100% + var(--about-offset));
    }

    .profile-pic {
        margin-top: clamp(2rem, 2.8vw, 3rem);
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: clamp(0.65rem, 1.6vw, 0.85rem);
    width: 100%;
    flex-wrap: nowrap;
}

.section-header::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in oklab, var(--brand) 65%, transparent), color-mix(in oklab, var(--brand-2) 55%, transparent), transparent 75%);
    opacity: 0.8;
    margin-left: clamp(0.5rem, 1.4vw, 0.75rem);
}

.section-icon {
    --icon-size: clamp(2.35rem, 3.1vw, 2.9rem);
    flex: 0 0 var(--icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 14px;
    background: linear-gradient(135deg,
    color-mix(in oklab, var(--brand) 30%, transparent) 0%,
    color-mix(in oklab, var(--brand-2) 38%, transparent) 100%);
    color: var(--brand-2);
    border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 28%, transparent);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.section-symbol {
    width: 70%;
    height: 70%;
    display: block;
}

.section-header:hover .section-icon,
.section-header:focus-within .section-icon {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--brand) 38%, transparent);
}

.section-header--lg .section-icon {
    --icon-size: clamp(2.45rem, 3.4vw, 3.1rem);
}

.section-header--sm .section-icon {
    --icon-size: clamp(2.1rem, 2.8vw, 2.45rem);
}

.section-header--xs .section-icon {
    --icon-size: clamp(1.9rem, 2.4vw, 2.2rem);
    border-radius: 10px;
}

.section-title {
    margin: 0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-2);
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: clamp(1rem, 2.4vw, 1.3rem);
    line-height: 1.25;
}

.section-title--lg {
    font-size: clamp(1.15rem, 3vw, 1.6rem);
}

.section-title--sm {
    font-size: clamp(0.95rem, 2.1vw, 1.1rem);
}

.section-title--xs {
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    letter-spacing: 0.14em;
}

section > .section-header:first-child {
    margin-bottom: clamp(1.25rem, 2.2vw, 1.85rem);
}

.education-section > .section-header,
.education-timeline > .section-header {
    margin-bottom: 0.6rem;
}

.interest-grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: clamp(0.85rem, 2vw, 1.25rem);
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.interest-card {
    position: relative;
    display: flex;
    gap: clamp(0.85rem, 2vw, 1.25rem);
    align-items: flex-start;
    padding: clamp(1rem, 1.5vw + 0.75rem, 1.35rem);
    border-radius: 18px;
    border: 1px solid color-mix(in oklab, var(--card-border) 70%, var(--brand) 30%);
    background: color-mix(in oklab, var(--card-bg) 92%, transparent);
    box-shadow: 0 24px 40px -28px rgba(9, 12, 24, 0.65);
    overflow: hidden;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.interest-card::before {
    content: "";
    position: absolute;
    inset: -10% -20% auto -10%;
    height: 160%;
    background: radial-gradient(120% 120% at 16% 12%, rgba(79, 195, 247, 0.35), rgba(160, 231, 229, 0.05) 60%, transparent 75%);
    opacity: 0;
    transform: translate3d(0, 12%, 0);
    transition: opacity 280ms ease, transform 280ms ease;
}

.interest-card:hover,
.interest-card:focus-within {
    transform: translateY(-4px);
    border-color: color-mix(in oklab, var(--brand) 55%, var(--brand-2) 45%);
    box-shadow: 0 32px 56px -30px rgba(9, 12, 24, 0.75);
}

.interest-card:hover::before,
.interest-card:focus-within::before {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.interest-card > * {
    position: relative;
    z-index: 1;
}

.interest-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(2.8rem, 2.4vw + 2.4rem, 3.3rem);
    aspect-ratio: 1;
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 70%, #ffffff 30%), color-mix(in oklab, var(--brand-2) 70%, #ffffff 30%));
    box-shadow: 0 18px 38px rgba(79, 195, 247, 0.35);
    color: #0b1024;
    transition: transform 220ms ease;
}

.interest-icon::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
    opacity: 0.55;
}

.interest-card:hover .interest-icon,
.interest-card:focus-within .interest-icon {
    transform: translateY(-3px);
}

.interest-symbol {
    width: clamp(1.4rem, 1vw + 1.2rem, 1.6rem);
    height: clamp(1.4rem, 1vw + 1.2rem, 1.6rem);
    z-index: 1;
    color: #0b1024;
}

.interest-body {
    display: grid;
    gap: 0.35rem;
}

.interest-body h5 {
    margin: 0;
    font-size: clamp(1rem, 1.2vw + 0.8rem, 1.2rem);
    font-weight: 700;
    color: var(--text);
}

.interest-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.interest-body strong {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: color-mix(in oklab, var(--brand-2) 60%, transparent);
}

@media (max-width: 640px) {
    .section-header::after {
        display: none;
    }

    .interest-card {
        padding: 1rem;
    }
}

.profile-pic {
    width: var(--about-avatar-size, 200px);
    height: var(--about-avatar-size, 200px);
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--brand);
    box-shadow: 0 0 10px rgba(255,255,255,.08);
}

#projects,
#education,
#about-me,
#skills,
#favorites {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

#education h2,
#projects h2,
#about-me h2,
#skills h2,
#favorites h2 {
    font-size: 2rem;
    color: var(--brand-2);
}

#education .education-container {
    margin-top: 1.75rem;
}

#education .education-card {
    position: relative;
    display: grid;
    gap: 1.75rem;
    padding: clamp(1.75rem, 2vw + 1rem, 2.5rem);
    background: color-mix(in oklab, var(--card-bg) 88%, transparent);
}

#education .education-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 12px 12px 0 0;
}

.education-top {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 720px) {
    .education-top {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.education-heading {
    display: grid;
    gap: 0.4rem;
}

.education-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.education-title {
    margin: 0;
    font-size: clamp(1.65rem, 2vw + 1.2rem, 2.1rem);
    color: var(--text);
}

.education-program {
    margin: 0;
    font-size: 1.1rem;
    color: var(--brand-2);
}

.education-summary {
    margin: 0.5rem 0 0;
    color: var(--muted);
    max-width: 48ch;
}

.education-meta {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin: 0;
}

.education-meta div {
    background: color-mix(in oklab, var(--card-bg) 70%, transparent);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.education-meta dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 0.25rem;
}

.education-meta dd {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.education-content {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.education-section {
    display: grid;
    gap: 0.75rem;
}

.education-section h4,
.education-timeline h4 {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.education-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.6rem;
    color: var(--text);
}

.education-list li {
    line-height: 1.5;
}

.education-timeline {
    padding: 1.25rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: color-mix(in oklab, var(--card-bg) 60%, transparent);
    display: grid;
    gap: 1rem;
}

.education-years {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
}

.education-years li {
    display: grid;
    gap: 0.4rem;
    background: color-mix(in oklab, var(--card-bg) 78%, transparent);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.education-year {
    font-weight: 600;
    color: var(--brand-2);
}

.education-years p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

/* Hide extra content inside cards; shown only in modal */
.project-body { display: none; }

/* Layout */
.wrap { max-width: 1100px; margin: 40px auto; padding: 0 20px; }

/* Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: clamp(1rem, 1.2vw + 0.75rem, 1.75rem);
}
@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-item {
    height: 100%;
}

.project-card {
    height: 100%;
}

.project-card .project-foot {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-card .badges {
    margin-top: auto;
    padding-top: 12px;
}

/* Card (shared) */
.card{
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    color: var(--text);
    padding: 20px;
    text-decoration: none;
    display: block;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    will-change: transform, box-shadow;
}
.card:hover{
    transform: translateY(var(--card-hover-lift)) scale(var(--card-hover-scale));
    box-shadow: var(--card-shadow-hover);
    border-color: var(--card-border);
}
.card:focus-visible{
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #6ea8ff) 70%, transparent), var(--card-shadow-hover);
    transform: translateY(var(--card-hover-lift)) scale(var(--card-hover-scale));
}

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

/* Card content */
.project-title { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.project-desc  { margin: 8px 0 12px; color: var(--muted); }
.project-meta  {
    margin: 0;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.project-meta__text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Card thumbnail */
.card-media {
    margin: 0 0 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    position: relative;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal__dynamic .project-body { display: block; }

/* Modal blur (darken + blur the page behind the dialog) */
.modal {
    position: fixed;
    inset: 0;
    display: none;           /* toggled with .is-open */
    z-index: 1000;
}
.modal.is-open { display: block; }

.modal__backdrop {
    position: fixed;         /* <-- key: fixed, not absolute */
    inset: 0;                /* cover entire viewport */
    z-index: 0;
    background: rgba(5, 8, 13, 0.55);
    backdrop-filter: blur(6px) saturate(115%);
    -webkit-backdrop-filter: blur(6px) saturate(115%);
    opacity: 0;
    transition: opacity 180ms ease;
}

.modal.is-open .modal__backdrop { opacity: 1; }

/* Media inside modal */
.media-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
.media-fig { margin: 0; }
.media-fig img, .media-fig video {
    width: 100%; height: auto; display: block; border-radius: 12px; background:#000;
    box-shadow: var(--card-shadow);
}

.media-fig figcaption { margin-top: 6px; font-size: .9rem; color: var(--muted); }

/* 2-tall stack left, video spans right */
.media-grid--stack2x1{
    display: grid;
    grid-template-columns: 1fr 1.1fr;                    /* tweak the ratio if you want */
    gap: 12px;
}

/* Place the tiles */
.media-grid--stack2x1 .stack-top    { grid-column: 1; grid-row: 1; }
.media-grid--stack2x1 .stack-bottom { grid-column: 1; grid-row: 2; }
.media-grid--stack2x1 .stack-video  { grid-column: 2; grid-row: 1 / span 2; }

/* Make the right video fill the two rows neatly */
.media-grid--stack2x1 .stack-video video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* crop edges if needed */
    border-radius: 12px;
}

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

    .media-grid--stack2x1 .stack-top,
    .media-grid--stack2x1 .stack-bottom,
    .media-grid--stack2x1 .stack-video {
        grid-column: auto;
        grid-row: auto;
    }

    .media-grid--stack2x1 .stack-video video {
        height: auto;
    }
}

/* Modal */
.modal { position: fixed; inset: 0; display: none; z-index: 1000; }
.modal.is-open { display: block; }
.modal__backdrop{
    position: fixed;       /* full viewport, independent of dialog */
    inset: 0;
    background: rgba(10,12,22,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 180ms ease;
}

/* If the browser can’t do backdrop-filter fast, fall back to a solid tint */
@supports not (backdrop-filter: blur(2px)) {
    .modal__backdrop{
        background: rgba(10,12,22,.72);
    }
}

.modal.is-open .modal__backdrop { opacity: 1; }

.modal__dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    contain: content;
    will-change: transform;
    
    /* center + subtle drop-in */
    transform: translate(-50%, calc(-50% + 12px)) scale(.98);
    opacity: 0;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;

    z-index: 1;                    /* above the blurred backdrop */
    width: min(960px, calc(100% - 32px));
    max-height: min(90vh, 900px);  /* stay on screen */
    overflow-y: auto;

    /* keep your existing look */
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 32px;
}
.modal.is-open .modal__dialog {   transform: translate(-50%, -50%) scale(1); opacity: 1; }
.modal__title { margin: 0 36px 8px 0; font-size: 22px; }
.modal__summary { margin: 8px 0 16px; color: var(--muted); }
.modal__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.modal__facts dt { font-weight: 600; }
.modal__facts dd { margin: 2px 0 0; color: var(--muted); }
.modal__details { margin-top: 20px; line-height: 1.6; }
.modal__role {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--modal-border);
    background: rgba(255, 255, 255, 0.04);
}
:root[data-theme="light"] .modal__role {
    background: rgba(15, 23, 42, 0.04);
}
.modal__role-label {
    margin: 0 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.modal__role-text {
    margin: 0;
    line-height: 1.6;
    color: var(--modal-text);
}
.modal__close{
    position:absolute;
    top:10px;
    right:10px;
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    border-radius:10px;
    border: 1px solid var(--modal-close-border);
    background: var(--modal-close-bg);
    color: var(--modal-close-fg);
    transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
    cursor:pointer;
    font-size:22px;
}

.modal__close:hover{
    background: var(--modal-close-bg-hover);
    color: var(--modal-close-fg-hover);
    border-color: color-mix(in oklab, var(--modal-close-fg-hover) 18%, transparent);
    box-shadow: var(--modal-close-shadow);
    transform: translateY(-1px);
}

.modal__close:focus-visible{
    outline: none;
    box-shadow:
            0 0 0 3px color-mix(in oklab, var(--brand) 65%, transparent),
            var(--modal-close-shadow);
}

@media (max-width: 480px) {
    .modal__dialog {
        width: calc(100% - 24px);
        max-height: 88vh;
        padding: 24px;
    }
}

/* Audio trigger link (no autoplay) */
.audio-link {
    background: none; border: 0; padding: 0;
    color: var(--accent, #6ea8ff); text-decoration: underline;
    cursor: pointer; font: inherit;
}
.audio-link:hover { text-decoration: none; }
.audio-note { display:block; margin-top:4px; color: var(--muted, #a5acba); font-size:.9rem; }


/* Enable perspective so tilt looks 3D */
#projects article,
#education,
#about-me .about-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

#projects article:hover,
#education .education-card:hover,
#about-me .about-card:hover {
    box-shadow: var(--card-shadow-hover);
}

/* Scroll progress */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    background-size: 200% 100%;
    border-radius: 0 2px 2px 0;
    z-index: 1001;
    transition: width .15s linear;
    box-shadow:
            0 0 6px color-mix(in oklab, var(--brand) 70%, black 30%),
            0 0 12px color-mix(in oklab, var(--brand-2) 60%, black 40%);
}

#scrollProgress::after {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    filter: blur(8px);
    opacity: .55;
    pointer-events: none;
}

/* a touch stronger glow in dark theme, softer in light */
:root[data-theme="dark"] #scrollProgress::after { opacity: .65; }
:root[data-theme="light"] #scrollProgress::after { opacity: .45; }


/* Footer */
footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--muted);
    font-size: .95rem;
    text-align: left;
}

footer p {
    margin: 0;
}

.last-updated {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: .75rem;
    text-align: right;
}

.links-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--card-border, rgba(255,255,255,0.08));
    background: transparent;
    color: var(--text, #e7e9ef);
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.link-icon:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.link-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #6ea8ff) 70%, transparent);
}
.link-icon svg { width: 20px; height: 20px; display: block; fill: currentColor; }
.link-icon--live {
    color: var(--accent, #6ea8ff);
    border-color: color-mix(in oklab, var(--accent, #6ea8ff) 40%, transparent);
}
.link-icon--live svg {
    fill: none;
    stroke: currentColor;
}
.link-icon--live:hover {
    background: color-mix(in oklab, var(--accent, #6ea8ff) 12%, transparent);
    border-color: color-mix(in oklab, var(--accent, #6ea8ff) 60%, transparent);
}
.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;
}

.skills-container {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 1000px;
    margin: 0 auto;
    gap: clamp(1.25rem, 2.2vw, 1.85rem);
}

.skills-card {
    background: var(--skill-card-bg);
    border-color: var(--skill-card-border);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: clamp(1.5rem, 2.8vw, 2.25rem);
}

.skill-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-group__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-group__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-2);
}

.skill-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.skill-item {
    display: grid;
    grid-template-columns: minmax(130px, max-content) 1fr;
    align-items: center;
    gap: 1rem;
}

.skill-label {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
}

.skill-track {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--card-border) 65%, transparent);
    overflow: hidden;
}


.skill-bar {
    position: absolute;
    inset: 0;
    right: auto;
    width: var(--skill-percent, 0%);
    border-radius: inherit;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0;
    color: var(--card-bg);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    transition: width 800ms ease;
}

.skill-bar:not([aria-valuenow="0"]) {
    padding-right: 0.75rem;
}

.skill-bar__value {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

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

@media (max-width: 480px) {
    .skill-item {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .skill-label {
        justify-self: start;
    }
}

/* Badges */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    line-height: 1;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    user-select: none;
}

.badge:hover {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--brand) 40%, transparent);
    background: rgba(255, 255, 255, 0.4);
}

.badge img {
    width: 16px;
    height: 16px;
    display: block;
}

.badge--accent {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #0d0d0d;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* WIP ribbon on card media */

.badge--wip {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.favorite-card {
    display: grid;
    gap: clamp(1.4rem, 2.5vw, 2.5rem);
}

@media (min-width: 880px) {
    .favorite-card {
        grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
        align-items: center;
    }
}

.favorite-copy {
    display: grid;
    gap: clamp(1rem, 1.4vw, 1.4rem);
}

.favorite-title {
    margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    color: var(--text);
}

.favorite-text {
    margin: 0;
    color: var(--muted);
    max-width: 52ch;
}

.favorite-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.65rem;
    color: var(--text);
}

.favorite-list li {     
    line-height: 1.55;
}

.favorite-viewer {
    display: grid;
    gap: clamp(0.75rem, 1.5vw, 1rem);
    align-items: start;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .favorite-viewer {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

.viewer {
    position: relative;
    border-radius: clamp(18px, 1.6vw + 14px, 28px);
    background: radial-gradient(120% 120% at 22% 18%,
    color-mix(in srgb, var(--brand-2) 45%, transparent) 0%,
    color-mix(in srgb, var(--brand) 38%, transparent) 38%,
    rgba(10, 11, 26, 0.92) 100%);
    border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
    box-shadow: 0 28px 60px rgba(8, 10, 25, 0.55);
    overflow: hidden;
    min-height: clamp(250px, 26vw, 320px);
    aspect-ratio: 16 / 9;
    width: 100%;
}

.viewer-still,
.viewer-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.viewer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 22%, rgba(79, 195, 247, 0.35), transparent 55%);
    mix-blend-mode: screen;
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
}

.viewer-still {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 0;
}

.viewer-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
}

.viewer-canvas[hidden] {
    display: none;
}

:fullscreen .viewer-canvas,
:-webkit-full-screen .viewer-canvas,
.favorite-viewer--fullscreen .viewer-canvas {
    width: 100vw;
    height: 100vh;
    display: block;
}

:fullscreen .viewer,
:-webkit-full-screen .viewer,
.favorite-viewer--fullscreen .viewer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    background: radial-gradient(circle at 30% 22%, rgba(79, 195, 247, 0.22) 0%, rgba(18, 20, 38, 0.94) 68%, rgba(10, 12, 26, 0.98) 100%);
    background-color: #14182c;
}

:fullscreen .viewer::before,
:-webkit-full-screen .viewer::before,
.favorite-viewer--fullscreen .viewer::before {
    display: none;
}

:fullscreen .viewer-still,
:-webkit-full-screen .viewer-still,
.favorite-viewer--fullscreen .viewer-still {
    display: none;
}

:fullscreen .viewer-fullscreen,
:-webkit-full-screen .viewer-fullscreen,
.favorite-viewer--fullscreen .viewer-fullscreen {
    right: clamp(1rem, 3vw, 1.6rem);
    bottom: clamp(1rem, 3vw, 1.6rem);
}

.favorite-viewer .viewer-still,
.favorite-viewer .viewer-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.favorite-viewer .viewer-canvas[hidden] { display: none; }

.viewer-still[hidden] {
    display: none !important;
}

.viewer-fullscreen {
    position: absolute;
    right: clamp(0.75rem, 2.4vw, 1.4rem);
    bottom: clamp(0.75rem, 2.4vw, 1.4rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.5rem, 4vw, 2.9rem);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--brand) 55%, transparent);
    background: color-mix(in srgb, var(--brand) 25%, rgba(12, 13, 28, 0.88));
    color: var(--text);
    cursor: pointer;
    z-index: 4;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.viewer-fullscreen:hover {
    background: color-mix(in srgb, var(--brand-2) 38%, rgba(18, 20, 38, 0.92));
    box-shadow: 0 12px 28px rgba(8, 10, 25, 0.45);
}

.viewer-fullscreen:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.45);
}

.viewer-fullscreen[aria-pressed="true"] {
    background: color-mix(in srgb, var(--brand-2) 48%, rgba(18, 20, 38, 0.92));
}

.viewer-fullscreen__icon {
    width: clamp(1.25rem, 2.5vw, 1.5rem);
    height: auto;
    display: none;
}

.viewer-fullscreen__icon--enter {
    display: block;
}

.viewer-fullscreen[aria-pressed="true"] .viewer-fullscreen__icon--enter {
    display: none;
}

.viewer-fullscreen[aria-pressed="true"] .viewer-fullscreen__icon--exit {
    display: block;
}

@media (max-width: 720px) {
    .favorite-viewer {
        grid-template-columns: 1fr;
    }

    .viewer {
        min-height: clamp(240px, 58vw, 360px);
    }

    .viewer-fullscreen {
        align-self: flex-start;
    }
}

.favorite-viewer--fullscreen .viewer-control-group {
    position: absolute;
    left: clamp(0.75rem, 2.4vw, 1.4rem);
    bottom: clamp(0.75rem, 2.4vw, 1.4rem);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: clamp(0.35rem, 1.2vw, 0.6rem);
}

.favorite-viewer--fullscreen .viewer-control-group > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
    background: color-mix(in srgb, var(--brand) 18%, rgba(12, 13, 28, 0.88));
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.favorite-viewer--fullscreen .viewer-control-group > button:hover {
    background: color-mix(in srgb, var(--brand-2) 32%, rgba(18, 20, 38, 0.92));
    box-shadow: 0 12px 28px rgba(8, 10, 25, 0.45);
}

.favorite-viewer--fullscreen .viewer-control-group > button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.45);
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
    :root {
        --header-h: var(--header-height-tablet);
    }

    body {
        padding-top: calc(var(--header-h) + 0.75rem);
    }

    .profile-header {
        grid-template-columns: auto 1fr;
        grid-template-areas:
                "logo nav"
                "title title";
        row-gap: 0.55rem;
        padding: 0.7rem 1rem;
        height: var(--header-h);
        min-height: var(--header-h);
        max-height: var(--header-h);
    }

    .left-header {
        grid-area: logo;
        justify-self: flex-start;
    }

    .center-header {
        grid-area: title;
    }

    .right-header {
        grid-area: nav;
        justify-content: flex-end;
        gap: 0.65rem;
    }

    .right-header .resume-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.65rem 1rem;
        min-height: 44px;
        border-radius: 999px;
        border: 1px solid var(--card-border);
        background: color-mix(in srgb, var(--panel) 92%, transparent);
        font-size: 1rem;
        line-height: 1.2;
    }

    .icon-button {
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding: 1.5rem 1.25rem;
    }

    .card-section {
        margin: 1.5rem auto;
        padding: 1.1rem;
    }

    #about-me,
    #projects,
    #education,
    #skills,
    #favorites {
        margin: 1.5rem auto;
        padding: 0 0.85rem;
    }

    .about-container {
        justify-content: center;
        gap: 1.5rem;
    }

    .about-content {
        flex-basis: 100%;
    }

    .project-meta {
        flex-wrap: wrap;
        gap: 0.6rem;
        align-items: flex-start;
    }

    .side-panel {
        width: min(100vw, 320px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .panel-inner {
        padding: 1.5rem 1rem 1rem;
    }

    .panel-bottom {
        padding: 1rem;
        gap: 0.75rem;
    }

    .panel-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .panel-controls .bb8-toggle {
        align-self: flex-start;
    }

    .panel-controls .motion-toggle {
        width: 100%;
    }

    .connect-btn {
        width: 100%;
        min-height: 48px;
    }

    .menu-toggle {
        top: calc(var(--header-h) + 0.75rem);
        left: 1rem;
        padding: 14px;
    }

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

    .interest-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    :root {
        --header-h: var(--header-height-mobile);
    }

    body {
        padding-top: calc(var(--header-h) + 0.75rem);
    }

    .profile-header {
        grid-template-columns: 1fr;
        grid-template-areas:
                "logo"
                "title"
                "nav";
        row-gap: 0.55rem;
        padding: 0.65rem 0.85rem;
        justify-items: center;
        height: var(--header-h);
        min-height: var(--header-h);
        max-height: var(--header-h);
    }

    .logo-slot {
        width: clamp(96px, 26vw, 124px);
        height: clamp(96px, 26vw, 124px);
        max-width: 124px;
        max-height: 124px;
    }

    .left-header {
        justify-self: center;
    }

    .center-header {
        align-items: center;
    }

    .right-header {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
    }

    .right-header .resume-button {
        width: auto;
        padding: 0.6rem 0.9rem;
        min-height: 42px;
        font-size: 0.95rem;
    }

    .icon-button {
        width: 44px;
        height: 44px;
    }

    .main-content {
        padding: 1.25rem 0.75rem;
    }

    .card-section {
        margin: 1.25rem auto;
        padding: 1rem;
    }

    #about-me,
    #projects,
    #education,
    #skills,
    #favorites {
        padding: 0 0.5rem;
    }

    .about-container {
        gap: 1.5rem;
        align-items: center;
    }

    .about-content,
    .about-text {
        align-items: stretch;
        text-align: left;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-meta__text {
        width: 100%;
    }

    .side-panel {
        width: 100vw;
    }

    .panel-inner,
    .panel-bottom {
        padding-inline: 1rem;
    }

    .menu-toggle {
        left: 0.75rem;
        top: calc(var(--header-h) + 0.5rem);
        padding: 12px;
    }

    .connect-btn {
        font-size: 1.05rem;
        padding: 0.9rem;
        min-height: 52px;
    }
}
.favorite-viewer--fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    z-index: 2147483646;
}

#favorite-model:fullscreen,
#favorite-model:-webkit-full-screen {
    display: block;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Fullscreen button icon swap */
.viewer-fullscreen .icon-exit { display: none; }
.viewer-fullscreen[aria-pressed="true"] .icon-enter { display: none; }
.viewer-fullscreen[aria-pressed="true"] .icon-exit { display: inline; }

@media (max-width: 1024px) {
    :root {
        --header-h: var(--header-height-tablet);
    }

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

    .project-meta {
        flex-wrap: wrap;
    }

    .modal__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .modal__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.experience-snapshot {
    margin-top: 18px;
    padding: 16px 18px;
}
.experience-snapshot h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.experience-snapshot ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}
.snapshot-cta {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.connect-btn--inline {
    margin: 0;
    width: auto;
    min-width: 120px;
    justify-content: center;
}
.modal__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 680px) {
    .modal__facts {
        grid-template-columns: 1fr;
    }
}
