/* ============================================================
   Tokens
   Near-black ground, warm off-white ink, one flat muted amber
   accent (no glow, no gradient — a nod to phosphor terminals,
   used quietly). System-native faces throughout: a real sans
   stack for reading, a real mono stack reserved for genuinely
   data-shaped elements (dates, tech tags, the LeetCode numbers)
   — never worn as a "technical" costume on body text.
   ============================================================ */
:root {
  --bg: #0d0e10;
  --bg-raised: #131417;
  --ink: #e8e5dd;
  --ink-dim: #9a978f;
  --ink-faint: #66645e;
  --accent: #c99a53;
  --accent-dim: #9c7940;
  --line: #26272b;
  --line-soft: #1a1b1e;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --measure: 68ch;
  --edge: 1.5rem;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--accent-dim);
  color: var(--bg);
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color 120ms ease, color 120ms ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent-dim);
}
a:focus-visible,
button:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: rgba(13, 14, 16, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-height: 3.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.site-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.site-name:hover {
  color: var(--accent);
}
.site-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-dim);
}
.site-nav a:hover {
  color: var(--accent);
}
.nav-resume {
  color: var(--accent) !important;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-top: 4.5rem;
  padding-bottom: 3.5rem;
}
.hero[data-loading] {
  min-height: 12rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}
.hero-role {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
}
.hero-summary {
  max-width: var(--measure);
  color: var(--ink-dim);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1.75rem;
}
.contact-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}
.contact-row a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.contact-row a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 3rem 0;
  border-top: 1px solid var(--line-soft);
}
.section h2 {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 2rem;
}

/* ---- Experience ---- */
.job + .job,
.edu + .edu {
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line-soft);
}
.job-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.job-head h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}
.job-company {
  font-weight: 400;
  color: var(--ink-dim);
}
.job-dates {
  font-size: 0.8rem;
  color: var(--ink-faint);
  white-space: nowrap;
}
.job-bullets {
  margin: 0;
  padding-left: 1.15rem;
  max-width: var(--measure);
}
.job-bullets li {
  color: var(--ink-dim);
  margin-bottom: 0.6rem;
  line-height: 1.65;
}
.job-bullets li::marker {
  color: var(--ink-faint);
}
.edu-detail {
  color: var(--ink-dim);
  margin: 0;
}

/* ---- Projects ---- */
.project + .project {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line-soft);
}
.project {
  display: grid;
  gap: 1.5rem;
}
.project-text h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.project-summary {
  color: var(--ink);
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.project-text p {
  color: var(--ink-dim);
  line-height: 1.65;
  max-width: var(--measure);
}
.tech-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  padding: 0;
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.tech-tags li::before {
  content: "";
}
.project-links a {
  color: var(--accent);
}
.project-shots {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.project-shots img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
}
.project-shots-empty {
  border: 1px dashed var(--line);
  padding: 2rem;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.project-shots-empty p {
  margin: 0;
}
.empty-note {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* ---- LeetCode ---- */
.leetcode-line {
  max-width: var(--measure);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink);
}
.leetcode-num {
  color: var(--accent);
  font-size: 1.2em;
  font-weight: 600;
}

/* ---- Skills ---- */
#skills [data-list="skills"] {
  display: grid;
  gap: 1.75rem;
}
.skill-group h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
}
.skill-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2.5rem 0 3.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}
.footer-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-top: 0.6rem;
  color: var(--ink-faint);
}

.load-error {
  color: var(--accent);
  padding-top: 2rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 640px) {
  .project {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 639px) {
  body {
    font-size: 16px;
  }
  .site-nav {
    gap: 0.85rem;
    font-size: 0.76rem;
  }
  .hero {
    padding-top: 3rem;
  }
}

@media (max-width: 400px) {
  /* Also a plain contact link further down the page -- dropping it from
     the header specifically is what keeps the header to one line at the
     narrowest common phone width, not a loss of the link itself. */
  .site-nav a[href="#leetcode"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
