/* macOS Design System — Dark Mode */
:root {
    --bg-primary: #101010;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: rgba(28, 28, 30, 0.82);
    --bg-elevated: #2c2c2e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-light: rgba(10, 132, 255, 0.15);
    --accent-glow: rgba(0, 255, 65, 0.6);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --blur: saturate(180%) blur(20px);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
    --tl-red: #ff5f57;
    --tl-yellow: #febc2e;
    --tl-green: #28c840;
    --highlight: #ff6b6b;
    --success: #30d158;
    --wallpaper-bg: #050505;
    --wallpaper-canvas-opacity: 0.75;
    --titlebar-bg: linear-gradient(180deg, #2a2a2c 0%, #1e1e20 100%);
    --terminal-matrix-opacity: 0.75;
}

html[data-theme="light"] {
    --bg-primary: #ebebf0;
    --bg-secondary: #ffffff;
    --bg-tertiary: rgba(255, 255, 255, 0.78);
    --bg-elevated: #f2f2f7;
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-tertiary: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-light: rgba(0, 113, 227, 0.12);
    --accent-glow: rgba(0, 113, 227, 0.35);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    --highlight: #d70015;
    --wallpaper-bg: #d1d1d6;
    --wallpaper-canvas-opacity: 0.62;
    --titlebar-bg: linear-gradient(180deg, #ececee 0%, #e3e3e8 100%);
    --terminal-matrix-opacity: 0.62;
}

.about-internship {
    margin: 14px 0 0;
    color: #ff3b30;
    font-size: 1em;
    line-height: 1.55;
}

.about-internship strong {
    color: #ff3b30;
    font-weight: 700;
}

html[data-theme="light"] .about-internship,
html[data-theme="light"] .about-internship strong {
    color: #d70015;
}

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

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

body {
    margin: 0;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Custom cursor — terminal-inspired glow dot */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00FF41;
    box-shadow:
        0 0 6px #00FF41,
        0 0 12px rgba(0, 255, 65, 0.6),
        0 0 20px rgba(0, 255, 65, 0.3);
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition:
        width 0.18s var(--ease-spring),
        height 0.18s var(--ease-spring),
        background 0.15s ease,
        box-shadow 0.15s ease;
    mix-blend-mode: screen;
}

.custom-cursor.hover {
    width: 32px;
    height: 32px;
    background: rgba(0, 255, 65, 0.15);
    border: 1.5px solid #00FF41;
    box-shadow:
        0 0 8px rgba(0, 255, 65, 0.8),
        0 0 20px rgba(0, 255, 65, 0.4),
        inset 0 0 8px rgba(0, 255, 65, 0.2);
}

.custom-cursor.pressed {
    width: 24px;
    height: 24px;
    background: rgba(0, 255, 65, 0.3);
    box-shadow:
        0 0 10px #00FF41,
        0 0 24px rgba(0, 255, 65, 0.5);
}

.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00FF41;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    animation: trailFade 0.6s ease-out forwards;
    mix-blend-mode: screen;
}

@keyframes trailFade {
    0% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
}

/* Hide native cursor when custom cursor active (except during resize) */
body.custom-cursor-active:not(.tab-resizing),
body.custom-cursor-active:not(.tab-resizing) * {
    cursor: none !important;
}

body.tab-resizing .custom-cursor {
    display: none;
}

/* Wallpaper — terminal-inspired animated grid + glow */
.wallpaper {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--wallpaper-bg);
    pointer-events: none;
    overflow: hidden;
    transition: background 0.35s ease;
}

.bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: var(--wallpaper-canvas-opacity);
    transition: opacity 0.35s ease;
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    mix-blend-mode: screen;
}

.aurora-1 {
    width: 55vw;
    height: 45vh;
    top: -10%;
    left: -5%;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.18) 0%, transparent 70%);
    animation: auroraDrift1 18s ease-in-out infinite alternate;
}

.aurora-2 {
    width: 50vw;
    height: 40vh;
    bottom: -15%;
    right: -8%;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.14) 0%, transparent 70%);
    animation: auroraDrift2 22s ease-in-out infinite alternate;
}

@keyframes auroraDrift1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(8%, 6%) rotate(8deg); }
}

@keyframes auroraDrift2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-6%, -8%) rotate(-6deg); }
}

