/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:        #fbfaf8;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f0ec;
  --text:      #16181d;
  --text-soft: #565b66;
  --text-mute: #858b97;
  --line:      #e3e0da;
  --line-firm: #cfcbc3;
  --accent:    #0f766e;
  --accent-soft:#d8efec;
  --accent-text:#ffffff;
  --shadow:    0 1px 2px rgba(20,22,28,.05), 0 8px 24px -12px rgba(20,22,28,.14);

  --max: 60rem;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0e1014;
    --bg-raised: #161a20;
    --bg-sunken: #12151a;
    --text:      #eceef2;
    --text-soft: #a4abb8;
    --text-mute: #6f7684;
    --line:      #242930;
    --line-firm: #333a45;
    --accent:    #4fd1c5;
    --accent-soft:#11302e;
    --accent-text:#08201e;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 28px -14px rgba(0,0,0,.7);
  }
}

:root[data-theme="dark"] {
  --bg:        #0e1014;
  --bg-raised: #161a20;
  --bg-sunken: #12151a;
  --text:      #eceef2;
  --text-soft: #a4abb8;
  --text-mute: #6f7684;
  --line:      #242930;
  --line-firm: #333a45;
  --accent:    #4fd1c5;
  --accent-soft:#11302e;
  --accent-text:#08201e;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 28px -14px rgba(0,0,0,.7);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  padding: 0 1.25rem;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

main { max-width: var(--max); margin: 0 auto; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.021em; margin: 0; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--accent-text);
  padding: .6rem 1rem; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ── Theme toggle ────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: 1rem;
  z-index: 50;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--line-firm); }
.theme-toggle svg {
  width: 1.125rem; height: 1.125rem;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero { padding: clamp(4rem, 13vw, 8rem) 0 clamp(2.5rem, 6vw, 4rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 1.25rem;
  display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 1px; background: var(--line-firm);
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  margin-bottom: .5rem;
}

.role {
  font-family: var(--mono);
  font-size: clamp(.9375rem, 2.6vw, 1.0625rem);
  color: var(--accent);
  margin: 0 0 1.75rem;
  font-weight: 500;
}

.lede {
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  color: var(--text-soft);
  max-width: 44ch;
  margin: 0 0 2.25rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.actions, .contact-row {
  display: flex; flex-wrap: wrap; gap: .75rem; margin: 0;
}

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .625rem 1.125rem;
  border: 1px solid var(--line-firm);
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--text);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn svg {
  width: 1.0625rem; height: 1.0625rem;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }

/* ── Sections ────────────────────────────────────────────── */
.section {
  padding: clamp(2.5rem, 7vw, 4.5rem) 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(1.375rem, 3.6vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 2rem;
  display: flex; align-items: baseline; gap: .875rem;
}
.num {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 400;
  color: var(--accent);
}

.section-note {
  margin: -1.25rem 0 1.75rem;
  font-size: .875rem;
  color: var(--text-mute);
  max-width: 56ch;
}

/* ── Cards ───────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.375rem;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover {
  border-color: var(--line-firm);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.card p {
  margin: 0 0 1rem;
  font-size: .9375rem;
  color: var(--text-soft);
}

.card-work { border-style: dashed; }

.tags {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: .375rem; margin: 0; padding: 0;
}
.tags li {
  font-family: var(--mono);
  font-size: .75rem;
  padding: .1875rem .5rem;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-mute);
}

/* ── Timeline ────────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }

.entry {
  padding-left: 1.5rem;
  border-left: 2px solid var(--line);
  position: relative;
}
.entry::before {
  content: ""; position: absolute; left: -5px; top: .5rem;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
}
.entry-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .375rem .75rem;
}
.entry h3 { font-size: 1.0625rem; font-weight: 600; }
.where {
  font-family: var(--mono); font-size: .875rem; color: var(--accent);
}
.when {
  font-family: var(--mono); font-size: .8125rem;
  color: var(--text-mute); margin: .25rem 0 .625rem;
}
.entry p:last-child { margin: 0; color: var(--text-soft); font-size: .9375rem; }

/* ── Bullets (experience) ────────────────────────────────── */
.bullets { margin: 0; padding-left: 1.125rem; display: grid; gap: .5rem; }
.bullets li { color: var(--text-soft); font-size: .9375rem; }
.bullets li::marker { color: var(--accent); }

/* ── Skill cards are tag-only: kill the empty <p> gap ────── */
.card > .tags:first-of-type { margin-top: .25rem; }

/* ── Split column block (certs / education) ──────────────── */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2rem;
}
.sub {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: .875rem;
}
.sub-gap { margin-top: 2rem; }

.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .875rem; }
.plain li { display: grid; gap: .0625rem; }
.plain strong { font-weight: 600; font-size: .9375rem; }
.meta {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--text-mute);
}

/* ── Contact + footer ────────────────────────────────────── */
.section-contact .lede { margin-bottom: 1.75rem; }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  font-size: .8125rem;
  color: var(--text-mute);
}
.footer p { margin: 0; }
.mono { font-family: var(--mono); }
