:root {
  --ink: #15171c;
  --slate: #4b5563;
  --muted: #6b7280;
  --cream: #f6f1ea;
  --surface: #ffffff;
  --accent: #e65b3a;
  --accent-deep: #c0482c;
  --teal: #2a7f76;
  --border: rgba(21, 23, 28, 0.12);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow: 0 22px 55px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #ffffff 0%, var(--cream) 45%, #e8edf5 100%);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  position: relative;
  overflow-x: hidden;
}

.page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
  pointer-events: none;
  opacity: 0.4;
  z-index: -1;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(246, 241, 234, 0.8);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-family: "Space Mono", monospace;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
}

.brand-role {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 600;
}

.site-nav a {
  position: relative;
  padding-bottom: 6px;
  font-size: 0.95rem;
}

.site-nav a.active::after,
.site-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  border: none;
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.ticker {
  background: var(--ink);
  color: #f8fafc;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
}

.ticker-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 10px 0;
}

.hero {
  padding: 80px 0 60px;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: 30px;
  background: radial-gradient(circle, rgba(230, 91, 58, 0.25), transparent 70%);
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: "Space Mono", monospace;
}

.hero-content h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.8rem, 4.5vw, 4.8rem);
  margin: 10px 0 14px;
}

.lead {
  font-size: 1.05rem;
  color: var(--slate);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 26px 0 22px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  background: transparent;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn.primary:hover {
  transform: translateY(-2px);
  background: var(--accent-deep);
}

.btn.secondary {
  border: 1px solid var(--ink);
  color: var(--ink);
}

.btn.secondary:hover {
  background: var(--ink);
  color: #fff;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.stat-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.panel-card {
  background: var(--surface);
  border-radius: 20px 6px 20px 20px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-card.accent {
  background: linear-gradient(135deg, #0f2c2c 0%, #2a7f76 100%);
  color: #fff;
  border: none;
}

.panel-title {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.panel-card.accent .panel-title {
  color: rgba(255, 255, 255, 0.7);
}

.panel-list {
  margin: 0;
  padding-left: 18px;
}

.panel-note {
  margin: 0;
  font-weight: 600;
}

.sparkline {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 52px;
  margin-bottom: 12px;
}

.sparkline span {
  flex: 1;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
}

.sparkline span:nth-child(1) { height: 30%; }
.sparkline span:nth-child(2) { height: 50%; }
.sparkline span:nth-child(3) { height: 70%; }
.sparkline span:nth-child(4) { height: 40%; }
.sparkline span:nth-child(5) { height: 85%; }
.sparkline span:nth-child(6) { height: 55%; }
.sparkline span:nth-child(7) { height: 75%; }

.section {
  padding: 70px 0;
}

.section-contrast {
  background: #111827;
  color: #f9fafb;
}

.section-headline {
  margin-bottom: 18px;
}

.section-headline h2 {
  font-family: "Fraunces", serif;
  font-size: 2rem;
  margin: 0 0 8px;
}

.section-sub {
  margin: 0;
  color: var(--muted);
}

.section-contrast .section-sub {
  color: rgba(255, 255, 255, 0.7);
}

.section-headline-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.about-card {
  background: #fef3e6;
}

.section-contrast .card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.skill-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.skill-card h3 {
  font-family: "Fraunces", serif;
  margin-top: 0;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
}

.timeline {
  display: grid;
  gap: 20px;
}

.timeline article {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.company {
  color: var(--muted);
  margin-top: 6px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.filter.active,
.filter:hover {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.project-link {
  color: var(--accent);
  font-weight: 600;
}

.project-note {
  margin: 0;
  color: var(--slate);
}

.education-note {
  margin: 8px 0 0;
  color: var(--muted);
}

.publication {
  margin: 0;
}

.contact-panel {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.contact-card {
  background: #f1f5f9;
}

.contact-actions {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.contact-note {
  color: var(--muted);
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.link-list a {
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  padding: 30px 0 50px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.back-to-top {
  font-weight: 600;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    inset: 80px 20px auto 20px;
    background: var(--surface);
    border-radius: var(--radius);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: none;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 60px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}