.wallpaper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridPulse 4s ease-in-out infinite;
}

.wallpaper::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(0, 255, 65, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 80% 70%, rgba(10, 132, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 30% 30% at 60% 30%, rgba(0, 255, 65, 0.04) 0%, transparent 45%);
    animation: glowShift 12s ease-in-out infinite alternate;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes glowShift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-2%, 1%) scale(1.02); }
}

/* Floating ambient orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: orbFloat 14s ease-in-out infinite;
}

.orb-1 {
    width: 280px;
    height: 280px;
    background: rgba(0, 255, 65, 0.06);
    top: 15%;
    left: 8%;
    animation-delay: 0s;
    animation-duration: 16s;
}

.orb-2 {
    width: 220px;
    height: 220px;
    background: rgba(10, 132, 255, 0.07);
    bottom: 12%;
    right: 10%;
    animation-delay: -4s;
    animation-duration: 18s;
}

.orb-3 {
    width: 180px;
    height: 180px;
    background: rgba(0, 255, 65, 0.04);
    top: 50%;
    left: 55%;
    animation-delay: -8s;
    animation-duration: 14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(25px, -30px) scale(1.06) rotate(2deg); }
    50% { transform: translate(-20px, 20px) scale(0.97) rotate(-2deg); }
    75% { transform: translate(15px, 25px) scale(1.03) rotate(1deg); }
}

/* Pulsing grid glow spots */
.glow-spot {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,255,65,0.15) 0%, transparent 70%);
    filter: blur(40px);
    animation: spotPulse 6s ease-in-out infinite;
}

.glow-spot-1 { top: 20%; left: 30%; animation-delay: 0s; }
.glow-spot-2 { top: 60%; left: 70%; animation-delay: -2s; }
.glow-spot-3 { top: 40%; left: 80%; animation-delay: -4s; }

@keyframes spotPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Scanline shimmer — subtle CRT feel */
.scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.06) 0px,
        rgba(0, 0, 0, 0.06) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.35;
    animation: scanShift 8s linear infinite;
}

@keyframes scanShift {
    0% { transform: translateY(0); }
    100% { transform: translateY(12px); }
}

html[data-theme="light"] .aurora {
    opacity: 0.5;
    mix-blend-mode: multiply;
}

html[data-theme="light"] .aurora-1 {
    background: radial-gradient(circle, rgba(0, 113, 227, 0.24) 0%, transparent 70%);
}

html[data-theme="light"] .aurora-2 {
    background: radial-gradient(circle, rgba(90, 200, 250, 0.2) 0%, transparent 70%);
}

html[data-theme="light"] .wallpaper::before {
    background-image:
        linear-gradient(rgba(0, 113, 227, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 113, 227, 0.07) 1px, transparent 1px);
}

html[data-theme="light"] .wallpaper::after {
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(0, 113, 227, 0.14) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 80% 70%, rgba(90, 200, 250, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 30% 30% at 60% 30%, rgba(0, 113, 227, 0.08) 0%, transparent 45%);
}

html[data-theme="light"] .orb-1 {
    background: rgba(0, 113, 227, 0.12);
}

html[data-theme="light"] .orb-2 {
    background: rgba(90, 200, 250, 0.14);
}

html[data-theme="light"] .orb-3 {
    background: rgba(0, 113, 227, 0.08);
}

html[data-theme="light"] .glow-spot {
    background: radial-gradient(circle, rgba(0, 113, 227, 0.2) 0%, transparent 70%);
}

html[data-theme="light"] .scanline {
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.08) 0px,
        rgba(255, 255, 255, 0.08) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.25;
}

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: var(--bg-tertiary);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
    animation: slideDown 0.5s var(--ease-out) both;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.menu-bar.scrolled {
    box-shadow: var(--shadow-sm);
}

