/* ═══════════════════════════════════════════
   DESIGN TOKENS — Dark Mode (Default)
   ═══════════════════════════════════════════ */
:root {
    --eng-blue: #3b82f6;
    --eng-light: #60a5fa;
    --eng-dark: #2563eb;
    --dev-green: #0e8c6a;
    --dev-light: #1da87a;
    --safety-orange: #d4940a;
    --dark-950: #0a0b0e;
    --dark-900: #111216;
    --dark-800: #1e2029;
    --accent-blue: #60a5fa;

    /* Semantic aliases — dark */
    --bg-base: #0a0b0e;
    --bg-surface: #111216;
    --bg-elevated: #181a22;
    --bg-card: rgba(17, 18, 22, 0.65);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-mid: rgba(255, 255, 255, 0.14);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #a8b8d0;
    --blueprint-dot: rgba(59, 130, 246, 0.10);
    --glass-shimmer: linear-gradient(45deg, transparent 40%, rgba(59, 130, 246, 0.08), transparent 60%);
    --card-hover-bg: rgba(17, 18, 22, 0.85);
    --modal-overlay: rgba(10, 11, 14, 0.95);
    --input-bg: rgba(255, 255, 255, 0.05);
    --scrollbar-thumb: #1e2029;
}

/* ── LIGHT MODE ─────────────────────────────── */
/* ── LIGHT MODE ─────────────────────────────── */
html.light {
    --eng-blue: #22344d;
    --eng-light: #2a4a6b;
    --eng-dark: #1a2838;
    --dev-green: #1f6f6b;
    --dev-light: #2a8a85;
    --dev-dark: #15504d;
    --safety-orange: #a87308;
    --accent-blue: #2a4a6b;
    --bg-base: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-mid: rgba(0, 0, 0, 0.12);
    --text-primary: #1a1a2e;
    --text-secondary: #323a5e;
    --text-muted: #4e5a7a;
    --blueprint-dot: rgba(34, 52, 77, 0.07);
    --glass-shimmer: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.6), transparent 60%);
    --card-hover-bg: rgba(255, 255, 255, 1);
    --modal-overlay: rgba(26, 26, 40, 0.65);
    --input-bg: rgba(0, 0, 0, 0.04);
    --scrollbar-thumb: #cbd5e1;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.35s ease, color 0.35s ease;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

/* ═══════════════════════════════════════════
   BLUEPRINT GRID BACKGROUND
   ═══════════════════════════════════════════ */
.grid-blueprint {
    background-image: radial-gradient(var(--blueprint-dot) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ═══════════════════════════════════════════
   GLASSMORPHISM CARD
   ═══════════════════════════════════════════ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-shimmer);
    pointer-events: none;
    z-index: 1;
}

/* ═══════════════════════════════════════════
   PROJECT CARDS — Index (Horizontal Scroll)
   ═══════════════════════════════════════════ */
.project-card {
    border: 1px solid rgba(59, 130, 246, 0.18);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-width: 320px;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.project-card:hover {
    border-color: rgba(59, 130, 246, 0.55);
    background: var(--card-hover-bg);
    box-shadow: 0 8px 40px -8px rgba(59, 130, 246, 0.25),
        0 0 0 1px rgba(59, 130, 246, 0.1);
    transform: translateY(-6px);
}

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

.project-card:active {
    transform: scale(0.965) translateY(-2px);
    border-color: var(--eng-blue);
}

/* ─── Card Inner Layout ─── */
.project-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 95%;
    padding: 1.75rem 2rem;
}

.project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.project-card-category {
    font-size: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--eng-light);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.project-card-category.dev {
    color: var(--dev-light);
}

/* Privacy Badge — inline on card */
.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 99px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.privacy-badge.private {
    background: rgba(212, 148, 10, 0.15);
    border: 1px solid rgba(212, 148, 10, 0.30);
    color: var(--safety-orange);
}

.privacy-badge.public {
    background: rgba(14, 140, 106, 0.12);
    border: 1px solid rgba(14, 140, 106, 0.25);
    color: var(--dev-light);
}

