/* Hi-fi Portfolio — Minimal Modernist */

:root {
  --paper: #fbfaf6;
  --paper-2: #f4f1ea;
  --paper-3: #ebe7dc;
  --ink: #161614;
  --ink-2: #2a2925;
  --ink-soft: #5a584f;
  --ink-faint: #98948a;
  --ink-line: #d6d1c4;
  --ink-line-soft: #e8e3d6;

  --red: oklch(0.58 0.21 25);
  --red-soft: oklch(0.58 0.21 25 / 0.08);
  --red-mid:  oklch(0.58 0.21 25 / 0.5);

  --blue: oklch(0.5 0.18 250);
  --blue-soft: oklch(0.5 0.18 250 / 0.08);
  --blue-mid:  oklch(0.5 0.18 250 / 0.5);

  --display: 'Fraunces', 'Times New Roman', serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --max: 1240px;
  --pad: 80px;
  --rail: 140px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* utilities */
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.serif { font-family: var(--display); font-weight: 300; font-style: normal; }
.serif-i { font-family: var(--display); font-weight: 300; font-style: italic; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
}

.section {
  padding: 140px 0;
  position: relative;
}
.section + .section { border-top: 1px solid var(--ink-line); }

.section-grid {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 80px;
  align-items: flex-start;
}

.section-rail {
  position: sticky;
  top: 80px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-rail .num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 36px;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1;
  margin-bottom: 4px;
}
.section-rail .meta { color: var(--ink-faint); font-size: 10px; }

/* HERO */
.hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--ink-line);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad);
}
.topbar .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: oklch(0.7 0.15 145);
  margin-right: 8px;
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-name {
  padding: 0 var(--pad);
  margin-top: auto;
}
.hero-name h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(72px, 11vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
}
.hero-name h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
}

.hero-foot {
  padding: 80px var(--pad) 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 60px;
  align-items: end;
}
.hero-tagline {
  font-family: var(--display);
  font-weight: 300;
  font-size: 24px;
  line-height: 1.4;
  max-width: 520px;
  grid-column: span 2;
  margin: 0;
  color: var(--ink-2);
}
.hero-tagline em { font-style: italic; }
.hero-scroll {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.hero-scroll .arrow {
  font-size: 32px;
  color: var(--ink);
  animation: drop 2.4s ease-in-out infinite;
}
@keyframes drop {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}
.cv-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border-bottom: 1px solid var(--ink-line);
  padding-bottom: 6px;
  margin-bottom: 16px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.cv-link:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* SECTION HEADINGS */
.section-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.section-title em { font-style: italic; }
.section-lede {
  font-family: var(--display);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 580px;
  margin: 0 0 48px;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 80px;
  margin-top: 32px;
}
.bio {
  font-family: var(--display);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 540px;
}
.bio p { margin: 0 0 1.2em; }
.bio p:last-child { margin-bottom: 0; }
.bio em { font-style: italic; color: var(--ink-soft); }

.facts {
  border-top: 1px solid var(--ink);
}
.facts dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.facts .row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--ink-line);
  gap: 16px;
}
.facts dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.facts dd {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--ink);
}