.menu-bar-inner {
    width: min(1100px, 94%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-brand {
    font-weight: 600;
    font-size: 14px;
    font-family: 'White Rabbit Regular', sans-serif;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.menu-brand:hover {
    color: #00FF41;
}

.menu-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    transition: all 0.25s var(--ease-out);
}

.menu-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.menu-nav a.active {
    color: var(--accent);
    background: var(--accent-light);
}

.menu-nav a.nav-terminal:hover {
    color: #00FF41;
    background: rgba(0, 255, 65, 0.1);
}

.menu-nav a.nav-terminal.active {
    color: #00FF41;
    background: rgba(0, 255, 65, 0.12);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    padding: 0;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle .theme-icon-dark { display: none; }
.theme-toggle .theme-icon-light { display: inline; }

html[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .theme-toggle .theme-icon-dark { display: inline; }
html[data-theme="light"] .theme-toggle .theme-icon-light { display: none; }

html[data-theme="light"] .menu-nav a:hover {
    background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .menu-nav a.nav-terminal:hover,
html[data-theme="light"] .menu-nav a.nav-terminal.active {
    color: #0071e3;
    background: var(--accent-light);
}

html[data-theme="light"] .mac-titlebar {
    background: var(--titlebar-bg);
}

html[data-theme="light"] .mac-window:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .mac-resize-edge:hover,
html[data-theme="light"] .mac-resizable.resizing .mac-resize-edge.active {
    background: transparent;
}

html[data-theme="light"] .custom-cursor {
    background: #0071e3;
    box-shadow:
        0 0 6px #0071e3,
        0 0 12px rgba(0, 113, 227, 0.5),
        0 0 20px rgba(0, 113, 227, 0.25);
    mix-blend-mode: normal;
}

html[data-theme="light"] .cursor-trail {
    background: #0071e3;
    box-shadow:
        0 0 6px rgba(0, 113, 227, 0.75),
        0 0 14px rgba(0, 113, 227, 0.32);
    mix-blend-mode: normal;
}

html[data-theme="light"] .custom-cursor.hover {
    background: rgba(0, 113, 227, 0.14);
    border-color: #0071e3;
    box-shadow:
        0 0 8px rgba(0, 113, 227, 0.8),
        0 0 20px rgba(0, 113, 227, 0.38),
        inset 0 0 8px rgba(0, 113, 227, 0.2);
}

html[data-theme="light"] .custom-cursor.pressed {
    background: rgba(0, 113, 227, 0.28);
    box-shadow:
        0 0 10px #0071e3,
        0 0 24px rgba(0, 113, 227, 0.48);
}

html[data-theme="light"] .scanline {
    opacity: 0.08;
}

.menu-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

/* Main */
.page {
    position: relative;
    z-index: 1;
    padding-top: 44px;
    min-height: 100vh;
}

.container-main {
    width: min(1100px, 94%);
    margin: 0 auto;
    padding: 32px 0 64px;
}

/* macOS Window */
.mac-window {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-strong);
    overflow: hidden;
    margin-bottom: 20px;
    transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
    opacity: 0;
    transform: translateY(24px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mac-window.mac-resizable {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 160px;
}

.mac-window.mac-resizable.resizing {
    transition: none;
    box-shadow: var(--shadow-lg);
    z-index: 5;
}

.mac-window.mac-resizable.edge-hover {
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(0, 255, 65, 0.35);
}

html[data-theme="light"] .mac-window.mac-resizable.edge-hover {
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(0, 113, 227, 0.35);
}

.mac-window.mac-resizable .mac-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: none;
}

.mac-window.revealed {
    opacity: 1;
    transform: translateY(0);
}

.mac-window:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="light"] .mac-window:hover {
    border-color: rgba(0, 0, 0, 0.1);
}

.mac-window.collapsed .mac-body {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.mac-window.minimized {
    transform: scale(0.95);
    opacity: 0.6;
    pointer-events: none;
}

.mac-titlebar {
    position: relative;
    z-index: 55;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--titlebar-bg);
    border-bottom: 1px solid var(--border);
    user-select: none;
    cursor: default;
}

.traffic-lights {
    display: flex;
    gap: 6px;
    margin-right: 12px;
    align-items: center;
    padding: 0 2px;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 0.5px solid rgba(0, 0, 0, 0.18);
    cursor: default;
    position: relative;
    padding: 0;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -0.5px 0 rgba(0, 0, 0, 0.12);
    transition: filter 0.12s ease, transform 0.12s ease;
    -webkit-app-region: no-drag;
}

.traffic-light::before,
.traffic-light::after {
    position: absolute;
    inset: 0;
    margin: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    display: block;
}

.mac-titlebar:hover .traffic-light::before,
.mac-titlebar:hover .traffic-light::after,
.browser-chrome-row:hover .traffic-light::before,
.browser-chrome-row:hover .traffic-light::after,
.traffic-lights:hover .traffic-light::before,
.traffic-lights:hover .traffic-light::after,
.traffic-light:hover::before,
.traffic-light:hover::after {
    opacity: 1;
}

.traffic-light.close {
    background: #ff5f57;
    border-color: rgba(130, 22, 18, 0.45);
    cursor: pointer;
}

.traffic-light.close::after {
    content: '';
    width: 8px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 1.5 L6.5 6.5 M6.5 1.5 L1.5 6.5' stroke='rgba(80,0,0,0.75)' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.traffic-light.minimize {
    background: #febc2e;
    border-color: rgba(130, 95, 15, 0.45);
    cursor: pointer;
}

.traffic-light.minimize::after {
    content: '';
    width: 8px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='1.5' y1='4' x2='6.5' y2='4' stroke='rgba(80,50,0,0.8)' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.traffic-light.maximize {
    background: #28c840;
    border-color: rgba(15, 100, 30, 0.45);
    cursor: pointer;
}

.traffic-light.maximize::after {
    content: '';
    width: 8px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3.5 L1.5 1.5 L3.5 1.5' fill='none' stroke='rgba(0,60,0,0.75)' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.5 4.5 L6.5 6.5 L4.5 6.5' fill='none' stroke='rgba(0,60,0,0.75)' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.traffic-light:hover {
    filter: brightness(1.05);
}

.traffic-light:active {
    filter: brightness(0.9);
    transform: scale(0.96);
}

.mac-window.mac-closing {
    animation: macClose 0.42s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

@keyframes macClose {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(0.92) translateY(4px); opacity: 0.9; }
    70% { transform: scale(0.88) translateY(10px); opacity: 0.4; }
    100% { transform: scale(0.85) translateY(14px); opacity: 0; }
}

.mac-window.mac-minimizing {
    animation: macMinimize 0.46s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

@keyframes macMinimize {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    40% { transform: translateY(12px) scale(0.96); opacity: 0.85; }
    100% { transform: translateY(28px) scale(0.93); opacity: 0.25; }
}

.mac-window.mac-maximizing {
    animation: macMaximize 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes macMaximize {
    0% { transform: scale(1); }
    50% { transform: scale(1.045); }
    100% { transform: scale(1.03); }
}

.mac-window.mac-maximizing .mac-body {
    max-height: 6000px;
}

.mac-window {
    will-change: transform, opacity;
}

.mac-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    font-family: 'White Rabbit Regular', sans-serif;
    color: var(--text-secondary);
    margin-right: 52px;
}

.mac-body-compact {
    padding: 14px 16px;
}

.mac-body {
    padding: 20px 24px;
    overflow: hidden;
    transition: max-height 0.45s var(--ease-in-out), opacity 0.35s var(--ease-out), padding 0.35s var(--ease-out);
    max-height: 5000px;
    opacity: 1;
}

/* Layout Grid */
.hero-grid {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 20px;
    align-items: start;
}

.section-label {
    font-size: 28px;
    font-weight: 700;
    font-family: 'White Rabbit Regular', sans-serif;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 48px 0 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.6s var(--ease-out);
    scroll-margin-top: 56px;
}

#projects,
#selected-publications {
    scroll-margin-top: 56px;
}

.section-label.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-label span {
    color: var(--text-tertiary);
    font-weight: 400;
    font-size: 15px;
    margin-left: 12px;
}

/* Profile */
.profile-photo {
    width: 72%;
    max-width: 168px;
    display: block;
    margin: 10px auto 14px;
    border-radius: var(--radius-md);
}

.profile-photo-full {
    width: 72%;
    max-width: 168px;
    display: block;
    margin: 10px auto 14px;
    border-radius: var(--radius-md);
}

.mac-body-photo {
    padding: 4px 12px 8px;
    margin: 0;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-sidebar .mac-window {
    margin-bottom: 16px;
}

.contact-body {
    text-align: center;
    padding: 16px 18px;
}

.contact-body .profile-name {
    font-size: 1.5em;
    margin: 0 0 4px;
}

.contact-body .profile-role {
    font-size: 1.1em;
    opacity: 0.85;
    margin-bottom: 0;
}

.contact-divider {
    border: none;
    border-top: 1px solid var(--border-strong);
    margin: 16px 0;
    opacity: 0.5;
}

.link-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    max-width: 140px;
    margin: 0 auto;
    justify-items: center;
    align-items: center;
}

.link-grid a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.25s var(--ease-out), transform 0.25s var(--ease-spring);
    padding: 4px;
}

.link-grid a:hover {
    color: #00FF41;
    transform: scale(1.1);
}

.link-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0 auto;
    gap: 8px;
}

.link-row a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.25s var(--ease-out), transform 0.25s var(--ease-spring);
    padding: 6px;
}

.link-row a:hover {
    color: #00FF41;
    transform: scale(1.1);
}

.contact-body .contact-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin: 16px 0 4px;
}

.profile-role {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 20px;
    transition: all 0.25s var(--ease-spring);
    border: 1px solid var(--border-strong);
}

.social-icon:hover {
    color: var(--accent-glow);
    background: rgba(0, 255, 65, 0.1);
    border-color: rgba(0, 255, 65, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.15);
}

.contact-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 12px;
    line-height: 1.5;
}

/* Research tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s var(--ease-out);
}

.tag:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: rgba(0, 255, 65, 0.25);
    color: var(--accent-glow);
}

/* News Timeline */
.news-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    opacity: 0;
    transform: translateX(16px);
}

