/* ═══════════════════════════════════════════════════════
   PORTFOLIO — Midnight Obsidian Design System
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #09090f;
    --bg-elevated: #0f1019;
    --bg-card: #13141e;
    --bg-hover: #1b1d2b;
    --purple: #7b6bbf;
    --purple-dim: rgba(123, 107, 191, 0.18);
    --purple-glow: rgba(123, 107, 191, 0.38);
    --emerald: var(--purple);
    --emerald-dim: var(--purple-dim);
    --emerald-glow: var(--purple-glow);
    --slate: #31323e;
    --slate-dim: rgba(49, 50, 62, 0.5);
    --copper: var(--purple);
    --copper-dim: var(--purple-dim);
    --copper-glow: var(--purple-glow);
    --white: #ecedf5;
    --white-dim: rgba(236, 237, 245, 0.82);
    --white-muted: rgba(236, 237, 245, 0.5);
    --border: rgba(236, 237, 245, 0.08);
    --border-hover: rgba(123, 107, 191, 0.5);
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Space Grotesk', sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--emerald) var(--bg);
    overflow-x: hidden;
    background-color: var(--bg);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg) !important;
    color: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--emerald); border-radius: 3px; }

::selection { background: var(--emerald); color: var(--bg); }

/* ─── PRELOADER ─── */
#preloader {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s;
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-inner { text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; }

/* Orbital rings system */
.preloader-orbits {
    position: relative; width: 140px; height: 140px; margin-bottom: 40px;
}
.orbit {
    position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid transparent;
}
.orbit-1 {
    border-top-color: var(--emerald); border-bottom-color: var(--emerald);
    animation: orbit-spin 2.5s linear infinite;
    opacity: 0.8;
}
.orbit-2 {
    inset: 15px; border-left-color: var(--copper); border-right-color: var(--copper);
    animation: orbit-spin 2s linear infinite reverse;
    opacity: 0.6;
}
.orbit-3 {
    inset: 30px; border-top-color: var(--purple); border-left-color: rgba(168,85,247,0.3);
    animation: orbit-spin 1.5s linear infinite;
    opacity: 0.4;
}
.orbit-core {
    position: absolute; top: 50%; left: 50%;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--purple);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--purple-glow), 0 0 40px var(--purple-dim), 0 0 60px rgba(168,85,247,0.1);
    animation: core-pulse 2s ease-in-out infinite;
}

@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes core-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px var(--purple-glow), 0 0 40px var(--purple-dim); }
    50% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 30px var(--purple-glow), 0 0 60px var(--purple-dim), 0 0 80px rgba(168,85,247,0.1); }
}

/* Name reveal */
.preloader-name {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 16px;
    opacity: 0; animation: name-reveal 0.8s 0.5s var(--ease-out-expo) forwards;
}
.preloader-dash {
    color: var(--copper); font-weight: 300; font-size: 1.2rem;
    opacity: 0; animation: dash-slide 0.6s 0.8s var(--ease-out-expo) forwards;
}
.preloader-dash:last-child { animation-delay: 1s; }
.preloader-name-text {
    font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600; color: var(--white); letter-spacing: 0.05em;
    position: relative;
    animation: name-shimmer 3s infinite linear;
}
@keyframes name-shimmer {
    0% { color: var(--white); text-shadow: none; }
    48% { color: var(--white); text-shadow: none; }
    50% { color: var(--emerald); text-shadow: 0 0 10px var(--emerald-glow); }
    52% { color: var(--white); text-shadow: none; }
    54% { color: var(--copper); text-shadow: 0 0 10px var(--copper-glow); }
    56% { color: var(--white); text-shadow: none; }
    100% { color: var(--white); text-shadow: none; }
}

