:root {
  --bg: #07070a;
  --surface: rgba(24, 14, 18, 0.56);
  --surface-hover: rgba(34, 18, 24, 0.72);
  --border: rgba(244, 63, 94, 0.16);
  --border-strong: rgba(251, 113, 133, 0.34);
  --text: #f4f4f5;
  --muted: #b4b4bd;
  --dim: #7b7b85;
  --accent: #fb7185;
  --accent-strong: #f43f5e;
  --accent-dim: rgba(244, 63, 94, 0.14);
  --radius: 14px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 108px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  margin: 0;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  position: relative;
}

/* WebGL Shader Canvas & Dither Vignette */
#shader-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.92;
}

.dither-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, transparent 25%, rgba(7, 7, 10, 0.82) 90%),
    linear-gradient(to bottom, rgba(7, 7, 10, 0.18), rgba(7, 7, 10, 0.92));
}

/* Slightly-Red Liquid Glass Surface (Flat 2D, no 3D bevels) */
.liquid-glass {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.095), rgba(20, 12, 16, 0.55) 55%, rgba(255, 255, 255, 0.025));
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid rgba(251, 113, 133, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 196, 206, 0.14);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(244, 63, 94, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  background: linear-gradient(180deg, rgba(22, 10, 14, 0.82), rgba(7, 7, 10, 0.84));
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  min-width: 0;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 12px var(--accent-strong);
  flex-shrink: 0;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--dim);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-links a { transition: color 0.18s; }
.nav-links a:hover { color: var(--text); }

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.audio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  color: var(--muted);
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.audio-pill.active {
  border-color: var(--border-strong);
  color: var(--accent);
  background: var(--accent-dim);
}

.clock {
  font-size: 0.76rem;
  color: var(--dim);
}

.cmd-trigger {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 9px;
  padding: 0 12px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.cmd-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.cmd-mobile-label { display: none; }

/* Mobile Quick Nav */
.mobile-subnav {
  display: none;
}

/* Hero */
.hero {
  padding: 72px 24px 56px;
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
  flex-shrink: 0;
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.1rem, 6vw, 4.55rem);
  line-height: 1.07;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  max-width: 900px;
  font-weight: 600;
}

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.12rem);
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 30px;
}

.hero-lead strong { color: var(--text); font-weight: 600; }
.hero-lead a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.2s, color 0.2s;
}
.hero-lead a:hover { color: var(--accent); border-color: var(--accent); }

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}

/* Classic Flat Crisp Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--text);
  color: #07070a;
}

.btn-primary:hover { background: #ffffff; }

.btn-outline {
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.brew-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}

.brew-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brew-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.brew-prompt { color: var(--accent); }

.copy-badge {
  font-size: 0.71rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.16);
  color: var(--text);
  flex-shrink: 0;
}

/* 2D Spotlight Card */
.spotlight-card {
  position: relative;
  overflow: hidden;
  --mx: 50%;
  --my: 50%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(244, 63, 94, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.spotlight-card:hover::before { opacity: 1; }
.spotlight-card:hover { border-color: var(--border-strong); }

/* Metrics Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card {
  border-radius: var(--radius);
  padding: 18px;
}

.metric-value {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.metric-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Sections */
.section {
  padding: 64px 24px;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.section-index {
  display: block;
  font-size: 0.74rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 600;
}

/* Filter Bar */
.filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  max-width: 100%;
}

.filter-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 9px;
  min-height: 36px;
  padding: 6px 13px;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all 0.18s;
}

.filter-btn:hover { color: var(--text); }
.filter-btn.active {
  background: var(--text);
  color: #07070a;
  font-weight: 600;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.project-featured {
  grid-column: span 2;
}

.project-card.hidden-card { display: none; }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  margin-bottom: 10px;
}

.project-badge {
  color: var(--accent);
  letter-spacing: 0.04em;
}

.project-stars { color: var(--muted); }

.project-card h3 {
  margin: 0 0 10px;
  font-size: 1.24rem;
  letter-spacing: -0.02em;
}

.project-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.project-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.project-highlights span {
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.11);
  border: 1px solid rgba(251, 113, 133, 0.26);
  color: var(--accent);
}

.project-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tags span {
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

.project-links {
  display: flex;
  gap: 14px;
  font-size: 0.86rem;
  font-weight: 500;
}

.project-links a { padding: 4px 0; }
.project-links a:hover { color: var(--accent); }

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  border-radius: var(--radius);
  padding: 24px;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-date {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.timeline-loc {
  color: var(--dim);
  font-size: 0.84rem;
}

.timeline-content h3 {
  margin: 0 0 12px;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
}

.role-org { color: var(--muted); font-weight: 400; }

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.93rem;
}

.timeline-content strong { color: var(--text); font-weight: 500; }

/* Stack & Education */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stack-card {
  border-radius: var(--radius);
  padding: 20px;
}

.stack-card h3 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: var(--accent);
}

