/* ============ Design tokens ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --text: #111418;
  --text-muted: #5b6370;
  --border: #e6e8ec;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1080px;
  --nav-h: 64px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d0f12;
  --bg-soft: #14171c;
  --surface: #171a20;
  --text: #eef0f3;
  --text-muted: #9aa3b0;
  --border: #262b33;
  --accent: #6b9bff;
  --accent-soft: #1b2640;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; height: 100%; gap: 16px; }
.nav__brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; margin-right: auto; white-space: nowrap; }
.nav__brand:hover { text-decoration: none; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a { color: var(--text-muted); font-size: .92rem; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--bg-soft); text-decoration: none; }
@media (max-width: 560px) {
  .nav__links { gap: 0; }
  .nav__links a { padding: 6px 7px; font-size: .85rem; }
  .nav__brand { display: none; }
  .nav__inner nav { margin-right: auto; }
}

.theme-toggle, .icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.theme-toggle:hover, .icon-btn:hover { background: var(--bg-soft); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.theme-toggle svg, .icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* ============ Hero ============ */
.hero {
  display: flex; align-items: center; gap: 48px;
  min-height: calc(88vh - var(--nav-h));
  padding-top: 48px; padding-bottom: 48px;
}
.hero__photo {
  width: 200px; height: 200px; flex: none;
  border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
  background: var(--bg-soft);
}
.eyebrow { margin: 0 0 4px; color: var(--accent); font-weight: 600; font-size: .95rem; }
.hero__name { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; }
.hero__tagline { margin: 10px 0 0; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text-muted); font-weight: 500; }
.hero__bio { margin: 16px 0 0; max-width: 56ch; color: var(--text-muted); }
@media (max-width: 720px) {
  .hero { flex-direction: column; text-align: center; gap: 24px; min-height: auto; padding-top: 40px; }
  .hero__photo { width: 150px; height: 150px; }
  .hero__bio { margin-left: auto; margin-right: auto; }
}

.socials { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.socials--center { justify-content: center; }
@media (max-width: 720px) { .hero .socials { justify-content: center; } }
.social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: .9rem; font-weight: 500;
  transition: border-color .2s ease, transform .2s ease;
}
.social:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.social svg { width: 16px; height: 16px; fill: currentColor; }

/* ============ Sections ============ */
.section { padding-top: 72px; padding-bottom: 72px; }
.section + .section { border-top: 1px solid var(--border); }
.section__head { margin-bottom: 32px; }
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section__sub { margin: 8px 0 0; color: var(--text-muted); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ============ Now cards ============ */
.now-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.now-card h3 { margin-top: 14px; }
.now-card p { margin: 8px 0 0; color: var(--text-muted); font-size: .95rem; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.pill--status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--muted { background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border); }

/* ============ Updates / timeline ============ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font: inherit; font-size: .88rem; font-weight: 500;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.post { position: relative; padding-left: 36px; margin-bottom: 16px; }
.post::before {
  content: ""; position: absolute; left: 0; top: 26px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.post__card { padding: 20px 24px; }
.post__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--text-muted); }
.post__title { margin-top: 8px; }
.post__toggle {
  all: unset; cursor: pointer; display: block; width: 100%;
}
.post__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.post__toggle:hover .post__title { color: var(--accent); }
.post__summary { margin: 6px 0 0; color: var(--text-muted); }
.post__body { margin-top: 12px; color: var(--text); }
.post__body p { margin: 0 0 12px; }
.post__body p:last-child { margin-bottom: 0; }
.post__more { margin-top: 10px; font-size: .88rem; font-weight: 600; color: var(--accent); }
.empty { color: var(--text-muted); padding: 16px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); margin: 8px 0 0 36px; }
.btn--ghost:hover { border-color: var(--accent); }

/* ============ Projects carousel ============ */
.carousel__controls { display: flex; gap: 8px; }
.carousel { overflow: hidden; border-radius: var(--radius); outline: none; }
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.carousel__track { display: flex; transition: transform .5s cubic-bezier(.22, .8, .2, 1); touch-action: pan-y; }
.slide { flex: 0 0 100%; min-width: 0; padding: 2px; }
.project {
  display: grid; grid-template-columns: 1.25fr 1fr; overflow: hidden; padding: 0;
  height: 100%;
}
.project__thumb { aspect-ratio: 16 / 10; background: var(--bg-soft); overflow: hidden; }
.project__thumb img { width: 100%; height: 100%; object-fit: cover; }
.project__info { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.project__info h3 { font-size: 1.5rem; }
.project__info p { margin: 0; color: var(--text-muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.btn--dark { background: var(--text); color: var(--bg); }
@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; }
  .project__info { padding: 22px; }
  .project__info h3 { font-size: 1.25rem; }
}
.carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.dot {
  width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--border); transition: width .3s ease, background .3s ease;
}
.dot[aria-current="true"] { width: 24px; background: var(--accent); }

/* ============ Footer ============ */
.footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 72px 0 40px; }
.footer__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.footer__inner .btn { margin-top: 24px; }
.footer__copy { margin: 40px 0 0; color: var(--text-muted); font-size: .85rem; }
