/* ============================================
   Ashutosh Srivastava — Portfolio
   iOS-inspired premium styling
   ============================================ */

:root {
    /* iOS-style palette */
    --ios-blue: #007aff;
    --ios-indigo: #5856d6;
    --ios-purple: #af52de;
    --ios-pink: #ff2d55;
    --ios-teal: #5ac8fa;
    --ios-mint: #00c7be;
    --ios-green: #34c759;
    --ios-orange: #ff9500;

    /* Neutral grays — Apple-spec */
    --gray-50:  #fafafa;
    --gray-100: #f5f5f7;
    --gray-200: #e8e8ed;
    --gray-300: #d2d2d7;
    --gray-400: #a1a1a6;
    --gray-500: #86868b;
    --gray-600: #6e6e73;
    --gray-700: #424245;
    --gray-800: #1d1d1f;
    --gray-900: #0a0a0c;

    /* Premium glass */
    --glass: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.86);
    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 30px -10px rgba(0,0,0,0.08), 0 30px 60px -30px rgba(0,0,0,0.06);

    /* Premium multi-layer shadow */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px -8px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.6) inset;
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 16px 40px -12px rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.7) inset;
    --shadow-xl: 0 8px 16px rgba(0,0,0,0.05), 0 24px 60px -16px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.8) inset;

    /* Spring easing */
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-ios: cubic-bezier(0.22, 1, 0.36, 1);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-2xl: 40px;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background: #fbfbfd;
    color: var(--gray-800);
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', system-ui, sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'kern';
    letter-spacing: -0.011em;
}

::selection {
    background: var(--ios-blue);
    color: #fff;
}

/* Remove Bootstrap's default link underline globally */
a,
a:hover,
a:focus,
a:active {
    text-decoration: none;
}

/* ============= SCROLL PROGRESS BAR ============= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--ios-blue), var(--ios-indigo), var(--ios-purple));
    z-index: 99999;
    transition: width 0.1s linear;
    box-shadow: 0 0 16px rgba(0, 122, 255, 0.6);
}

/* ============= CURSOR GLOW ============= */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(0, 122, 255, 0.18) 0%,
        rgba(88, 86, 214, 0.10) 30%,
        transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s var(--ease-ios);
    will-change: transform;
    mix-blend-mode: multiply;
}

body.cursor-active .cursor-glow {
    opacity: 1;
}

@media (hover: none), (pointer: coarse) {
    .cursor-glow { display: none; }
}

/* ============= MESH GRADIENT (HERO) ============= */
.mesh-gradient {
    position: absolute;
    top: -200px;
    left: -200px;
    right: -200px;
    height: 800px;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 122, 255, 0.25), transparent 40%),
        radial-gradient(circle at 80% 40%, rgba(175, 82, 222, 0.20), transparent 40%),
        radial-gradient(circle at 50% 70%, rgba(90, 200, 250, 0.18), transparent 40%),
        radial-gradient(circle at 30% 90%, rgba(255, 45, 85, 0.10), transparent 40%);
    filter: blur(60px);
    z-index: -1;
    animation: meshMove 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes meshMove {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.05); }
    100% { transform: rotate(-6deg) scale(0.98); }
}

/* ============= FLOATING PARTICLES ============= */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particles span {
    position: absolute;
    display: block;
    width: 6px;
    height: 6px;
    background: var(--ios-blue);
    border-radius: 50%;
    opacity: 0.4;
    box-shadow: 0 0 12px var(--ios-blue);
    animation: particleFloat 18s linear infinite;
}

