/* ============================================================
   Personal site — "hermes agent" style
   dark · glowing · terminal-flavored · gradient accents
   ============================================================ */

:root {
  --bg: #05060a;
  --bg-soft: #0a0c12;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --muted: #98a1b3;
  --faint: #5f6878;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --grad: linear-gradient(100deg, #a78bfa 0%, #818cf8 45%, #22d3ee 100%);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --maxw: 1120px;
  --nav-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1c2030; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2a2f45; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
.mono { font-family: var(--mono); }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- ambient background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -2;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
  pointer-events: none;
}
.bg-glow--a {
  top: -220px;
  left: -140px;
  background: radial-gradient(circle, #6d28d9 0%, transparent 65%);
}
.bg-glow--b {
  top: 30%;
  right: -260px;
  background: radial-gradient(circle, #0e7490 0%, transparent 65%);
  opacity: 0.16;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 6, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad);
  color: #05060a;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 0 18px rgba(129, 140, 248, 0.45);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links a {
  position: relative;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.nav-cta {
  margin-left: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav-cta:hover {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.hamburger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 72px) 24px 0;
  display: flex;
  flex-direction: column;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.06);
  font-family: var(--mono);
  font-size: 12px;
  color: #a5f3fc;
  margin-bottom: 26px;
}
.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.9);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.hero-role {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  min-height: 1.8em;
}
.rotator { color: #7dd3fc; display: inline-block; }
.rot-cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -0.18em;
  background: var(--cyan);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  margin-top: 20px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16.5px;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad);
  color: #07080d;
  box-shadow: 0 10px 34px -8px rgba(129, 140, 248, 0.55);
}
.btn-primary:hover { box-shadow: 0 16px 40px -8px rgba(129, 140, 248, 0.7); }
.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}
.btn-ghost:hover { border-color: rgba(139, 92, 246, 0.55); color: #c7d2fe; }
.btn-lg { padding: 16px 34px; font-size: 16px; }

.hero-links {
  margin-top: 26px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.hero-links a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  transition: color 0.2s ease;
}
.hero-links a:hover { color: #c7d2fe; }

/* ---------- terminal ---------- */
.terminal {
  background: linear-gradient(180deg, #0d0f18 0%, #080a11 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(139, 92, 246, 0.05),
    0 0 90px -40px rgba(99, 102, 241, 0.55);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }
.terminal-title {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.terminal-body {
  padding: 20px 22px 22px;
  min-height: 300px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
}
.t-line { margin-bottom: 4px; word-break: break-word; }
.t-prompt { color: var(--violet); }
.t-tag { color: var(--violet); }
.t-line.t-cmd .t-text { color: #e2e8f0; }
.t-line.t-out .t-text { color: var(--muted); }
.t-line.t-agent .t-text { color: #7dd3fc; }
.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--cyan);
  animation: blink 1s steps(1) infinite;
}
.t-fade { opacity: 0; transition: opacity 0.5s ease; }

/* ---------- stack strip ---------- */
.stack-strip {
  margin-top: 72px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}
.stack-strip span {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.stack-strip i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--indigo);
  opacity: 0.6;
}

/* ---------- sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 110px 24px 0;
}
.section--contact { padding-bottom: 120px; text-align: center; }

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: #a5b4fc;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kicker::after {
  content: "";
  height: 1px;
  width: 46px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.7), transparent);
}
.kicker--center { justify-content: center; }
.kicker--center::after { display: none; }

.section-title {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 48px;
}
.section-title--center { text-align: center; margin-bottom: 20px; }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 56px;
  align-items: start;
}
.about-copy p { color: var(--muted); margin-bottom: 18px; font-size: 16.5px; }
.about-copy .hl { color: #dbe3ff; font-weight: 600; }
.about-sig {
  margin-top: 26px;
  color: var(--faint);
  font-size: 13.5px;
  border-left: 2px solid rgba(139, 92, 246, 0.6);
  padding-left: 14px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.stat:hover { border-color: rgba(139, 92, 246, 0.45); transform: translateY(-3px); }
.stat-num {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
}
.stat-label { font-size: 13px; color: var(--faint); }

/* ---------- cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.card:hover {
  border-color: rgba(139, 92, 246, 0.45);
  transform: translateY(-4px);
  background: var(--surface-hover);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 160px at 50% -40px, rgba(139, 92, 246, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.12));
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.card h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #b6bdd0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
}

/* ---------- projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.project:hover { border-color: rgba(139, 92, 246, 0.5); transform: translateY(-5px); }
.project-thumb {
  height: 170px;
  display: grid;
  place-items: center;
  font-size: 52px;
  position: relative;
  filter: saturate(0.85);
}
.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 100px at 50% 100%, rgba(0, 0, 0, 0.5), transparent 70%);
}
.project-thumb--nexus { background: linear-gradient(135deg, #1e1b4b, #4c1d95); }
.project-thumb--pulse { background: linear-gradient(135deg, #042f2e, #155e75); }
.project-thumb--orbit { background: linear-gradient(135deg, #18181b, #3f3f46); }
.project-thumb--flux { background: linear-gradient(135deg, #1e1b4b, #1e3a8a); }
.project-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body h3 { font-size: 17px; font-weight: 600; }
.project-body p { font-size: 14px; color: var(--muted); flex: 1; }
.project-links { display: flex; gap: 18px; margin-top: 4px; }
.project-links a {
  font-family: var(--mono);
  font-size: 13px;
  color: #a5b4fc;
  transition: color 0.2s ease;
}
.project-links a:hover { color: #fff; }

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 1px solid var(--border);
  max-width: 760px;
}
.tl-item { position: relative; margin-bottom: 46px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -35.5px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.8);
}
.tl-date {
  font-family: var(--mono);
  font-size: 12px;
  color: #67e8f9;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.tl-role { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.tl-org { color: var(--faint); font-weight: 500; }
.tl-item p { color: var(--muted); font-size: 14.5px; margin-bottom: 12px; max-width: 62ch; }

/* ---------- contact ---------- */
.contact-sub {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 36px;
  font-size: 16.5px;
}
.contact-actions { margin-bottom: 30px; }
.contact-socials { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; }
.contact-socials a {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.contact-socials a:hover { color: #c7d2fe; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 34px 24px 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.footer p { font-size: 13px; color: var(--faint); }
.footer-note { font-size: 12px !important; }

/* ---------- reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 26px 30px;
    background: rgba(5, 6, 10, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    transform: translateY(-14px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }
  .section { padding: 84px 20px 0; }
  .hero { padding: calc(var(--nav-h) + 56px) 20px 0; }
  .stack-strip { margin-top: 56px; gap: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .terminal-body { min-height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