.privacy-badge svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.project-card-title {
    font-size: 1.15rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.65rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.project-card:hover .project-card-title {
    color: var(--eng-light);
}

.project-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-footer {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-card-cta {
    margin-left: auto;
    font-size: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(59, 130, 246, 0.4);
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.project-card:hover .project-card-cta {
    color: var(--eng-light);
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════
   SECTION TAGS
   ═══════════════════════════════════════════ */
.section-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════
   TECH TAGS
   ═══════════════════════════════════════════ */
.tech-tag {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #a3c6ff;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

.tech-tag:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.dev-tag {
    background: rgba(29, 168, 122, 0.1);
    border: 1px solid rgba(29, 168, 122, 0.22);
    color: var(--dev-light);
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

/* ═══════════════════════════════════════════
   NAVIGATION (light-aware)
   ═══════════════════════════════════════════ */
nav.glass-card {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

html.light nav.glass-card {
    background: rgba(255, 255, 255, 0.88);
}

/* Mobile dark nav overlay */
#mobile-menu {
    background-color: var(--bg-base);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu.active {
    transform: translateY(0);
}

html.light #mobile-menu {
    background-color: rgba(255, 255, 255, 0.97);
}

/* ═══════════════════════════════════════════
   MODAL — Redesigned, no empty space
   ═══════════════════════════════════════════ */
#image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: var(--modal-overlay);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1.5rem;
}

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

.modal-content {
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 1.75rem;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    box-shadow: 0 32px 80px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

#image-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
}

.modal-inner {
    padding: 2rem 2rem 1.75rem;
    position: relative;
}

#modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 900;
    line-height: 1;
}

#modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

html.light #modal-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}

#modal-img {
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    max-height: 580px;
    display: block;
    margin-bottom: 1.5rem;
}

#modal-img[src=""],
#modal-img:not([src]) {
    display: none !important;
}

#modal-title {
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
    padding-right: 2.5rem;
}

.modal-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1rem 0;
}

#modal-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

#modal-desc a {
    color: var(--eng-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

#modal-desc a:hover {
    color: #a3c6ff;
}

/* Modal description text */
.modal-project-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

/* Links row with icon buttons */
.modal-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.modal-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    transition: all 0.25s ease;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--eng-light) !important;
    cursor: pointer;
}

.modal-link-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -4px rgba(59, 130, 246, 0.35);
}

/* GitHub button — darker variant */
.modal-link-github {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary) !important;
}

.modal-link-github:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--text-primary) !important;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.3);
}

/* Icon inside button */
.modal-link-icon {
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-link-icon svg {
    width: 100%;
    height: 100%;
}

/* Arrow icon at end of button */
.modal-link-arrow {
    width: 0.65rem;
    height: 0.65rem;
    opacity: 0.6;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s;
}

.modal-link-btn:hover .modal-link-arrow {
    transform: translate(2px, -2px);
    opacity: 1;
}

/* Last updated timestamp */
.modal-last-updated {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Light mode overrides */
html.light .modal-link-github {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #323a5e !important;
}

html.light .modal-link-github:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a2e !important;
}

/* ═══════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════ */
#theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-mid);
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

#theme-toggle:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--eng-light);
}

#theme-toggle svg {
    width: 1rem;
    height: 1rem;
}

/* ═══════════════════════════════════════════
   LANGUAGE SELECTOR
   ═══════════════════════════════════════════ */
#lang-picker {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    height: -webkit-fill-available;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.35rem 1.6rem 0.35rem 0.6rem;
    border-radius: 0.55rem;
    cursor: pointer;
    transition: all 0.25s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

#lang-picker:hover,
#lang-picker:focus {
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--text-primary);
    outline: none;
}

#lang-picker option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   HORIZONTAL SCROLL (Project showcase)
   ═══════════════════════════════════════════ */
.horizontal-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */
.hero {
    object-position: center 20%;
}

.hover-lift {
    transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px -10px rgba(59, 130, 246, 0.28);
}

.pt-48 {
    padding-top: 5rem;
}

@media (min-width: 768px) {
    .md\:text-9xl {
        font-size: 6rem;
        line-height: 1;
    }
}

