/* ============================================================
   Tam Vu — portfolio
   Bauhaus system: yellow ground, black ink, white as the third
   solid. Flat colour only — no gradients, shadows, or blur.
   Emphasis comes from inverting to black, never from a new hue.
   ============================================================ */

:root {
  --yellow: #ffd400;
  --black:  #0d0d0d;
  --white:  #fbf9f2;

  --bg:    var(--yellow);
  --ink:   var(--black);
  --dim:   rgba(13, 13, 13, 0.66);
  --faint: rgba(13, 13, 13, 0.45);
  --line:  rgba(13, 13, 13, 0.22);

  --display: "Jost", "Futura", Avenir, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gut: clamp(1.25rem, 4vw, 4.5rem);
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.08rem);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--black); color: var(--yellow); }

:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; }

/* ── Top bar ───────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gut);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  background: var(--bg);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.topbar.stuck { border-bottom-color: var(--black); }

.mark { display: flex; align-items: center; gap: 0.6rem; }
.mark-glyph {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  background: var(--black);
  color: var(--yellow);          /* the banana strokes use currentColor */
  transition: background 0.2s, color 0.2s;
}
.mark-glyph svg { width: 20px; height: 20px; display: block; }
.mark:hover .mark-glyph { background: var(--white); color: var(--black); }
.mark-name {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav { display: flex; gap: 1.5rem; }
.nav a {
  color: var(--dim);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav a i {
  font-style: normal;
  color: var(--faint);
  margin-right: 0.3rem;
  transition: color 0.2s;
}
.nav a:hover, .nav a.on { color: var(--ink); }
.nav a.on { border-bottom-color: var(--black); }
.nav a:hover i, .nav a.on i { color: var(--ink); }

.status {
  background: var(--black);
  color: var(--yellow);
  padding: 0.45rem 0.8rem;
  font-weight: 500;
  border: 2px solid var(--black);
  transition: background 0.2s, color 0.2s;
}
.status:hover { background: transparent; color: var(--black); }

/* ── Shell ─────────────────────────────────────────────────── */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: 8rem 0 4rem;
}

.eyeline {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}
.eyeline b { color: var(--ink); }

.giant {
  font-size: clamp(4rem, 14vw, 11rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.giant .line { display: block; }
.giant em { font-style: normal; color: var(--white); }
/* the spoken lead-in — same sentence, quieter voice */
.giant .greet {
  display: block;
  font-size: clamp(1.1rem, 0.5rem + 2vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.45em;
}

.lede {
  margin-top: clamp(1.5rem, 3vw, 2.2rem);
  padding-top: clamp(1.5rem, 3vw, 2.2rem);
  border-top: 3px solid var(--black);
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.3rem);
  font-weight: 400;
  line-height: 1.55;
  max-width: 46ch;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
}

.btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.8rem 1.3rem;
  border: 2px solid var(--black);
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--black); color: var(--yellow); }
.btn-solid {
  background: var(--black);
  color: var(--yellow);
  font-weight: 500;
}
.btn-solid:hover { background: transparent; color: var(--black); }

/* ── Bauhaus self-portrait ─────────────────────────────────────
   Just the head: a circle, an angular swept crop, and ringed
   eyes. The pupils are driven by script.js; everything else
   assembles once when the hero scrolls in.                   */

.hero-shapes {
  position: relative;
  aspect-ratio: 1;
  max-width: 400px;
  width: 100%;
  justify-self: end;
}
.face { width: 100%; height: 100%; display: block; }

.fc-head, .fc-hair, .fc-eye, .fc-nose, .fc-mouth {
  transform-box: fill-box;
  transform-origin: center;
}

.fc-head   { fill: var(--white); }
.fc-hair   { fill: var(--black); }
.fc-socket { fill: #fff; stroke: var(--black); stroke-width: 2.2; }
.fc-pupil  { fill: var(--black); }
.fc-nose   { fill: var(--black); }
.fc-mouth {
  fill: none;
  stroke: var(--black);
  stroke-width: 3.4;
  stroke-linecap: round;
}

/* ── Assembly ──────────────────────────────────────────────────
   Head drops in, the crop slides on, then the features pop on
   in reading order.                                          */

.js .hero-shapes { opacity: 1; transform: none; }  /* parts animate, not the frame */
.js .fc-head,
.js .fc-hair,
.js .fc-eye,
.js .fc-nose,
.js .fc-mouth { opacity: 0; }

.js .hero-shapes.in .fc-head,
.js .hero-shapes.in .fc-hair,
.js .hero-shapes.in .fc-eye,
.js .hero-shapes.in .fc-nose,
.js .hero-shapes.in .fc-mouth {
  animation-duration: 0.7s;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.2, 1.35, 0.5, 1);
}

.js .hero-shapes.in .fc-head  { animation-name: drop-in;  animation-delay: 0.05s; }
.js .hero-shapes.in .fc-hair  { animation-name: hair-on;  animation-delay: 0.30s; }
.js .hero-shapes.in .fc-eye-l { animation-name: pop-in;   animation-delay: 0.52s; }
.js .hero-shapes.in .fc-eye-r { animation-name: pop-in;   animation-delay: 0.62s; }
.js .hero-shapes.in .fc-nose  { animation-name: drop-in;  animation-delay: 0.72s; }
.js .hero-shapes.in .fc-mouth { animation-name: mouth-on; animation-delay: 0.82s; }

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-38px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hair-on {
  from { opacity: 0; transform: translateY(-26px) rotate(-8deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes mouth-on {
  from { opacity: 0; transform: scaleX(0.2); }
  to   { opacity: 1; transform: none; }
}

/* ── Section heads ─────────────────────────────────────────── */

.band { padding: clamp(5rem, 10vw, 9rem) 0 0; }

.band-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding-bottom: 1.2rem;
  border-bottom: 3px solid var(--black);
}
.band-head .index {
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  background: var(--black);
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  flex: none;
}
.band-head h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Each section carries one shape from the hero's vocabulary,
   parked at the end of the rule. */
.head-glyph {
  margin-left: auto;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--black);
  transform: scale(0.4) rotate(-45deg);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 1.35, 0.5, 1) 0.15s,
              opacity 0.5s var(--ease) 0.15s;
}
.band-head.in .head-glyph { transform: none; opacity: 1; }
.hg-circle  { border-radius: 50%; }
.hg-quarter { border-radius: 100% 0 0 0; }
.hg-ring {
  background: transparent;
  border: 5px solid var(--black);
  border-radius: 50%;
}
.hg-grid {
  background: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}
.hg-grid i { background: var(--black); }
.hg-grid i:nth-child(2) { border-radius: 50%; }
.hg-grid i:nth-child(3) { border-radius: 100% 0 0 0; }

/* ── Timeline ──────────────────────────────────────────────── */

.timeline {
  position: relative;
  padding-left: clamp(2.5rem, 6vw, 4.5rem);
}
/* the spine */
.timeline::before {
  content: "";
  position: absolute;
  left: clamp(0.9rem, 2.2vw, 1.6rem);
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: var(--black);
}

.tl {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0 0 clamp(2.5rem, 5vw, 3.5rem);
}
.tl:last-child { padding-bottom: 0; }

/* node sitting on the spine — cycles through the shape vocabulary */
.tl::before {
  content: "";
  position: absolute;
  left: calc(clamp(0.9rem, 2.2vw, 1.6rem) - clamp(2.5rem, 6vw, 4.5rem) - 7px);
  top: 0.45rem;
  width: 16px; height: 16px;
  background: var(--black);
}
.tl:nth-child(2)::before { border-radius: 50%; }
.tl:nth-child(3)::before {
  background: var(--yellow);
  border: 4px solid var(--black);
  border-radius: 50%;
}
.tl:nth-child(4)::before { border-radius: 100% 0 0 0; }

.tl-when {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}
.tl-when i {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.2rem;
}

.tl-body h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.tl-org {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  margin: 0.35rem 0 0.25rem;
}
.tl-loc {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.8rem;
}
.tl-org a, .tl-copy a {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 2px solid var(--line);
  transition: border-color 0.2s;
}
.tl-org a:hover, .tl-copy a:hover { border-bottom-color: var(--black); }
.tl-copy {
  color: rgba(13, 13, 13, 0.82);
  max-width: 62ch;
  text-wrap: pretty;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  margin-left: 0.3rem;
  background: var(--black);
  color: var(--yellow);
  vertical-align: middle;
}

/* ── Project cards ─────────────────────────────────────────── */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.card {
  border: 2px solid var(--black);
  display: flex;
  flex-direction: column;
  transition: background 0.25s, color 0.25s;
}
.card:hover { background: var(--black); color: var(--yellow); }
.card-wide { grid-column: span 2; }

.card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 2px solid var(--black);
  background: rgba(13, 13, 13, 0.08);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
}
.card-wide .card-media { aspect-ratio: 21 / 9; }

