:root {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --ink: #141414;
  --muted: #6B6B6B;
  --line: #E6E3DC;
  --accent: #E26D3C;
  --accent-ink: #FFFFFF;
  --radius: 14px;
  --radius-lg: 28px;
  --max: 960px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 32px rgba(20,20,20,.06);
}

[data-theme="dark"] {
  --bg: #0F0F10;
  --surface: #17181A;
  --ink: #F4F2EC;
  --muted: #9A978E;
  --line: #26272A;
  --accent: #F08A5A;
  --accent-ink: #141414;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 32px rgba(0,0,0,.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F10;
    --surface: #17181A;
    --ink: #F4F2EC;
    --muted: #9A978E;
    --line: #26272A;
    --accent: #F08A5A;
    --accent-ink: #141414;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 32px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.nav__brand {
  font-weight: 600; letter-spacing: -.01em;
  text-decoration: none; color: var(--ink);
}
.nav__links {
  display: flex; gap: 26px;
  font-size: 15px;
}
.nav__links a {
  text-decoration: none; color: var(--muted);
  transition: color .15s;
  position: relative;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav__actions { display: flex; align-items: center; gap: 8px; }

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 2px;
}
.lang-toggle__btn {
  font: 600 12px/1 var(--font-mono);
  letter-spacing: .06em;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-toggle__btn:hover { color: var(--ink); }
.lang-toggle__btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.theme-toggle {
  width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[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; }
}

.nav__burger {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav__burger span { width: 16px; height: 2px; background: var(--ink); border-radius: 2px; }

/* HERO */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px 56px;
  min-height: calc(100svh - 72px);
  display: flex; align-items: center;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px; align-items: center;
  width: 100%;
}
.hero__eyebrow {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); margin: 0 0 18px;
  text-transform: uppercase; letter-spacing: .08em;
}
.hero__title {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05; letter-spacing: -.02em;
  margin: 0 0 22px; font-weight: 700;
}
.accent { color: var(--accent); font-weight: 500; font-style: italic; }
.hero__lede {
  font-size: 18px; color: var(--muted); max-width: 52ch;
  margin: 0 0 22px;
}
.hero__meta {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--muted); margin: 0 0 28px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.hero__meta .dot { opacity: .5; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }

.pillars {
  list-style: none; padding: 18px 0; margin: 0 0 28px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pillars li {
  display: flex; flex-direction: column; gap: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}
.pillars strong {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink);
}
.pillars span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
}

.hero__avatar {
  position: relative; justify-self: center;
  width: 100%; max-width: 320px; aspect-ratio: 1;
}
.hero__avatar img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 38% 42% 40% 44% / 42% 40% 44% 38%;
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.hero__avatar-ring {
  position: absolute; inset: -14px;
  border: 1.5px dashed var(--accent);
  border-radius: 38% 42% 40% 44% / 42% 40% 44% 38%;
  opacity: .5;
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero__avatar-ring { animation: none; } }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--accent) 85%, black); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: 14px 26px; font-size: 17px; }

/* SECTIONS */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 24px;
  border-top: 1px solid var(--line);
}
.section__head { margin-bottom: 40px; }
.section__kicker {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: .08em;
}
.section__title {
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -.01em; line-height: 1.15;
  margin: 0; font-weight: 600;
}

.prose p {
  font-size: 18px; color: var(--ink); max-width: 64ch;
  margin: 0 0 16px;
}
.prose p:last-child { margin-bottom: 0; }