.industrial-border {
    border-left: 4px solid var(--eng-blue);
    padding-left: 1.5rem;
}

.gradient-text-blue {
    background: linear-gradient(to right, #7bb3fe, var(--eng-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html.light .gradient-text-blue {
    background: linear-gradient(to right, #3a5a7a, var(--eng-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Light mode text adjustments */
html.light .text-slate-400 {
    color: #323a5e !important;
}

html.light .text-slate-500 {
    color: #4e5a7a !important;
}

html.light .text-slate-600 {
    color: #5a6a8e !important;
}

html.light .text-slate-100 {
    color: #1a1a2e !important;
}

html.light .text-white {
    color: #1a1a2e !important;
}

html.light .bg-black\/40 {
    background-color: rgba(244, 246, 249, 0.9) !important;
}

html.light .bg-dark-950 {
    background-color: #f4f6f9 !important;
}

html.light .bg-dark-900 {
    background-color: #ffffff !important;
}

html.light .bg-dark-900\/30 {
    background-color: rgba(255, 255, 255, 0.6) !important;
}

html.light .bg-dark-900\/50 {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

html.light .glass-card {
    background: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(0, 0, 0, 0.09) !important;
}

html.light .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html.light .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

html.light .bg-white\/5 {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

html.light .tech-tag {
    background: rgba(34, 52, 77, 0.08);
    border-color: rgba(34, 52, 77, 0.18);
    color: #22344d;
}

html.light .dev-tag {
    background: rgba(31, 111, 107, 0.08);
    border-color: rgba(31, 111, 107, 0.18);
    color: #1f6f6b;
}

html.light .section-tag {
    color: #4e5a7a;
}

html.light .project-card {
    border-color: rgba(34, 52, 77, 0.15);
}

html.light .project-card:hover {
    background: rgba(255, 255, 255, 0.92) !important;
}

html.light .project-card-title {
    color: #1a1a2e;
}

html.light .project-card:hover .project-card-title {
    color: #22344d;
}

html.light .project-card-desc {
    color: #323a5e;
}

html.light #mobile-menu {
    background-color: rgba(255, 255, 255, 0.97);
}

html.light #mobile-menu a {
    color: #1a1a2e;
}

html.light select option {
    background: #ffffff;
    color: #1a1a2e;
}

html.light .modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

html.light #modal-title {
    color: #1a1a2e;
}

html.light #modal-desc {
    color: #323a5e;
}

html.light .bg-slate-800 {
    background-color: rgba(0, 0, 0, 0.06) !important;
}

html.light .bg-slate-900 {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

html.light .arch-node {
    background: rgba(255, 255, 255, 0.85);
}

html.light .grid-blueprint {
    background-image: radial-gradient(rgba(34, 52, 77, 0.07) 1px, transparent 1px);
}

html.light .bg-eng {
    background-color: #b2d2fe !important;
}

html.light .text-eng {
    color: #22344d !important;
}

html.light .border-eng {
    border-color: #22344d !important;
}

html.light .bg-dev {
    background-color: #1f6f6b !important;
}

html.light .text-dev {
    color: #1f6f6b !important;
}

html.light .border-dev {
    border-color: #1f6f6b !important;
}

/* ═══════════════════════════════════════════
   SYSTEM ARCHITECTURE DIAGRAM
   ═══════════════════════════════════════════ */
.arch-node {
    position: relative;
    padding: 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    border-radius: 1rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.arch-node:hover {
    transform: scale(1.02);
    border-color: var(--eng-blue);
}

.arch-arrow {
    height: 2px;
    background: linear-gradient(90deg, var(--eng-blue), transparent);
    flex-grow: 1;
    position: relative;
    min-width: 40px;
}

.arch-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border-left: 6px solid var(--eng-blue);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

/* ═══════════════════════════════════════════
   GITHUB REPO CARD
   ═══════════════════════════════════════════ */
.repo-card {
    background: var(--bg-elevated);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.repo-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--eng-blue);
    transform: translateX(5px);
}

/* ═══════════════════════════════════════════
   PROFILE FRAME
   ═══════════════════════════════════════════ */
.profile-frame {
    position: relative;
    mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.profile-frame:hover {
    transform: scale(1.03);
    mask-image: radial-gradient(circle at center, black 80%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 80%, transparent 100%);
}

.profile-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.5s ease;
}

.profile-frame:hover img {
    transform: scale(1.1);
}

.profile-vignette {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 40px 10px rgba(10, 11, 14, 0.8);
    pointer-events: none;
}

/* ═══════════════════════════════════════════
   CV DROPDOWN
   ═══════════════════════════════════════════ */
#cv-dropdown.active-click #cv-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* ═══════════════════════════════════════════
   REPO MARQUEE
   ═══════════════════════════════════════════ */
.repo-marquee-container {
    animation: marquee 40s linear infinite;
    gap: 2rem;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.repo-marquee-item {
    min-width: 350px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: 1rem;
    display: inline-flex;
    flex-direction: column;
    pointer-events: none;
}

.repo-marquee-item .repo-status {
    font-size: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.repo-marquee-item .status-private {
    color: var(--safety-orange);
}

.repo-marquee-item .status-public {
    color: var(--eng-blue);
}

/* ═══════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════ */
.timeline-line {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--eng-blue), transparent);
}

/* ═══════════════════════════════════════════
   PROTOCOL GLOW (Icon anim)
   ═══════════════════════════════════════════ */
.protocol-glow {
    transition: filter 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    will-change: transform, opacity;
}

.project-card:hover .protocol-glow {
    filter: drop-shadow(0 0 8px var(--eng-blue));
    color: var(--eng-blue);
    transform: scale(1.3);
    opacity: 1;
}

/* ═══════════════════════════════════════════
   ICON ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes icon-float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }
}

.icon-float {
    animation: icon-float 3.5s ease-in-out infinite;
}

@keyframes icon-spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.icon-spin {
    animation: icon-spin-slow 10s linear infinite;
}

@keyframes glow-eng {

    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(75, 139, 250, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(75, 139, 250, 0.9));
    }
}

.icon-glow-eng {
    animation: glow-eng 2.5s ease-in-out infinite;
}

@keyframes glow-dev {

    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(29, 168, 122, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(29, 168, 122, 0.9));
    }
}

.icon-glow-dev {
    animation: glow-dev 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }

    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

.icon-shimmer {
    animation: shimmer 2.8s ease-in-out infinite;
}

/* Fade up stagger */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fade-up-1 {
    animation-delay: 0.05s;
}

.fade-up-2 {
    animation-delay: 0.12s;
}

.fade-up-3 {
    animation-delay: 0.19s;
}

.fade-up-4 {
    animation-delay: 0.26s;
}

.fade-up-5 {
    animation-delay: 0.33s;
}

/* ═══════════════════════════════════════════
   BUTTON / INTERACTIVE UTILITIES
   ═══════════════════════════════════════════ */
button,
.filter-btn,
.cert-card,
.project-card {
    -webkit-tap-highlight-color: transparent;
}

#filter-hub {
    gap: 0.5rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.filter-btn.active .btn-icon,
.filter-btn[class*="bg-eng"] .btn-icon {
    opacity: 1;
}

/* ═══════════════════════════════════════════
   STAT BARS
   ═══════════════════════════════════════════ */
.stat-icon {
    display: inline-flex;
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.stat-bar-item:hover .stat-icon {
    opacity: 1;
}

.stat-icon svg {
    width: 11px;
    height: 11px;
    stroke-width: 2;
}

.item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   FORM INPUTS
   ═══════════════════════════════════════════ */
select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

input,
textarea,
select {
    color-scheme: dark;
}

html.light input,
html.light textarea,
html.light select {
    color-scheme: light;
}

/* ═══════════════════════════════════════════
   ABOUT / PROFILE IMAGE
   ═══════════════════════════════════════════ */
.about {
    width: 100%;
    height: 33vh;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.5s ease;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .grid-blueprint {
        background-size: 30px 30px;
    }

    .project-card {
        min-width: 280px;
    }

    h1 {
        font-size: 3.5rem !important;
    }

    h2 {
        font-size: 2.5rem !important;
    }

    .arch-arrow {
        display: none;
    }

    .modal-content {
        width: 95%;
        max-height: 92vh;
    }

    .modal-inner {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    #modal-img {
        max-height: 200px;
    }
}

/* ── Tablet ─────────────────────────────────── */
@media (max-width: 1024px) {
    .project-card {
        min-width: 260px;
        height: 28vh !important;
    }

    nav .flex.items-center.gap-3 {
        gap: 0.5rem;
    }

    .hero-gap {
        gap: 1.5rem;
    }
}

/* ── Mobile kecil ───────────────────────────── */
@media (max-width: 640px) {
    .project-card {
        min-width: 240px;
        height: 26vh !important;
    }

    .project-card-inner {
        padding: 1.25rem 1.25rem;
    }

    .section-tag {
        font-size: 0.55rem !important;
    }

    #visitor-telemetry {
        max-width: 180px;
    }

    #visitor-telemetry .glass-card {
        padding: 0.5rem !important;
    }
}

/* ═══════════════════════════════════════════
   PAGE LOADER
   ═══════════════════════════════════════════ */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--bg-base);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.custom-loader {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #766DF4;
    -webkit-mask:
        repeating-conic-gradient(#0000 0deg, #000 1deg 70deg, #0000 71deg 90deg),
        radial-gradient(farthest-side, #0000 calc(100% - 9px), #000 calc(100% - 8px));
    mask:
        repeating-conic-gradient(#0000 0deg, #000 1deg 70deg, #0000 71deg 90deg),
        radial-gradient(farthest-side, #0000 calc(100% - 9px), #000 calc(100% - 8px));
    -webkit-mask-composite: destination-in;
    mask-composite: intersect;
    animation: s5 1s infinite;
}

@keyframes s5 {
    to {
        transform: rotate(.5turn);
    }
}

.loader-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-muted);
    animation: loader-blink 1.2s ease-in-out infinite;
}

@keyframes loader-blink {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════
   HOVER TEXT EFFECTS
   ═══════════════════════════════════════════ */
.text-hover-line {
    position: relative;
    display: inline-block;
    cursor: default;
}

.text-hover-line::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--eng-blue), var(--eng-light));
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.text-hover-line:hover::after {
    width: 100%;
}

.text-hover-line:hover {
    color: var(--eng-light);
    transition: color 0.3s ease;
}

.text-hover-line-dev {
    position: relative;
    display: inline-block;
    cursor: default;
}

.text-hover-line-dev::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--dev-green), var(--dev-light));
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.text-hover-line-dev:hover::after {
    width: 100%;
}

