/* ==============================================================================
   Impeccable Style Design System
   Project: Akmal Ariq Portfolio
   File: css/style.css
   ============================================================================== */

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

/* 🎨 Design Tokens (Warm Dark Specimen Strategy) */
:root {
    /* Typography Hierarchy */
    --font-display: 'EB Garamond', Georgia, serif;
    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing Scale (Fluid clamp) */
    --spacing-xs: clamp(0.5rem, 1vw, 0.75rem);
    --spacing-sm: clamp(0.75rem, 1.5vw, 1.25rem);
    --spacing-md: clamp(1.5rem, 3vw, 2.5rem);
    --spacing-lg: clamp(3rem, 6vw, 5rem);
    --spacing-xl: clamp(4.5rem, 9vw, 8rem);

    /* Layout Constraints */
    --container-max: 1300px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Default Dark Theme variables */
:root, html.dark {
    --bg-primary: oklch(0.13 0.008 75);      /* Muted slate-tinted charcoal #0d0d0c */
    --bg-secondary: oklch(0.16 0.01 75);    /* Integrated slate panel #141413 */
    --text-primary: oklch(0.94 0.006 75);    /* Soft print-paper alabaster #f0efec */
    --text-secondary: oklch(0.65 0.008 75);   /* Sophisticated cool grey #9a9a97 */
    --border: oklch(0.24 0.01 75);          /* Crisp low-contrast gridline #222221 */
    --accent: oklch(0.79 0.12 80);           /* Technical muted gold/bronze #e5c183 */
    --accent-dim: oklch(0.26 0.04 80);       /* Dim bronze backing tint */
    --bg-header: rgba(13, 13, 12, 0.9);      /* Translucent dark header */
    --status-online: #34d399;                /* Vibrant green for dark */
    --status-offline: #f87171;               /* Vibrant red for dark */
    --btn-primary-hover-text: var(--bg-primary);
    --btn-demo-hover-text: var(--bg-primary);
    --user-chat-text: var(--bg-primary);
}

/* Elegant Light Theme variables (Timezone-Triggered) */
html.light {
    --bg-primary: oklch(0.97 0.006 80);      /* Warm alabaster print paper #f7f5f2 */
    --bg-secondary: oklch(0.94 0.008 80);    /* Integrated panel light sandstone #efece7 */
    --text-primary: oklch(0.16 0.01 75);     /* Deep warm dark slate #14181a */
    --text-secondary: oklch(0.45 0.008 75);  /* Muted warm sandstone-grey #6b6a65 */
    --border: oklch(0.88 0.006 80);          /* Thin crisp grey borders #dbd8d2 */
    --accent: oklch(0.55 0.12 75);           /* High-contrast intellectual amber #b27830 */
    --accent-dim: oklch(0.92 0.04 75);       /* Sandstone amber backing tint */
    --bg-header: rgba(247, 245, 242, 0.9);   /* Translucent light header */
    --status-online: #059669;                /* High-contrast forest green for light */
    --status-offline: #dc2626;               /* High-contrast deep red for light */
    --btn-primary-hover-text: var(--text-primary);
    --btn-demo-hover-text: var(--text-primary);
    --user-chat-text: var(--text-primary);
}

/* Base Body Setup */
html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.7;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 2rem;
}

/* Selection State */
::selection {
    background-color: var(--accent);
    color: var(--bg-primary);
}

/* Grid Layout container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ==============================================================================
   🖥️ Header & Navigation (Minimal Blueprint Border)
   ============================================================================== */
.header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    gap: 2px;
}

.name {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Desktop Nav Links */
.nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-color: var(--border);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: transform var(--transition), opacity var(--transition);
}

.mobile-menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    gap: 0.5rem;
}

.mobile-menu[hidden] {
    display: none;
}

.mobile-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: all var(--transition);
}

.mobile-nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* ==============================================================================
   🚀 Hero Section (Asymmetric Specimen Split)
   ============================================================================== */
.hero {
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    background: radial-gradient(ellipse 60% 50% at 90% -10%, var(--accent-dim) 0%, transparent 85%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.hero-text {
    max-width: 720px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px #10b981; }
    50% { opacity: 0.4; transform: scale(0.85); box-shadow: 0 0 2px #10b981; }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.hero-title em {
    font-style: italic;
    font-weight: 300;
    color: var(--accent);
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    max-width: 65ch;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ==============================================================================
   📟 Medallion Data Pipeline Flow Styling
   ============================================================================== */
.pipeline-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

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

.pipeline-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent);
    text-transform: uppercase;
}

.pipeline-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.08);
    color: var(--status-online);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pipeline-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s infinite;
}

