/* ===== Tokens ===== */
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #6b665e;
  --line: #e4ded3;
  --accent: #c2512f;
  --accent-ink: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(28, 26, 23, .18);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1d1b18; --text: #f1ece4; --muted: #a39d93;
    --line: #2e2b26; --accent: #e8774f; --accent-ink: #141311;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1d1b18; --text: #f1ece4; --muted: #a39d93;
  --line: #2e2b26; --accent: #e8774f; --accent-ink: #141311;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0 0 1rem; }
.container { width: min(1100px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); font-weight: 400; }
.accent { color: var(--accent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__logo { font: 600 1.4rem var(--serif); text-decoration: none; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 32px; }
.nav__links a { text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.nav__burger { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  border-radius: 999px; font-weight: 500; text-decoration: none; transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--text); }
.btn--lg { font-size: clamp(1rem, 3vw, 1.25rem); padding: 16px 30px; }

/* ===== Hero ===== */
.hero { padding: clamp(80px, 16vh, 160px) 0 clamp(60px, 10vh, 120px); }
.eyebrow { color: var(--muted); font-weight: 500; letter-spacing: .02em; margin-bottom: .5rem; }
.hero__title { font-size: clamp(3rem, 11vw, 7.5rem); letter-spacing: -.02em; }
.hero__lead { font-size: clamp(1.15rem, 2.4vw, 1.5rem); max-width: 34ch; color: var(--muted); margin: 1.5rem 0 2rem; }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__status { margin-top: 2.5rem; font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3aa76d; box-shadow: 0 0 0 4px color-mix(in srgb, #3aa76d 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }

/* ===== Sections ===== */
.section { padding: clamp(60px, 10vh, 110px) 0; border-top: 1px solid var(--line); }
.section__title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 2.5rem; display: flex; align-items: baseline; gap: 14px; }
.section__title span { font: 500 .9rem var(--sans); color: var(--accent); }
.sub { font-size: 1.15rem; margin: 2rem 0 1rem; }

/* About */
.about { display: grid; grid-template-columns: 320px 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.about__photo img, .avatar { aspect-ratio: 4/5; width: 100%; border-radius: var(--radius); object-fit: cover; }
.avatar {
  display: grid; place-items: center; font: 600 4rem var(--serif); color: var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
}
.about__text { max-width: 60ch; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; background: var(--surface); }
.tags--sm li { padding: 3px 10px; font-size: .8rem; }

/* Work */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media {
  aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--hue) 60% 72%), hsl(calc(var(--hue) + 40) 55% 55%));
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__media span { font: 600 3.5rem var(--serif); color: rgba(255, 255, 255, .85); }
.card__body { padding: 24px; }
.card__body h3 { font-size: 1.35rem; margin-bottom: .5rem; }
.card__body p { color: var(--muted); font-size: .98rem; }
.card__links { display: flex; gap: 18px; margin-top: 1.25rem; }
.card__links a { font-weight: 500; font-size: .95rem; text-decoration: none; color: var(--accent); }
.card__links a:hover { text-decoration: underline; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.timeline li:first-child { padding-top: 0; }
.timeline__date { color: var(--muted); font-size: .95rem; padding-top: 4px; }
.timeline h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.timeline p { color: var(--muted); margin: 0; }

/* Contact */
.contact__big { font: 600 clamp(2rem, 6vw, 4rem)/1.1 var(--serif); letter-spacing: -.01em; margin-bottom: 2rem; }
.contact .btn--lg { overflow-wrap: anywhere; }
.socials { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; flex-wrap: wrap; gap: 28px; }
.socials a { font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .2s; }
.socials a:hover { border-color: var(--accent); }

/* Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 32px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 260px; }
  .grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 680px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 0; font-size: 1.05rem; }
}
