/* ============================================
   GM.STUDIO — Design System
   Accent: #C41E3A (Chinese Red)
   Theme: Dark Minimalist Tech
   ============================================ */

/* ---------- CSS Variables ---------- */
:root,
[data-theme="dark"] {
    --bg-primary: #080808;
    --bg-secondary: #0d0d0d;
    --bg-surface: #111111;
    --bg-surface-hover: #181818;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --border-subtle: rgba(255,255,255,0.06);
    --border-default: rgba(255,255,255,0.10);
    --border-hover: rgba(255,255,255,0.15);
    --text-primary: #f0f0f0;
    --text-secondary: #999;
    --text-tertiary: #666;
    --accent: #C41E3A;
    --accent-hover: #e0244a;
    --accent-light: rgba(196,30,58,0.12);
    --accent-glow: rgba(196,30,58,0.25);
    --accent-gradient: linear-gradient(135deg, #C41E3A, #ff4757);
    --success: #2ed573;
    --warning: #ffa502;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
}

[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #eeeef0;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f0f0f2;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --border-subtle: rgba(0,0,0,0.06);
    --border-default: rgba(0,0,0,0.10);
    --border-hover: rgba(0,0,0,0.18);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-tertiary: #999;
    --accent: #C41E3A;
    --accent-hover: #a01830;
    --accent-light: rgba(196,30,58,0.08);
    --accent-glow: rgba(196,30,58,0.15);
    --accent-gradient: linear-gradient(135deg, #C41E3A, #e0244a);
    --success: #16a34a;
    --warning: #d97706;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px var(--accent-glow);
}

:root {
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --max-width: 1200px;
    --header-height: 64px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

::selection {
    background: var(--accent);
    color: white;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

img {
    max-width: 100%;
    display: block;
}

/* ---------- Container ---------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Section ---------- */
.section {
    padding: 120px 0;
    position: relative;
}

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

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 16px;
    padding: 4px 12px;
    border: 1px solid rgba(196,30,58,0.25);
    border-radius: 100px;
    background: var(--accent-light);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #fff 0%, #999 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 520px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 12px rgba(196,30,58,0.3);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(196,30,58,0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    transition: all var(--transition-base);
    background: rgba(8,8,8,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    background: rgba(8,8,8,0.85);
    border-bottom-color: var(--border-subtle);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.logo-mark {
    font-size: 1.2rem;
}

.logo-accent {
    color: var(--accent);
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
    padding: 4px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}
.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 120px 24px 80px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 70%);
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.hero-orb--1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    right: -100px;
    animation: orbFloat 8s ease-in-out infinite;
}

.hero-orb--2 {
    width: 400px;
    height: 400px;
    background: #ff4757;
    bottom: -100px;
    left: -100px;
    animation: orbFloat 6s ease-in-out infinite reverse;
    filter: blur(100px);
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent);
    padding: 6px 16px;
    border: 1px solid rgba(196,30,58,0.3);
    border-radius: 100px;
    margin-bottom: 32px;
    background: rgba(196,30,58,0.06);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero-line {
    display: block;
}
.hero-line--accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 64px;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   REVEAL ANIMATION
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   BRAND SECTION
   ============================================ */
.brand {
    background: var(--bg-secondary);
}

.brand-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.brand-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition-base);
}

.brand-card:hover {
    border-color: var(--border-default);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.brand-card--timeline {
    grid-column: 1 / -1;
}

.brand-card--highlights {
    grid-column: 1 / -1;
}

.highlights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 4px;
}

.highlight-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    transition: border-color 0.25s;
}

.highlight-card:hover {
    border-color: var(--accent-border);
}

.highlight-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.highlight-emoji {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1.35;
}

.highlight-head strong {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.45;
}

.highlight-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.highlight-points li {
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--text-secondary);
    padding-left: 14px;
    position: relative;
}

.highlight-points li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.highlight-points li em {
    font-style: normal;
    color: var(--text-primary);
    font-weight: 500;
}

.highlight-points li b {
    color: var(--accent);
    font-weight: 700;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border: 1px solid rgba(196,30,58,0.2);
    border-radius: var(--radius-md);
    color: var(--accent);
    margin-bottom: 20px;
}

.brand-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.brand-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.card-tags {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.card-tags span {
    font-size: 0.78rem;
    padding: 4px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    color: var(--text-secondary);
}

/* Values */
.values-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 4px;
}

.value-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.value-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 24px;
    padding-top: 2px;
}

.value-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 8px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border-default);
}

.tl-item {
    display: flex;
    gap: 20px;
    padding: 8px 0;
    position: relative;
}

.tl-dot {
    position: absolute;
    left: -1px;
    top: 14px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border-default);
    border: 2px solid var(--bg-card);
    transform: translateX(-50%);
}

