:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b675f;
  --line: #e3ded4;
  --accent: #d9480f;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #121210;
  --surface: #1b1a17;
  --text: #ece8e1;
  --muted: #9a958b;
  --line: #2c2a26;
  --accent: #ff7a45;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.25rem, 5vw, 4rem);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__logo { font-family: var(--serif); font-size: 1.6rem; text-decoration: none; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 1.75rem; }
.nav__links a { text-decoration: none; font-size: 0.9rem; color: var(--muted); transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 2.25rem; height: 2.25rem; border-radius: 50%; cursor: pointer; font-size: 1rem;
}

main { max-width: 960px; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }

/* HERO */
.hero { padding: clamp(4rem, 12vh, 8rem) 0 4rem; }
.hero__tag { color: var(--accent); margin-bottom: 1.5rem; }
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.05; letter-spacing: -0.01em;
}
.hero__title em { color: var(--accent); }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; font-weight: 300; }
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { max-width: 34rem; margin-top: 1.75rem; font-size: 1.1rem; color: var(--muted); }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 0.75rem 1.4rem; border-radius: 999px;
  font: 500 0.92rem var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid var(--text); transition: transform 0.15s, background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--text); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--text); color: var(--bg); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.stats dt { font-family: var(--serif); font-size: 2.4rem; line-height: 1; }
.stats dd { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }

/* SECTIONS */
.section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.section__title { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; margin-bottom: 2.5rem; }
.section__title .mono { color: var(--accent); vertical-align: super; margin-right: 0.5rem; }

/* PROJECTS */
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 2rem; margin-bottom: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
}
.project:hover { border-color: var(--accent); transform: translateY(-3px); }
.project__meta { color: var(--muted); margin-bottom: 0.6rem; text-transform: uppercase; }
.project h3 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.75rem; }
.project > p { color: var(--muted); }
.project__points { margin: 1rem 0 0 1.1rem; }
.project__points li { margin-bottom: 0.4rem; }
.project__points li::marker { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.chips span {
  font: 0.75rem var(--mono); padding: 0.3rem 0.7rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.project__links { margin-top: 1.25rem; }
.project__links a { color: var(--accent); font-weight: 500; text-decoration: none; }

/* TIMELINE */
.timeline { border-left: 1px solid var(--line); padding-left: 1.75rem; }
.timeline__item { position: relative; margin-bottom: 2.25rem; }
.timeline__item::before {
  content: ""; position: absolute; left: calc(-1.75rem - 5px); top: 0.35rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.timeline__date { color: var(--accent); }
.timeline__item h3 { font-size: 1.1rem; font-weight: 600; margin: 0.2rem 0 0.4rem; }
.timeline__item p:last-child { color: var(--muted); }

/* SKILLS */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.skills > div { padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.skills h4 { color: var(--accent); margin-bottom: 0.5rem; text-transform: uppercase; }

/* CONTACT */
.contact { text-align: center; padding-bottom: 6rem; }
.contact__title { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; }
.contact > p { color: var(--muted); margin-top: 1rem; }
.contact__row { display: flex; justify-content: center; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }
.toast { min-height: 1.5rem; margin-top: 1rem; color: var(--accent); }

.footer { text-align: center; padding: 2rem; color: var(--muted); border-top: 1px solid var(--line); }

/* REVEAL ON SCROLL */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret { animation: none; }
}

/* MOBILE */
@media (max-width: 640px) {
  .nav__links { display: none; }
  .stats { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .project { padding: 1.5rem; }
}