@keyframes name-reveal {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes dash-slide {
    from { opacity: 0; transform: scaleX(0); }
    to { opacity: 0.7; transform: scaleX(1); }
}

.preloader-text {
    font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.35em;
    color: var(--white-muted); display: block;
    opacity: 0; animation: preloader-text-in 0.6s 1.2s var(--ease-out-expo) forwards;
}
@keyframes preloader-text-in {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

.preloader-bar {
    width: 160px; height: 2px; background: var(--border); margin: 16px auto 0;
    border-radius: 1px; overflow: hidden;
    opacity: 0; animation: preloader-text-in 0.4s 1.4s var(--ease-out-expo) forwards;
}
.preloader-bar-fill {
    width: 0%; height: 100%; background: linear-gradient(90deg, var(--emerald), var(--copper));
    border-radius: 1px; animation: preloader-fill 2s 0.6s var(--ease-out-expo) forwards;
}
@keyframes preloader-fill { to { width: 100%; } }

/* ─── CUSTOM CURSOR ─── */
#cursor-dot, #cursor-ring {
    position: fixed; pointer-events: none; z-index: 9999;
    border-radius: 50%; transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}
#cursor-dot { width: 6px; height: 6px; background: var(--emerald); }
#cursor-ring {
    width: 36px; height: 36px; border: 1px solid var(--emerald-glow);
    transition: width 0.3s var(--ease-spring), height 0.3s var(--ease-spring), border-color 0.3s;
}
#cursor-ring.hovering { width: 56px; height: 56px; border-color: var(--emerald); }
@media (hover: none) { #cursor-dot, #cursor-ring { display: none; } }

/* ─── SCROLL PROGRESS ─── */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; z-index: 9998;
    background: linear-gradient(90deg, var(--emerald), var(--copper));
    width: 0%; transition: width 0.1s linear;
}

/* ─── NAVIGATION ─── */
#main-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px clamp(20px, 5vw, 60px);
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: padding 0.4s var(--ease-out-expo), background 0.4s;
}
#main-nav.scrolled { padding-top: 12px; padding-bottom: 12px; background: rgba(5, 5, 5, 0.9); }

.nav-logo {
    font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
    color: var(--white); letter-spacing: 0.02em;
}
.logo-dash { color: var(--copper); margin: 0 4px; font-weight: 300; opacity: 0.6; }

.nav-links { display: flex; gap: 32px; }
.nav-link {
    font-size: 0.82rem; font-weight: 500; color: var(--white-muted);
    text-decoration: none; letter-spacing: 0.04em; text-transform: uppercase;
    position: relative; transition: color 0.3s;
}
.nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: var(--emerald);
    transition: width 0.4s var(--ease-out-expo);
}
.nav-link:hover, .nav-link.active { color: var(--emerald); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

#nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    width: 28px; height: 20px; position: relative; z-index: 1001;
}
#nav-toggle span {
    position: absolute; left: 0; width: 100%; height: 2px;
    background: var(--white); transition: all 0.3s var(--ease-out-expo);
}
#nav-toggle span:nth-child(1) { top: 0; }
#nav-toggle span:nth-child(2) { top: 9px; }
#nav-toggle span:nth-child(3) { top: 18px; }
#nav-toggle.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

#mobile-menu {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(5, 5, 5, 0.95); backdrop-filter: blur(30px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    opacity: 0; visibility: hidden; transition: all 0.5s var(--ease-out-expo);
}
#mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-link {
    font-family: var(--font-display); font-size: 2rem; font-weight: 600;
    color: var(--white-dim); text-decoration: none; transition: color 0.3s;
    position: relative;
}
.mobile-link::before {
    content: ''; position: absolute; left: -20px; top: 50%;
    width: 8px; height: 8px; border-radius: 50%; background: var(--emerald);
    transform: translateY(-50%) scale(0); transition: transform 0.3s var(--ease-spring);
}
.mobile-link:hover { color: var(--emerald); }
.mobile-link:hover::before { transform: translateY(-50%) scale(1); }

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

/* ─── WEBGL CANVAS ─── */
#webgl-canvas {
    position: fixed; inset: 0; z-index: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    background-color: var(--bg);
}

/* ─── SECTIONS COMMON ─── */
.section {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(80px, 12vh, 140px) clamp(20px, 5vw, 80px);
    background-color: transparent;
}

.section-container { max-width: 1200px; width: 100%; margin: 0 auto; }

.section-header { margin-bottom: 60px; }
.section-index {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--copper);
    letter-spacing: 0.15em; display: block; margin-bottom: 12px;
}
.section-title {
    font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
}
.accent { color: var(--emerald); }
.text-accent { color: var(--emerald); font-weight: 500; }
.section-line {
    width: 60px; height: 2px; margin-top: 16px;
    background: linear-gradient(90deg, var(--emerald), var(--copper));
}
.section-subtitle { color: var(--white-muted); margin-top: 12px; font-size: 1rem; }