.particles span:nth-child(1)  { left: 8%;  top: 80%; animation-delay: 0s;   width: 8px; height: 8px; }
.particles span:nth-child(2)  { left: 18%; top: 90%; animation-delay: 2s;   background: var(--ios-purple); box-shadow: 0 0 12px var(--ios-purple); }
.particles span:nth-child(3)  { left: 28%; top: 85%; animation-delay: 4s;   width: 4px; height: 4px; }
.particles span:nth-child(4)  { left: 42%; top: 95%; animation-delay: 1s;   background: var(--ios-teal); box-shadow: 0 0 12px var(--ios-teal); }
.particles span:nth-child(5)  { left: 58%; top: 88%; animation-delay: 3s;   width: 5px; height: 5px; }
.particles span:nth-child(6)  { left: 70%; top: 92%; animation-delay: 5s;   background: var(--ios-indigo); box-shadow: 0 0 12px var(--ios-indigo); }
.particles span:nth-child(7)  { left: 82%; top: 86%; animation-delay: 6s;   width: 7px; height: 7px; }
.particles span:nth-child(8)  { left: 92%; top: 94%; animation-delay: 1.5s; background: var(--ios-pink); box-shadow: 0 0 12px var(--ios-pink); }
.particles span:nth-child(9)  { left: 12%; top: 70%; animation-delay: 7s;   width: 3px; height: 3px; }
.particles span:nth-child(10) { left: 88%; top: 75%; animation-delay: 8s;   width: 5px; height: 5px; background: var(--ios-mint); box-shadow: 0 0 12px var(--ios-mint); }
.particles span:nth-child(11) { left: 50%; top: 80%; animation-delay: 9s;   width: 4px; height: 4px; }
.particles span:nth-child(12) { left: 35%; top: 75%; animation-delay: 10s;  background: var(--ios-orange); box-shadow: 0 0 10px var(--ios-orange); }

@keyframes particleFloat {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10%  { opacity: 0.45; }
    50%  { transform: translateY(-200px) translateX(40px) scale(1.2); opacity: 0.6; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-600px) translateX(-20px) scale(0.8); opacity: 0; }
}

/* ============= 3D TILT CARDS ============= */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.4s var(--ease-ios), box-shadow 0.5s var(--ease-ios), border-color 0.5s var(--ease-ios);
    will-change: transform;
}

.tilt-card .skill-icon,
.tilt-card .research-badge {
    transform: translateZ(40px);
    transition: transform 0.4s var(--ease-ios);
}

/* Shine that follows the cursor across the tilt card */
.tilt-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--mx, 50%) var(--my, 50%),
        rgba(255, 255, 255, 0.35),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s var(--ease-ios);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

.tilt-card:hover::after {
    opacity: 1;
}

/* ============= MAGNETIC BUTTON ============= */
.magnetic {
    transition: transform 0.4s var(--spring) !important;
    will-change: transform;
}

.magnetic-inner {
    display: inline-flex;
    transition: transform 0.4s var(--spring);
    will-change: transform;
}

/* ============= SECTION TITLE REVEAL ============= */
.reveal-word {
    display: inline-block;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.9s var(--ease-ios), opacity 0.9s var(--ease-ios);
}

.reveal-title.in-view .reveal-word {
    transform: translateY(0);
    opacity: 1;
}

.reveal-title {
    overflow: hidden;
    display: inline-block;
}

/* ============= ANIMATED SKILL ICONS GLOW ============= */
.skill-card:hover .skill-icon {
    box-shadow:
        0 1px 0 rgba(255,255,255,0.4) inset,
        0 0 0 6px rgba(0, 122, 255, 0.08),
        0 12px 30px -6px rgba(0, 122, 255, 0.45);
}

/* ============= GLOWING BORDER ON NAV LINKS ============= */
.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(175, 82, 222, 0.15));
    opacity: 0;
    transition: opacity 0.3s var(--ease-ios);
    z-index: -1;
}

.nav-link.active::before {
    opacity: 1;
}