.news-item.revealed {
    opacity: 1;
    transform: translateX(0);
}

.news-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

.news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.contact-text a {
    color: #0a84ff;
    text-decoration: none;
}

.contact-text a:hover {
    color: #00FF41;
}

/* News — always expanded */
.news-always-open .news-item {
    cursor: default;
}

.news-always-open .news-header {
    cursor: default;
    padding-bottom: 4px;
}

.news-always-open .news-chevron {
    display: none;
}

.news-always-open .news-item.open .news-body,
.news-always-open .news-body {
    max-height: none;
    padding: 0 16px 12px;
    overflow: visible;
}

.news-date {
    font-size: 13px;
    font-weight: 600;
    font-family: 'White Rabbit Regular', sans-serif;
    color: #00FF41;
    letter-spacing: -0.01em;
}

/* Browser-style tab widget */
.tab-section {
    margin-top: 48px;
}

.browser-tabs-widget {
    position: relative;
    width: 100%;
    min-width: 280px;
    max-width: 100%;
}

.browser-chrome-row {
    position: relative;
    z-index: 55;
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding: 10px 12px 0;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

html[data-theme="light"] .browser-chrome-row {
    background: rgba(0, 0, 0, 0.05);
}

.browser-chrome-row .tab-chrome-lights {
    flex-shrink: 0;
    margin: 0 14px 8px 4px;
    align-self: center;
}

.browser-tab-strip {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    margin: 0;
    padding: 0;
    min-width: 0;
    background: transparent;
    border: none;
    overflow: hidden;
}

.browser-tab-strip .mac-tab {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    height: 34px;
    padding: 0 10px;
    margin: 0;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.2s var(--ease-out),
        color 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.browser-tab-strip .mac-tab i {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-tertiary);
}

.browser-tab-strip .mac-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-tab-strip .mac-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
}