.pipeline-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pipeline-node {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    transition: all var(--transition);
}

.pipeline-node:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.node-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-meta {
    display: flex;
    flex-direction: column;
}

.node-label {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.node-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.pipeline-connector {
    height: 24px;
    width: 2px;
    background: var(--border);
    margin-left: 31px;
    position: relative;
}

.connector-pulse {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    left: -2px;
    box-shadow: 0 0 6px var(--accent);
    animation: flowDown 3s infinite linear;
}

@keyframes flowDown {
    0% { top: 0%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ==============================================================================
   ⚖️ Buttons & Actions
   ============================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all var(--transition);
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--btn-primary-hover-text);
    border-color: var(--accent);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-github {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
}

.btn-github:hover {
    border-color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-demo {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
}

.btn-demo:hover {
    background: var(--accent);
    color: var(--btn-demo-hover-text);
    transform: translateY(-1px);
}

/* ==============================================================================
   🏛️ Main Content & Section Layouts
   ============================================================================== */
section {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 400;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
}

/* ==============================================================================
   💼 Core Solutions (Pain Point Matrix)
   ============================================================================== */
.solutions {
    background: var(--bg-secondary);
}

.solutions-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-lg) auto;
}

.section-subtitle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.section-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-top: var(--spacing-xs);
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.solution-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-md);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.solution-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.4);
}

.solution-icon {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition);
}

.solution-card:hover .solution-icon {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.solution-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.solution-text {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.7;
}

/* ==============================================================================
   📂 Featured Projects (Typographic Specimen Cards)
   ============================================================================== */
.projects {
    background: var(--bg-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-md);
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-md);
    transition: all var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.6);
    transform: translateY(-3px);
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* GitHub Stats inside Card */
.github-stats {
    display: flex;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.github-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Project Specs/Stats Table */
.project-stats {
    display: grid;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    line-height: 1.5;
}

.stat-label {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 10px;
}

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

/* Highlights Checklist */
.project-highlights {
    margin-bottom: var(--spacing-sm);
}

.project-highlights strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.project-highlights ul {
    list-style: none;
}

.project-highlights li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-highlights li::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* Tag pill row */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-md);
    margin-top: auto;
}

.tag {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}

.project-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==============================================================================
   🎛️ Technical Skills Section (Custom Grid Specimen)
   ============================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.skill-category {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.skill-category-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.skill-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.skill-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.skill-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.skill-bar {
    width: 100px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skills-animated .skill-bar-fill {
    width: var(--skill-width);
}

/* ==============================================================================
   🎭 About Me Section (Asymmetric Columns)
   ============================================================================== */
.about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
}

/* ==============================================================================
   ✉️ Contact Section (High-End Links List)
   ============================================================================== */
.contact-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-sm);
    max-width: 1000px;
    margin: 0 auto;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.contact-link:hover {
    border-color: var(--accent);
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
    color: var(--accent);
}

.contact-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: color var(--transition);
}

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

/* ==============================================================================
   🏛️ Footer Section (Razor Separator)
   ============================================================================== */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: var(--spacing-md) 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

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

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

/* ==============================================================================
   🔝 Utilities & Global Enhancements
   ============================================================================== */
/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 6.5rem;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    transition: all var(--transition);
    z-index: 50;
    opacity: 0;
    transform: translateY(8px);
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.back-to-top:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top[hidden] {
    display: flex;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

/* Scroll reveal states */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--transition-slow), transform 0.8s var(--transition-slow);
}

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

.reveal-grid .project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--transition-slow), transform 0.8s var(--transition-slow), border-color var(--transition), box-shadow var(--transition);
}

.reveal-grid.visible .project-card {
    opacity: 1;
    transform: translateY(0);
}

.reveal-grid.visible .project-card:nth-child(2) { transition-delay: 0.15s; }
.reveal-grid.visible .project-card:nth-child(3) { transition-delay: 0.3s; }
.reveal-grid.visible .project-card:nth-child(4) { transition-delay: 0.45s; }

/* Custom premium scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}

/* ==============================================================================
   📱 Responsive Breakpoints
   ============================================================================== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-title {
        font-size: clamp(2rem, 7vw, 3rem);
    }

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

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

    .contact-links {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ==============================================================================
   ☀️/🌙 Theme Toggle Button Styling
   ============================================================================== */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Switch sun/moon display based on active class */
