/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  --bg: #FAFAF9;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F2F2F0;
  --text: #0E0E0F;
  --text-secondary: #57575C;
  --text-tertiary: #8D8D92;
  --border: #E6E6E3;
  --border-strong: #0E0E0F;
  --overlay: rgba(14,14,15,0.04);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1180px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-out: cubic-bezier(.4,0,.2,1);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;
}

html[data-theme="dark"] {
  --bg: #09090A;
  --bg-elevated: #121213;
  --bg-subtle: #171718;
  --text: #F6F6F4;
  --text-secondary: #A3A3A8;
  --text-tertiary: #6C6C71;
  --border: #232324;
  --border-strong: #F6F6F4;
  --overlay: rgba(255,255,255,0.04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 300ms var(--ease-out), color 300ms var(--ease-out);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

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

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 2px; }

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--text-tertiary);
}
.cursor-blink { animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* scroll reveal utility */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}

.nav__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav__mark-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text);
  display: inline-block;
}

.nav__links { display: flex; gap: 2.25rem; font-size: 0.86rem; }
.nav__links a {
  position: relative;
  color: var(--text-secondary);
  padding-bottom: 2px;
  transition: color 200ms var(--ease-out);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--text);
  transition: right 260ms var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { right: 0; }

.nav__actions { display: flex; align-items: center; gap: 0.7rem; }

.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.theme-toggle:hover { border-color: var(--border-strong); transform: rotate(-8deg); }
.icon { width: 16px; height: 16px; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-burger span { width: 15px; height: 1.5px; background: var(--text); transition: transform 200ms var(--ease-out), opacity 200ms; }
.nav-burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  inset: 0;
  background: var(--bg);
  padding: 6rem 2rem 2rem;
  gap: 2rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease-out);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }

/* ==========================================================================
   LAYOUT / SECTION
   ========================================================================== */
main { max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }

.section { padding: var(--space-6) 0; border-top: 1px solid var(--border); }
.section--contact { border-bottom: 1px solid var(--border); }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: var(--space-4); flex-wrap: wrap; }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-eyebrow::before {
  content: '';
  width: 14px; height: 1px;
  background: var(--text-tertiary);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  max-width: 24ch;
}
.section-sub {
  color: var(--text-secondary);
  max-width: 54ch;
  margin: 0;
  font-size: 1rem;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1.25rem, 4vw, 3rem) var(--space-6);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 0 0 1.75rem;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text);
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
}
.hero__title em {
  font-style: normal;
  color: var(--text-tertiary);
}

.hero__lede {
  max-width: 50ch;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.05vw, 1.08rem);
  margin: 0 0 2.25rem;
}

.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: background 220ms var(--ease-out), color 220ms var(--ease-out), border-color 220ms var(--ease-out);
  will-change: transform;
}
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { background: var(--text-secondary); border-color: var(--text-secondary); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--border-strong); }

/* Terminal card — signature element */
.hero__terminal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 24px 48px -24px var(--overlay);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.terminal__dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--text-tertiary); }
.terminal__title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}
.terminal__body {
  padding: 1.35rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  min-height: 220px;
}
.terminal__line { color: var(--text-secondary); white-space: pre-wrap; }
.terminal__prompt { color: var(--text); }
.terminal__prompt::before { content: '$ '; color: var(--text-tertiary); }
.terminal__ok::before { content: '✓ '; }
.terminal__cursor {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
.about-text p { margin: 0 0 1.15rem; max-width: 58ch; font-size: 1.02rem; }
.about-text strong { font-weight: 600; }

.profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 200px;
  margin-bottom: var(--space-3);
}
.profile-card img { filter: grayscale(1) contrast(1.05); aspect-ratio: 2/3; object-fit: cover; }
.profile-card__meta { padding: 0.85rem 1rem; border-top: 1px solid var(--border); }
.profile-card__name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; }
.profile-card__loc { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-tertiary); margin-top: 0.15rem; }

.value-list { display: flex; flex-direction: column; gap: 0; margin-top: var(--space-3); }
.value-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0.85rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.value-item:last-child { border-bottom: 1px solid var(--border); }
.value-item__mark { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-tertiary); padding-top: 0.15rem; }
.value-item__title { font-weight: 600; font-size: 0.95rem; margin: 0 0 0.25rem; }
.value-item__desc { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }

/* ==========================================================================
   JOURNEY (timeline)
   ========================================================================== */