.browser-tab-strip .mac-tab.active {
    height: 36px;
    margin-bottom: -1px;
    padding-bottom: 1px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-strong);
    box-shadow: 0 -1px 0 var(--bg-secondary);
    z-index: 2;
}

.browser-tab-strip .mac-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--bg-secondary);
    z-index: 3;
}

.browser-tabs-widget.edge-hover .browser-chrome-row,
.browser-tabs-widget.resizing .browser-chrome-row {
    border-color: rgba(0, 255, 65, 0.55);
}

.browser-tabs-widget.edge-hover .mac-tab.active,
.browser-tabs-widget.resizing .mac-tab.active {
    border-color: rgba(0, 255, 65, 0.55);
}

html[data-theme="light"] .browser-tabs-widget.edge-hover .browser-chrome-row,
html[data-theme="light"] .browser-tabs-widget.resizing .browser-chrome-row,
html[data-theme="light"] .browser-tabs-widget.edge-hover .mac-tab.active,
html[data-theme="light"] .browser-tabs-widget.resizing .mac-tab.active {
    border-color: rgba(0, 113, 227, 0.55);
}

html[data-theme="light"] .browser-tab-strip .mac-tab {
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .browser-tab-strip .mac-tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .browser-tab-strip .mac-tab.active {
    color: var(--text-primary);
}

.browser-tab-strip .mac-tab.active i {
    color: #00FF41;
}

html[data-theme="light"] .browser-tab-strip .mac-tab.active i {
    color: #0071e3;
}

.tab-file-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: var(--titlebar-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tab-file-name {
    font-family: 'White Rabbit Regular', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.tab-panel-shell {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border-strong);
    border-top: none;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

.browser-tabs-widget.edge-hover .tab-panel-shell,
.browser-tabs-widget.resizing .tab-panel-shell {
    border-color: rgba(0, 255, 65, 0.55);
    box-shadow: var(--shadow-lg);
}

html[data-theme="light"] .browser-tabs-widget.edge-hover .tab-panel-shell,
html[data-theme="light"] .browser-tabs-widget.resizing .tab-panel-shell {
    border-color: rgba(0, 113, 227, 0.55);
}

.browser-tabs-widget.resizing {
    user-select: none;
    z-index: 5;
}

.tab-panel-shell .tab-panel-window.mac-window {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    background: transparent;
    opacity: 1;
    transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.tab-panel-shell .tab-panel-window.mac-window:hover {
    box-shadow: none;
    border-color: transparent;
}

.tab-panel-window {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    position: relative;
    height: 280px;
    display: flex;
    flex-direction: column;
    transition: none;
}

.tab-panel-window.resizable-window {
    min-height: 120px;
    max-height: 85vh;
}

.tab-panel-shell.resizing .tab-panel-window,
.tab-panel-window.resizing {
    box-shadow: none;
    transition: none;
}

.tab-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* macOS-style resize edges */
.mac-resize-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.mac-resize-edge {
    position: absolute;
    pointer-events: auto;
    touch-action: none;
    background: transparent;
    transition: background 0.12s ease;
    z-index: 51;
}

.mac-resize-edge:hover,
.mac-resizable.resizing .mac-resize-edge.active {
    /* The outer window border is the resize affordance; do not draw a
       second inset line that appears detached from the tab bar. */
    background: transparent;
}

.mac-resize-edge[data-edge="n"] {
    top: 0;
    left: 14px;
    right: 14px;
    height: 10px;
    cursor: ns-resize;
}

.mac-resize-edge[data-edge="s"] {
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 10px;
    cursor: ns-resize;
}

.mac-resize-edge[data-edge="e"] {
    top: 14px;
    bottom: 14px;
    right: 0;
    width: 10px;
    cursor: ew-resize;
}

.mac-resize-edge[data-edge="w"] {
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 10px;
    cursor: ew-resize;
}

.mac-resize-edge[data-edge="nw"] {
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
}

.mac-resize-edge[data-edge="ne"] {
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: nesw-resize;
}

.mac-resize-edge[data-edge="sw"] {
    bottom: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nesw-resize;
}

.mac-resize-edge[data-edge="se"] {
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
}

body.tab-resizing .custom-cursor {
    display: none;
}

body.tab-cursor-ns,
body.tab-cursor-ns * { cursor: ns-resize !important; }

body.tab-cursor-ew,
body.tab-cursor-ew * { cursor: ew-resize !important; }

body.tab-cursor-nwse,
body.tab-cursor-nwse * { cursor: nwse-resize !important; }

body.tab-cursor-nesw,
body.tab-cursor-nesw * { cursor: nesw-resize !important; }

/* ── Tab content ── */
.tab-panel-body ul {
    padding-left: 1.2em;
    margin: 0;
}

.tab-panel-body li {
    margin-bottom: 6px;
}

.tab-panel-body h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.tab-panel-body h3:first-child {
    margin-top: 0;
}

.tab-panel-body a {
    color: #0a84ff;
}

.tab-panel-body a:hover {
    color: #00FF41;
}

.news-chevron {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: transform 0.3s var(--ease-spring);
}

.news-item.open .news-chevron {
    transform: rotate(180deg);
}

.news-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-in-out), padding 0.3s var(--ease-out);
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.news-item.open .news-body {
    max-height: 300px;
    padding: 0 16px 14px;
}

/* Publications Accordion */
.pub-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pub-btn {
    padding: 7px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    font-family: inherit;
}

.pub-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.pub-btn.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pub-btn.primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 16px rgba(10, 132, 255, 0.3);
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pub-list > p:first-child {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.pub-list > p:first-child a {
    font-weight: 500;
}

.publication-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.35s var(--ease-out);
    margin: 0;
    padding: 0;
    box-shadow: none;
    opacity: 0;
    transform: translateY(12px);
}

.publication-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.publication-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.publication-item.open {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 255, 65, 0.2);
}

.pub-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    user-select: none;
}

.pub-header .pub-chevron {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    transition: all 0.3s var(--ease-spring);
}

.publication-item.open .pub-chevron {
    transform: rotate(180deg);
    background: rgba(0, 255, 65, 0.12);
    color: #00FF41;
}

.pub-header-content {
    flex: 1;
    min-width: 0;
}

.publication-title {
    display: block;
    margin: 0;
}

.publication-title h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.publication-meta {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.publication-meta strong {
    color: #00FF41;
}

.publication-venue {
    font-size: 13px;
    color: var(--text-tertiary);
    font-style: normal;
    margin-top: 4px;
}

.publication-venue em {
    font-style: normal;
    color: var(--accent);
    font-weight: 500;
}

.publication-highlight {
    font-size: 13px;
    color: var(--highlight);
    font-weight: 500;
    margin-top: 6px;
}

.publication-highlight a {
    color: var(--highlight);
}

.author-marker {
    color: #0a84ff;
    font-weight: 600;
}

.pub-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease-in-out);
}