/* ============= LIGHTBOX BACKDROP SHIMMER ============= */
@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* Premium ambient background */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 60% 50% at 20% 0%, rgba(0, 122, 255, 0.06), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(175, 82, 222, 0.05), transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(90, 200, 250, 0.04), transparent 60%),
        #fbfbfd;
    pointer-events: none;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.5;
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* ============= LOADER ============= */
.loader-circle {
    width: 56px;
    height: 56px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============= LOGO AVATAR ============= */
.logo-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
    box-shadow:
        0 0 0 1px rgba(0, 122, 255, 0.15),
        0 0 0 4px rgba(255, 255, 255, 0.95),
        0 8px 20px -8px rgba(0, 122, 255, 0.45);
    flex-shrink: 0;
    transition: transform 0.4s var(--spring), box-shadow 0.4s var(--ease-ios);
}

.logo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

a:hover .logo-avatar,
.group:hover .logo-avatar {
    transform: scale(1.08);
}

/* ============= NAVBAR ============= */
#navbar {
    backdrop-filter: blur(0);
    background: rgba(255, 255, 255, 0);
    transition: background 0.4s var(--ease-ios), backdrop-filter 0.4s var(--ease-ios), box-shadow 0.4s var(--ease-ios);
}

#navbar.scrolled {
    background: rgba(251, 251, 253, 0.72);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.04),
        0 4px 24px -8px rgba(0, 0, 0, 0.05);
}

.nav-link {
    position: relative;
    padding: 6px 14px;
    border-radius: 999px;
    transition: all 0.3s var(--ease-ios);
    color: var(--gray-700);
}

.nav-link:hover {
    color: var(--gray-900);
    background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
    color: var(--ios-blue);
    background: rgba(0, 122, 255, 0.08);
}

.nav-pill-link {
    background: var(--glass-strong);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-ios);
    letter-spacing: -0.005em;
}

.nav-pill-link:hover {
    background: #ffffff;
    border-color: rgba(0, 122, 255, 0.25);
    color: var(--ios-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.mobile-link {
    display: block;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--gray-700);
    transition: all 0.2s var(--ease-ios);
}

.mobile-link:hover {
    color: var(--ios-blue);
    background: var(--gray-100);
}

/* ============= STATUS PILL ============= */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.1rem 0.5rem 0.9rem;
    background: var(--glass-strong);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-700);
    letter-spacing: -0.005em;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 4px 12px -4px rgba(0, 0, 0, 0.06);
}

/* ============= HERO ============= */
.hero-glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 700px;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(0, 122, 255, 0.18), transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(175, 82, 222, 0.12), transparent 60%);
    z-index: -1;
    pointer-events: none;
    filter: blur(40px);
}

.hero-photo {
    transition: transform 0.6s var(--ease-ios);
}

.hero-photo:hover {
    transform: scale(1.03);
}

.typed-cursor {
    color: var(--ios-blue);
    font-weight: 400;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Floating cards animation */
.floating-card {
    animation: float 5s ease-in-out infinite;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-md) !important;
}

