:root {
  --bg: #070a12;
  --bg-soft: #0c101b;
  --card: rgba(14, 19, 31, 0.72);
  --card-solid: #0f1522;
  --text: #f7f8fc;
  --muted: #a2a9ba;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.15);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --shadow: 0 25px 70px rgba(0,0,0,.28);
  --radius-lg: 28px;
  --radius-md: 20px;
  --container: 1180px;
}

html[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-soft: #ffffff;
  --card: rgba(255,255,255,.78);
  --card-solid: #ffffff;
  --text: #0f172a;
  --muted: #5b6578;
  --line: rgba(15,23,42,.08);
  --line-strong: rgba(15,23,42,.14);
  --shadow: 0 25px 70px rgba(15,23,42,.09);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}

body::selection {
  background: rgba(139,92,246,.35);
}

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

button, a { -webkit-tap-highlight-color: transparent; }

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

.container {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.site-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -2; }

.noise {
  position: absolute; inset: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.orb {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .12;
}
.orb-1 { background: #8b5cf6; top: -180px; right: -140px; }
.orb-2 { background: #22d3ee; bottom: -220px; left: -120px; }

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  background: rgba(7,10,18,.35);
  backdrop-filter: blur(16px);
  transition: .25s ease;
}
.navbar.scrolled {
  background: rgba(7,10,18,.72);
  border-bottom-color: var(--line);
}
html[data-theme="light"] .navbar { background: rgba(247,248,252,.35); }
html[data-theme="light"] .navbar.scrolled { background: rgba(247,248,252,.82); }

.nav-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; font-weight: 700; letter-spacing: -.03em; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: linear-gradient(145deg, rgba(139,92,246,.22), rgba(34,211,238,.10));
  box-shadow: inset 0 0 20px rgba(139,92,246,.10);
}
.brand-dot { color: var(--accent-2); }

.nav-links { display: flex; gap: 6px; }
.nav-link {
  padding: 10px 14px; border-radius: 12px; color: var(--muted);
  font-size: .92rem; transition: .2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.06); }

.theme-toggle, .menu-toggle {
  border: 1px solid var(--line); color: var(--text); background: var(--card);
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
}
.menu-toggle { display: none; }
.menu-toggle span { display:block; width:18px; height:2px; background: currentColor; margin: 4px auto; transition:.2s; }

.section { padding: 130px 0; position: relative; }
.section-muted { background: linear-gradient(180deg, transparent, rgba(255,255,255,.018), transparent); }

.hero { min-height: 100vh; display: grid; place-items: center; padding-top: 140px; padding-bottom: 90px; }
.hero-grid { display: grid; grid-template-columns: 1.06fr .94fr; align-items: center; gap: 72px; }