.publication-item.open .pub-details {
    max-height: 800px;
}

.pub-details-inner {
    padding: 0 18px 18px 54px;
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding-top: 16px;
}

.publication-abstract {
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    border-left: 3px solid rgba(0, 255, 65, 0.5);
    margin-top: 0;
    max-height: none;
    opacity: 1;
}

.publication-abstract.is-hidden {
    display: none;
}

.abstract-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.publication-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    min-width: auto;
    box-shadow: none;
}

.publication-links a:hover {
    background: rgba(0, 255, 65, 0.1);
    color: #00FF41;
    border-color: rgba(0, 255, 65, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.abstract-btn {
    display: none;
}

/* Terminal tab embed */
.terminal-embed-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.terminal-embed-hint i.bi-terminal {
    font-size: 32px;
    color: var(--text-tertiary);
}

.terminal-embed-hint p {
    margin: 0;
    font-size: 14px;
}

.terminal-launch-btn.terminal-launch-inline {
    margin-top: 8px;
}

/* Projects */
.terminal-launch-wrap {
    margin: 20px 0 48px;
}

.terminal-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'White Rabbit Regular', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    box-shadow: var(--shadow-sm);
}

.terminal-launch-btn:hover {
    background: rgba(0, 255, 65, 0.08);
    border-color: rgba(0, 255, 65, 0.35);
    color: #00FF41;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 255, 65, 0.15);
}

.terminal-launch-btn i {
    font-size: 16px;
    color: var(--text-tertiary);
    transition: color 0.3s;
}

.terminal-launch-btn:hover i {
    color: #00FF41;
}

.terminal-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Terminal modal */
.terminal-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.terminal-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.terminal-window {
    width: min(720px, 92vw);
    height: min(520px, 80vh);
    background: #0d0d0d;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 255, 65, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.35s var(--ease-spring), opacity 0.3s var(--ease-out);
    position: relative;
}

.terminal-modal.active .terminal-window {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.terminal-window .mac-titlebar {
    background: var(--titlebar-bg);
    flex-shrink: 0;
}

.terminal-body {
    flex: 1;
    padding: 18px 20px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.55;
    color: #00FF41;
    text-shadow: 0 0 2px rgba(0, 255, 65, 0.3);
}

.terminal-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line.output {
    color: rgba(0, 255, 65, 0.85);
}

.terminal-line .cmd {
    color: #5ff5ff;
    font-weight: 600;
}

.terminal-line .prompt {
    color: #ff6b6b;
    font-weight: 700;
}

.terminal-line .info {
    color: #ffd93d;
}

.terminal-line .error {
    color: #ff5f57;
}

.terminal-art {
    margin: 4px 0;
    font-size: 12px;
    line-height: 1.35;
    color: rgba(0, 255, 65, 0.9);
    white-space: pre;
    font-family: 'SF Mono', Menlo, Monaco, monospace;
}

.terminal-embed-hint .cmd {
    color: #5ff5ff;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 12px;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 255, 65, 0.12);
    background: rgba(0, 0, 0, 0.3);
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    flex-shrink: 0;
}

.terminal-input-line .prompt {
    color: #ff6b6b;
    font-weight: 700;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #00FF41;
    font-family: inherit;
    font-size: inherit;
    caret-color: transparent;
    text-shadow: 0 0 2px rgba(0, 255, 65, 0.3);
}

.terminal-caret {
    width: 8px;
    height: 16px;
    background: #00FF41;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 4px #00FF41;
}

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

/* Matrix rain canvas */
.matrix-canvas {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.terminal-modal.matrix-on .matrix-canvas {
    opacity: 0.12;
}

/* Terminal window maximize state */
.terminal-window.maximized {
    width: 96vw;
    height: 90vh;
    transition: width 0.3s var(--ease-spring), height 0.3s var(--ease-spring);
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.35s var(--ease-out);
    opacity: 0;
    transform: translateY(16px);
}

.project-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.project-image {
    height: 160px;
    background: var(--bg-primary);
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.project-card:hover .project-image img {
    transform: scale(1.04);
}

.project-content {
    padding: 16px 18px;
    background: var(--bg-secondary);
}

.project-content::before {
    display: none;
}

.project-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.project-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 12px;
}

.project-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    box-shadow: none;
}

.project-link:hover {
    background: rgba(0, 255, 65, 0.1);
    color: #00FF41;
    border-color: rgba(0, 255, 65, 0.3);
    transform: none;
}

/* Accordion sections (More) */
.accordion-section {
    margin-bottom: 12px;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: all 0.25s var(--ease-out);
    opacity: 0;
    transform: translateY(12px);
}

.accordion-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.accordion-header:hover {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.accordion-header.open {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom-color: transparent;
    background: var(--bg-secondary);
}

.accordion-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-title i {
    color: var(--accent);
    font-size: 14px;
}

.accordion-chevron {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: transform 0.3s var(--ease-spring);
}

.accordion-header.open .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease-in-out);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.accordion-body.open {
    max-height: 2000px;
}

.accordion-content {
    padding: 16px 18px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.accordion-content ul {
    padding-left: 1.2em;
    margin: 0;
}

.accordion-content li {
    margin-bottom: 6px;
}

.accordion-content h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.accordion-content a {
    color: #0a84ff;
    text-decoration: none;
}

.accordion-content a:hover {
    color: #00FF41;
    text-decoration: underline;
}

/* Links in content */
.mac-body a,
.container-main a {
    color: #0a84ff;
    text-decoration: none;
    transition: color 0.2s;
}

.mac-body a:hover,
.container-main a:hover {
    color: #00FF41;
    text-decoration: underline;
}

/* Lightbox */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out);
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.92);
    transition: transform 0.4s var(--ease-spring);
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    background: none;
    border: none;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-caption {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    padding: 12px;
    font-size: 14px;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }

.gallery-link, .gallery-link-no-icon {
    color: var(--accent);
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 0 48px;
    font-size: 13px;
    color: var(--text-tertiary);
    position: relative;
    z-index: 1;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent);
}

/* Pub page layout */
.pub-page-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

.pub-sidebar {
    position: sticky;
    top: 64px;
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.2s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .pub-page-grid {
        grid-template-columns: 1fr;
    }

    .pub-sidebar {
        position: static;
    }

    .menu-nav {
        display: none;
        position: absolute;
        top: 44px;
        left: 0;
        right: 0;
        background: var(--bg-tertiary);
        backdrop-filter: var(--blur);
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        gap: 2px;
    }

    .menu-nav.open {
        display: flex;
    }

    .menu-nav a {
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .menu-hamburger {
        display: block;
    }

    .pub-details-inner {
        padding-left: 18px;
    }

    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

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