/* ==========================================================================
   ALI MIRZAKHANI — NEUROTECHNOLOGY RESEARCH — DESIGN SYSTEM
   --------------------------------------------------------------------------
   Visual language: printed-circuit-board / oscilloscope instrumentation.
   A dark soldermask substrate, a single burnished-copper signature accent
   (standing in for both a circuit trace and a signal trace), a muted
   secondary "bottom-layer" blue, and silkscreen-white typography.
   Sharp, precise edges — like a schematic, not a soft consumer app.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root{
  /* ---- color: dark (default) — "board under lab light" ---- */
  --c-bg: #0B0F0D;
  --c-bg-alt: #0F1512;
  --c-bg-elevated: #141C17;
  --c-bg-elevated-2: #1A231C;
  --c-border: rgba(230,236,228,0.09);
  --c-border-strong: rgba(230,236,228,0.18);
  --c-silk: #ECEFE7;
  --c-silk-muted: #8D9791;
  --c-silk-faint: #5B655F;
  --c-copper: #D9924C;
  --c-copper-bright: #F2B677;
  --c-copper-rgb: 217,146,76;
  --c-trace-blue: #5B93A6;
  --c-trace-blue-rgb: 91,147,166;
  --c-status: #6FBF8B;
  --c-overlay: rgba(6,9,7,0.86);
  --shadow-elevated: 0 20px 60px -20px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(var(--c-copper-rgb), 0.12);

  /* ---- type ---- */
  --f-display: 'Chakra Petch', 'Arial Narrow', sans-serif;
  --f-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;

  --text-hero: clamp(2.6rem, 5.6vw + 0.6rem, 6.2rem);
  --text-h1: clamp(2.1rem, 3.4vw + 0.6rem, 3.6rem);
  --text-h2: clamp(1.6rem, 2vw + 0.6rem, 2.5rem);
  --text-h3: clamp(1.3rem, 1vw + 0.6rem, 1.6rem);
  --text-h4: clamp(1.05rem, 0.5vw + 0.6rem, 1.2rem);
  --text-lg: clamp(1.1rem, 0.4vw + 0.9rem, 1.3rem);
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;

  /* ---- spacing ---- */
  --sp-3xs: 0.25rem;
  --sp-2xs: 0.5rem;
  --sp-xs: 0.75rem;
  --sp-sm: 1.25rem;
  --sp-md: 2rem;
  --sp-lg: 3.25rem;
  --sp-xl: 5rem;
  --sp-2xl: 7.5rem;
  --sp-3xl: 10.5rem;

  /* ---- layout ---- */
  --container-w: 1240px;
  --container-pad: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 3px;
  --radius-sm: 2px;
  --header-h: 76px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.6, 0, 0.4, 1);
}

