/* ------------------------------------------------------------------
   TOKENS
------------------------------------------------------------------ */
:root {
  --ink: #1c2430;
  --ink-soft: #5b6472;
  --paper: #faf8f4;
  --surface: #ffffff;
  --line: #e4e0d6;
  --amber: #c9902e;
  --amber-soft: #f3e3c2;
  --teal: #2f6f5e;
  --teal-soft: #dceae4;
  --muted: #8a8578;

  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --maxw: 1080px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

a {
  color: inherit;
}
button {
  font-family: inherit;
  cursor: pointer;
}

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

/* ------------------------------------------------------------------
   TOPBAR 
------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  height: 64px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-dot {
  color: var(--amber);
}

.tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  height: 100%;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  align-self: flex-end;
  margin-bottom: -1px;
}
.tab:hover {
  background: var(--surface);
  color: var(--ink);
}
.tab.active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: inset 0 3px 0 var(--teal);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--teal);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--ink);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.menu-toggle span {
  width: 16px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  position: sticky;
  top: 64px;
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu .tab {
  text-align: left;
  border-radius: 0;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.mobile-menu .tab.active {
  box-shadow: inset 3px 0 0 var(--teal);
}

/* ------------------------------------------------------------------
   HERO
------------------------------------------------------------------ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 32px 96px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  background: var(--teal-soft);
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 0 24px;
}

.hero-headline {
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-links {
  display: flex;
  gap: 20px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.hero-links a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.hero-links a:hover {
  color: var(--teal);
  border-color: var(--teal);
}

/* Hero visual: animated mock spreadsheet — the signature element */
.hero-visual {
  display: flex;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -24px rgba(28, 36, 48, 0.25);
  overflow: hidden;
  transform: rotate(1.2deg);
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.sheet-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.sheet-name {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.sheet-grid {
  padding: 8px;
}
.sheet-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  gap: 6px;
  align-items: center;
  padding: 7px 6px;
  border-radius: 6px;
}
.sheet-row .r {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.sheet-cell {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-cell.dirty {
  color: #a14b3d;
  background: #fbebe7;
}
.sheet-cell.clean {
  color: var(--teal);
  background: var(--teal-soft);
  transition:
    background 0.4s ease,
    color 0.4s ease;
}
.sheet-cell.flash {
  background: var(--amber-soft);
  color: #7a5a15;
}

/* ------------------------------------------------------------------
   SECTIONS (shared)
------------------------------------------------------------------ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 32px;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.section-title {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 32px;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0;
}
.about-facts {
  display: grid;
  gap: 18px;
  margin: 0;
}
.about-facts > div {
  border-left: 2px solid var(--amber);
  padding-left: 14px;
}
.about-facts dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 3px;
}
.about-facts dd {
  margin: 0;
  font-weight: 600;
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
}
.skill-card h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 14px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #7a5a15;
  border: 1px solid transparent;
}

/* PROJECTS */
.projects-list {
  display: grid;
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.project-card.featured {
  border-color: var(--teal);
  box-shadow: 0 20px 50px -30px rgba(47, 111, 94, 0.35);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.project-card h3 {
  font-size: 22px;
}
.project-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.project-desc {
  color: var(--ink-soft);
  margin: 12px 0 22px;
  max-width: 68ch;
}
.project-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.project-stat .val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--teal);
  display: block;
}
.project-stat .lbl {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 18ch;
  display: block;
  margin-top: 2px;
}
.project-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.project-links a {
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.project-links a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* EXPERIENCE */
.experience-list {
  display: grid;
  gap: 22px;
}
.exp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px 28px;
}
.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.exp-card h3 {
  font-size: 19px;
}
.exp-org {
  color: var(--teal);
  font-weight: 600;
  font-size: 14.5px;
}
.exp-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.exp-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
}
.exp-card li {
  margin-bottom: 8px;
}
.exp-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.exp-links a {
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.exp-links a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* EDUCATION */
.education-list {
  display: grid;
  gap: 16px;
}
.edu-card {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}
.edu-card h3 {
  font-size: 19px;
  margin-bottom: 4px;
}
.edu-card .school {
  color: var(--ink-soft);
}
.edu-card .period {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
}
.edu-card .note {
  display: block;
  font-size: 12px;
  color: var(--amber);
  margin-top: 2px;
}

/* CERTIFICATIONS */
.cert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.cert-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.cert-card:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}
.cert-card .cert-title {
  font-weight: 600;
  font-size: 14.5px;
  display: block;
}
.cert-card .cert-issuer {
  font-size: 12.5px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.cert-card .cert-arrow {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 15px;
  flex-shrink: 0;
}

/* CONTACT */
.contact-section {
  text-align: left;
}
.contact-sub {
  color: var(--ink-soft);
  margin: -20px 0 32px;
  max-width: 50ch;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.contact-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.contact-value {
  font-weight: 600;
  word-break: break-word;
}

/* FOOTER */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------------ */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 56px;
  }
  .hero-visual {
    order: -1;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .tabs {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .topbar {
    padding: 0 20px;
  }
  .hero,
  .section,
  .footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .exp-top,
  .edu-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .edu-card .period {
    text-align: left;
  }
}
