/* ========================================
   DONALD QUACH · Personal site
   "Quiet precision" — elegant, simple, modern
   Light paper theme · deep ink · one refined accent
   Fonts unchanged: Space Grotesk (display/body) + IBM Plex Mono (utility)
   ======================================== */

/* Fonts are self-hosted: fonts/fonts.css (linked from index.html) provides
   'Space Grotesk' and 'IBM Plex Mono'. System fallbacks apply until then. */

:root {
  --paper:      #f5f4f0;   /* page — warm paper */
  --surface:    #ffffff;   /* cards */
  --raise:      #faf9f6;   /* insets / chips */
  --ink:        #16181d;   /* headings — near-black */
  --text:       #454a53;   /* body */
  --muted:      #787d86;   /* secondary */
  --faint:      #a9adb4;   /* tertiary */
  --line:       rgba(22,24,29,0.10);
  --line-2:     rgba(22,24,29,0.18);
  --accent:     #2b3c9c;   /* deep refined indigo */
  --accent-2:   #202c76;   /* darker */
  --accent-tint:rgba(43,60,156,0.06);
  --good:       #2f7d54;   /* status / available */
  --shadow-sm:  0 1px 2px rgba(22,24,29,0.04);
  --shadow:     0 26px 60px -30px rgba(22,24,29,0.28);
  --font:       'Space Grotesk', system-ui, sans-serif;
  --mono:       'IBM Plex Mono', ui-monospace, monospace;
  --maxw:       1080px;
  --r:          14px;
  --r-sm:       8px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

.wrap { max-width: var(--maxw); margin: 0 auto; }
.mono { font-family: var(--mono); }

/* selection */
::selection { background: var(--accent); color: #fff; }

/* ========================================
   Shared type devices
   ======================================== */

/* refined highlight (replaces the old neon gradient) */
.grad { color: var(--accent); }

.ok { color: var(--good); font-weight: 500; }

/* small static status dot (was a pulsing on-air light) */
.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  flex-shrink: 0;
}

/* remnants of the old console — neutralised so stray markup stays tidy */
.blink, .cursor { display: none; }

section { position: relative; z-index: 1; padding: 7.5rem 2rem; }
section[id], header[id] { scroll-margin-top: 88px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
}
.eyebrow.center { justify-content: center; }

.title {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.06;
  color: var(--ink);
}

.lead {
  color: var(--muted);
  max-width: 620px;
  margin-top: 1.2rem;
  font-size: 1.06rem;
}

.mini-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 1rem;
}

/* ========================================
   NAV
   ======================================== */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: rgba(245,244,240,0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s, padding 0.35s;
}
nav.solid {
  background: rgba(245,244,240,0.9);
  border-bottom-color: var(--line);
  padding: 0.8rem 2rem;
}

.nav-logo { display: flex; align-items: center; gap: 0.7rem; }
.bug {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--ink);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
}
.nav-name {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.98rem;
  color: var(--ink);
}

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: -4px;
  height: 1px; background: var(--accent);
  transition: right 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.nav-cta {
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* language selector */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.lang-switch button {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0.38rem 0.66rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.is-active { background: var(--ink); color: var(--paper); }

/* ========================================
   HERO
   ======================================== */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9rem 2rem 4rem;
}
.hero-grid-bg { display: none; } /* old blueprint glow removed */

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 4rem;
  align-items: center;
}