.tl-dot--active {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.tl-content {
    padding-left: 16px;
}

.tl-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

.tl-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tl-active {
    color: var(--text-primary) !important;
    font-weight: 500;
}

/* ============================================
   CREATIVE SYSTEM
   ============================================ */
.create {
    background: var(--bg-primary);
}

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 100px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

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

.work-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.work-card:hover {
    border-color: var(--border-default);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.work-card.hidden {
    display: none;
}

.work-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.work-thumb-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.work-card:hover .work-thumb-inner {
    transform: scale(1.05);
}

.work-emoji {
    font-size: 3rem;
    filter: grayscale(0.3);
    transition: filter 0.3s ease;
}

.work-card:hover .work-emoji {
    filter: grayscale(0);
}

.work-info {
    padding: 20px;
}

.work-cat {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.work-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.4;
}

.work-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-info time {
    display: block;
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   AI LAB
   ============================================ */
.lab {
    background: var(--bg-secondary);
}

/* Tabs */
.lab-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
    border: 1px solid var(--border-subtle);
}

.lab-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.lab-tab:hover {
    color: var(--text-primary);
}

.lab-tab.active {
    background: var(--accent);
    color: white;
}

/* Panels */
.lab-panel {
    display: none;
}

.lab-panel.active {
    display: block;
}

/* ---------- Chat Layout ---------- */
.chat-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    min-height: 600px;
    max-height: 700px;
}

.chat-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-sidebar h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.input-with-icon {
    display: flex;
    gap: 4px;
}

.input-with-icon input {
    flex: 1;
}

.chat-status {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
}
.status-dot.connected {
    background: var(--success);
}
.status-dot.error {
    background: var(--accent);
}
.status-dot.streaming {
    background: var(--accent);
    animation: pulse 1s ease-in-out infinite;
}

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

/* Chat Main */
.chat-main {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.chat-welcome h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.chat-welcome p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.welcome-prompts {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.prompt-chip {
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 100px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.prompt-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--accent-light);
}

/* Chat Messages */
.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: msgSlideIn 0.3s ease;
}

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.chat-msg.user .chat-msg-avatar {
    background: var(--accent);
    color: white;
}

.chat-msg.assistant .chat-msg-avatar {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
}

.chat-msg-content {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
}

.chat-msg.user .chat-msg-content {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.assistant .chat-msg-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
}

.chat-msg-content pre {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin: 8px 0;
}

.chat-msg-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(255,255,255,0.08);
    padding: 1px 4px;
    border-radius: 3px;
}

.chat-msg-content pre code {
    background: none;
    padding: 0;
}

/* Chat Input */
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color var(--transition-fast);
}

.chat-input-area textarea:focus {
    border-color: var(--accent);
}

.chat-input-area .btn {
    height: 44px;
    width: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

/* ---------- Tools Layout ---------- */
.tools-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color var(--transition-base);
}

.tool-card:hover {
    border-color: var(--border-default);
}

.tool-card-header {
    text-align: center;
}

.tool-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.tool-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tool-input {
    width: 100%;
    padding: 12px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--transition-fast);
}

.tool-input:focus {
    border-color: var(--accent);
}

.tool-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tool-select {
    flex: 1;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.tool-output {
    min-height: 40px;
    padding: 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border: 1px solid var(--border-subtle);
    display: none;
}

.tool-output.has-content {
    display: block;
}

.tool-output.loading {
    color: var(--accent);
    font-style: italic;
}

.tool-output.error {
    color: var(--accent);
    border-color: rgba(196,30,58,0.3);
    background: rgba(196,30,58,0.05);
}

/* ---------- Showcase ---------- */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.showcase-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition-base);
}

.showcase-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
}

.showcase-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.showcase-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.showcase-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.showcase-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.showcase-tags span {
    font-size: 0.7rem;
    padding: 3px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    color: var(--text-tertiary);
}

.showcase-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    transition: color var(--transition-fast);
}

.showcase-link:hover {
    color: var(--accent-hover);
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
    background: var(--bg-primary);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.contact-method:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 48px 0;
    background: var(--bg-secondary);
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 32px;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* ============================================
   RESUME SECTION
   ============================================ */
.resume {
    background: var(--bg-primary);
}

.resume-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

.resume-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.resume-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition-base);
}

.resume-card:hover {
    border-color: var(--border-default);
}

.resume-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.resume-card--full {
    margin-bottom: 20px;
}
.resume-card--full:last-child {
    margin-bottom: 0;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.info-label {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* Skill Bars */
.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.skill-info span:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.skill-info span:last-child {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.skill-track {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Education */
.edu-item {
    padding: 4px 0;
}

.edu-year {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
}

.edu-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 6px 0 4px;
    color: var(--text-primary);
}

.edu-item p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Self Eval */
.self-eval {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Intent Tags */
.intent-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.intent-tags span {
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--accent-light);
    border: 1px solid rgba(196,30,58,0.2);
    border-radius: 100px;
    color: var(--accent);
}

/* Experience */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.exp-item {
    position: relative;
    padding-left: 24px;
}

.exp-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: -16px;
    width: 1px;
    background: var(--border-default);
}

.exp-item:last-child::before {
    display: none;
}

.exp-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.exp-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
}

.exp-title h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.exp-company {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.exp-date {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

.exp-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.exp-duties {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exp-duties li {
    position: relative;
    padding-left: 16px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.exp-duties li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-hover);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.project-item {
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.project-item:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
}

.project-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 8px;
}

.project-item h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.project-item p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Muted card for secondary content */
.resume-card--muted {
    opacity: 0.75;
}
.resume-card--muted:hover {
    opacity: 1;
}

.resume-card--muted h3 {
    color: var(--text-tertiary);
}

.early-projects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    line-height: 1.8;
}

.early-sep {
    color: var(--border-default);
    margin: 0 2px;
}

/* ============================================
   REVIEW SECTION
   ============================================ */
.review {
    background: var(--bg-secondary);
}

/* Metrics Dashboard */
.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 56px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition-base);
}
.metric-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
}