/* flat geometric stand-in where there's no screenshot */
.card-media-shape {
  position: relative;
  background: var(--black);
}
.glyph-circle {
  position: absolute;
  left: 12%; top: 50%;
  transform: translateY(-50%);
  width: 40%; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
}
.glyph-bar {
  position: absolute;
  right: 12%; top: 18%;
  width: 14%; height: 64%;
  background: var(--yellow);
}

.card-body {
  padding: clamp(1.2rem, 2.2vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}
.card-body h3 {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
/* Outlined in currentColor so it survives the card's hover inversion. */
.wip {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-body h3 .go {
  font-size: 0.8em;
  display: inline-block;
  transition: transform 0.25s var(--ease);
}
.card-body h3 a:hover .go { transform: translate(3px, -3px); }
.card-body p {
  font-size: 0.95rem;
  color: rgba(13, 13, 13, 0.82);
  text-wrap: pretty;
  transition: color 0.25s;
}
.card:hover .card-body p { color: rgba(251, 249, 242, 0.85); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.tags li {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border: 1px solid currentColor;
  color: var(--dim);
  transition: color 0.25s;
}
.card:hover .tags li { color: rgba(251, 249, 242, 0.7); }

/* ── Stack ─────────────────────────────────────────────────── */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
}
.stack-col h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--yellow);
  display: inline-block;
  padding: 0.3rem 0.6rem;
  margin-bottom: 1.1rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li {
  font-size: 0.88rem;
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--black);
  transition: background 0.2s, color 0.2s;
}
.chips li:hover { background: var(--black); color: var(--yellow); }

.edu-school {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.3rem;
}
.edu-detail { line-height: 1.5; color: rgba(13, 13, 13, 0.82); }
.edu-detail span {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  margin-top: 0.25rem;
}
.edu-note {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--line);
  font-size: 0.88rem;
  color: var(--dim);
}

