/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5
 * genre: modern-minimal · macrostructure: Marquee Hero (H1 knobs: size=xl, alignment=left-bias, underlay=rule-below)
 * theme: Cobalt · enrichment: none (typography + real photos only)
 * nav: N9 Edge-aligned minimal (deviates from Cobalt's default bordered ⌘K nav — a single-page CV
 *   has too few destinations to justify a command palette; N9 is genre-acceptable and "earns the silence")
 * footer: Ft5 Statement (audience/goal = get recruiters to email; a closing line carries that better
 *   than an inline credit row)
 * contrast: pass (40-41, verified via computed WCAG ratios) · chrome: pass (47, no re-drawn UI)
 * tokens: pass (48) · responsive: pass (34, 49-57 — verified 320/375/414/768/1920px, zero overflow)
 * mobile: pass (34, 49, 50-57)
 */

/* tokens.css is linked separately in <head> (not @import'd) so both
   stylesheets fetch in parallel instead of a serial waterfall. */

/* ---------- Reset ---------- */

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

html, body { overflow-x: clip; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100svh;
}

img, picture { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--color-ink); line-height: 1.15; }

p { max-width: var(--measure); }

a { color: inherit; text-decoration: none; }
a:active { opacity: 0.72; }

ul, ol { list-style: none; padding: 0; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--color-accent-strong); color: var(--color-accent-ink); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  transition: none;
}

/* ---------- Layout helpers ---------- */

.wrap {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 1.5rem);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-xs) var(--space-sm);
  z-index: 100;
  border-radius: var(--radius-sm);
}
.skip-link:focus-visible { left: var(--space-sm); top: var(--space-sm); }

/* ---------- Reveal (motion engine) ---------- */

/* Progressive enhancement: content is visible by default. Only once main.js
   confirms it's running (.js on <html>) do sections start hidden, ready to reveal. */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* ---------- Nav — N9 edge-aligned minimal ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-paper-translucent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-rule);
}

.nav__inner {
  max-width: 46rem;
  margin-inline: auto;
  padding: var(--space-sm) clamp(1.25rem, 4vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__link:hover { color: var(--color-accent-strong); }

/* GitHub/LinkedIn stay in the footer on narrow phones — three nav-right items
   plus the wordmark don't fit 320–375px without crowding or wrapping. */
@media (max-width: 36rem) {
  .nav__link { display: none; }
}

.nav__cta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  padding: var(--space-2xs) var(--space-sm);
  white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav__cta:hover { border-color: var(--color-accent); color: var(--color-accent-strong); }
.nav__cta:active { transform: translateY(1px); }

/* ---------- Hero — Marquee ---------- */

.hero {
  padding-block: clamp(3.5rem, 12vh, 6.5rem) clamp(2rem, 6vh, 3rem);
}

.hero__display {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 1.5rem);
  font-size: var(--text-display);
  letter-spacing: -0.03em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero__display em {
  font-style: normal;
  color: var(--color-accent);
}

.hero__meta {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 1.5rem);
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  letter-spacing: 0.01em;
}

.rule-thick {
  border: 0;
  border-top: 3px solid var(--color-ink);
  max-width: 46rem;
  margin: 0 auto;
}

/* ---------- Sections ---------- */

.doc { padding-block: var(--space-3xl); }

.sec { padding-block: var(--space-2xl); border-bottom: 1px solid var(--color-rule); }
.sec:last-child { border-bottom: 0; }

.sec__title {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.sec__subtitle {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  font-weight: 500;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.lede { font-size: var(--text-md); color: var(--color-ink); line-height: 1.55; }

.sec p + p { margin-top: var(--space-sm); }

.sec a:not(.project-card) { color: var(--color-accent-strong); text-underline-offset: 3px; text-decoration: underline; text-decoration-color: var(--color-accent-soft); transition: text-decoration-color var(--dur-fast) var(--ease-out); }
.sec a:not(.project-card):hover { text-decoration-color: var(--color-accent); }

/* ---------- Terminal card (the one graphite band) ----------
   No fake window chrome (no traffic-light dots, no title bar) — the user's own
   terminal/editor already supplies that; a redrawn one is an AI-generated tell. */

.terminal-card {
  background: var(--color-graphite);
  border: 1px solid var(--color-graphite-rule);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px var(--color-shadow);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-card__label {
  padding: var(--space-sm) var(--space-md) 0;
  font-size: var(--text-xs);
  color: var(--color-graphite-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terminal-card__body {
  padding: var(--space-md);
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-graphite-ink);
  overflow-x: auto;
  white-space: pre;
}

.tok-prompt { color: var(--color-accent-bright); }
.tok-cmd { color: var(--color-graphite-ink); }
.tok-out { color: var(--color-graphite-muted); }
.tok-out strong { color: var(--color-graphite-ink); font-weight: 500; }

/* ---------- Timeline (experience + activities) ---------- */

.timeline__item + .timeline__item { margin-top: var(--space-xl); }

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-md);
  margin-bottom: var(--space-2xs);
}

.timeline__head h3 { font-size: var(--text-lg); letter-spacing: -0.01em; }

.timeline__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline__org { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-xs); }

.timeline__points > li {
  position: relative;
  padding-left: var(--space-md);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  line-height: 1.65;
}
.timeline__points > li + li { margin-top: var(--space-2xs); }
.timeline__points > li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.65em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ---------- Education ---------- */

.edu__meta { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-3xs); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-top: var(--space-md);
}

.tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--color-ink-2);
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  padding: var(--space-3xs) var(--space-2xs);
  white-space: nowrap;
}

