/* Portfolio design system — see docs/superpowers/specs/2026-05-30-portfolio-redesign-design.md */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0A0A0B;
  --text: #F5F5F5;
  --muted: #8A8A8E;
  --accent: #3B82F6;
  --surface: #1A1A1D;
  --hairline: color-mix(in srgb, var(--muted) 20%, transparent);
  --content-width: 720px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 300ms;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
a:hover { opacity: 0.7; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.05;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px;
  background: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
}
.nav-logo { color: var(--text); }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { color: var(--text); }
.nav-links a.is-current { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-top: 1px solid var(--hairline);
    padding: 16px 24px;
    gap: 16px;
  }
  .nav-links.is-open { display: flex; }
}

/* ---------- Layout ---------- */
main { max-width: var(--content-width); margin: 0 auto; padding: 0 24px 96px; }
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--hairline); }

/* ---------- Type utilities ---------- */
.muted { color: var(--muted); }
.mono { font-family: 'JetBrains Mono', monospace; }
.serif { font-family: 'Geist', system-ui, sans-serif; }

/* ---------- Hero (home page) ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  overflow: hidden;
  /* Break out of main's max-width so the wordmark has room */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-wordmark {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(48px, 11vw, 120px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.hero-wordmark .letter,
.k-letter {
  display: inline-block;
  will-change: transform;
  transition: transform var(--dur) var(--ease);
}
.k-word {
  display: inline-block;
  white-space: nowrap;
}
.hero-rule {
  width: 80px;
  height: 1px;
  background: var(--accent);
  margin: 24px auto;
}
.hero-tagline {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 40px;
}
.hero-ctas {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn-ghost {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid var(--muted);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

/* ---------- Pages ---------- */
.page-hero {
  padding-top: 96px;
  padding-bottom: 64px;
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.page-kicker::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.page-title {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(56px, 10vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin-bottom: 24px;
}
.page-intro {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 540px;
  font-size: 16px;
  line-height: 1.55;
}
.page-highlight {
  margin-top: 48px;
  padding: 28px 0 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px 24px;
  align-items: baseline;
}
.page-highlight-label {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 8px;
}
.page-highlight-value {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.page-highlight-value a {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.page-highlight-value a:hover { color: var(--accent); opacity: 1; }
.page-highlight-meta {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .page-highlight { grid-template-columns: 1fr; gap: 8px; }
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.section-label > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.section-label > span:first-child::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.section-label > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

/* ---------- Projects ---------- */
.project-list { display: flex; flex-direction: column; gap: 8px; }
.project {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  padding: 24px 16px 24px 0;
  border-left: 2px solid transparent;
  padding-left: 18px;
  margin-left: -20px;
  border-radius: 0 4px 4px 0;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.project:hover {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.project-num {
  color: var(--muted);
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  padding-top: 4px;
  transition: color var(--dur) var(--ease);
}
.project:hover .project-num { color: var(--accent); }
.project-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.project-title {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.project-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--muted);
}
.project-badge.is-live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.project-badge.is-research { color: #c084fc; border-color: color-mix(in srgb, #c084fc 40%, transparent); }
.project-badge.is-shipped { color: #34d399; border-color: color-mix(in srgb, #34d399 40%, transparent); }
.project-badge.is-archive { color: var(--muted); }
.project-blurb { margin-bottom: 12px; line-height: 1.55; }
.project-links { display: flex; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.project-tags { color: var(--muted); font-size: 12.5px; font-family: 'JetBrains Mono', monospace; }

/* ---------- Experiments list ---------- */
.exp-list { display: flex; flex-direction: column; }
.exp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  transition: padding-left var(--dur) var(--ease);
}
.exp-item:hover { padding-left: 8px; opacity: 1; }
.exp-name { font-family: 'Geist', system-ui, sans-serif; font-size: 20px; }
.exp-tag { color: var(--muted); font-size: 13px; font-family: 'JetBrains Mono', monospace; }

/* ---------- Timeline ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--hairline);
}
.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  transition: background var(--dur) var(--ease);
}
.timeline-item:hover::before { background: var(--accent); }
.timeline-date {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding-top: 4px;
  letter-spacing: 0.02em;
}
.timeline-title {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 19px;
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.timeline-desc { color: var(--muted); font-style: italic; font-size: 14px; }

@media (max-width: 600px) {
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Skills grid (About) ---------- */
.skills {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px 24px;
  align-items: baseline;
}
.skills > .skill-cat {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 4px;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 600px) {
  .skills { grid-template-columns: 1fr; gap: 8px; }
  .skills > .skill-cat { padding-top: 12px; }
  .skills > .skill-cat:first-child { padding-top: 0; }
}

/* ---------- Contact ---------- */
.contact-hero {
  margin-bottom: 48px;
}
.contact-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.contact-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: status-pulse 2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
}
.contact-email-big {
  display: inline-block;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  margin-bottom: 24px;
  transition: color var(--dur) var(--ease);
}
.contact-email-big:hover { color: var(--accent); opacity: 1; }
.contact-links { display: flex; flex-direction: column; max-width: 540px; }
.contact-section {
  margin-top: 16px;
}
.contact-section + .contact-section { margin-top: 48px; }
.contact-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  transition: padding-left var(--dur) var(--ease);
}
.contact-row:hover { padding-left: 6px; }
.contact-label {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.contact-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ---------- Scroll-in fade ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */
footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 64px 24px 32px;
  color: var(--muted);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--hairline);
}

/* ---------- Research page ---------- */
.research-list { display: flex; flex-direction: column; gap: 0; }
.research-item {
  padding: 40px 16px 40px 18px;
  margin-left: -20px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0 4px 4px 0;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.research-item:hover {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.research-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.research-title {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.research-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.research-status.is-completed { color: #34d399; border-color: color-mix(in srgb, #34d399 40%, transparent); }
.research-meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 24px;
  align-items: baseline;
  margin-bottom: 24px;
}
.research-meta dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 4px;
}
.research-meta dd {
  color: var(--text);
  font-size: 14px;
}
.research-abstract {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 640px;
}
.research-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 24px;
  align-items: baseline;
  margin-top: 12px;
}
.research-row-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 4px;
}
.research-row-value { color: var(--text); font-size: 14px; line-height: 1.55; }
.research-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}

@media (max-width: 600px) {
  .research-meta, .research-row { grid-template-columns: 1fr; gap: 4px; }
  .research-row { margin-top: 16px; }
}

/* ---------- Now block (home) ---------- */
.now-block {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px 24px;
  align-items: baseline;
  font-size: 16px;
}
.now-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 4px;
}
.now-value { color: var(--text); line-height: 1.55; }
.now-value a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}
.now-value a:hover { color: var(--accent); opacity: 1; }

@media (max-width: 600px) {
  .now-block { grid-template-columns: 1fr; gap: 4px 0; }
  .now-label { padding-top: 16px; }
  .now-block > .now-label:first-child { padding-top: 0; }
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: scroll-bounce 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.55; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ---------- Ambient background ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
  .hero-wordmark .letter { transform: none !important; }
}