.stack-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.edu-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.edu-item {
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-year { font-size: 0.76rem; color: var(--dim); }
.edu-item strong { font-size: 0.95rem; }
.edu-item span:last-child { font-size: 0.84rem; color: var(--muted); }

/* Interactive Terminal */
.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.term-chip {
  color: var(--muted);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.term-chip:hover {
  border-color: var(--border-strong);
  color: var(--accent);
  background: var(--accent-dim);
}

.terminal-window {
  border-radius: var(--radius);
  overflow: hidden;
}

.terminal-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 63, 94, 0.05);
}

.traffic-lights {
  display: flex;
  gap: 7px;
  justify-self: start;
}

.tl {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tl-red { background: #f43f5e; }
.tl-amber { background: rgba(251, 113, 133, 0.45); }
.tl-muted { background: rgba(255, 255, 255, 0.18); }

.terminal-title {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.term-clear {
  justify-self: end;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  cursor: pointer;
}

.term-clear:hover { color: var(--text); border-color: var(--border-strong); }

.terminal-body {
  padding: 16px 18px 10px;
  min-height: 190px;
  max-height: 310px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e4e4e7;
}

.term-line { margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.term-cmd-echo { color: var(--accent); }
.term-muted { color: var(--muted); }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border);
}

.term-prompt {
  color: var(--accent);
  font-size: 0.85rem;
  white-space: nowrap;
}

#terminal-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  outline: none;
}

/* Footer */
.footer {
  padding: 64px 24px 44px;
  border-top: 1px solid var(--border);
}

.footer-card {
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  letter-spacing: -0.025em;
}

.footer-sub { margin: 0; color: var(--muted); font-size: 0.95rem; }

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--dim);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover { color: var(--text); }

/* Command Palette */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}

.cmd-backdrop[hidden] { display: none; }

.cmd-dialog {
  width: min(560px, 100%);
  border-radius: 14px;
  overflow: hidden;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.cmd-prefix { color: var(--accent); font-weight: 600; }

#cmd-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  outline: none;
}

.cmd-close {
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

.cmd-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.cmd-item:hover, .cmd-item.selected {
  background: rgba(244, 63, 94, 0.16);
  color: var(--text);
}

.cmd-item span:last-child {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--dim);
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: #07070a;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 120;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse-dot { animation: none; }
  .spotlight-card, .btn { transition: none; }
}

/* =========================================================================
   Phone & Mobile Navbar / Layout Alignment
   ========================================================================= */
@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .nav-links, .clock, .brand-tag { display: none; }
  .cmd-desktop-label { display: none; }
  .cmd-mobile-label { display: inline; }

  .masthead-inner {
    height: 54px;
    padding: 0 16px;
  }

  .brand-name {
    font-size: 0.96rem;
  }

  .audio-pill, .cmd-trigger {
    height: 34px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .mobile-subnav {
    display: block;
    border-top: 1px solid rgba(244, 63, 94, 0.12);
    width: 100%;
  }

  .mobile-subnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-subnav-inner::-webkit-scrollbar { display: none; }

  .mobile-subnav a {
    flex: 1 0 auto;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    background: rgba(244, 63, 94, 0.06);
    border: 1px solid rgba(251, 113, 133, 0.16);
    padding: 6px 12px;
    border-radius: 999px;
  }

  .mobile-subnav a:active {
    color: var(--accent);
    border-color: var(--accent);
  }

  .hero { padding: 36px 16px 40px; }
  .hero-sub-tag { display: none; }
  .hero-cta-row { flex-direction: column; align-items: stretch; margin-bottom: 32px; }
  .btn, .brew-pill { width: 100%; }

  .metrics-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 14px; }

  .section { padding: 42px 16px; }
  .bento-grid, .stack-grid, .edu-strip { grid-template-columns: 1fr; }
  .project-featured { grid-column: span 1; }
  .project-card, .timeline-item, .footer-card { padding: 18px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }

  .filter-bar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }

  .term-chips {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .term-chips::-webkit-scrollbar { display: none; }
  .term-chip { flex-shrink: 0; }

  .footer { padding: 42px 16px 32px; }
  .footer-actions { width: 100%; flex-direction: column; }
  .cmd-item span:last-child { display: none; }
}