.metric-card--highlight {
    background: var(--accent-light);
    border-color: rgba(196,30,58,0.25);
}

.metric-value {
    display: block;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.metric-unit {
    font-size: 1.4rem;
    font-weight: 700;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0 4px;
}

.metric-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* Review Sections */
.review-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.review-block {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: border-color var(--transition-base);
}
.review-block:hover {
    border-color: var(--border-default);
}

.review-block-num {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.2;
    display: block;
    line-height: 1;
    margin-bottom: 8px;
}

.review-block h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.review-block ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-block li {
    position: relative;
    padding-left: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.review-block li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.4;
}

.review-block li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Outlook Bar */
.outlook-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.outlook-bar h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    white-space: nowrap;
}

.outlook-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.outlook-tags span {
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--accent-light);
    border: 1px solid rgba(196,30,58,0.2);
    border-radius: 100px;
    color: var(--accent);
    transition: all var(--transition-fast);
}
.outlook-tags span:hover {
    background: rgba(196,30,58,0.18);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .brand-grid {
        grid-template-columns: 1fr;
    }
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tools-layout {
        grid-template-columns: 1fr 1fr;
    }
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chat-layout {
        grid-template-columns: 1fr;
        max-height: none;
    }
    .chat-sidebar {
        order: -1;
    }
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .resume-layout {
        grid-template-columns: 1fr;
    }
    .resume-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .metrics-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    .review-sections {
        grid-template-columns: 1fr;
    }
    .outlook-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: rgba(8,8,8,0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0;
        padding: 16px 0;
        border-bottom: 1px solid var(--border-subtle);
        transform: translateY(-100%);
        opacity: 0;
        transition: all var(--transition-base);
        pointer-events: none;
    }

    .nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .nav-link::after {
        display: none;
    }

    .hero-stats {
        gap: 32px;
    }

    .works-grid {
        grid-template-columns: 1fr;
    }
    .tools-layout {
        grid-template-columns: 1fr;
    }
    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .lab-tabs {
        width: 100%;
        overflow-x: auto;
    }
    .resume-sidebar {
        grid-template-columns: 1fr;
    }
    .exp-header {
        flex-wrap: wrap;
    }
    .exp-date {
        margin-left: 0;
        width: 100%;
        margin-top: 4px;
    }
    .metrics-dashboard {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-stats {
        gap: 20px;
    }

    .stat-num {
        font-size: 1.8rem;
    }

    .brand-card {
        padding: 20px;
    }
    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.8rem;
    }
    .metrics-dashboard {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme="light"] .header {
    background: rgba(245,245,247,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="light"] .header.scrolled {
    background: rgba(245,245,247,0.9);
}
[data-theme="light"] .hero-orb {
    opacity: 0.06;
}
[data-theme="light"] .hero-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}
[data-theme="light"] .section-title {
    background: linear-gradient(180deg, #1a1a1a 0%, #666 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
[data-theme="light"] .chat-msg-content pre {
    background: rgba(0,0,0,0.04);
}
[data-theme="light"] .chat-msg-content code {
    background: rgba(0,0,0,0.06);
}
[data-theme="light"] .chat-msg.assistant .chat-msg-content {
    background: #f5f5f7;
}
[data-theme="light"] .chat-msg.assistant .chat-msg-avatar {
    background: #eee;
}
[data-theme="light"] .nav {
    background: rgba(245,245,247,0.95);
}
[data-theme="light"] .prompt-chip {
    background: #f0f0f2;
}
[data-theme="light"] .prompt-chip:hover {
    background: rgba(196,30,58,0.06);
}
[data-theme="light"] .card-tags span,
[data-theme="light"] .showcase-tags span {
    background: #f0f0f2;
}
[data-theme="light"] .tool-output {
    background: #f8f8fa;
}
[data-theme="light"] .tool-input,
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select,
[data-theme="light"] .tool-select,
[data-theme="light"] .chat-input-area textarea {
    background: #f5f5f7;
}
[data-theme="light"] .chat-input-area {
    border-top-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .chat-sidebar {
    background: #fafafa;
}
[data-theme="light"] .showcase-icon {
    background: rgba(196,30,58,0.08) !important;
}
[data-theme="light"] .welcome-prompts .prompt-chip {
    background: #f0f0f2;
}