/* BRAIN */
.brain-section { padding-bottom: 200px; }
.brain-stage {
  position: relative;
  margin-top: 40px;
  aspect-ratio: 1240 / 1380;
  margin-left: calc(var(--rail) * -1 - 40px);
  width: calc(100% + var(--rail) + 40px);
}
.brain-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.brain-svg .wire { transition: stroke 0.4s ease, opacity 0.4s ease, stroke-width 0.4s ease; }
.project-card {
  position: absolute;
  width: 264px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease, border-color 0.3s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 8px 0 -2px var(--ink);
}
.project-card .pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.project-card .pc-head .side-l { color: var(--red); }
.project-card .pc-head .side-r { color: var(--blue); }
.project-card .pc-thumb {
  height: 120px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink-line);
  background: var(--paper-2);
}
.project-card .pc-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.project-card .pc-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.project-card .pc-tags {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-line);
}
.project-card .pc-tag-sep { color: var(--ink-faint); }
.project-card .pc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
}
.project-card .pc-foot .arrow { transition: transform 0.3s ease; }
.project-card:hover .pc-foot .arrow { transform: translateX(4px); }

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 56px 60px;
  margin-top: 40px;
}
.skill-group h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.skill-group h3 .count {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-transform: none;
}
.skill-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.skill-group li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-line);
  font-family: var(--display);
  font-weight: 300;
  font-size: 20px;
}
.skill-group li:last-child { border-bottom: none; }
.skill-group li .level {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  display: flex;
  gap: 3px;
}
.skill-group li .level .pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink);
}
.skill-group li .level .pip.off { background: var(--ink-line); }
.skill-group.learning li .level { color: oklch(0.6 0.13 70); font-style: italic; font-family: var(--display); }

/* JOURNEY */
.journey {
  margin-top: 60px;
  position: relative;
}
.journey-line {
  position: absolute;
  left: 0; right: 0;
  top: 92px;
  height: 1px;
  background: var(--ink);
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  position: relative;
}
.journey-stop {
  position: relative;
  padding-top: 0;
}
.journey-stop .year {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.journey-stop .dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}
.journey-stop.now .dot {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 6px oklch(0.58 0.21 25 / 0.15);
}
.journey-stop.next .dot {
  background: var(--paper);
  border-style: dashed;
}
.journey-stop h4 {
  font-family: var(--display);
  font-weight: 300;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.journey-stop h4 em { font-style: italic; }
.journey-stop p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: 200px;
}

/* CONTACT */
.contact {
  padding: 200px 0 120px;
  background: var(--paper);
  border-top: 1px solid var(--ink-line);
}
.contact-mail {
  display: inline-block;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  word-break: break-all;
  position: relative;
  margin-top: 48px;
}
.contact-mail .at { color: var(--red); font-style: italic; }
.contact-mail::after {
  content: '↗';
  display: inline-block;
  font-size: 0.5em;
  vertical-align: top;
  margin-left: 12px;
  font-style: normal;
  color: var(--ink-soft);
  transition: transform 0.3s ease, color 0.3s ease;
}
.contact-mail:hover::after { transform: translate(4px, -4px); color: var(--ink); }

.socials {
  margin-top: 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}
.socials a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--ink-line);
  padding-bottom: 6px;
  transition: border-color 0.3s ease;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.socials a:hover { border-bottom-color: var(--ink); }
.socials a .label { color: var(--ink-soft); }

.footer {
  margin-top: 140px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.footer a:hover { color: var(--ink); }

/* responsive — degrade gracefully */
@media (max-width: 1100px) {
  :root { --pad: 48px; --rail: 80px; }
  .section-grid { grid-template-columns: 1fr; gap: 32px; }
  .section-rail { position: static; }
  .about-grid { grid-template-columns: 1fr; gap: 56px; }
  .skills-grid { grid-template-columns: 1fr; }
  .journey-grid { grid-template-columns: 1fr; gap: 40px; }
  .journey-line { display: none; }
  .brain-stage { margin-left: 0; width: 100%; }
}

@media (max-width: 640px) {
  :root { --pad: 20px; }

  /* Hero */
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-name h1 { font-size: clamp(36px, 10vw, 64px); }
  .hero-foot { grid-template-columns: 1fr; padding-top: 40px; gap: 20px; }
  .hero-tagline { grid-column: 1; font-size: 18px; }
  .hero-scroll { align-items: flex-start; }

  /* Projects — abandon brain layout, stack cards vertically */
  .brain-section { padding-bottom: 80px; }
  .brain-stage {
    position: static;
    aspect-ratio: unset;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .brain-svg { display: none; }
  .project-card {
    position: static !important;
    width: 100% !important;
  }
}