/* ---- light theme: "print / blueprint on paper" ---- */
[data-theme="light"]{
  --c-bg: #F5F3EC;
  --c-bg-alt: #EDEAE1;
  --c-bg-elevated: #FFFFFF;
  --c-bg-elevated-2: #F9F7F1;
  --c-border: rgba(18,22,18,0.11);
  --c-border-strong: rgba(18,22,18,0.22);
  --c-silk: #14201A;
  --c-silk-muted: #51584F;
  --c-silk-faint: #83887F;
  --c-copper: #A85A24;
  --c-copper-bright: #8A4A1C;
  --c-copper-rgb: 168,90,36;
  --c-trace-blue: #2E6478;
  --c-trace-blue-rgb: 46,100,120;
  --c-status: #2E7D4F;
  --c-overlay: rgba(245,243,236,0.92);
  --shadow-elevated: 0 20px 50px -25px rgba(20,20,18,0.25);
  --shadow-glow: 0 0 40px rgba(var(--c-copper-rgb), 0.08);
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }
html{
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
body{
  margin: 0;
  background: var(--c-bg);
  color: var(--c-silk);
  font-family: var(--f-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg{ display: block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4,p,figure{ margin: 0; }
button, input, textarea, select{ font: inherit; color: inherit; }
button{ background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea{ background: none; border: 0; }

/* focus visibility — never remove outlines, only restyle them */
:focus-visible{
  outline: 2px solid var(--c-copper);
  outline-offset: 3px;
}
:focus:not(:focus-visible){ outline: none; }

/* skip link */
.skip-link{
  position: fixed;
  top: -60px;
  left: 1rem;
  z-index: 999;
  background: var(--c-copper);
  color: #0B0F0D;
  padding: 0.75rem 1.25rem;
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus{ top: 1rem; }

::selection{ background: var(--c-copper); color: #0B0F0D; }

/* faint schematic grid, fixed behind everything */
.board-grid{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--c-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,h2,h3,h4{
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: var(--c-silk);
}
h1{ font-size: var(--text-h1); }
h2{ font-size: var(--text-h2); }
h3{ font-size: var(--text-h3); }
h4{ font-size: var(--text-h4); font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }

.mono{ font-family: var(--f-mono); }

.eyebrow{
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-copper);
  margin-bottom: var(--sp-sm);
}
.eyebrow::before{
  content: '';
  width: 22px;
  height: 1px;
  background: var(--c-copper);
  flex-shrink: 0;
}
.eyebrow .idx{ color: var(--c-silk-faint); }

.lede{
  font-size: var(--text-lg);
  color: var(--c-silk-muted);
  max-width: 62ch;
  line-height: 1.65;
}

.text-muted{ color: var(--c-silk-muted); }
.text-faint{ color: var(--c-silk-faint); }
.text-copper{ color: var(--c-copper); }

a.inline-link{
  position: relative;
  color: var(--c-silk);
  font-weight: 500;
  background-image: linear-gradient(var(--c-copper), var(--c-copper));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 2px;
  transition: background-size 0.3s var(--ease), color 0.3s var(--ease);
}
a.inline-link:hover{ color: var(--c-copper); background-size: 0% 1px; }

.arrow-link{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  color: var(--c-copper);
  letter-spacing: 0.02em;
}
.arrow-link svg{ width: 15px; height: 15px; transition: transform 0.3s var(--ease); }
.arrow-link:hover svg{ transform: translateX(4px); }

blockquote.pull{
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2vw + 0.8rem, 2.15rem);
  line-height: 1.35;
  color: var(--c-silk);
  border-left: 2px solid var(--c-copper);
  padding-left: var(--sp-md);
  margin: 0;
}

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container{
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  position: relative;
}
.section{
  position: relative;
  padding-block: var(--sp-2xl);
  border-bottom: 1px solid var(--c-border);
}
.section.tight{ padding-block: var(--sp-xl); }
.section-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}
.section-head h2{ max-width: 34ch; }
.section-foot{
  margin-top: var(--sp-lg);
  display: flex;
  justify-content: center;
}

.grid{ display: grid; gap: var(--sp-md); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px){
  .grid-3, .grid-4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; }
}

/* trace-line divider that draws itself in on scroll */
.trace-divider{ width: 100%; height: 18px; overflow: visible; margin-block: var(--sp-lg); }
.trace-divider path{
  fill: none;
  stroke: var(--c-border-strong);
  stroke-width: 1;
}
.trace-divider path.live{
  stroke: var(--c-copper);
  stroke-dasharray: 6 10;
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.trace-divider.in-view path.live{ stroke-dashoffset: 0; }

/* scroll reveal */
.reveal{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
.reveal-stagger > *{ transition-delay: calc(var(--i, 0) * 80ms); }

/* --------------------------------------------------------------------------
   5. HEADER / NAVIGATION
   -------------------------------------------------------------------------- */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--c-bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.site-header .container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand{
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
  z-index: 2;
}
.brand .node-mark{ width: 26px; height: 26px; flex-shrink: 0; }
.brand .node-mark circle{ fill: none; stroke: var(--c-copper); stroke-width: 1.4; }
.brand .node-mark line{ stroke: var(--c-copper); stroke-width: 1.4; }
.brand .node-mark .n{ fill: var(--c-copper); stroke: none; }
.brand-name{ color: var(--c-silk); font-weight: 500; }
.brand-name .surname{ color: var(--c-silk-muted); }

.header-actions{ display: flex; align-items: center; gap: 1.1rem; z-index: 2; }

.theme-toggle{
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  color: var(--c-silk-muted);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.theme-toggle:hover{ color: var(--c-copper); border-color: var(--c-copper); }
.theme-toggle svg{ width: 16px; height: 16px; }
.theme-toggle .icon-moon{ display: none; }
[data-theme="light"] .theme-toggle .icon-sun{ display: none; }
[data-theme="light"] .theme-toggle .icon-moon{ display: block; }

.menu-btn{
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-silk);
}
.menu-btn .bars{ width: 22px; height: 14px; position: relative; }
.menu-btn .bars span{
  position: absolute; left: 0; right: 0; height: 1.5px; background: var(--c-copper);
  transition: transform 0.35s var(--ease), opacity 0.3s var(--ease), top 0.35s var(--ease);
}
.menu-btn .bars span:nth-child(1){ top: 0; }
.menu-btn .bars span:nth-child(2){ top: 6px; }
.menu-btn .bars span:nth-child(3){ top: 12px; }
[data-nav-open="true"] .menu-btn .bars span:nth-child(1){ top: 6px; transform: rotate(45deg); }
[data-nav-open="true"] .menu-btn .bars span:nth-child(2){ opacity: 0; }
[data-nav-open="true"] .menu-btn .bars span:nth-child(3){ top: 6px; transform: rotate(-45deg); }
[data-nav-open="true"] .menu-btn .label::before{ content: 'CLOSE'; }
.menu-btn .label::before{ content: 'MENU'; }
.menu-btn .label{ font-size: 0; }
.menu-btn .label::before{ font-size: var(--text-xs); }

.nav-overlay{
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--c-overlay);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-h);
}
[data-nav-open="true"] .nav-overlay{
  opacity: 1; visibility: visible;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0s;
}
.nav-overlay-inner{
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xl);
  max-width: var(--container-w);
  margin: 0 auto;
  padding: var(--sp-xl) var(--container-pad);
  width: 100%;
}
.nav-list{ flex: 1 1 420px; }
.nav-list li{
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.nav-list a{
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  font-weight: 500;
  color: var(--c-silk-muted);
  transform: translateY(100%);
  opacity: 0;
  transition: color 0.25s var(--ease), transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
[data-nav-open="true"] .nav-list a{ transform: translateY(0); opacity: 1; }
.nav-list li:nth-child(1) a{ transition-delay: 0.04s; }
.nav-list li:nth-child(2) a{ transition-delay: 0.08s; }
.nav-list li:nth-child(3) a{ transition-delay: 0.12s; }
.nav-list li:nth-child(4) a{ transition-delay: 0.16s; }
.nav-list li:nth-child(5) a{ transition-delay: 0.2s; }
.nav-list li:nth-child(6) a{ transition-delay: 0.24s; }
.nav-list li:nth-child(7) a{ transition-delay: 0.28s; }
.nav-list li:nth-child(8) a{ transition-delay: 0.32s; }
.nav-list li:nth-child(9) a{ transition-delay: 0.36s; }
.nav-list li:nth-child(10) a{ transition-delay: 0.4s; }
.nav-list li:nth-child(11) a{ transition-delay: 0.44s; }
.nav-list a .num{ font-family: var(--f-mono); font-size: var(--text-sm); color: var(--c-silk-faint); }
.nav-list a:hover, .nav-list a.active{ color: var(--c-copper); }
.nav-list a.active .num{ color: var(--c-copper); }

.nav-aside{
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: 0.5rem;
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-md);
}
.nav-aside .status-row{
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--f-mono); font-size: var(--text-xs);
  color: var(--c-silk-muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: var(--sp-md);
}
.status-dot{
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-status);
  box-shadow: 0 0 0 3px rgba(111,191,139,0.18);
  flex-shrink: 0;
}
.nav-aside .clock{ font-family: var(--f-mono); font-size: var(--text-sm); color: var(--c-silk-muted); margin-bottom: var(--sp-lg); }
.nav-aside .clock strong{ color: var(--c-silk); font-weight: 500; }
.nav-social{ display: flex; flex-direction: column; gap: 0.6rem; }
.nav-social a{
  font-family: var(--f-mono); font-size: var(--text-sm); color: var(--c-silk-muted);
  display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--c-border);
}
.nav-social a:hover{ color: var(--c-copper); }

body[data-nav-open="true"]{ overflow: hidden; }

/* --------------------------------------------------------------------------
   6. BUTTONS / TAGS
   -------------------------------------------------------------------------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-strong);
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn-primary{ background: var(--c-copper); color: #0B0F0D; border-color: var(--c-copper); font-weight: 600; }
.btn-primary:hover{ background: var(--c-copper-bright); border-color: var(--c-copper-bright); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-ghost{ color: var(--c-silk); }
.btn-ghost:hover{ border-color: var(--c-copper); color: var(--c-copper); }
.btn svg{ width: 15px; height: 15px; }

.tag{
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  color: var(--c-silk-muted);
}
.tag.on-blue{ color: var(--c-trace-blue); border-color: rgba(var(--c-trace-blue-rgb),0.4); }
.tag.on-copper{ color: var(--c-copper); border-color: rgba(var(--c-copper-rgb),0.4); }
.tag-row{ display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* --------------------------------------------------------------------------
   7. CARDS / BRACKETS
   -------------------------------------------------------------------------- */
.bracket{ position: relative; }
.bracket::before, .bracket::after{
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--c-copper);
  opacity: 0.7;
  transition: all 0.35s var(--ease);
}
.bracket::before{ top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.bracket::after{ bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.bracket:hover::before, .bracket:hover::after{ width: 20px; height: 20px; opacity: 1; }

.card{
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border);
  padding: var(--sp-md);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover{ border-color: var(--c-border-strong); }

.pillar-card .pillar-icon{ width: 40px; height: 40px; margin-bottom: var(--sp-sm); color: var(--c-copper); }
.pillar-card .pillar-icon svg{ width: 100%; height: 100%; }
.pillar-card h3{ margin-bottom: 0.6rem; font-size: var(--text-h4); }
.pillar-card p{ color: var(--c-silk-muted); font-size: var(--text-sm); line-height: 1.6; }
.pillar-card .pillar-link{ margin-top: var(--sp-sm); display: inline-block; }

.project-card{ display: flex; flex-direction: column; height: 100%; }
.project-card .thumb{
  aspect-ratio: 16/10;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  margin-bottom: var(--sp-sm);
  position: relative;
  overflow: hidden;
}
.project-card .thumb svg{ width: 100%; height: 100%; }
.project-card.featured{ grid-column: span 2; }
.project-card.featured .thumb{ aspect-ratio: 21/9; }
@media (max-width: 980px){ .project-card.featured{ grid-column: span 1; } }
.project-card .kicker{ font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-copper); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.project-card h3{ margin-bottom: 0.5rem; }
.project-card p{ color: var(--c-silk-muted); font-size: var(--text-sm); margin-bottom: var(--sp-sm); flex-grow: 1; }
.project-card .card-links{ display: flex; gap: 1.25rem; margin-top: auto; }

.filter-row{ display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: var(--sp-lg); }
.filter-btn{
  font-family: var(--f-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.55rem 1rem; border: 1px solid var(--c-border-strong); color: var(--c-silk-muted);
  border-radius: var(--radius-sm); transition: all 0.25s var(--ease);
}
.filter-btn:hover{ color: var(--c-silk); }
.filter-btn.active{ color: #0B0F0D; background: var(--c-copper); border-color: var(--c-copper); }
.project-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-md); }
@media (max-width: 980px){ .project-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .project-grid{ grid-template-columns: 1fr; } }
.project-grid > .project-card{ transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.project-grid > .project-card.hidden{ display: none; }

/* --------------------------------------------------------------------------
   8. HERO
   -------------------------------------------------------------------------- */
.hero{
  position: relative;
  padding-top: calc(var(--header-h) + var(--sp-xl));
  padding-bottom: var(--sp-2xl);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}
.hero-canvas-wrap{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  opacity: 0.9;
  pointer-events: none;
}
#hero-canvas{ width: 100%; height: 100%; display: block; }
.hero-inner{ position: relative; z-index: 1; max-width: 880px; }
.hero h1{ margin-bottom: var(--sp-md); }
.hero h1 .accent{ color: var(--c-copper); }
.hero .lede{ margin-bottom: var(--sp-lg); }
.hero-ctas{ display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: var(--sp-lg); }
.status-badge{
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--f-mono); font-size: var(--text-xs); letter-spacing: 0.05em;
  color: var(--c-silk-muted); text-transform: uppercase;
  border: 1px solid var(--c-border-strong); padding: 0.55rem 0.9rem; border-radius: var(--radius-sm);
}
.status-dot.pulse{ animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(111,191,139,0.35); }
  50%{ box-shadow: 0 0 0 6px rgba(111,191,139,0); }
}

/* page header for interior pages */
.page-hero{
  padding-top: calc(var(--header-h) + var(--sp-xl));
  padding-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--c-border);
}
.page-hero h1{ max-width: 18ch; }
.page-hero .lede{ margin-top: var(--sp-sm); }

/* --------------------------------------------------------------------------
   9. MARQUEE
   -------------------------------------------------------------------------- */
.marquee{
  border-bottom: 1px solid var(--c-border);
  padding-block: var(--sp-sm);
  overflow: hidden;
  white-space: nowrap;
  background: var(--c-bg-alt);
}
.marquee-track{
  display: inline-flex;
  animation: marquee 34s linear infinite;
}
@keyframes marquee{ from{ transform: translateX(0); } to{ transform: translateX(-50%); } }
.marquee-track span{
  font-family: var(--f-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--c-silk-faint);
  padding-inline: var(--sp-md);
  text-transform: uppercase;
}
.marquee-track span::after{ content: '◆'; margin-left: var(--sp-md); color: var(--c-copper); font-size: 0.6rem; vertical-align: middle; }

/* --------------------------------------------------------------------------
   10. TIMELINE (about)
   -------------------------------------------------------------------------- */
.timeline{ position: relative; padding-left: var(--sp-md); border-left: 1px solid var(--c-border-strong); }
.timeline-item{ position: relative; padding-bottom: var(--sp-lg); }
.timeline-item:last-child{ padding-bottom: 0; }
.timeline-item::before{
  content: ''; position: absolute; left: calc(-1 * var(--sp-md) - 4.5px); top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-bg); border: 1.5px solid var(--c-copper);
}
.timeline-item .t-year{ font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-copper); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.timeline-item h3{ font-size: var(--text-h4); margin-bottom: 0.3rem; }
.timeline-item .t-org{ color: var(--c-silk-muted); font-size: var(--text-sm); margin-bottom: 0.5rem; }
.timeline-item p{ color: var(--c-silk-muted); font-size: var(--text-sm); max-width: 60ch; }
.placeholder-note{
  display: inline-block; margin-top: 0.5rem; font-family: var(--f-mono); font-size: 0.7rem;
  color: var(--c-trace-blue); border: 1px dashed rgba(var(--c-trace-blue-rgb),0.5); padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   11. PUBLICATIONS
   -------------------------------------------------------------------------- */
.pub-filters{ display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--sp-lg); }
.pub-list{ display: flex; flex-direction: column; }
.pub-item{
  display: grid; grid-template-columns: 90px 1fr; gap: var(--sp-md);
  padding-block: var(--sp-md); border-bottom: 1px solid var(--c-border);
}
.pub-item .pub-year{ font-family: var(--f-mono); font-size: var(--text-lg); color: var(--c-copper); }
.pub-item h3{ font-size: var(--text-h4); margin-bottom: 0.4rem; font-family: var(--f-body); font-weight: 600; }
.pub-item .pub-meta{ color: var(--c-silk-muted); font-size: var(--text-sm); margin-bottom: 0.6rem; font-style: italic; }
.pub-item .pub-links{ display: flex; gap: 1.25rem; flex-wrap: wrap; }
@media (max-width: 600px){ .pub-item{ grid-template-columns: 1fr; gap: 0.3rem; } }