html.light .sun-icon { display: none; }
html.light .moon-icon { display: block; color: var(--accent); }
html.dark .sun-icon { display: block; color: var(--accent); }
html.dark .moon-icon { display: none; }

/* Default fallback icons */
.sun-icon { display: block; }
.moon-icon { display: none; }

/* ==============================================================================
   🤖 AI Partner Consulting Chatbot UI
   ============================================================================== */
.chatbot-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: var(--font-sans);
}

/* Floating Monogram Bubble */
.chatbot-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: all var(--transition);
    position: relative;
}

.chatbot-bubble:hover {
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.bubble-monogram {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--accent);
}

.bubble-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #10b981;
    border: 2px solid var(--bg-secondary);
    position: absolute;
    top: 2px;
    right: 2px;
    box-shadow: 0 0 6px #10b981;
}

/* Active State when chat window is open */
.chatbot-bubble.active-window {
    transform: scale(0.8) rotate(90deg);
    background-color: var(--accent);
    border-color: var(--accent);
    opacity: 0;
    pointer-events: none;
}

.chatbot-bubble.active-window .bubble-monogram {
    visibility: hidden;
}

.chatbot-bubble.active-window .bubble-dot {
    display: none;
}

/* Close indicator overlay inside rotated bubble */
.chatbot-bubble.active-window::after {
    content: "×";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 300;
    color: var(--bg-primary);
}

/* Consultation Card Window - Full-Height docked Side Panel */
.chatbot-window {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight var(--transition-slow);
    transform-origin: right center;
    z-index: 1200;
}

.chatbot-window[hidden] {
    display: none !important;
}

/* Layout Pushing on Desktop to prevent overlay/hover */
@media (min-width: 1024px) {
    body {
        transition: padding-right var(--transition-slow);
    }
    html.chatbot-open body {
        padding-right: 400px;
    }
    .header {
        transition: width var(--transition-slow), background var(--transition);
    }
    html.chatbot-open .header {
        width: calc(100% - 400px);
    }
    .back-to-top {
        transition: right var(--transition-slow), opacity var(--transition), transform var(--transition);
    }
    html.chatbot-open .back-to-top {
        right: 27rem; /* Shifts left of the side panel dynamically */
    }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* Window Header */
.chatbot-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-monogram {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.header-meta {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-status {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot-active {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 4px #10b981;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition);
}

.chatbot-close-btn:hover {
    color: var(--text-primary);
}

/* Chat Messages Scroller */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-bubble-wrapper {
    display: flex;
    width: 100%;
}

.chat-bubble-wrapper.user { justify-content: flex-end; }
.chat-bubble-wrapper.bot { justify-content: flex-start; }

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-bubble.user {
    background-color: var(--accent);
    color: var(--user-chat-text);
    font-weight: 700;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.chat-bubble.bot {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.chat-bubble.bot p {
    margin-bottom: 8px;
}

.chat-bubble.bot p:last-child {
    margin-bottom: 0;
}

.bot-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--accent);
    margin-bottom: 8px !important;
}

.bot-list {
    list-style: none;
    margin: 8px 0;
    padding-left: 0;
}

.bot-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bot-list li::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.bot-list li strong {
    color: var(--text-primary);
}

.bot-list a {
    color: var(--accent);
    text-decoration: underline;
}

/* Typing Indicator Animation */
.chat-bubble.bot.typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 18px;
}

.chat-bubble.bot.typing .dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chat-bubble.bot.typing .dot:nth-child(1) { animation-delay: -0.32s; }
.chat-bubble.bot.typing .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Input Area & Suggestion Chips */
.chatbot-input-container {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 14px 16px;
}

.chatbot-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.chatbot-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

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

.chatbot-form {
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

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

.chatbot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.chatbot-send-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--bg-primary);
}

/* Diagnostic / Telemetry spec styling inside chat */
.telemetry-log {
    background-color: #000;
    color: #10b981;
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #1e293b;
    margin: 8px 0;
    line-height: 1.6;
    overflow-x: auto;
    text-align: left;
}

.telemetry-log.error {
    color: #ef4444;
}

.text-green { color: #10b981; }
.text-red { color: #ef4444; }

/* Responsive adjustments for chatbot container on mobile */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        top: 0;
    }
}