.journey { display: flex; flex-direction: column; }
.journey-item {
  display: grid;
  grid-template-columns: 90px 22px 1fr;
  gap: 0 1.5rem;
  position: relative;
  padding-bottom: var(--space-4);
}
.journey-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 100px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.journey-item__date {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-tertiary);
  padding-top: 0.3rem;
}
.journey-item__node {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  position: relative;
}
.journey-item--current .journey-item__node { background: var(--text); }
.journey-item--future .journey-item__node { border-style: dashed; }
.journey-item__title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin: 0.05rem 0 0.4rem; }
.journey-item__desc { color: var(--text-secondary); font-size: 0.92rem; margin: 0; max-width: 60ch; }

/* ==========================================================================
   SKILLS (stack cards)
   ========================================================================== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.stack-card {
  background: var(--bg-elevated);
  padding: var(--space-3);
  transition: background 220ms var(--ease-out);
}
.stack-card:hover { background: var(--bg-subtle); }
.stack-card__label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-tertiary);
  margin: 0 0 0.3rem;
}
.stack-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0 0 1.1rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  transition: border-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.stack-card:hover .chip { border-color: var(--border-strong); color: var(--text); }

/* ==========================================================================
   PROJECT GRID (shipped) — v2 with visual header + hover depth
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 320ms var(--ease), border-color 320ms var(--ease-out), box-shadow 320ms var(--ease);
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px -20px var(--overlay);
}
.project-card__visual {
  height: 108px;
  border-bottom: 1px solid var(--border);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 18px 18px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0.9rem;
}
.project-card__index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
}
.project-card__body { padding: 1.5rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex-grow: 1; }
.project-card__year { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-tertiary); }
.project-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.55rem 0 0.15rem;
}
.project-card__subtitle { font-size: 0.84rem; color: var(--text-tertiary); margin: 0 0 0.9rem; }
.project-card__desc { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 1.25rem; flex-grow: 1; }

.tech-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.25rem; }
.tech-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}

.project-card__link {
  font-size: 0.85rem;
  font-weight: 500;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.project-card__link .arrow { transition: transform 220ms var(--ease-out); }
.project-card:hover .project-card__link .arrow { transform: translate(2px, -2px); }

/* ==========================================================================
   ROADMAP (planned, pipeline-style)
   ========================================================================== */
.roadmap-list { display: flex; flex-direction: column; }

.roadmap-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 1.5rem;
  padding-bottom: var(--space-4);
  position: relative;
}
.roadmap-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(to bottom, var(--border) 0 4px, transparent 4px 8px);
}
.roadmap-node {
  width: 26px; height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  flex-shrink: 0;
  background: var(--bg);
}
.roadmap-body__top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.roadmap-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin: 0; }
.roadmap-subtitle { font-size: 0.84rem; color: var(--text-tertiary); margin: 0.2rem 0 0.9rem; }
.roadmap-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}
.roadmap-desc { margin: 0 0 0.85rem; max-width: 62ch; color: var(--text-secondary); font-size: 0.95rem; }
.roadmap-why {
  font-size: 0.87rem;
  color: var(--text-tertiary);
  margin: 0 0 1rem;
  border-left: 2px solid var(--border);
  padding-left: 0.85rem;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  margin-bottom: var(--space-4);
}
.contact-banner .section-title { max-width: none; margin-left: auto; margin-right: auto; }
.contact-banner .section-sub { margin-left: auto; margin-right: auto; }
.contact-banner .btn { margin-top: 1.75rem; }

.contact-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.contact-link {
  background: var(--bg-elevated);
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 220ms var(--ease-out);
}
.contact-link:hover { background: var(--bg-subtle); }
.contact-link__label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-tertiary); }
.contact-link__value { font-family: var(--font-display); font-size: 0.98rem; font-weight: 500; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  text-align: center;
  padding: 2.25rem 1rem 2.75rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav-burger { display: flex; }
  .mobile-menu { display: flex; }

  .hero { grid-template-columns: 1fr; }
  .hero__terminal { order: -1; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .stack-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: repeat(2, 1fr); }

  .journey-item { grid-template-columns: 60px 18px 1fr; }
  .journey-item:not(:last-child)::before { left: 69px; }
}

@media (max-width: 520px) {
  .journey-item__date { font-size: 0.68rem; }
  .section { padding: var(--space-5) 0; }
}