.floating-card.bg-white {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.floating-card.bg-slate-900 {
    background: linear-gradient(180deg, #1d1d1f, #0a0a0c) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.1) inset,
        0 10px 30px -10px rgba(0, 0, 0, 0.45) !important;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* ============= MARQUEE / TECH STRIP ============= */
.marquee {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.marquee-track {
    display: flex;
    gap: 0.875rem;
    animation: scroll 32s linear infinite;
    width: max-content;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.tech-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease-ios);
    letter-spacing: -0.005em;
}

.tech-pill:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ============= SECTION TAGS / TITLES ============= */
.section-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    background: rgba(0, 122, 255, 0.08);
    color: var(--ios-blue);
    border: 1px solid rgba(0, 122, 255, 0.15);
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-title {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    line-height: 1.06;
    color: var(--gray-900);
    letter-spacing: -0.035em;
}

/* Override gradient text for iOS-style depth */
.bg-clip-text {
    background-image: linear-gradient(135deg, var(--ios-blue) 0%, var(--ios-indigo) 50%, var(--ios-purple) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

/* ============= PREMIUM BUTTONS ============= */
a.bg-slate-900,
button.bg-slate-900,
button[type="submit"].bg-white {
    background: linear-gradient(180deg, #1d1d1f 0%, #0a0a0c 100%) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.15) inset,
        0 -1px 0 rgba(0,0,0,0.2) inset,
        0 4px 12px -2px rgba(0,0,0,0.25),
        0 8px 24px -8px rgba(0,0,0,0.2) !important;
    transition: all 0.3s var(--ease-ios) !important;
    letter-spacing: -0.005em;
    color: #fff !important;
}

a.bg-slate-900:hover,
button.bg-slate-900:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #007aff 0%, #0051d5 100%) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.2) inset,
        0 6px 18px -4px rgba(0, 122, 255, 0.45),
        0 12px 30px -8px rgba(0, 122, 255, 0.3) !important;
}

/* Don't restyle dark floating-cards as buttons */
.floating-card.bg-slate-900 {
    background: linear-gradient(180deg, #1d1d1f, #0a0a0c) !important;
}

/* iOS-style secondary white/glass button */
a.bg-white.border.border-slate-200,
a.inline-flex.bg-white.border {
    background: var(--glass-strong) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.3s var(--ease-ios) !important;
    letter-spacing: -0.005em;
    color: var(--gray-900) !important;
}

a.bg-white.border.border-slate-200:hover,
a.inline-flex.bg-white.border:hover {
    background: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

/* ============= SKILLS — premium glass cards ============= */
.skill-card {
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    transition: transform 0.5s var(--spring), box-shadow 0.5s var(--ease-ios), border-color 0.5s var(--ease-ios);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255,255,255,0.4), transparent 50%);
    pointer-events: none;
    opacity: 0.8;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s var(--ease-ios);
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(0, 122, 255, 0.25);
}

.skill-card:hover::after {
    opacity: 1;
}

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

.skill-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 -1px 0 rgba(0,0,0,0.1) inset,
        0 8px 20px -6px rgba(0,0,0,0.25);
    transition: transform 0.4s var(--spring);
}

.skill-card:hover .skill-icon {
    transform: scale(1.08) rotate(-3deg);
}

.skill-bar {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.skill-bar span {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--gray-700);
}

.skill-bar .bar {
    height: 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 9999px;
    overflow: hidden;
}

.skill-bar .bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--ios-blue), var(--ios-indigo));
    border-radius: 9999px;
    transition: width 1.8s var(--ease-ios);
    box-shadow: 0 0 12px rgba(0, 122, 255, 0.4);
}

.tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.tech-chips span {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    font-size: 0.66rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--gray-600);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 9999px;
    letter-spacing: 0.02em;
    transition: all 0.3s var(--ease-ios);
    border: 1px solid transparent;
}

.skill-card:hover .tech-chips span {
    background: rgba(0, 122, 255, 0.08);
    color: var(--ios-blue);
    border-color: rgba(0, 122, 255, 0.15);
}

/* ============= TIMELINE ============= */
.timeline {
    position: relative;
    padding-left: 2.25rem;
    max-width: 920px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--ios-blue), rgba(0, 122, 255, 0.2), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.25rem;
    top: 1.25rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--ios-blue);
    box-shadow:
        0 0 0 6px rgba(0, 122, 255, 0.1),
        0 4px 12px -2px rgba(0, 122, 255, 0.3);
    z-index: 2;
}

.timeline-content {
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    transition: all 0.5s var(--ease-ios);
    box-shadow: var(--shadow-md);
}

.timeline-content:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: rgba(0, 122, 255, 0.2);
}

.timeline-tag {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-700);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .timeline {
        padding-left: 0;
    }

    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        width: 50%;
        padding-right: 2.5rem;
    }

    .timeline-item:nth-child(even) {
        margin-left: 50%;
        padding-left: 2.5rem;
        padding-right: 0;
    }

    .timeline-item .timeline-dot {
        left: auto;
        right: -14px;
        top: 1.5rem;
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: -14px;
        right: auto;
    }
}