/* --------------------------------------------------------------------------
   12. HARDWARE
   -------------------------------------------------------------------------- */
.hw-block{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-xl); align-items: center; padding-block: var(--sp-2xl); border-bottom: 1px solid var(--c-border); }
.hw-block:last-child{ border-bottom: 0; }
.hw-block:nth-child(even) .hw-visual{ order: 2; }
.hw-visual{ aspect-ratio: 4/3; border: 1px solid var(--c-border-strong); background: var(--c-bg-alt); position: relative; }
.hw-visual svg{ width: 100%; height: 100%; }
.spec-list{ display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; margin-block: var(--sp-md); font-family: var(--f-mono); font-size: var(--text-sm); }
.spec-list dt{ color: var(--c-silk-faint); text-transform: uppercase; font-size: var(--text-xs); letter-spacing: 0.05em; }
.spec-list dd{ margin: 0.15rem 0 0; color: var(--c-silk); }
@media (max-width: 860px){
  .hw-block{ grid-template-columns: 1fr; gap: var(--sp-md); }
  .hw-block:nth-child(even) .hw-visual{ order: 0; }
}

/* --------------------------------------------------------------------------
   13. TEACHING / MEDIA
   -------------------------------------------------------------------------- */
.list-row{ display: grid; grid-template-columns: 140px 1fr auto; gap: var(--sp-md); align-items: baseline; padding-block: var(--sp-sm); border-bottom: 1px solid var(--c-border); }
.list-row .lr-term{ font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-copper); text-transform: uppercase; letter-spacing: 0.05em; }
.list-row h4{ margin-bottom: 0.2rem; }
.list-row .lr-sub{ color: var(--c-silk-muted); font-size: var(--text-sm); }
@media (max-width: 700px){ .list-row{ grid-template-columns: 1fr; gap: 0.3rem; } }

