/* ---------- Self-hosted fonts (was Google Fonts) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fbfaf8;
  --bg-alt: #f3f1ec;
  --ink: #1c1c1a;
  --ink-soft: #55534d;
  --ink-faint: #8a887f;
  --line: #e4e1d8;
  --accent: #c1602f;
  --accent-soft: #f0e2d6;
  --accent-ink: #7a3d1c;
  --radius: 14px;
  --maxw: 1080px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 20% 10%, var(--accent-soft) 0%, transparent 40%);
  opacity: .55;
}

section, header, footer { position: relative; z-index: 1; }

/* ---------- Nav ---------- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: .92rem;
  color: var(--ink-soft);
  transition: color .2s;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  border: 1px solid var(--accent);
  color: var(--accent-ink) !important;
  padding: .45rem .95rem;
  border-radius: 100px;
  font-weight: 500;
}
.nav-cta:hover { background: var(--accent-soft); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  margin-left: 1.5rem;
}
.lang-sep { color: var(--ink-faint); }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: .82rem;
  padding: .2rem .3rem;
  transition: color .2s;
}
.lang-flag { width: 18px; height: 9px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; }
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active { color: var(--accent-ink); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem;
  margin-left: .8rem;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 7rem 1.5rem 2rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  margin-bottom: 2.6rem;
}

.section-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .95rem;
}

.section-head h3 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head h3::after {
  content: '';
  display: block;
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 3rem;
  align-items: center;
  min-height: 88vh;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .95rem;
  margin-bottom: .9rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-role {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: .6rem;
}

.hero-desc {
  margin-top: 1.4rem;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 2.2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: .85rem 1.6rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }

.hero-socials {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
}
.hero-socials a {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.hero-socials a:hover { color: var(--accent-ink); border-color: var(--accent); }

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  width: min(380px, 65vw);
  aspect-ratio: 1;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--ink) 30%, transparent);
  background: var(--bg-alt);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.about-text p { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: 65ch; }
.about-text strong { color: var(--ink); }

/* ---------- Timeline (experience) ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.6rem;
  border-left: 2px solid var(--line);
  padding-left: 2rem;
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.46rem;
  top: .4rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--ink-faint);
  margin-bottom: .4rem;
}
.timeline-body h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .7rem;
}
.timeline-org { font-weight: 500; color: var(--ink-soft); }
.timeline-body ul { display: flex; flex-direction: column; gap: .5rem; }
.timeline-body li {
  color: var(--ink-soft);
  font-size: .95rem;
  padding-left: 1.1rem;
  position: relative;
}
.timeline-body li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Research ---------- */
.research-list { display: flex; flex-direction: column; gap: 2rem; }
.research-item {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.research-item h4 { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; }
.research-meta { color: var(--ink-faint); font-size: .85rem; font-family: var(--font-mono); margin-bottom: 1rem; }
.research-item p { color: var(--ink-soft); margin-bottom: 1.2rem; max-width: 70ch; }
.link-arrow { color: var(--accent-ink); font-weight: 600; font-size: .92rem; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.8rem;
}
.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -24px color-mix(in srgb, var(--ink) 25%, transparent);
}
.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-link { color: var(--ink-faint); transition: color .2s; }
.project-link:hover { color: var(--accent-ink); }
.project-card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: .8rem; }
.project-card p { color: var(--ink-soft); font-size: .92rem; margin-bottom: 1.3rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.project-tags li {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: .3rem .7rem;
  border-radius: 100px;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.4rem 3rem;
}
.skill-group h5 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}
.tag-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.tag-list li {
  font-size: .88rem;
  border: 1px solid var(--line);
  padding: .45rem .9rem;
  border-radius: 100px;
  color: var(--ink-soft);
  transition: border-color .2s, color .2s;
}
.tag-list li:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Awards ---------- */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
}
.award-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  background: var(--bg-alt);
}
.award-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: .7rem; color: var(--accent-ink); }
.award-card p { font-size: .9rem; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact-section { padding-top: 8rem; padding-bottom: 8rem; text-align: center; }
.contact-inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.contact-inner .section-num { display: block; margin-bottom: .6rem; }
.contact-inner h3 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 1rem; }
.contact-inner p { color: var(--ink-soft); margin-bottom: 2.2rem; }
.contact-socials {
  display: flex;
  gap: 2rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.contact-socials a {
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.contact-socials a:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: .8rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.2rem;
    transform: translateY(-130%);
    transition: transform .3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }

  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 3rem; min-height: auto; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-socials { justify-content: center; }
  .hero-photo { order: -1; }

  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .awards-grid { grid-template-columns: 1fr; }
}