.hero-kicker, .section-label, .project-type {
  color: #9f8cff; letter-spacing: .18em; text-transform: uppercase; font-size: .76rem; font-weight: 700;
}
.hero-kicker { margin-bottom: 18px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; margin-bottom: 28px;
  color: var(--muted); background: rgba(255,255,255,.035);
  font-size: .78rem;
}
.status-dot { width: 7px; height: 7px; border-radius:50%; background:#34d399; box-shadow:0 0 0 6px rgba(52,211,153,.10); }

.hero h1, .section-heading h2, .contact-card h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -.05em;
  line-height: 1.02;
}
.hero h1 { font-size: clamp(3.6rem, 7vw, 6.8rem); max-width: 760px; }
.gradient-text {
  background: linear-gradient(90deg, #a78bfa 0%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-description { margin-top: 25px; max-width: 640px; color: var(--muted); font-size: 1.06rem; }
.hero-description strong { color: var(--text); }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-strong); font-size: .92rem; font-weight: 700;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
  cursor: pointer; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; border-color: transparent; background: linear-gradient(135deg, #7c3aed, #0891b2); box-shadow: 0 16px 30px rgba(76,29,149,.28); }
.btn-ghost { background: rgba(255,255,255,.035); }

.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-size: .83rem; }
.hero-meta i { margin-right: 7px; color: #9f8cff; }

.hero-visual { position: relative; min-height: 560px; display: grid; place-items: center; }
.profile-shell {
  position: relative; width: min(410px, 82vw); aspect-ratio: 1; display: grid; place-items: center;
}
.profile-ring {
  position: absolute; inset: 4%; border-radius: 50%;
  background: conic-gradient(from 180deg, rgba(139,92,246,.05), rgba(139,92,246,.8), rgba(34,211,238,.55), rgba(139,92,246,.05));
  filter: blur(1px);
  animation: spin 16s linear infinite;
}
.profile-ring::before {
  content:""; position:absolute; inset: 13px; border-radius:50%; background: var(--bg);
}
.profile-image {
  position: relative; z-index: 2; width: 72%; aspect-ratio:1; object-fit:cover; border-radius:50%;
  border: 10px solid rgba(7,10,18,.86);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.floating-card {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; background: rgba(12,16,27,.80); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(16px);
  font-size: .78rem;
}
.floating-card i { width: 32px; height: 32px; display:grid; place-items:center; border-radius: 10px; background: rgba(139,92,246,.13); color:#b79cff; }
.floating-card div { display:flex; flex-direction:column; }
.floating-card span { color: var(--muted); }
.card-top { top: 9%; left: -3%; }
.card-bottom { bottom: 8%; right: -2%; }

.code-window {
  position: absolute; right: 0; bottom: -2px; width: min(410px, 83%);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: rgba(10,13,22,.88); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.window-bar { display:flex; align-items:center; gap:7px; padding: 10px 13px; border-bottom:1px solid var(--line); }
.window-bar > span { width:8px; height:8px; border-radius:50%; background:#596273; }
.window-bar small { margin-left:8px; color:#768095; font: 600 11px "Inter"; }
.code-window pre { margin:0; padding:18px; overflow:auto; color:#d7deef; font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.kw { color: #c084fc; }
.str { color: #67e8f9; }

.scroll-hint { position:absolute; bottom: 28px; left:50%; transform:translateX(-50%); color:var(--muted); font-size:.72rem; letter-spacing:.12em; text-transform:uppercase; display:flex; gap:8px; align-items:center; }
.scroll-hint span { width:30px; height:46px; border:1px solid var(--line-strong); border-radius:999px; position:relative; }
.scroll-hint span::after { content:""; width:4px; height:8px; border-radius:99px; background:#9f8cff; position:absolute; left:50%; top:8px; transform:translateX(-50%); animation: scrollDot 1.5s infinite; }

.section-heading { max-width: 780px; }
.section-heading h2 { font-size: clamp(2.6rem, 5vw, 4.3rem); margin-top: 12px; }
.section-subtitle { color: var(--muted); max-width: 680px; margin-top: 16px; }
.project-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:30px; max-width:none; margin-bottom: 42px; }

.about-grid { margin-top: 42px; display:grid; grid-template-columns: 1.15fr .85fr; gap: 22px; }
.about-card, .stat-card, .stack-card, .project-card, .contact-card {
  border:1px solid var(--line); background:var(--card); border-radius:var(--radius-md);
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.about-card { padding: 34px; }
.about-card p + p { margin-top:18px; color:var(--muted); }
.about-card .lead { font-size:1.23rem; color:var(--text); max-width: 720px; }

.stats-grid { display:grid; grid-template-columns:repeat(2,1fr); gap: 14px; }
.stat-card { min-height: 160px; padding: 24px; display:flex; flex-direction:column; justify-content:space-between; }
.stat-number { font: 700 2rem "Space Grotesk"; color:#a78bfa; }
.stat-label { color:var(--muted); font-size:.9rem; }

.stack-grid { margin-top:42px; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.stack-card { padding:26px; min-height: 220px; transition: .25s ease; }
.stack-card:hover, .project-card:hover, .stat-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.stack-icon { width:46px; height:46px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(145deg, rgba(139,92,246,.16), rgba(34,211,238,.08)); color:#c4b5fd; font-size:1.2rem; margin-bottom:24px; }
.stack-card h3 { font: 700 1.18rem "Space Grotesk"; }
.stack-card p { color:var(--muted); font-size:.88rem; margin-top:10px; }

.project-grid { display:grid; grid-template-columns:repeat(12,1fr); gap:18px; }
.project-card { overflow:hidden; transition:.25s ease; grid-column:span 6; }
.project-featured { grid-column:span 7; }
.project-media { position:relative; aspect-ratio: 16/9; overflow:hidden; background:#101827; }
.project-media img { width:100%; height:100%; object-fit:cover; transition:transform .45s ease; }
.project-card:hover .project-media img { transform:scale(1.045); }
.project-overlay { position:absolute; inset:0; background:linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.58)); }
.project-badge, .project-year {
  position:absolute; top:14px; padding:6px 10px; border-radius:999px; font-size:.68rem; font-weight:700;
  backdrop-filter: blur(8px);
}
.project-badge { left:14px; border:1px solid rgba(255,255,255,.12); color:#fff; background:rgba(11,16,27,.62); }
.project-badge.completed { border-color:rgba(52,211,153,.3); }
.project-badge.progress { border-color:rgba(250,204,21,.3); }
.project-badge.upcoming { border-color:rgba(34,211,238,.3); }
.project-badge.archived { border-color:rgba(148,163,184,.3); }
.project-year { right:14px; color:#f4f7ff; background:rgba(11,16,27,.5); }
.project-body { padding:24px; }
.project-type { font-size:.67rem; color:#8ea6c9; }
.project-body h3 { font:700 1.35rem "Space Grotesk"; margin-top:5px; }
.project-body > p:not(.project-type) { color:var(--muted); font-size:.87rem; margin-top:10px; }
.project-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:24px; }
.tag-list { display:flex; flex-wrap:wrap; gap:6px; }
.tag-list span { font-size:.68rem; color:var(--muted); border:1px solid var(--line); border-radius:999px; padding:5px 9px; }
.icon-link { width:42px; height:42px; display:grid; place-items:center; border:1px solid var(--line); border-radius:12px; color:var(--text); background:rgba(255,255,255,.03); cursor:pointer; transition:.2s; }
.icon-link:hover { transform:translateY(-2px); border-color: rgba(167,139,250,.5); }

.contact-section { padding-top: 80px; padding-bottom: 90px; }
.contact-card { padding: 42px; display:flex; justify-content:space-between; align-items:flex-end; gap:34px; background: radial-gradient(circle at 85% 20%, rgba(34,211,238,.08), transparent 32%), radial-gradient(circle at 20% 80%, rgba(139,92,246,.10), transparent 32%), var(--card); }
.contact-card h2 { font-size:clamp(2.9rem,5vw,4.8rem); margin-top:12px; }
.contact-card p:not(.section-label) { color:var(--muted); max-width:620px; margin-top:16px; }
.contact-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }

.footer { border-top:1px solid var(--line); }
.footer-inner { min-height:80px; display:flex; justify-content:space-between; align-items:center; gap:18px; color:var(--muted); font-size:.78rem; }
.footer-links { display:flex; gap:8px; }
.footer-links a { width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--line); border-radius:11px; }

.reveal { opacity:0; transform:translateY(26px); transition: opacity .75s ease, transform .75s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity:1; transform:none; }
.reveal-delay { transition-delay:.1s; }

.toast {
  position:fixed; right:20px; bottom:20px; z-index:2000;
  padding:12px 16px; border:1px solid var(--line); border-radius:12px;
  background:var(--card-solid); box-shadow:var(--shadow); color:var(--text);
  opacity:0; transform:translateY(12px); pointer-events:none; transition:.22s ease;
}
.toast.show { opacity:1; transform:none; }

@keyframes spin { to { transform:rotate(360deg); } }
@keyframes scrollDot { 50% { transform:translate(-50%, 12px); opacity:.45; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }

@media (max-width: 980px) {
  .nav-links {
    position:absolute; top:76px; left:20px; right:20px; display:none; flex-direction:column;
    padding:10px; border:1px solid var(--line); border-radius:18px; background:rgba(10,13,22,.92); backdrop-filter:blur(18px);
  }
  html[data-theme="light"] .nav-links { background:rgba(255,255,255,.94); }
  .nav-links.open { display:flex; }
  .menu-toggle { display:block; }
  .theme-toggle { margin-left:auto; }
  .hero-grid, .about-grid { grid-template-columns:1fr; }
  .hero-visual { min-height: 530px; }
  .stack-grid { grid-template-columns:repeat(2,1fr); }
  .project-featured, .project-card { grid-column:span 6; }
  .project-heading { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 700px) {
  .container { width:min(calc(100% - 28px), var(--container)); }
  .section { padding:92px 0; }
  .nav-inner { height:68px; }
  .nav-links { top:68px; left:14px; right:14px; }
  .hero { padding-top:120px; }
  .hero h1 { font-size:clamp(3.1rem, 15vw, 4.7rem); }
  .hero-description { font-size:1rem; }
  .hero-visual { min-height: 430px; }
  .profile-shell { width:min(340px, 88vw); }
  .code-window { width:94%; right:3%; }
  .floating-card { transform:scale(.9); }
  .card-top { left:-7%; }
  .card-bottom { right:-7%; }
  .stack-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .project-featured, .project-card { grid-column:span 12; }
  .contact-card { padding:28px; align-items:flex-start; flex-direction:column; }
  .contact-actions { justify-content:flex-start; }
  .footer-inner { padding:18px 0; align-items:flex-start; flex-direction:column; }
  .scroll-hint { display:none; }
}

@media (max-width: 470px) {
  .theme-toggle { display:none; }
  .hero-actions .btn, .contact-actions .btn { width:100%; }
  .stats-grid { grid-template-columns:1fr; }
  .about-card { padding:25px; }
}