.media-grid{ display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-md); }
@media (max-width: 860px){ .media-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .media-grid{ grid-template-columns: 1fr; } }
.media-item .thumb{ aspect-ratio: 4/3; background: var(--c-bg-alt); border: 1px solid var(--c-border); margin-bottom: 0.8rem; display: grid; place-items: center; }
.media-item .thumb svg{ width: 46px; height: 46px; color: var(--c-copper); opacity: 0.7; }
.media-item .m-kicker{ font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-trace-blue); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }

/* --------------------------------------------------------------------------
   14. CV PAGE
   -------------------------------------------------------------------------- */
.cv-sheet{ background: var(--c-bg-elevated); border: 1px solid var(--c-border); padding: var(--sp-xl); }
.cv-sheet h2{ font-size: var(--text-h3); border-bottom: 1px solid var(--c-border-strong); padding-bottom: 0.6rem; margin-bottom: var(--sp-sm); }
.cv-sheet section + section{ margin-top: var(--sp-lg); }
.cv-row{ display: flex; justify-content: space-between; gap: var(--sp-md); padding-block: 0.6rem; border-bottom: 1px solid var(--c-border); }
.cv-row .cv-what strong{ display: block; font-weight: 600; }
.cv-row .cv-what span{ color: var(--c-silk-muted); font-size: var(--text-sm); }
.cv-row .cv-when{ font-family: var(--f-mono); font-size: var(--text-sm); color: var(--c-silk-faint); white-space: nowrap; }
@media (max-width: 640px){ .cv-sheet{ padding: var(--sp-md); } .cv-row{ flex-direction: column; gap: 0.2rem; } }