/* ============= RESEARCH ============= */
.research-card {
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.85rem;
    transition: all 0.5s var(--ease-ios);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.research-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(0, 122, 255, 0.2);
}

.research-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'JetBrains Mono', monospace;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.education-card {
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.85rem;
    transition: all 0.5s var(--ease-ios);
    box-shadow: var(--shadow-md);
}

.education-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 122, 255, 0.2);
}

.dot-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 1px, transparent 0);
    background-size: 24px 24px;
}

/* ============= GALLERY ============= */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    cursor: pointer;
    background: var(--gray-200);
    box-shadow: var(--shadow-md);
    transition: transform 0.5s var(--spring), box-shadow 0.5s var(--ease-ios);
}

.gallery-item:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-xl);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease-ios);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 12, 0.85), rgba(10, 10, 12, 0.15) 50%, transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.4rem;
    color: white;
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.5s var(--ease-ios);
    backdrop-filter: blur(0);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ============= CONTACT ============= */
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.4s var(--ease-ios);
    color: inherit;
    text-decoration: none;
    border: 1px solid transparent;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    color: inherit;
}

.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.form-input {
    width: 100%;
    padding: 0.95rem 1.15rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s var(--ease-ios);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

/* ============= FOOTER ============= */
.social-link {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--glass-strong);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-ios);
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.social-link:hover {
    background: linear-gradient(180deg, #1d1d1f, #0a0a0c);
    color: white;
    border-color: var(--gray-900);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ============= LIGHTBOX ============= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-ios), visibility 0.4s var(--ease-ios);
    padding: 80px 24px 120px;
}

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

.lightbox-stage {
    position: relative;
    max-width: min(1100px, 92vw);
    max-height: 75vh;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.94);
    transition: transform 0.5s var(--spring);
}

.lightbox.open .lightbox-stage {
    transform: scale(1);
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.04);
    opacity: 0;
    transition: opacity 0.35s var(--ease-ios);
}

#lightbox-img.loaded {
    opacity: 1;
}

.lightbox-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.2s var(--ease-ios);
}

.lightbox.loading .lightbox-spinner {
    opacity: 1;
}

.lightbox-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-ios);
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.32);
}

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

.lightbox-close {
    top: 24px;
    right: 24px;
}

.lightbox-prev {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev:active {
    transform: translateY(-50%) scale(0.96);
}

.lightbox-next:active {
    transform: translateY(-50%) scale(0.96);
}

.lightbox-caption {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 92vw;
    text-align: center;
    color: white;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

.lightbox-caption h4 {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    margin: 0 0 2px 0;
    letter-spacing: -0.01em;
}

.lightbox-caption p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.lightbox-counter {
    display: inline-block;
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
}

.gallery-item {
    cursor: zoom-in;
}

body.no-scroll {
    overflow: hidden;
}

@media (max-width: 640px) {
    .lightbox-btn {
        width: 42px;
        height: 42px;
    }
    .lightbox-close {
        top: 16px;
        right: 16px;
    }
    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }
    .lightbox-caption {
        bottom: 16px;
        padding: 10px 16px;
    }
}

/* ============= EASTER EGG PILL ============= */
.egg-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem 0.7rem 0.9rem;
    background: var(--glass-strong);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.4s var(--spring);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.7) inset,
        0 4px 14px -4px rgba(0, 122, 255, 0.18),
        0 12px 30px -12px rgba(0, 122, 255, 0.22);
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--gray-800);
    letter-spacing: 0.02em;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: eggPulse 3s ease-in-out infinite;
}