.text-hover-line-dev:hover {
    color: var(--dev-light);
    transition: color 0.3s ease;
}

.text-hover-highlight {
    position: relative;
    display: inline-block;
    transition: color 0.25s ease;
}

.text-hover-highlight::before {
    content: '';
    position: absolute;
    inset: -2px -6px;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 4px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.text-hover-highlight:hover::before {
    transform: scaleX(1);
}

.text-hover-highlight:hover {
    color: #7bb3fe;
}

.text-shimmer {
    background: linear-gradient(90deg,
            var(--text-primary) 0%,
            var(--eng-light) 40%,
            var(--text-primary) 60%,
            var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer-move 4s linear infinite;
}

@keyframes text-shimmer-move {
    0% {
        background-position: 100% center;
    }

    100% {
        background-position: -100% center;
    }
}

.title-hover-word {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
    cursor: default;
}

.title-hover-word:hover {
    transform: translateY(-4px) skewX(-4deg);
    color: var(--eng-light);
}

/* ═══════════════════════════════════════════
   VISITOR TELEMETRY (Bottom Left)
   ═══════════════════════════════════════════ */
#visitor-telemetry {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

#visitor-telemetry:hover {
    transform: scale(1.05) translateY(-4px);
    opacity: 1 !important;
}

#visitor-telemetry .glass-card {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

html.light #visitor-telemetry .glass-card {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(34, 52, 77, 0.1) !important;
    box-shadow: 0 10px 30px -10px rgba(34, 52, 77, 0.15);
}

#top-origins img {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#visitor-telemetry:hover #top-origins img {
    opacity: 1 !important;
    filter: grayscale(0) !important;
}