:root {
  --bg: #0b0b0c;
  --surface: rgba(255, 255, 255, .03);
  --border: rgba(255, 255, 255, .08);
  --text: #ededed;
  --muted: #8a8a8f;
  --c1: #d4d4d8;
  --c2: #52525b;
  --c3: #a1a1aa;
  --grad: linear-gradient(180deg, #ffffff, #a1a1aa);
  --hover: rgba(255, 255, 255, .25);
  --strong: #ffffff;
  --nav-bg: rgba(15, 15, 25, .6);
  --panel: rgba(12, 12, 20, .85);
  --shadow: rgba(0, 0, 0, .6);
  --track: rgba(255, 255, 255, .06);
  --glow: rgba(255, 255, 255, .035);
  --spot: rgba(255, 255, 255, .06);
  --input-bg: rgba(0, 0, 0, .35);
  --dot: #3f3f46;
}

[data-bs-theme="light"] {
  --bg: #fafafa;
  --surface: rgba(0, 0, 0, .025);
  --border: rgba(0, 0, 0, .09);
  --text: #18181b;
  --muted: #6b6b73;
  --c1: #3f3f46;
  --c2: #a1a1aa;
  --c3: #52525b;
  --grad: linear-gradient(180deg, #18181b, #71717a);
  --hover: rgba(0, 0, 0, .25);
  --strong: #000000;
  --nav-bg: rgba(255, 255, 255, .7);
  --panel: rgba(255, 255, 255, .9);
  --shadow: rgba(0, 0, 0, .08);
  --track: rgba(0, 0, 0, .07);
  --glow: rgba(0, 0, 0, .03);
  --spot: rgba(0, 0, 0, .04);
  --input-bg: #ffffff;
  --dot: #d4d4d8;
}

body, .pill-nav, .tile, .project, .terminal, .journey-card, .contact-card { transition: background-color .3s, color .3s, border-color .3s; }

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  overflow-x: hidden;
}
.mono { font-family: "JetBrains Mono", monospace; }
.text-secondary { color: var(--muted) !important; }
section { scroll-margin-top: 90px; }
.py-6 { padding-top: 6rem; padding-bottom: 6rem; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aurora { position: fixed; inset: 0; z-index: -2; filter: blur(110px); opacity: .08; }
.aurora span { position: absolute; border-radius: 50%; animation: float 18s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 45vw; height: 45vw; background: var(--c2); top: -10%; left: -10%; }
.aurora span:nth-child(2) { width: 35vw; height: 35vw; background: var(--c1); bottom: -10%; right: -5%; animation-delay: -6s; opacity: .6; }
.aurora span:nth-child(3) { width: 30vw; height: 30vw; background: var(--c3); top: 40%; left: 45%; animation-delay: -12s; opacity: .45; }
@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10vw, 8vh) scale(1.2); }
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.cursor-glow {
  position: fixed; width: 400px; height: 400px; border-radius: 50%;
  pointer-events: none; z-index: -1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow), transparent 60%);
}

.pill-nav {
  position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: .3rem; padding: .4rem .5rem;
  background: var(--nav-bg); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px;
}
.pill-nav a {
  color: var(--muted); text-decoration: none; padding: .45rem .9rem;
  border-radius: 999px; font-size: .92rem; transition: .2s;
}
.pill-nav a:hover, .pill-nav a.active { color: var(--text); background: var(--surface); }
.pill-nav .brand { color: var(--text); font-weight: 600; }
.pill-nav .nav-cta { background: var(--text); color: var(--bg); font-weight: 600; }
.pill-nav .nav-cta:hover { background: var(--strong); color: var(--bg); }
.theme-btn {
  background: none; border: 0; color: var(--muted); width: 2.2rem; height: 2.2rem;
  border-radius: 999px; display: grid; place-items: center; transition: .2s;
}
.theme-btn:hover { color: var(--text); background: var(--surface); }
[data-bs-theme="dark"] .theme-btn .bi-moon-stars,
[data-bs-theme="light"] .theme-btn .bi-sun { display: none; }
@media (max-width: 576px) {
  .pill-nav a:not(.brand):not(.nav-cta) { display: none; }
}

.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding-top: 6rem; }
.hero-title { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 700; line-height: 1.1; margin: 1.2rem 0; }
.hero-title .typed { color: var(--muted); font-size: .8em; }
.caret { color: var(--muted); animation: blink 1s step-end infinite; font-weight: 400; }
.hero-sub { font-size: 1.2rem; color: var(--muted); max-width: 520px; }
.status-chip {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem;
  padding: .35rem .8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes blink { 50% { opacity: 0; } }
.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: var(--muted); text-decoration: none; font-size: .8rem; animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

.btn-neon, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 14px; font-weight: 600; text-decoration: none; border: 0; transition: .25s;
}
.btn-neon { background: var(--text); color: var(--bg); }
.btn-neon:hover { background: var(--strong); transform: translateY(-2px); color: var(--bg); }
.btn-ghost { color: var(--text); border: 1px solid var(--border); background: transparent; }
.btn-ghost:hover { border-color: var(--hover); color: var(--strong); }