.hero-lede { max-width: 38rem; }
.kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 1.5rem;
  padding-left: 2.4rem;
  position: relative;
}
.kicker::before {
  content: '';
  position: absolute; left: 0; top: 0.5em;
  width: 1.8rem; height: 1px; background: var(--line-2);
}
.hero-name {
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: var(--ink);
}
.hero-focus {
  margin-top: 1.4rem;
  font-size: clamp(0.92rem, 1.35vw, 1.08rem);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.hero-intro {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1.04rem;
  max-width: 33rem;
}
.hero-intro b { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2.2rem;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(43,60,156,0.5);
}
.btn-ghost {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.85rem 0.4rem;
  transition: color 0.2s, gap 0.2s;
}
.btn-ghost:hover { color: var(--accent); }
.btn-line {
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.8rem 1.3rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

/* profile card (was the operator ID card) */
.profile {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.profile-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e9e8e3;
}
.profile-photo img {
  object-position: top center;
  transition: transform 0.9s cubic-bezier(0.2,0.7,0.2,1);
}
.profile:hover .profile-photo img { transform: scale(1.03); }

.profile-body { padding: 1.4rem 1.5rem 1.6rem; }
.profile-name {
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.profile-role {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0.15rem 0 1.2rem;
}
.profile-meta { display: grid; gap: 0.7rem; }
.profile-meta > div {
  display: flex; justify-content: space-between; gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.profile-meta > div:last-child { border-bottom: none; padding-bottom: 0; }
.profile-meta dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.profile-meta dd {
  font-size: 0.86rem;
  color: var(--text);
  text-align: right;
}
.profile-meta dd.avail {
  color: var(--good);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.profile-meta dd.avail::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
}

/* ========================================
   KEYWORD STRIP (was the broadcast ticker)
   ======================================== */

.ticker {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  padding: 1.1rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: inline-flex; align-items: center; gap: 1.2rem;
  white-space: nowrap; width: max-content;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  animation: ticker 46s linear infinite;
}
.ticker-half { display: inline-flex; align-items: center; gap: 1.2rem; white-space: nowrap; }
.ticker-track .sep { color: var(--line-2); }
.ticker-track .ok { color: var(--good); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ========================================
   TELEMETRY (kept, toggled off via .is-hidden)
   ======================================== */

#telemetry { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.metrics {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.metric { background: var(--surface); padding: 2.2rem 1.8rem; }
.metric-num {
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.metric-label { color: var(--muted); font-size: 0.9rem; margin-top: 0.8rem; max-width: 240px; }

/* ========================================
   EXPERIENCE LOG
   ======================================== */

#log { background: var(--paper); }

.logfeed { margin-top: 3.5rem; border-top: 1px solid var(--line); }
.entry { border-bottom: 1px solid var(--line); }
.entry-head {
  width: 100%;
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 1.4rem;
  align-items: center;
  padding: 1.7rem 0.4rem;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: padding-left 0.25s;
}
.entry-head:hover { padding-left: 0.9rem; }
.entry-tc {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.entry-role { display: block; font-weight: 600; font-size: 1.28rem; letter-spacing: -0.015em; color: var(--ink); }
.entry-co { display: block; font-size: 0.92rem; color: var(--muted); margin-top: 0.25rem; }
.entry-toggle {
  font-family: var(--font); font-size: 1.25rem; font-weight: 400; color: var(--accent);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  transition: transform 0.3s, border-color 0.2s, background 0.2s, color 0.2s;
}
.entry.is-open .entry-toggle { transform: rotate(45deg); border-color: var(--accent); background: var(--accent); color: #fff; }

.entry-body { max-height: 0; overflow: hidden; transition: max-height 0.45s ease; }
.entry.is-open .entry-body { max-height: 640px; }
.entry-body ul { list-style: none; padding: 0 0.4rem 0.6rem; margin: 0; }
.entry-body li {
  position: relative;
  color: var(--muted);
  font-size: 0.98rem;
  padding: 0.45rem 0 0.45rem 1.5rem;
  max-width: 820px;
}
.entry-body li::before {
  content: '';
  position: absolute; left: 0; top: 1.05rem;
  width: 0.7rem; height: 1px; background: var(--accent);
}
.entry-body b { color: var(--ink); font-weight: 600; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.7rem 0.4rem 1.8rem; }
.entry-tags span {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--raise);
}

/* ========================================
   STACK
   ======================================== */

#stack { background: var(--surface); border-top: 1px solid var(--line); }

.stack-grid {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.stack-col {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  padding: 1.8rem;
}
.stack-cat {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex; align-items: center; gap: 0.6rem;
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.stack-cat .tick { color: var(--accent); font-size: 0.9em; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.chips li:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

.edu-langs {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.2rem;
}
.edu, .langs {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  padding: 1.8rem;
}
.edu-school { font-weight: 600; font-size: 1.35rem; letter-spacing: -0.015em; color: var(--ink); }
.edu-degree { color: var(--accent); font-size: 0.9rem; margin-top: 0.35rem; }
.edu-date { color: var(--faint); font-family: var(--mono); font-size: 0.72rem; margin-top: 0.5rem; letter-spacing: 0.03em; }
.lang { display: flex; justify-content: space-between; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.lang:last-child { border-bottom: none; }
.lang span { font-weight: 600; color: var(--ink); }
.lang i { font-family: var(--mono); font-size: 0.72rem; color: var(--good); font-style: normal; letter-spacing: 0.03em; }

/* ========================================
   INTERESTS
   ======================================== */

#interests { background: var(--paper); }

.int-chips { margin-top: 2rem; }

.photo-grid {
  margin-top: 2.8rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--raise);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.photo-tile:hover img { transform: scale(1.05); }

.photo-tile.ph-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--raise);
}
.photo-tile.ph-empty::before {
  content: '+';
  font-family: var(--font);
  font-size: 1.6rem; font-weight: 300;
  color: var(--line-2);
}
.photo-tile.ph-empty::after {
  content: attr(data-label);
  position: absolute; bottom: 0.6rem; left: 0.5rem; right: 0.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.58rem; letter-spacing: 0.02em;
  color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ========================================
   CONTACT
   ======================================== */

#contact { position: relative; text-align: center; overflow: hidden; background: var(--surface); border-top: 1px solid var(--line); padding: 9rem 2rem; }
.contact-glow { display: none; }
.contact-wrap { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.contact-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
.contact-desc { color: var(--muted); font-size: 1.08rem; max-width: 540px; margin: 0 auto 2.6rem; }
.contact-links { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }
.clink {
  font-size: 0.92rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s, color 0.2s;
}
.clink:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.clink.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 500; }
.clink.primary:hover { background: var(--accent-2); color: #fff; box-shadow: 0 14px 30px -12px rgba(43,60,156,0.5); }

/* ========================================
   FOOTER
   ======================================== */

footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--maxw);
  margin: 0 auto;
}
.footer-name { font-weight: 600; letter-spacing: 0.02em; font-size: 0.95rem; color: var(--ink); }
.footer-meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--muted); }
.footer-copy { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }

/* ========================================
   REVEAL
   ======================================== */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

.is-hidden { display: none !important; }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 2.8rem; }
  .hero-lede { max-width: none; order: 2; }
  .profile { order: 1; max-width: 340px; justify-self: center; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: 1fr; }
  .edu-langs { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  section { padding: 5rem 1.4rem; }
  .hero { padding: 7rem 1.4rem 3rem; }

  /* compact nav — drop the wordmark, tighten spacing so the CTA sits right */
  nav, nav.solid { padding: 0.8rem 1.4rem; }
  .nav-name { display: none; }
  .nav-right { gap: 0.6rem; }

  /* the profile card already shows name + role, so hide the repeated lede text
     on phones and keep just the two actions */
  .kicker, .hero-name, .hero-focus, .hero-intro { display: none; }
  .hero-actions { justify-content: center; margin-top: 2rem; }

  .metrics { grid-template-columns: 1fr; }
  .entry-head { grid-template-columns: 1fr auto; gap: 0.6rem; }
  .entry-tc { grid-column: 1 / -1; }
  #contact { padding: 6rem 1.4rem; }
  footer { flex-direction: column; text-align: center; }
}

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