/* ---------- Projects — featured cards ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.project-card {
  display: block;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-paper-2);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.project-card:hover { border-color: var(--color-accent); }
.project-card:active { border-color: var(--color-accent-strong); }

/* Course-project cards: no screenshot exists, nothing to link to. Same shell,
   no hover/active affordance since there's nothing to click into. */
.project-card--static { cursor: default; }
.project-card--static:hover, .project-card--static:active { border-color: var(--color-rule); }
.project-card--static .project-card__body { padding: var(--space-lg) var(--space-sm); }

.project-card__figure { aspect-ratio: 4 / 3; background: var(--color-paper-3); }
.project-card__figure img { width: 100%; height: 100%; object-fit: cover; }

.project-card__body { padding: var(--space-sm); }

.project-card__body h3 { font-size: var(--text-md); letter-spacing: -0.01em; margin-bottom: var(--space-3xs); }

.project-card__win {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-strong);
  margin-bottom: var(--space-2xs);
}

.project-card--static .project-card__stack { font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.6; }

.project-card__stack { font-size: var(--text-xs); color: var(--color-muted); line-height: 1.5; }

/* ---------- Projects — compact table ---------- */

.project-table { width: 100%; border-collapse: collapse; margin-top: var(--space-xl); }

.project-table caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.project-table tr { border-top: 1px solid var(--color-rule); }
.project-table tr:last-child { border-bottom: 1px solid var(--color-rule); }

.project-table td { padding: var(--space-sm) 0; vertical-align: top; }

.project-table__name a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-ink);
  transition: color var(--dur-fast) var(--ease-out);
}
.project-table__name a .arrow { display: inline-block; }
.project-table__name a:hover { color: var(--color-accent-strong); }

.project-table__stack {
  font-size: var(--text-sm);
  color: var(--color-muted);
  padding-left: var(--space-md);
}

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-xl);
  margin-top: var(--space-lg);
}

.skills-group h3 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

/* ---------- Footer — Ft5 Statement ---------- */

.footer {
  background: var(--color-ink);
  color: var(--color-graphite-ink);
  padding-block: var(--space-3xl) var(--space-xl);
}

.footer__inner {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 1.5rem);
}

.footer__statement {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 22ch;
  overflow-wrap: anywhere;
}

.footer__statement a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-soft);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.footer__statement a:hover { text-decoration-color: var(--color-accent); }

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-graphite-rule);
}

.footer__links { display: flex; gap: var(--space-md); }
.footer__links a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-graphite-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.footer__links a:hover { color: var(--color-graphite-ink); }

.footer__copy { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-graphite-muted); }

/* ---------- Responsive: 60rem layout break ---------- */

@media (max-width: 60rem) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Responsive: 40rem typography break ---------- */

@media (max-width: 40rem) {
  .hero { padding-block: var(--space-xl) var(--space-lg); }
  .hero__display { font-size: var(--text-display-s); }

  .project-grid { grid-template-columns: minmax(0, 1fr); }

  .skills-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }

  .timeline__head { flex-direction: column; align-items: flex-start; gap: var(--space-3xs); }

  .project-table__stack { display: block; padding-left: 0; margin-top: var(--space-3xs); }
  .project-table tr { display: block; padding-block: var(--space-2xs); }
  .project-table td { display: block; padding: var(--space-3xs) 0; }

  .footer__meta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 22rem) {
  .nav__word { font-size: var(--text-sm); }
}

/* ---------- Print ---------- */

@media print {
  .nav, .footer { display: none; }
  .terminal-card { background: none; border: 1px solid #999; color: #000; box-shadow: none; }
  .tok-out, .tok-cmd, .tok-prompt, .terminal-card__label { color: #000 !important; }
  body { background: #fff; color: #000; }
  .sec { border-bottom: 1px solid #ccc; break-inside: avoid; }
  a { text-decoration: underline; color: #000; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