.terminal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 30px 80px var(--shadow);
  overflow: hidden; transform: perspective(1200px) rotateY(-8deg) rotateX(4deg); transition: transform .5s;
}
.terminal:hover { transform: none; }
.terminal-bar { display: flex; align-items: center; gap: .45rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.terminal-bar span.r, .terminal-bar span.y, .terminal-bar span.g { width: 12px; height: 12px; border-radius: 50%; }
.terminal-bar .r, .terminal-bar .y, .terminal-bar .g { background: var(--dot); }
.terminal-body { margin: 0; padding: 1.4rem; font-size: .9rem; line-height: 1.8; white-space: pre-wrap; color: var(--text); }
.terminal-body .p { color: var(--muted); }
.terminal-body .o { color: var(--text); }
.blink { animation: blink 1s step-end infinite; color: var(--text); }

.eyebrow { color: var(--muted); font-size: .85rem; letter-spacing: .1em; margin-bottom: 1rem; }
.section-heading { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }

.bento { display: grid; gap: 1.2rem; grid-template-columns: repeat(4, 1fr); }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 1.8rem; backdrop-filter: blur(10px); transition: border-color .3s;
}
.tile:hover { border-color: var(--hover); }
.tile-about { grid-column: span 2; }
.tile-about.tall { grid-row: span 2; }
.tile-about.full { grid-column: span 4; }
.tile-stat { display: flex; flex-direction: column; justify-content: center; }
.tile-stat.wide { grid-column: span 2; }
.skill-chip {
  padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: .95rem; transition: border-color .2s;
}
.skill-chip:hover { border-color: var(--hover); }
.tile-loc { grid-column: span 2; display: flex; align-items: center; gap: 1rem; }
.tile-skills { grid-column: span 4; }
.stat-num { font-size: 3.5rem; font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.avatar {
  width: 80px; height: 80px; border-radius: 22px; display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 700; color: var(--bg); background: var(--text); margin-bottom: 1.4rem;
}
@media (max-width: 992px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-skills, .tile-about, .tile-about.full, .tile-loc { grid-column: span 2; }
}

.rings { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-around; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; }
.ring {
  --fill: 0;
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--text) calc(var(--fill) * 1%), var(--track) 0);
  transition: --fill 1.5s;
  position: relative;
}
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; font-size: .85rem; }
.ring.in { --fill: var(--p); }
@property --fill { syntax: "<number>"; inherits: false; initial-value: 0; }

.project {
  position: relative; display: flex; flex-direction: column; height: 100%; min-height: 280px;
  padding: 2rem; border-radius: 22px; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transform-style: preserve-3d; transition: transform .15s ease-out, border-color .3s;
}
.project::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 40%);
}
.project:hover { border-color: var(--hover); color: var(--text); }
.project:hover::before { opacity: 1; }
.project-index { color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem; }
.project h4 { font-weight: 700; }
.project-arrow { position: absolute; top: 1.6rem; right: 1.6rem; font-size: 1.4rem; color: var(--muted); transition: .3s; }
.project:hover .project-arrow { color: var(--text); transform: translate(4px, -4px); }
.project-cover {
  width: calc(100% + 4rem); margin: -2rem -2rem 1.5rem; aspect-ratio: 16 / 9;
  object-fit: cover; border-bottom: 1px solid var(--border);
}

.project-page { padding-top: 8rem; padding-bottom: 4rem; max-width: 1000px; }
.back-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back-link:hover { color: var(--text); }
.project-head { margin: 2.5rem 0 3rem; }
.project-title { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; line-height: 1.1; margin-bottom: 1rem; }
.media-item { margin: 0; }
.media-item img, .media-item video, .media-item .ratio {
  width: 100%; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); overflow: hidden;
}
.media-item img { cursor: zoom-in; display: block; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s; }
.media-item img:hover { transform: scale(1.01); }
.media-main img { aspect-ratio: auto; max-height: 70vh; object-fit: contain; }
.media-item video { display: block; max-height: 70vh; background: #000; }
.media-item figcaption { color: var(--muted); font-size: .85rem; margin-top: .6rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.project-details { max-width: 720px; margin-top: 3.5rem; }
.project-details p { font-size: 1.08rem; line-height: 1.8; color: var(--text); white-space: pre-line; }
.project-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.project-nav-link {
  display: flex; flex-direction: column; gap: .3rem; color: var(--text); text-decoration: none;
  padding: 1rem 1.25rem; border-radius: 14px; border: 1px solid var(--border); min-width: 0; max-width: 48%;
}
.project-nav-link:hover { border-color: var(--hover); color: var(--text); }
#lightbox .modal-content img { max-height: 85vh; }

.tag { font-size: .75rem; padding: .25rem .6rem; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); }

.journey { position: relative; }
.journey::before { content: ""; position: absolute; left: 150px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.journey-item { display: flex; gap: 3rem; margin-bottom: 2rem; position: relative; }
.journey-item::after {
  content: ""; position: absolute; left: 144px; top: 1.6rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--text);
}
.journey-period { flex: 0 0 120px; color: var(--muted); padding-top: 1.4rem; font-size: .85rem; text-align: right; }
.journey-card { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem 1.6rem; }
@media (max-width: 768px) {
  .journey::before, .journey-item::after { display: none; }
  .journey-item { flex-direction: column; gap: .5rem; }
  .journey-period { text-align: left; padding-top: 0; flex: none; }
}

.contact-card {
  padding: clamp(2rem, 5vw, 4rem); border-radius: 30px; border: 1px solid var(--border);
  background: var(--surface);
}
.neo-form .form-control {
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 14px; padding: .9rem 1.1rem; font-family: "JetBrains Mono", monospace; font-size: .9rem;
}
.neo-form .form-control:focus { border-color: var(--hover); box-shadow: none; background: var(--input-bg); color: var(--text); }
.neo-form .form-control::placeholder { color: var(--muted); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.link-glow { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--muted); }

.socials a { color: var(--muted); font-size: 1.4rem; margin: 0 .8rem; transition: .2s; }
.socials a:hover { color: var(--text); }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