/* SERVICES */
.services {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.service:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.service__icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.service h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.service p { margin: 0; color: var(--muted); font-size: 15px; }

/* TIMELINE */
.timeline {
  list-style: none; margin: 0; padding: 0;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute;
  left: 27px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.timeline__item {
  position: relative;
  display: grid; grid-template-columns: 56px 1fr;
  gap: 24px; padding: 0 0 40px 0;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative; z-index: 1;
  display: grid; place-items: center;
}
.timeline__logo img { width: 100%; height: 100%; object-fit: cover; }
.timeline__body { min-width: 0; }
.timeline__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap; margin-bottom: 4px;
}
.timeline__head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.timeline__period {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  white-space: nowrap;
}
.timeline__company {
  margin: 0 0 10px; color: var(--muted); font-size: 15px;
}
.timeline__body p { margin: 0 0 12px; color: var(--ink); font-size: 15.5px; }

.bullets {
  list-style: none; padding: 0; margin: 0 0 14px;
}
.bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px; top: .65em;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.tags {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tags li {
  font-family: var(--font-mono); font-size: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent);
}

/* PROJECTS */
.projects {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0 0 20px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.project:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.project__img {
  aspect-ratio: 16/10;
  background: color-mix(in oklab, var(--ink) 4%, var(--surface));
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.project__img img { width: 100%; height: 100%; object-fit: cover; }
.project h3 { margin: 18px 20px 6px; font-size: 18px; font-weight: 600; }
.project p { margin: 0 20px 14px; color: var(--muted); font-size: 15px; }
.project .tags { margin: auto 20px 0; }
.project__link {
  margin: 14px 20px 0 !important;
  font-family: var(--font-mono);
  font-size: 13px;
}
.project__link a {
  color: var(--accent);
  text-decoration: none;
}
.project__link a:hover { text-decoration: underline; }

.projects__more {
  margin: 26px 0 0; text-align: center;
  font-family: var(--font-mono); font-size: 14px;
  color: var(--muted);
}

/* SECTION LEDE (intro paragraph under a section title) */
.section__lede {
  margin: 14px 0 0; color: var(--muted);
  font-size: 16px; max-width: 62ch; line-height: 1.55;
}

/* LAB / CODE PROJECTS (no image, GitHub-card style) */
.projects--lab .project { padding: 0; }
.project--code .project__body {
  padding: 24px 22px 22px;
  display: flex; flex-direction: column; height: 100%;
}
.project--code .project__eyebrow {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 10px;
}
.project--code h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.project--code p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.project--code .tags { margin: auto 0 12px; }
.project--code .project__link { margin: 4px 0 0 !important; }
.project__note {
  margin: 6px 0 0; font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
}

/* EDUCATION */
.edu { list-style: none; padding: 0; margin: 0; }
.edu__item {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px dashed var(--line);
}
.edu__item:last-child { border-bottom: 0; }
.edu__item h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.edu__item p { margin: 0; color: var(--muted); font-size: 15px; }
.edu__period {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--muted); white-space: nowrap;
}

/* CONTACT */
.section--contact {
  text-align: center;
  padding: 100px 24px 120px;
}
.contact__title {
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: -.02em; line-height: 1;
  margin: 14px 0 18px; font-weight: 700;
}
.contact__lede {
  font-size: 18px; color: var(--muted);
  max-width: 52ch; margin: 0 auto 32px;
}
.contact__actions { margin-bottom: 24px; }
.contact__socials {
  display: flex; justify-content: center; gap: 14px;
  color: var(--muted); font-size: 15px;
}
.contact__socials a { text-decoration: none; }

/* FOOTER */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
}
.footer__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 14px;
}
.footer__inner p { margin: 0; }
.muted { color: var(--muted); }

/* REVEAL */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* RESPONSIVE */
@media (max-width: 820px) {
  .hero { padding-top: 48px; min-height: auto; }
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .hero__avatar { max-width: 220px; order: -1; justify-self: start; }
  .services, .projects { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
  .nav.is-open .nav__links {
    display: flex; position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
  }
  .nav.is-open .nav__links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav.is-open .nav__links a:last-child { border-bottom: 0; }
  .section { padding: 60px 24px; }
  .timeline__item { grid-template-columns: 44px 1fr; gap: 18px; padding-bottom: 32px; }
  .timeline__logo { width: 44px; height: 44px; border-radius: 10px; }
  .timeline::before { left: 21px; }
}
