/* ===== Theme tokens ===== */
:root {
  --w: 45rem;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --rail-pad: clamp(1.1rem, 3vw, 1.7rem);
  --radius: 9px;
  --radius-sm: 7px;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}

:root,
[data-theme='light'] {
  --bg: #fbfaf7;
  --bg-tint: #f2f0e8;
  --ink: #1c1b16;
  --ink-2: #45433a;
  --muted: #6f6c5f;
  --faint: #9a9684;
  --line: #e7e3d6;
  --line-2: #d8d3c2;
  --accent: #3b53d6;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(59, 83, 214, 0.09);
  --shadow: rgba(28, 27, 22, 0.10);
}

[data-theme='dark'] {
  --bg: #131310;
  --bg-tint: #20201a;
  --ink: #eceae0;
  --ink-2: #c8c5b8;
  --muted: #969283;
  --faint: #6c6859;
  --line: #2b2a22;
  --line-2: #3b392f;
  --accent: #9aa9ff;
  --accent-contrast: #14130f;
  --accent-soft: rgba(154, 169, 255, 0.13);
  --shadow: rgba(0, 0, 0, 0.45);
}

/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: 'kern';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--ink);
}

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 0.75rem;
}

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.nav-inner {
  max-width: var(--w);
  margin-inline: auto;
  padding-inline: var(--pad);
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}
.nav-monogram {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1;
}
.nav-name {
  display: none;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: none;
  gap: 1.6rem;
  margin-left: auto;
  margin-right: 1.4rem;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding-block: 0.4rem;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-links a[aria-current='true'] {
  color: var(--ink);
}
.nav-links a:hover::after,
.nav-links a[aria-current='true']::after {
  transform: scaleX(1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover {
  background: var(--bg-tint);
  border-color: var(--muted);
}
.ico {
  width: 18px;
  height: 18px;
}
[data-theme='light'] .ico-sun {
  display: none;
}
[data-theme='dark'] .ico-moon {
  display: none;
}

/* ===== Shared layout ===== */
.hero,
.section,
.footer {
  max-width: var(--w);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.hero,
main section[id] {
  scroll-margin-top: 5.25rem;
}

/* ===== Hero ===== */
.hero {
  padding-top: clamp(4.5rem, 14vh, 8rem);
  padding-bottom: clamp(3.5rem, 10vh, 6.5rem);
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-eyebrow::before {
  content: '';
  width: 1.7rem;
  height: 1px;
  background: var(--accent);
}
.hero-name {
  margin-top: 1.1rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.85rem, 8vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
}
.hero-statement {
  margin-top: 1.6rem;
  max-width: 30ch;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.42;
  color: var(--ink-2);
}
.hero-sub {
  margin-top: 1.5rem;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.hero-cta {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background-color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--accent-soft);
}
.btn--ghost {
  border-color: var(--line-2);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--muted);
  background: var(--bg-tint);
  transform: translateY(-2px);
}
.btn-arrow {
  display: inline-block;
  transition: transform 0.18s var(--ease);
}
.btn:hover .btn-arrow {
  transform: translate(2px, -2px);
}

/* ===== Sections ===== */
.section {
  padding-block: clamp(3.25rem, 8vw, 5.5rem);
  border-top: 1px solid var(--line);
}
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* ===== About ===== */
.prose p {
  margin-top: 1.15rem;
  max-width: 60ch;
  color: var(--ink-2);
}
.prose p:first-child {
  margin-top: 0;
}
.prose .lead {
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--ink);
}

/* ===== Experience ===== */
.exp-group + .exp-group {
  margin-top: 2.75rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--line);
}
.exp-co {
  margin-bottom: 1.6rem;
}
.exp-co-name {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.exp-co-meta {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.exp-roles {
  border-left: 1px solid var(--line-2);
  padding-left: var(--rail-pad);
}
.exp-role {
  position: relative;
}
.exp-role::before {
  content: '';
  position: absolute;
  top: 0.55rem;
  left: calc(-1 * var(--rail-pad) - 4px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.exp-role + .exp-role {
  margin-top: 2.1rem;
}
.exp-role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
}
.exp-role-title {
  font-size: 1.06rem;
  font-weight: 600;
}
.exp-role-team {
  font-weight: 400;
  color: var(--muted);
}
.exp-role-team::before {
  content: '·\00a0\00a0';
  color: var(--faint);
}
.exp-dates {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.exp-points {
  margin-top: 0.95rem;
}
.exp-points li {
  position: relative;
  padding-left: 1.15rem;
  margin-top: 0.55rem;
  color: var(--ink-2);
  font-size: 0.99rem;
  line-height: 1.62;
}
.exp-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 0.5rem;
  height: 1.5px;
  background: var(--line-2);
}

/* ===== Skills ===== */
.skill-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.6rem 1.5rem;
  padding-block: 1.15rem;
  border-top: 1px solid var(--line);
}
.skill-row:first-child {
  border-top: none;
  padding-top: 0;
}
.skill-row dt {
  font-weight: 600;
  font-size: 0.95rem;
  padding-top: 0.32rem;
}
.skill-row dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag {
  display: inline-flex;
  padding: 0.34rem 0.72rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ===== Education ===== */
.edu {
  display: flex;
  flex-direction: column;
}
.edu-item,
.edu-certs {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.edu-item:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}
.edu-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
}
.edu-degree {
  font-size: 1.1rem;
  font-weight: 600;
}
.edu-org {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.edu-note {
  margin-top: 0.6rem;
  max-width: 58ch;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.6;
}
.edu-certs-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.edu-certs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

/* ===== Community ===== */
.community li {
  padding-block: 1.4rem;
  border-top: 1px solid var(--line);
}
.community li:first-child {
  border-top: none;
  padding-top: 0;
}
.community li h3 {
  font-size: 1.04rem;
  font-weight: 600;
}
.community li p {
  margin-top: 0.35rem;
  color: var(--ink-2);
  font-size: 0.97rem;
}

/* ===== Contact ===== */
.section--contact {
  padding-bottom: clamp(3.5rem, 9vw, 6rem);
}
.contact-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
}
.contact-lead {
  margin-top: 0.9rem;
  max-width: 48ch;
  color: var(--ink-2);
}
.contact-links {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.contact-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.18s var(--ease), border-color 0.2s ease,
    background-color 0.2s ease;
}
.contact-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.contact-link-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-link-value {
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 500;
  word-break: break-word;
}
.contact-link:hover .btn-arrow {
  transform: translate(2px, -2px);
}

/* ===== Footer ===== */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 2.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.hero .reveal:nth-child(1) {
  transition-delay: 0.04s;
}
.hero .reveal:nth-child(2) {
  transition-delay: 0.12s;
}
.hero .reveal:nth-child(3) {
  transition-delay: 0.2s;
}
.hero .reveal:nth-child(4) {
  transition-delay: 0.28s;
}
.hero .reveal:nth-child(5) {
  transition-delay: 0.36s;
}

/* ===== Responsive ===== */
@media (min-width: 33rem) {
  .nav-monogram {
    display: none;
  }
  .nav-name {
    display: inline;
  }
}
@media (min-width: 40rem) {
  .nav-links {
    display: flex;
  }
}
@media (max-width: 34rem) {
  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  .skill-row dt {
    padding-top: 0;
  }
  .contact-links {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover,
  .btn--ghost:hover,
  .contact-link:hover {
    transform: none;
  }
}