/* ─── HERO ─── */
#hero { flex-direction: column; text-align: center; }

.hero-content {
    max-width: 800px; position: relative; z-index: 2;
    opacity: 0; transform: translateY(40px);
}
.hero-content.visible { opacity: 1; transform: translateY(0); transition: all 1.2s var(--ease-out-expo); }

.hero-overline {
    display: inline-flex; align-items: center; gap: 10px;
    margin-bottom: 24px; padding: 6px 16px;
    background: var(--emerald-dim); border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 100px;
}
.overline-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--emerald);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.5); } }
.overline-text {
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em;
    color: var(--emerald);
}

.hero-title {
    font-family: var(--font-display); font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800; letter-spacing: -0.04em; line-height: 1;
    margin-bottom: 24px;
}
.title-line { display: block; overflow: hidden; }
.title-line.accent {
    background: linear-gradient(135deg, #ffffff 0%, #ecedf5 45%, #7b6bbf 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem); color: var(--white-dim);
    line-height: 1.7; max-width: 600px; margin: 0 auto 36px;
}

.hero-cta-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: 12px; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: all 0.4s var(--ease-out-expo);
    border: none; font-family: var(--font-main);
}
.btn-primary {
    background: linear-gradient(135deg, #7b6bbf, #60519b);
    color: #ffffff;
    box-shadow: 0 4px 24px rgba(123, 107, 191, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(123, 107, 191, 0.55); }
.btn-ghost {
    background: transparent; color: var(--white);
    border: 1px solid var(--border-hover);
}
.btn-ghost:hover { border-color: var(--copper); color: var(--copper); }

.hero-stats {
    display: flex; align-items: center; justify-content: center; gap: 32px;
    padding: 24px 0; border-top: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-number {
    font-family: var(--font-display); font-size: 2rem; font-weight: 700;
    color: var(--emerald);
}
.stat-suffix { font-family: var(--font-display); font-size: 1.4rem; color: var(--copper); }
.stat-label { display: block; font-size: 0.75rem; color: var(--white-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

.scroll-indicator {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    opacity: 0; animation: fade-in-up 1s 2.5s forwards;
}
@keyframes fade-in-up { to { opacity: 0.5; } }
.scroll-indicator span { font-size: 0.7rem; color: var(--white-muted); letter-spacing: 0.15em; text-transform: uppercase; }
.scroll-mouse {
    width: 22px; height: 34px; border: 2px solid var(--white-muted);
    border-radius: 11px; position: relative;
}
.scroll-wheel {
    width: 3px; height: 8px; background: var(--emerald);
    border-radius: 2px; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    animation: scroll-wheel 2s ease-in-out infinite;
}
@keyframes scroll-wheel { 0% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(12px); } }

/* ─── ABOUT ─── */
.about-grid {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center;
}
.about-lead { font-size: 1.15rem; line-height: 1.8; margin-bottom: 16px; }
.about-text p { color: var(--white-dim); line-height: 1.8; margin-bottom: 16px; font-size: 0.95rem; }
.about-highlights { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.highlight-item { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--white-dim); }

.about-card {
    position: relative; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 24px; overflow: hidden;
}
.card-glow {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 30%, var(--emerald-dim), transparent 60%);
    opacity: 0.5; pointer-events: none;
}
.code-window { position: relative; }
.code-dots { display: flex; gap: 6px; margin-bottom: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }
.code-block {
    font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.8;
    color: var(--white-dim); white-space: pre-wrap; overflow-x: auto;
}
.code-keyword { color: #c792ea; }
.code-var { color: var(--white); }
.code-key { color: var(--emerald); }
.code-string { color: var(--copper); }

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ─── SKILLS ─── */
.skills-universe { position: relative; }
#constellation-canvas {
    width: 100%; height: 300px; display: block;
    border-radius: 16px; border: 1px solid var(--border);
    background: var(--bg-card); margin-bottom: 40px;
}
.skills-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
@media (min-width: 1200px) {
    .skills-categories { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .skills-categories { grid-template-columns: 1fr; }
}
.skill-category {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 32px;
    display: flex; flex-direction: column;
    height: 100%;
    transition: border-color 0.4s, transform 0.4s var(--ease-out-expo), box-shadow 0.4s;
}
.skill-category[data-category="frontend"] { transform: translateY(10px); }
.skill-category:hover { border-color: var(--emerald-glow); transform: translateY(6px); }
.skill-category:not([data-category="frontend"]):hover { transform: translateY(-4px); }
.category-icon { margin-bottom: 16px; }
.category-title {
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
    margin-bottom: 20px; color: var(--white);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
    padding: 6px 14px; background: var(--emerald-dim); border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 100px; font-size: 0.78rem; font-weight: 500; color: var(--emerald);
    transition: all 0.3s var(--ease-out-expo); cursor: default;
}
.skill-tag:hover {
    background: var(--emerald); color: var(--bg);
    box-shadow: 0 0 20px var(--emerald-dim);
}

/* ─── PROJECTS ─── */
.project-module {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
    align-items: center; margin-bottom: 120px;
    padding: 40px; border-radius: 24px;
    background: var(--bg-card); border: 1px solid var(--border);
    opacity: 0; transform: translateY(60px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.project-module.visible { opacity: 1; transform: translateY(0); }
.project-module:nth-child(even) { direction: rtl; }
.project-module:nth-child(even) > * { direction: ltr; }
.project-module:last-child { margin-bottom: 0; }

/* ─── BESPOKE PROJECT PREVIEW CARDS ─── */
.project-preview-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s var(--ease-out-expo), border-color 0.5s, box-shadow 0.5s;
}
.project-module:hover .project-preview-wrap {
    border-color: rgba(123, 107, 191, 0.5);
    box-shadow: 0 25px 60px rgba(123, 107, 191, 0.22), 0 0 30px rgba(123, 107, 191, 0.14);
    transform: translateY(-4px);
}

.preview-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #07070d;
    border-radius: 20px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(15, 15, 22, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}
.preview-dots { display: flex; gap: 6px; }
.preview-dots .dot { width: 9px; height: 9px; border-radius: 50%; }
.preview-dots .dot.red { background: #ff5f57; }
.preview-dots .dot.yellow { background: #febc2e; }
.preview-dots .dot.green { background: #28c840; }

.preview-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--white-dim);
}
.preview-url svg { color: var(--purple); }

.preview-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(123, 107, 191, 0.2);
    color: #ecedf5;
    border: 1px solid rgba(123, 107, 191, 0.38);
}

.preview-body {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.clinical-preview::before {
    content: ''; position: absolute; top: -30%; right: -20%; width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(123, 107, 191, 0.25), transparent 70%);
    pointer-events: none;
}
.guro-preview::before {
    content: ''; position: absolute; top: -30%; right: -20%; width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(123, 107, 191, 0.2), transparent 70%);
    pointer-events: none;
}
.laguna-preview::before {
    content: ''; position: absolute; top: -30%; right: -20%; width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(123, 107, 191, 0.25), transparent 70%);
    pointer-events: none;
}

.brand-emblem-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-emblem {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.4s var(--ease-spring), border-color 0.4s;
}
.project-module:hover .brand-emblem {
    transform: scale(1.08);
    border-color: rgba(123, 107, 191, 0.6);
    box-shadow: 0 15px 35px rgba(123, 107, 191, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}
.brand-sub {
    font-size: 0.75rem;
    color: var(--white-muted);
    margin-top: 3px;
}

.widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.preview-widget {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(10px);
}
.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--white-muted);
    margin-bottom: 6px;
}
.widget-value {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-dot.green { background: #10b981; box-shadow: 0 0 10px #10b981; }

.live-pill, .offline-pill, .ai-pill {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.live-pill { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.offline-pill { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.ai-pill { background: rgba(123, 107, 191, 0.22); color: #ecedf5; border: 1px solid rgba(123, 107, 191, 0.45); }

.telemetry-bar {
    width: 100%; height: 4px; background: rgba(255, 255, 255, 0.08);
    border-radius: 2px; overflow: hidden; margin-top: 6px;
}
.telemetry-fill {
    height: 100%; background: linear-gradient(90deg, #7b6bbf, #60519b);
    border-radius: 2px;
}
.guro-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.sparkline-svg { margin-top: 2px; }
.subject-tags, .security-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.sub-pill, .sec-pill {
    font-size: 0.62rem; font-weight: 600; padding: 2px 6px; border-radius: 4px;
    background: rgba(255, 255, 255, 0.04); color: var(--white-dim);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.sub-pill.active { background: rgba(123, 107, 191, 0.22); color: #ecedf5; border-color: rgba(123, 107, 191, 0.42); }

.chat-bubble-mock {
    font-size: 0.68rem; color: var(--white-dim); background: rgba(123, 107, 191, 0.1);
    border: 1px solid rgba(123, 107, 191, 0.25); border-radius: 6px; padding: 6px 8px;
    margin-top: 2px; line-height: 1.3;
}
.chat-author { font-weight: 700; color: #ecedf5; display: block; margin-bottom: 1px; }

.project-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.project-number { font-family: var(--font-mono); font-size: 0.75rem; color: var(--copper); letter-spacing: 0.1em; }
.project-tag {
    font-size: 0.72rem; font-weight: 600; color: var(--emerald); text-transform: uppercase;
    letter-spacing: 0.1em; padding: 4px 12px; background: var(--emerald-dim);
    border-radius: 100px;
}
.project-title {
    font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px;
}
.project-title a {
    color: inherit; text-decoration: none;
    transition: color 0.3s ease;
}
.project-title a:hover {
    color: var(--emerald);
}
.project-tagline { font-size: 0.95rem; color: var(--copper); margin-bottom: 16px; font-weight: 500; }
.project-description { font-size: 0.9rem; color: var(--white-dim); line-height: 1.7; margin-bottom: 20px; }

.project-tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tech-pill {
    padding: 4px 12px; font-size: 0.72rem; font-weight: 600;
    border: 1px solid var(--border-hover); border-radius: 100px;
    color: var(--white-muted); transition: all 0.3s;
}
.tech-pill:hover { border-color: var(--copper); color: var(--copper); }

.project-metrics { display: flex; gap: 20px; flex-wrap: wrap; }
.metric {
    padding: 12px 16px; background: var(--bg-elevated); border-radius: 12px;
    border: 1px solid var(--border); flex: 1; min-width: 100px;
}
.metric-value { display: block; font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--emerald); }
.metric-label { font-size: 0.7rem; color: var(--white-muted); margin-top: 2px; display: block; }

.project-actions { margin-top: 24px; }
.btn-secondary {
    background: rgba(168, 85, 247, 0.08);
    color: var(--emerald);
    border: 1px solid rgba(168, 85, 247, 0.25);
    padding: 10px 20px;
    font-size: 0.85rem;
}
.btn-secondary:hover {
    background: var(--emerald);
    color: var(--bg);
    border-color: var(--emerald);
    box-shadow: 0 0 25px var(--emerald-dim);
    transform: translateY(-2px);
}
.project-link svg { transition: transform 0.3s ease; }
.project-link:hover svg { transform: translate(2px, -2px); }

@media (max-width: 900px) {
    .project-module { grid-template-columns: 1fr; }
    .project-module:nth-child(even) { direction: ltr; }
}

/* ─── CONTACT ─── */
.contact-container { text-align: center; }
.contact-lead { font-size: 1.2rem; color: var(--white-dim); margin-bottom: 40px; }

.contact-email {
    display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
    text-decoration: none; padding: 32px 48px; border-radius: 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    transition: all 0.5s var(--ease-out-expo); position: relative; overflow: hidden;
}
.contact-email::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at center, var(--emerald-dim), transparent 70%);
    opacity: 0; transition: opacity 0.5s;
}
.contact-email:hover { border-color: var(--emerald-glow); transform: translateY(-4px); box-shadow: 0 20px 60px rgba(168, 85, 247, 0.15); }
.contact-email:hover::before { opacity: 1; }
.email-label { font-size: 0.75rem; color: var(--white-muted); text-transform: uppercase; letter-spacing: 0.15em; position: relative; z-index: 1; }
.email-address { font-family: var(--font-display); font-size: clamp(1rem, 3vw, 1.5rem); font-weight: 600; color: var(--emerald); position: relative; z-index: 1; }
.contact-email svg { color: var(--copper); position: relative; z-index: 1; }

/* Social Links */
.social-links {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    margin-top: 40px;
}
.social-link {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--white-muted); text-decoration: none;
    transition: all 0.4s var(--ease-out-expo);
}
.social-link:hover {
    color: var(--emerald); border-color: var(--emerald-glow);
    box-shadow: 0 0 24px var(--emerald-dim);
    transform: translateY(-3px);
}

/* ─── FOOTER ─── */
.site-footer {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 20px clamp(20px, 5vw, 80px);
    border-top: 1px solid var(--border);
}
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 16px; }
.footer-copyright { font-size: 0.75rem; color: var(--white-muted); }
.footer-accent-line { width: 40px; height: 1px; background: linear-gradient(90deg, var(--emerald), var(--copper)); }
.footer-tagline { font-size: 0.75rem; color: var(--white-muted); font-style: italic; }

/* ─── BACK TO TOP ─── */
#back-to-top {
    position: fixed; bottom: 32px; right: 32px; z-index: 900;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--emerald); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: all 0.4s var(--ease-out-expo);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover {
    border-color: var(--emerald); background: var(--emerald);
    color: var(--bg); box-shadow: 0 0 24px var(--emerald-dim);
}

/* ─── GLOBAL REVEAL ANIMATION UTILITY ─── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── PREMIUM POLISH ─── */

/* Ambient vignette on the page edges */
body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(5,5,5,0.6) 100%);
}

/* Project card hover glow */
.project-module::before {
    content: ''; position: absolute; inset: -1px; z-index: -1;
    border-radius: 25px; opacity: 0;
    background: linear-gradient(135deg, var(--emerald-glow), transparent 40%, transparent 60%, var(--copper-glow));
    transition: opacity 0.6s var(--ease-out-expo);
}
.project-module { position: relative; }
.project-module:hover::before { opacity: 1; }
.project-module:hover { border-color: var(--emerald-glow); }

/* Shimmer effect on skill tags */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.skill-tag:hover {
    background: linear-gradient(90deg, var(--emerald), #34d399, var(--emerald));
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    color: var(--bg); border-color: transparent;
    box-shadow: 0 0 24px var(--emerald-dim);
}

/* Contact section ambient glow */
.contact-email::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, var(--emerald-dim), transparent 70%);
    transform: translate(-50%, -50%); z-index: 0; pointer-events: none;
    opacity: 0; transition: opacity 0.5s;
}
.contact-email:hover::after { opacity: 0.6; }

/* Grid line accent between sections */
.section + .section::before {
    content: ''; position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 1px; height: 80px;
    background: linear-gradient(to bottom, var(--emerald-glow), transparent);
    pointer-events: none;
}

/* Floating decoration dots */
.section-header::before {
    content: ''; position: absolute; top: -8px; left: -16px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--copper);
    box-shadow: 0 0 12px var(--copper-glow);
}
.section-header { position: relative; }

/* Metric cards subtle hover */
.metric { transition: border-color 0.3s, box-shadow 0.3s; }
.metric:hover { border-color: var(--emerald-glow); box-shadow: 0 0 20px var(--emerald-dim); }

/* About card tilt-ready border */
.about-card { transition: border-color 0.4s, box-shadow 0.4s; }
.about-card:hover { border-color: var(--emerald-glow); box-shadow: 0 0 40px var(--emerald-dim); }

/* Responsive footer padding */
#contact { padding-bottom: 120px; }

/* Extra mobile refinements */
@media (max-width: 768px) {
    .hero-title { font-size: clamp(2.4rem, 10vw, 3.5rem); }
    .hero-stats { gap: 20px; flex-wrap: wrap; }
    .stat-number { font-size: 1.5rem; }
    .project-module { padding: 24px; margin-bottom: 60px; }
    .project-metrics { flex-direction: column; }
    .contact-email { padding: 24px 32px; }
    #constellation-canvas { height: 200px; }
    .skills-categories { grid-template-columns: 1fr; gap: 20px; }
    .skill-category { padding: 24px; }
    .section + .section::before { height: 40px; }
}
