/* ==========================================================================
   henryle97.github.io — clean minimal light
   Plain CSS, no framework. Theming lives in the :root tokens below.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --text: #18181b;
  --text-soft: #3f3f46;
  --muted: #6b7280;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;

  --max-w: 62rem;
  --gutter: 1.5rem;
  --radius: 10px;
  --radius-sm: 6px;

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

  --nav-h: 4rem;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 4px 16px rgba(24, 24, 27, 0.06);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Inline SVG icons default to text size. Component rules below override this;
   without it an un-sized SVG stretches to fill its container. */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul {
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --- Layout primitives ---------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 2.5rem;
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 1.75rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

/* --- Navbar --------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-brand:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-brand .nav-brand-role {
  color: var(--muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9375rem;
  color: var(--text-soft);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
  text-decoration: none;
}

.nav-link.is-active {
  font-weight: 550;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.nav-cta svg {
  width: 0.875rem;
  height: 0.875rem;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1rem;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: '';
  position: absolute;
}

.nav-toggle-bars::before {
  transform: translateY(-5px);
}

.nav-toggle-bars::after {
  transform: translateY(5px);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bars::before {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bars::after {
  transform: rotate(-45deg);
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding: 5rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.hero-name {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
}

.hero-role {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 34rem;
  margin-bottom: 1rem;
}

.hero-intro {
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Portrait / monogram */
.hero-portrait {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-2));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-monogram {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--text);
  color: var(--text);
}

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* --- Metrics -------------------------------------------------------------- */

.metrics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.metric {
  padding: 1.5rem 1.25rem;
  border-right: 1px solid var(--border);
}

.metric:last-child {
  border-right: none;
}

.metric-figure {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1.1;
}

.metric-label {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--text);
}

.metric-source {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

/* --- Experience timeline -------------------------------------------------- */

.timeline {
  list-style: none;
  display: grid;
  gap: 2.75rem;
}

.role {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2rem;
}

.role-rail {
  position: relative;
  padding-top: 0.2rem;
}

.role-period {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.role-current {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #16a34a;
}

.role-body {
  position: relative;
  padding-left: 1.75rem;
  border-left: 1px solid var(--border);
}

.role-body::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.role.is-current .role-body::before {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.role-title {
  font-size: 1.125rem;
  margin-bottom: 0.15rem;
}

.role-company {
  color: var(--accent);
}

.role-company:hover {
  text-decoration: none;
}

.role-location {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.role-highlights {
  list-style: none;
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.role-highlights li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.role-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 4px;
  height: 1px;
  background: var(--border-strong);
}

/* --- Tag chips ------------------------------------------------------------ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

/* --- Projects ------------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.25rem;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
}

.project:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project.is-featured {
  background: var(--surface);
}

.project-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.project-name {
  font-size: 1.0625rem;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.project-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.project-stars svg {
  width: 0.8rem;
  height: 0.8rem;
}

.project-summary {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.project-footer {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.project-links svg {
  width: 0.875rem;
  height: 0.875rem;
}

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

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.skill-group {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.skill-group h3 {
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.skill-group ul {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.skill-group li {
  font-size: 0.875rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* --- Fact list (education, awards, contact) ------------------------------- */

.facts {
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.fact {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.facts .fact:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fact-key {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  padding-top: 0.15rem;
}

.fact-value strong {
  font-weight: 550;
}

.fact-note {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Page header + prose -------------------------------------------------- */

.page-head {
  padding: 3.5rem 0 2.5rem;
}

.page-title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  margin-bottom: 0.65rem;
}

.page-subtitle {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0;
}

.prose {
  max-width: 42rem;
}

.prose h2 {
  font-size: 1.375rem;
  margin: 2.5rem 0 1rem;
}

.prose h3 {
  font-size: 1.0625rem;
  margin: 2rem 0 0.75rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-meta strong {
  color: var(--text);
  font-weight: 550;
}

.social {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  transition: all 0.15s ease;
}

.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.social svg {
  width: 1.0625rem;
  height: 1.0625rem;
}

/* --- 404 ------------------------------------------------------------------ */

.notfound {
  padding: 7rem 0;
  text-align: center;
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 600;
  color: var(--border-strong);
  line-height: 1;
  margin-bottom: 1rem;
}

/* --- Scroll reveal -------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(2n) {
    border-right: none;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .skills {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: none;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.is-open {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
    padding-top: 0.75rem;
  }

  .nav-link {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
  }

  .nav-cta {
    justify-content: center;
    width: 100%;
    padding: 0.6rem 1rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-portrait {
    order: -1;
    width: 6rem;
    height: 6rem;
  }

  .hero-monogram {
    font-size: 1.5rem;
  }

  .section {
    padding: 3.25rem 0;
  }

  .role,
  .fact {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .role-body {
    padding-left: 1.25rem;
  }

  .role-current {
    margin-top: 0.15rem;
  }

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

@media (max-width: 480px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .metric:last-child {
    border-bottom: none;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

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

@media print {
  .nav,
  .footer,
  .hero-actions {
    display: none;
  }

  .section {
    padding: 1.5rem 0;
  }

  a {
    color: var(--text);
  }
}