@keyframes eggPulse {
    0%, 100% {
        box-shadow:
            0 1px 0 rgba(255,255,255,0.7) inset,
            0 4px 14px -4px rgba(0, 122, 255, 0.18),
            0 12px 30px -12px rgba(0, 122, 255, 0.22),
            0 0 0 0 rgba(0, 122, 255, 0.35);
    }
    50% {
        box-shadow:
            0 1px 0 rgba(255,255,255,0.7) inset,
            0 4px 14px -4px rgba(0, 122, 255, 0.25),
            0 12px 30px -12px rgba(0, 122, 255, 0.3),
            0 0 0 12px rgba(0, 122, 255, 0);
    }
}

.egg-pill:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: rgba(0, 122, 255, 0.3);
}

.egg-pill:active {
    transform: translateY(-1px) scale(1);
}

.egg-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
    color: white;
    font-size: 0.78rem;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.3) inset,
        0 4px 10px -2px rgba(0, 122, 255, 0.45);
    animation: eggWiggle 4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes eggWiggle {
    0%, 90%, 100% { transform: rotate(0deg); }
    93% { transform: rotate(-10deg); }
    96% { transform: rotate(10deg); }
}

.egg-pill-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-800);
}

.egg-pill-hint {
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ios-blue);
    padding: 0.18rem 0.5rem;
    background: rgba(0, 122, 255, 0.08);
    border-radius: 999px;
    border: 1px solid rgba(0, 122, 255, 0.18);
}

.egg-pill.revealed .egg-pill-hint {
    color: var(--ios-green);
    background: rgba(52, 199, 89, 0.08);
    border-color: rgba(52, 199, 89, 0.18);
}

.egg-pill.revealed .egg-pill-hint::before {
    content: 'hide ';
}

.egg-pill.revealed {
    animation: none;
}

/* ============= GAME REVEAL CONTAINER ============= */
.game-reveal {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        max-height 0.9s var(--ease-ios),
        opacity 0.6s var(--ease-ios),
        transform 0.6s var(--ease-ios);
    transform: translateY(20px) scale(0.98);
    pointer-events: none;
}

.game-reveal.revealed {
    max-height: 3000px;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ============= SNAKE GAME ============= */
.game-card {
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,122,255,0.04), transparent 60%);
    pointer-events: none;
    border-radius: inherit;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    position: relative;
    gap: 1rem;
}

.game-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}

.game-player-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    font-family: 'JetBrains Mono', monospace;
}

.game-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ios-blue);
    box-shadow:
        0 0 0 2px rgba(255,255,255,0.9),
        0 2px 6px -1px rgba(0,0,0,0.2);
    transition: background 0.2s var(--ease-ios);
}

.game-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.game-value {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.game-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.85rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.game-status.playing {
    background: rgba(52, 199, 89, 0.1);
    color: var(--ios-green);
    border-color: rgba(52, 199, 89, 0.2);
}

.game-status.over {
    background: rgba(255, 59, 48, 0.1);
    color: var(--ios-pink);
    border-color: rgba(255, 59, 48, 0.2);
}

.game-stage {
    position: relative;
    background: linear-gradient(135deg, #f5f5f7, #e8e8ed);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 8px 24px -8px rgba(0,0,0,0.1);
    aspect-ratio: 16/9;
    width: 100%;
}

@media (max-width: 640px) {
    .game-stage {
        aspect-ratio: 4/3;
    }
}

#snake-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: -webkit-optimize-contrast;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.62);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s var(--ease-ios), backdrop-filter 0.4s var(--ease-ios);
    z-index: 2;
    padding: 1.5rem;
    overflow: auto;
}

.game-overlay-inner {
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.game-overlay-msg {
    color: rgba(255, 255, 255, 0.85);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.game-color-picker {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 1.4rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.game-color-row {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}

.game-picker-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.06em;
    min-width: 92px;
    text-align: left;
}

.game-swatches {
    display: flex;
    gap: 8px;
}

.game-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.25s var(--ease-ios);
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.game-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.game-swatch.selected {
    border-color: white;
    transform: scale(1.18);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.18),
        0 6px 14px -2px rgba(0, 0, 0, 0.45);
}

.game-swatch.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.game-swatch.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

.game-swatch.disabled:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.game-button {
    padding: 0.85rem 2rem;
    background: linear-gradient(180deg, #007aff, #0051d5);
    color: white;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-ios);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.25) inset,
        0 8px 20px -4px rgba(0, 122, 255, 0.5);
    letter-spacing: -0.005em;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.25) inset,
        0 12px 28px -4px rgba(0, 122, 255, 0.6);
}