/* --------------------------------------------------------------------------
   15. CONTACT
   -------------------------------------------------------------------------- */
.contact-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-xl); }
@media (max-width: 860px){ .contact-grid{ grid-template-columns: 1fr; } }
.contact-channel{ display: flex; justify-content: space-between; align-items: center; padding-block: var(--sp-sm); border-bottom: 1px solid var(--c-border); }
.contact-channel .cc-label{ font-family: var(--f-mono); font-size: var(--text-xs); text-transform: uppercase; color: var(--c-silk-faint); letter-spacing: 0.06em; }
.contact-channel .cc-value{ font-size: var(--text-lg); }
.copy-btn{ font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-copper); border: 1px solid rgba(var(--c-copper-rgb),0.4); padding: 0.35rem 0.7rem; border-radius: var(--radius-sm); }
.copy-btn:hover{ background: var(--c-copper); color: #0B0F0D; }

.field{ margin-bottom: var(--sp-sm); }
.field label{ display: block; font-family: var(--f-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-silk-muted); margin-bottom: 0.5rem; }
.field input, .field textarea{
  width: 100%; border: 1px solid var(--c-border-strong); background: var(--c-bg-alt);
  padding: 0.85rem 1rem; border-radius: var(--radius-sm); color: var(--c-silk); font-size: var(--text-body);
  transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus{ border-color: var(--c-copper); }
.field textarea{ min-height: 140px; resize: vertical; }
.form-note{ font-size: var(--text-xs); color: var(--c-silk-faint); margin-top: 0.75rem; }
.form-status{ margin-top: 1rem; font-family: var(--f-mono); font-size: var(--text-sm); }
.form-status.ok{ color: var(--c-status); }

/* --------------------------------------------------------------------------
   16. CTA BAND / FOOTER
   -------------------------------------------------------------------------- */
.cta-band{ text-align: center; padding-block: var(--sp-2xl); }
.cta-band h2{ max-width: 20ch; margin-inline: auto; margin-bottom: var(--sp-md); }
.cta-band .btn{ margin-inline: auto; }

.site-footer{ padding-block: var(--sp-xl) var(--sp-md); }
.footer-top{ display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-md); margin-bottom: var(--sp-xl); }
.footer-brand p{ color: var(--c-silk-muted); font-size: var(--text-sm); max-width: 34ch; margin-top: 0.75rem; }
.footer-col h4{ font-family: var(--f-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-silk-faint); margin-bottom: 0.9rem; }
.footer-col ul li{ margin-bottom: 0.55rem; }
.footer-col a{ color: var(--c-silk-muted); font-size: var(--text-sm); }
.footer-col a:hover{ color: var(--c-copper); }
.footer-bottom{ display: flex; justify-content: space-between; align-items: center; padding-top: var(--sp-md); border-top: 1px solid var(--c-border); font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-silk-faint); flex-wrap: wrap; gap: 1rem; }
@media (max-width: 860px){ .footer-top{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-top{ grid-template-columns: 1fr; } }

.back-to-top{
  position: fixed; right: var(--sp-md); bottom: var(--sp-md); z-index: 40;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--c-border-strong); background: var(--c-bg-elevated);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.3s var(--ease);
}
.back-to-top.visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover{ border-color: var(--c-copper); color: var(--c-copper); }
.back-to-top svg{ width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   17. 404
   -------------------------------------------------------------------------- */
.error-page{ min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--sp-xl) var(--container-pad); }
.error-page .code{ font-family: var(--f-mono); font-size: var(--text-xs); color: var(--c-copper); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--sp-sm); }
.error-page h1{ margin-bottom: var(--sp-sm); }

/* --------------------------------------------------------------------------
   18. UTILITIES
   -------------------------------------------------------------------------- */
.sr-only{ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mt-lg{ margin-top: var(--sp-lg); }
.mt-md{ margin-top: var(--sp-md); }
.center{ text-align: center; }

/* --------------------------------------------------------------------------
   19. PRINT (CV page especially)
   -------------------------------------------------------------------------- */
@media print{
  .site-header, .nav-overlay, .marquee, .back-to-top, .site-footer, .cta-band, .board-grid, .no-print{ display: none !important; }
  body{ background: #fff; color: #000; }
  .cv-sheet{ border: none; padding: 0; }
  a{ color: #000; }
  .page-hero{ padding-top: 1rem; border: none; }
}