/* ── Contact ───────────────────────────────────────────────── */

.band-contact { padding-bottom: 2rem; }

.mailto {
  display: block;
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
  border-bottom: 3px solid var(--line);
  transition: border-color 0.25s, border-width 0.25s;
}
.mailto:hover { border-bottom-color: var(--black); }
.mailto-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.5rem;
}
.mailto-value {
  display: block;
  font-size: clamp(1.5rem, 0.8rem + 4vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  word-break: break-word;
}

.contact-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.contact-copy {
  font-size: 1.05rem;
  color: rgba(13, 13, 13, 0.82);
  max-width: 34ch;
}

.contact-links { display: grid; }
.contact-links a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 2px solid var(--line);
  font-family: var(--mono);
  font-size: 0.82rem;
  transition: border-color 0.2s, padding-left 0.25s var(--ease);
}
.contact-links a span { color: var(--faint); font-size: 0.72rem; }
.contact-links a:hover {
  border-bottom-color: var(--black);
  padding-left: 0.4rem;
}

/* Closing band — the hero composition, unpacked into a single line. */
.shape-rule {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.2rem);
  margin-top: clamp(3rem, 7vw, 5rem);
  height: 2.6rem;
}
.sr { flex: none; height: 100%; aspect-ratio: 1; background: var(--black); }
.sr-circle  { border-radius: 50%; }
.sr-quarter { border-radius: 100% 0 0 0; }
.sr-half    { border-radius: 999px 999px 0 0; height: 50%; aspect-ratio: 2 / 1; }
.sr-ring {
  background: transparent;
  border: 6px solid var(--black);
  border-radius: 50%;
}
.sr-bar { flex: 1; aspect-ratio: auto; height: 40%; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding: 1.3rem 0;
  border-top: 3px solid var(--black);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--dim);
}

/* ── Reveal (scoped to .js so the page is never blank) ─────── */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ── Responsive ────────────────────────────────────────────── */

/* Short viewports: the greeting line pushes the buttons below the
   fold on laptop screens, so tighten the hero's vertical rhythm. */
@media (max-height: 820px) {
  .hero { padding: 6rem 0 2rem; }
  .lede { margin-top: 1.2rem; padding-top: 1.2rem; }
  .hero-actions { margin-top: 1.3rem; }
  .giant .greet { margin-bottom: 0.3em; }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    align-content: center;
    padding-top: 7rem;
  }
  .hero-shapes { max-width: 240px; justify-self: start; order: -1; }
  .card-wide { grid-column: auto; }
  .card-wide .card-media { aspect-ratio: 16 / 9; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .tl { grid-template-columns: 1fr; gap: 0.5rem; }
  .tl-when { display: flex; align-items: baseline; gap: 0.5rem; }
  .tl-when i { margin-top: 0; }
  .contact-wrap { grid-template-columns: 1fr; }
  .foot { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .mark-name { display: none; }
  .timeline { padding-left: 1.8rem; }
  .timeline::before { left: 0.35rem; }
  .tl::before { left: -1.45rem; }
}

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