.game-button:active {
    transform: translateY(0);
}

.game-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.game-keys-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.game-keys-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gray-500);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    background: rgba(0,0,0,0.04);
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.06);
}

.game-vs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--gray-400);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.game-dpad-hint {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--gray-500);
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.game-keys {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.game-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 2px 0 rgba(0,0,0,0.06),
        0 4px 8px -2px rgba(0,0,0,0.06);
}

.game-kbd-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--gray-500);
    padding: 0 0.4rem;
}

.game-dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.game-dpad-row {
    display: flex;
    gap: 6px;
}

.game-dpad-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    color: var(--gray-700);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-ios);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-dpad-btn:active {
    transform: scale(0.92);
    background: var(--ios-blue);
    color: white;
    border-color: var(--ios-blue);
}

/* ============= TO TOP BUTTON ============= */
#to-top {
    transition: opacity 0.3s var(--ease-ios), visibility 0.3s var(--ease-ios), background 0.3s var(--ease-ios), transform 0.3s var(--spring);
    background: linear-gradient(180deg, #1d1d1f, #0a0a0c) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.15) inset,
        0 8px 24px -8px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#to-top.visible {
    opacity: 1;
    visibility: visible;
}

#to-top:hover {
    transform: translateY(-3px);
    background: linear-gradient(180deg, #007aff, #0051d5) !important;
}

/* ============= GENERAL HELPER OVERRIDES ============= */
/* iOS-style softer slate backgrounds */
.bg-slate-50 {
    background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%) !important;
}

/* Hero image card refinement */
.bg-gradient-to-br.from-brand-50.via-white.to-indigo-50 {
    background: var(--glass-strong) !important;
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--shadow-xl) !important;
}

/* About info cards refinement */
.flex.items-start.gap-3.p-4.bg-white.rounded-xl.border.border-slate-100 {
    background: var(--glass) !important;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s var(--ease-ios);
}

.flex.items-start.gap-3.p-4.bg-white.rounded-xl.border.border-slate-100:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 122, 255, 0.15) !important;
}

/* Contact card outer wrapper */
.bg-gradient-to-br.from-slate-900.via-slate-900 {
    background:
        linear-gradient(135deg, #1d1d1f 0%, #0a0a0c 100%) !important;
    border-radius: var(--radius-2xl) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.08) inset,
        0 30px 80px -20px rgba(0, 0, 0, 0.35) !important;
}

/* Book chapters dark card */
.bg-gradient-to-br.from-slate-900.to-slate-800 {
    background: linear-gradient(135deg, #1d1d1f 0%, #0a0a0c 100%) !important;
    border-radius: var(--radius-2xl) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.08) inset,
        0 20px 60px -16px rgba(0, 0, 0, 0.3) !important;
}

/* Awards card */
.bg-white.rounded-3xl.border.border-slate-100 {
    background: var(--glass) !important;
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-2xl) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* About image rotated background */
.bg-gradient-to-br.from-brand-500.to-indigo-600 {
    background: linear-gradient(135deg, #007aff, #5856d6) !important;
    box-shadow: 0 20px 60px -16px rgba(0, 122, 255, 0.35);
}

/* ============= UTILITIES ============= */
@media (max-width: 640px) {
    .section-title {
        font-size: 2.1rem;
    }
}

section {
    position: relative;
}

/* Smooth focus ring throughout */
*:focus-visible {
    outline: 2px solid var(--ios-blue);
    outline-offset: 3px;
    border-radius: 6px;
}
