@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #0c0d10;
  --surface: #15171c;
  --surface-2: #1d2027;
  --text: #eceef2;
  --muted: #9aa1ad;
  --line: #262a33;
  --accent: #f2b45a;
  --accent-ink: #1a1305;
  --radius: 16px;
  --maxw: 1280px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f5f0;
    --surface: #ffffff;
    --surface-2: #efece5;
    --text: #15161a;
    --muted: #5c6370;
    --line: #dedad0;
    --accent: #b8741a;
    --accent-ink: #ffffff;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efece5;
  --text: #15161a;
  --muted: #5c6370;
  --line: #dedad0;
  --accent: #b8741a;
  --accent-ink: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.25rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: clamp(4rem, 9vw, 8rem); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0 0 1rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.75rem, 2rem + 6vw, 7rem); }
h2 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem); }
h3, .card-title { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.8rem; color: var(--accent); margin-bottom: 1rem; }
.muted { color: var(--muted); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { font-family: var(--font-display); font-weight: 600; text-decoration: none; font-size: 1.15rem; }
.nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 2rem); }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; padding: 0.6rem 0.25rem; }
.nav a:hover { color: var(--text); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  font: inherit; font-size: 0.8rem; min-width: 2.75rem; min-height: 2.25rem;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.theme-toggle {
  font: inherit; font-size: 1.1rem; width: 2.75rem; height: 2.75rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
@media (max-width: 640px) { .nav a { display: none; } }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(4rem, 9vw, 8rem); position: relative; overflow: hidden; }
.hero p.lead { max-width: 38ch; font-size: clamp(1.1rem, 1rem + 0.8vw, 1.6rem); color: var(--muted); }
.cta {
  display: inline-block; margin-top: 1.5rem; padding: 0.9rem 1.6rem; min-height: 44px;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
  text-decoration: none; font-weight: 600;
  transition: transform .2s ease;
}
.cta:hover { transform: translateY(-2px); }
.wave { display: flex; align-items: center; gap: 5px; height: 90px; margin-top: 3rem; opacity: .9; }
.wave span {
  flex: 0 0 8px; background: var(--accent); border-radius: 4px;
  height: calc(var(--h) * 1%); opacity: calc(0.35 + var(--h) / 160);
  animation: pulse 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 40ms);
}
@keyframes pulse { 50% { transform: scaleY(.55); } }

/* Hero extras */
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 6rem); } }
.portrait { margin: 0; width: 100%; max-width: 26rem; justify-self: center; }
.portrait img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: center top;
  border-radius: calc(var(--radius) * 1.5); border: 1px solid var(--line);
}
.hero h1 { font-size: clamp(2.5rem, 1.4rem + 4.2vw, 5rem); max-width: 18ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.cta.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.cta.ghost:hover { border-color: var(--accent); }
.pillars { display: grid; gap: 1.25rem; margin-top: clamp(3rem, 7vw, 5rem); grid-template-columns: 1fr; }
@media (min-width: 768px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.card h3, .card .card-title { color: var(--accent); margin-bottom: .5rem; }
section.alt { background: var(--surface); border-block: 1px solid var(--line); }
section.alt .card { background: var(--bg); }

/* Timeline */
.timeline { list-style: none; margin: 2.5rem 0 0; padding: 0; max-width: 56rem; }
.timeline li { display: grid; gap: .25rem 2rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.timeline .when { color: var(--accent); font-size: .95rem; }
.timeline h3 { margin-bottom: .25rem; }
.timeline p { margin: 0; color: var(--muted); }
.timeline p.org { color: var(--text); font-size: .95rem; margin-bottom: .25rem; }
@media (min-width: 640px) { .timeline li { grid-template-columns: 11rem 1fr; } }

.subhead { margin-top: clamp(3rem, 6vw, 4.5rem); }
.train-grid { display: grid; gap: 1.25rem; margin-top: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .train-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .train-grid { grid-template-columns: repeat(3, 1fr); } }
.card .when { color: var(--accent); font-size: .85rem; margin-bottom: .5rem; }
.card .org { color: var(--text); margin-bottom: .25rem; }

/* Voice reel */
.reel {
  margin-top: 2rem; min-height: 16rem; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 2rem 1rem;
}
.reel .wave { margin: 0; width: 100%; justify-content: center; }
.reel p { margin: 0; }

/* Projects */
.proj-grid { display: grid; gap: 1.25rem; margin-top: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .proj-grid { grid-template-columns: repeat(6, 1fr); }
  .proj-grid .card { grid-column: span 2; }
  .proj-grid .card:nth-child(n+4), .proj-grid .card:last-child:nth-child(odd) { grid-column: span 3; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Contact */
.contact-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5);
  padding: clamp(2rem, 6vw, 5rem); text-align: center;
}
.contact-box h2 { margin-inline: auto; }
.contact-box p { max-width: 50ch; margin-inline: auto; color: var(--muted); }
.mail { font-family: var(--font-display); font-size: clamp(1.4rem, 1rem + 2vw, 2.4rem); color: var(--accent); text-decoration: none; word-break: break-word; }
.mail:hover { text-decoration: underline; }
.social { display: flex; justify-content: center; gap: .75rem; margin-top: 1.75rem; }
.social a {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); transition: border-color .2s, color .2s;
}
.social a:hover { border-color: var(--accent); color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a { text-decoration: none; padding: .6rem 0; }
.site-footer a:hover { color: var(--text); }

/* Legal pages */
.legal { padding-block: clamp(3rem, 7vw, 6rem); max-width: 48rem; }
.legal h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 4rem); }
.legal h2 { font-size: 1.4rem; margin-top: 2.5rem; }
.placeholder { background: color-mix(in srgb, var(--accent) 22%, transparent); padding: 0 .3em; border-radius: 4px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (min-width: 1600px) { :root { --maxw: 1480px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cta { transition: none; }
}
