/* ============================================
   TOKENS
   ============================================ */
:root{
  --paper: #EDEAE0;
  --paper-card: #F7F5EE;
  --ink: #1F2E2B;
  --ink-soft: #3A453F;
  --line: #445C52;
  --accent: #A8471F;
  --accent2: #C99A3A;
  --border: rgba(31,46,43,0.16);
  --border-light: rgba(247,245,238,0.18);

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max-w: 1140px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3{ font-family: var(--font-display); margin:0; color: var(--ink); }
p{ margin:0 0 1em; color: var(--ink-soft); }
a{ color: inherit; }
ul,ol{ margin:0; padding:0; list-style:none; }
img{ max-width:100%; display:block; }
.mono{ font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}

/* ============================================
   SHARED
   ============================================ */
.section{ padding: 7rem 0; border-bottom: 1px solid var(--border); }
.section-inner{ max-width: var(--max-w); margin:0 auto; padding: 0 2rem; }
.section-alt{ background: var(--paper-card); }
.section-dark{
  background: var(--ink);
  color: var(--paper);
  border-bottom: none;
}
.section-dark .section-title{ color: var(--paper); }

.eyebrow{
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
.eyebrow.light{ color: var(--accent2); }

.section-title{
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.two-col{
  display:grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4rem;
}
.col-note{
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin-top: 1.5rem;
}
.col-note:empty{ display:none; }
.section-dark .col-note{ color: rgba(247,245,238,0.6); }
.light-body{ color: rgba(247,245,238,0.82); }

@media (max-width: 860px){
  .two-col{ grid-template-columns: 1fr; gap: 2rem; }
}

/* ============================================
   NAV
   ============================================ */
.site-nav{
  position: sticky; top:0; z-index: 100;
  background: rgba(237,234,224,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner{
  max-width: var(--max-w); margin:0 auto; padding: 1.1rem 2rem;
  display:flex; align-items:center; justify-content:space-between;
}
.nav-mark{
  font-family: var(--font-mono); font-weight:500; font-size: 0.95rem;
  text-decoration:none; letter-spacing: 0.04em;
}
.nav-mark-dot{ color: var(--accent); }
.nav-links{ display:flex; gap: 2rem; }
.nav-links a{
  font-family: var(--font-mono); font-size: 0.82rem; text-decoration:none;
  color: var(--ink-soft); letter-spacing: 0.02em;
  padding-bottom: 3px; border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.nav-links a:hover{ color: var(--accent); border-color: var(--accent); }

.nav-toggle{
  display:none; flex-direction:column; gap:5px; background:none; border:none; cursor:pointer; padding: 6px;
}
.nav-toggle span{ width: 22px; height: 2px; background: var(--ink); display:block; }

@media (max-width: 720px){
  .nav-toggle{ display:flex; }
  .nav-links{
    position:absolute; top: 100%; left:0; right:0;
    background: var(--paper); flex-direction:column; gap:0;
    max-height:0; overflow:hidden; border-bottom: 1px solid var(--border);
    transition: max-height 0.3s ease;
  }
  .nav-links.open{ max-height: 400px; }
  .nav-links a{ padding: 1rem 2rem; border-bottom: 1px solid var(--border); }
}

/* ============================================
   HERO
   ============================================ */
.hero{
  position: relative;
  min-height: 92vh;
  display:flex; flex-direction:column; justify-content:center;
  padding: 6rem 2rem 2rem;
  overflow:hidden;
}
.contour-field{
  position:absolute; inset:0; z-index:0; opacity: 0.55;
}
.contour-field svg{ width:100%; height:100%; }
.contour-line{
  fill:none; stroke: var(--line); stroke-width:1.4; opacity:0.35;
}
.contour-line.c2{ opacity:0.3; }
.contour-line.c3{ opacity:0.25; stroke: var(--accent2); }
.contour-line.c4{ opacity:0.22; }
.contour-line.c5{ opacity:0.18; }

.hero-inner{
  position:relative; z-index:1;
  max-width: var(--max-w); margin: 0 auto; width:100%;
}
.hero-title{
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}
.hero-role{
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--line);
  margin-bottom: 1.5rem;
  max-width: 640px;
}
.hero-desc{
  max-width: 560px;
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin-bottom: 2.25rem;
}
.hero-actions{ display:flex; gap:1rem; flex-wrap:wrap; }

.btn{
  display:inline-block;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-decoration:none;
  border-radius: 2px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary{ background: var(--ink); color: var(--paper); }
.btn-primary:hover{ background: var(--accent); transform: translateY(-1px); }
.btn-ghost{ border: 1px solid var(--ink); color: var(--ink); }
.btn-ghost:hover{ background: var(--ink); color: var(--paper); }

.hero-legend{
  position:relative; z-index:1;
  max-width: var(--max-w); margin: 3rem auto 0; width:100%;
  display:flex; gap: 2rem; flex-wrap:wrap;
  font-size: 0.76rem; color: var(--ink-soft);
  border-top: 1px solid var(--border); padding-top: 1.25rem;
}
.legend-key{ display:flex; align-items:center; gap: 0.5rem; }
.key-swatch{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.key-a{ background: var(--accent); }
.key-b{ background: var(--line); }
.key-c{ background: var(--accent2); }

@media (max-width: 600px){
  .hero{ min-height:auto; padding-top: 5rem; }
}

/* ============================================
   ABOUT / fact grid
   ============================================ */
.fact-grid{
  margin-top: 2rem;
  display:grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  border-top: 1px solid var(--border); padding-top: 1.5rem;
}
.fact{ display:flex; flex-direction:column; gap:0.35rem; }
.fact-label{ font-size:0.72rem; color: var(--accent); text-transform:uppercase; letter-spacing:0.06em; }
.fact-value{ font-size:0.85rem; }

.profile-photo{
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* ============================================
   RESEARCH LIST
   ============================================ */
.research-list{ display:flex; flex-direction:column; gap: 2rem; margin: 1.5rem 0 2rem; }
.research-list h3{
  font-size: 1.25rem; color: var(--paper); margin-bottom: 0.5rem;
  border-left: 2px solid var(--accent2); padding-left: 0.85rem;
}

/* ============================================
   PROJECTS
   ============================================ */
.project-grid{
  display:grid; grid-template-columns: 1fr 1fr; gap: 2.5rem;
  margin-top: 2.5rem;
}
.project-card{
  background: var(--paper-card);
  border: 1px solid var(--border);
}
.project-visual{ line-height:0; border-bottom: 1px solid var(--border); background: var(--paper-card); }
.project-visual img{
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.pv-bg{ fill: #E3DECE; }
.pv-bg-b{ fill: #E0DFD3; }
.pv-line{ fill:none; stroke: var(--line); stroke-width:2; opacity:0.55; }
.pv-line2{ stroke: var(--accent2); opacity:0.6; }
.pv-line3{ stroke: var(--accent); opacity:0.5; }
.pv-grid line{ stroke: var(--border); stroke-width:1; }
.pv-route{ fill:none; stroke: var(--accent); stroke-width:2.5; }
.pv-node{ fill: var(--ink); }
.pv-roads line{ stroke: var(--ink-soft); stroke-width: 1.5; opacity:0.4; }
.pv-hot{ fill: var(--accent); opacity:0.35; }
.pv-hot2{ fill: var(--accent2); opacity:0.4; }
.pv-placeholder-text{
  font-family: var(--font-mono); font-size: 14px; fill: var(--ink-soft);
  text-transform:uppercase; letter-spacing: 0.08em;
}
.project-card-placeholder{ border-style: dashed; }

.project-tag{ font-size: 0.72rem; color: var(--accent); padding: 1.25rem 1.5rem 0; letter-spacing: 0.03em; }
.project-card h3{ font-size: 1.3rem; padding: 0.5rem 1.5rem 0; line-height:1.25; }
.project-card p{ padding: 0 1.5rem; font-size: 0.94rem; }
.project-meta{ font-size: 0.72rem; color: var(--ink-soft); padding: 0 1.5rem 0.4rem; }
.project-meta:last-of-type{ padding-bottom: 1.5rem; }
.project-link{
  display:block; font-size: 0.76rem; color: var(--accent);
  text-decoration:none; padding: 0.9rem 1.5rem; border-top: 1px solid var(--border);
  transition: background 0.15s ease;
}
.project-link:hover{ background: rgba(168,71,31,0.07); }
.project-link-static{
  color: var(--ink-soft); cursor: default; opacity: 0.75;
}
.project-link-static:hover{ background: none; }
.project-card p code{
  font-family: var(--font-mono); font-size: 0.85em; background: rgba(31,46,43,0.06);
  padding: 0.1em 0.35em; border-radius: 2px;
}

@media (max-width: 780px){
  .project-grid{ grid-template-columns: 1fr; }
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline{ display:flex; flex-direction:column; }
.timeline-item{
  padding: 1.75rem 0; border-top: 1px solid var(--border);
}
.timeline-item:last-child{ border-bottom: 1px solid var(--border); }
.timeline-date{ font-size: 0.76rem; color: var(--accent); margin-bottom: 0.5rem; }
.timeline-item h3{ font-size: 1.15rem; margin-bottom: 0.2rem; }
.timeline-org{ font-size: 0.88rem; color: var(--ink-soft); font-style: italic; font-family: var(--font-display); margin-bottom: 0.6rem; }

/* ============================================
   PUBLICATIONS
   ============================================ */
.pub-list{ display:flex; flex-direction:column; gap: 1.5rem; margin-bottom: 1.5rem; }
.pub-item{ border-left: 2px solid var(--border); padding-left: 1.1rem; }
.pub-type{ font-size: 0.72rem; color: var(--accent); margin-bottom: 0.35rem; }
.pub-title{ font-size: 1rem; color: var(--ink); }
.pub-title a{ color: var(--accent); text-decoration: underline; text-decoration-color: rgba(168,71,31,0.35); text-underline-offset: 2px; }
.pub-title a:hover{ text-decoration-color: var(--accent); }
.pub-desc{ font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.5rem; }

/* ============================================
   CONTACT
   ============================================ */
.contact-title{ margin-bottom: 3rem; }
.contact-grid{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
.contact-link{
  background: var(--ink); padding: 1.75rem 1.5rem;
  text-decoration:none; display:flex; flex-direction:column; gap:0.6rem;
  transition: background 0.2s ease;
}
.contact-link:hover{ background: #2a3934; }
.contact-label{ font-size: 0.7rem; color: var(--accent2); text-transform:uppercase; letter-spacing:0.06em; }
.contact-value{ font-size: 0.92rem; color: var(--paper); word-break: break-word; }

@media (max-width: 780px){
  .contact-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px){
  .contact-grid{ grid-template-columns: 1fr; }
}

.site-footer{
  max-width: var(--max-w); margin: 4rem auto 0; padding: 1.5rem 2rem 0;
  border-top: 1px solid var(--border-light);
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:0.5rem;
  font-size: 0.75rem; color: rgba(247,245,238,0.5);
}
