/* =========================================================
   Dr. Narjes Rohani — academic site
   Palette: pure black / white / grays. Type: a single,
   standard, easy-to-read sans-serif (Inter) used throughout
   for headings, labels, and body text, at a comfortable
   reading size. Signature: brain-as-network motif.
   ========================================================= */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f4f4f2;
  --ink:       #0a0a0a;
  --muted:     #5a5d58;
  --faint:     #8d8f8a;
  --line:      #dcddd8;
  --card:      #ffffff;

  --invert-bg:    #0a0a0a;
  --invert-ink:   #f4f4f2;
  --invert-muted: #9a9c96;
  --invert-line:  #2a2b27;

  --max: 1160px;
  --sans:  "Inter", Arial, Helvetica, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Headings and labels use the same standard font as the body for consistency and readability. */
  --serif: var(--sans);
  --mono:  var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 18px;
}
a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
::selection { background: var(--ink); color: var(--bg); }

.container { width: min(var(--max), calc(100% - 44px)); margin: 0 auto; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.22rem;
  letter-spacing: -.01em;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.brand .mark { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 3px;
}
.nav a:hover, .nav a.active { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.menu-toggle { display: none; border: 1px solid var(--line); background: transparent; font-size: 1.1rem; padding: 6px 11px; border-radius: 4px; font-family: var(--mono); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -.01em; font-weight: 700; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 1em; }
.lead { font-size: 1.25rem; max-width: 700px; color: var(--ink); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

.eyebrow {
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ">"; color: var(--ink); font-weight: 700; }

/* ---------- buttons ---------- */
.actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 3px;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink);
  font-family: var(--mono); font-size: .92rem; font-weight: 500; letter-spacing: .02em;
}
.button:hover { background: #262622; text-decoration: none; }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { background: var(--bg-soft); }
.button.on-dark { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); }
.button.on-dark:hover { background: #d8d8d4; }
.button.ghost-on-dark { background: transparent; color: var(--invert-ink); border-color: var(--invert-line); }
.button.ghost-on-dark:hover { background: rgba(255,255,255,.06); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.28fr .9fr; gap: 60px; padding: 78px 0 84px; align-items: center; }
.hero-text .tagline-code {
  display: inline-block; font-family: var(--mono); font-size: .88rem; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line); padding: 4px 10px; border-radius: 3px; margin: 22px 0 0;
}
.hero-visual { position: relative; }
.hero-visual svg { width: 100%; height: auto; display: block; }
.neuron { fill: var(--ink); }
.syn { stroke: var(--muted); stroke-width: 1; opacity: .55; }
.trace { stroke: var(--ink); stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pad { fill: var(--ink); }
.brain-outline { fill: none; stroke: var(--line); stroke-width: 1.4; stroke-dasharray: 3 4; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.35); } }
.neuron { transform-box: fill-box; transform-origin: center; animation: pulse 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .neuron { animation: none; } }
.hero-visual .cap {
  font-family: var(--mono); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  fill: var(--faint);
}

/* ---------- sections ---------- */
.section { padding: 76px 0; }
.section.tight { padding: 56px 0; }
.section-heading { margin-bottom: 34px; max-width: 680px; }
.alt {
  background: var(--invert-bg);
  color: var(--invert-ink);
}
.alt .eyebrow { color: var(--invert-muted); }
.alt .eyebrow::before { color: var(--invert-ink); }
.alt h2 { color: var(--invert-ink); }
.alt a { color: var(--invert-ink); text-decoration-color: var(--invert-line); }
.alt .muted { color: var(--invert-muted); }

/* ---------- cards ---------- */
.cards { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--card); padding: 30px 28px; position: relative; }
.number { font-family: var(--mono); color: var(--faint); font-size: .88rem; letter-spacing: .04em; }
.card p { color: var(--muted); }
.card a { font-family: var(--mono); font-size: .92rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.tag {
  font-family: var(--mono); font-size: .82rem; letter-spacing: .03em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); padding: 3px 8px; border-radius: 3px;
}
.alt .tag { border-color: var(--invert-line); color: var(--invert-muted); }
.alt .cards { background: var(--invert-line); border-color: var(--invert-line); }
.alt .card { background: var(--invert-bg); }
.alt .card p { color: var(--invert-muted); }

/* ---------- split / publications ---------- */
.split { display: grid; grid-template-columns: .55fr 1fr; gap: 60px; }
.publication-list article { display: grid; grid-template-columns: 78px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--invert-line); }
.publication-list article:first-child { padding-top: 0; }
.pub-year { font-family: var(--mono); color: var(--invert-muted); font-weight: 500; font-size: .92rem; }
.pub-year::before { content: "$ "; }
.publication-list h3 { margin-top: 0; color: var(--invert-ink); font-size: 1.05rem; }
.publication-list p { color: var(--invert-muted); font-size: .93rem; margin-bottom: 6px; }
.publication-list a { font-family: var(--mono); font-size: .88rem; }

/* ---------- footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer-wrap { display: flex; justify-content: space-between; gap: 25px; align-items: center; flex-wrap: wrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--mono); font-size: .88rem; }
.footer .muted { font-family: var(--mono); font-size: .88rem; }

/* ---------- inner pages ---------- */
.page { padding: 70px 0 90px; }
.page-header { max-width: 780px; margin-bottom: 48px; }
.page-header p { font-size: 1.12rem; color: var(--muted); }
.grid-two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-two > section { background: var(--card); padding: 32px; }
.list-item { padding: 24px 0; border-bottom: 1px solid var(--line); }
.list-item:first-child { padding-top: 0; }
.meta { font-family: var(--mono); color: var(--muted); font-size: .92rem; letter-spacing: .02em; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.gallery figure { margin: 0; background: var(--card); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery figcaption { font-family: var(--mono); font-size: .88rem; color: var(--muted); padding: 10px 12px; border-top: 1px solid var(--line); }
.cv-actions { margin: 22px 0 42px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cv-note { font-family: var(--mono); font-size: .88rem; color: var(--faint); }
.cv-page { padding: 120px 0; text-align: center; }
.cv-page .page-header { margin: 0 auto; }
.cv-page .cv-actions { justify-content: center; margin-top: 30px; }

.divider {
  height: 10px; margin: 0;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 20px);
  opacity: .12;
}

.repo-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.repo { background: var(--card); padding: 22px 28px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.repo h3 { margin: 0 0 4px; font-family: var(--mono); font-size: 1rem; }
.repo p { margin: 0; color: var(--muted); font-size: .92rem; }
.repo a { font-family: var(--mono); font-size: .88rem; white-space: nowrap; }

.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 30px; }
.video-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.video-card p { color: var(--muted); font-size: .95rem; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pill-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pill-links a {
  font-family: var(--mono); font-size: .88rem; border: 1px solid var(--line); padding: 6px 12px; border-radius: 20px; color: var(--muted);
}
.pill-links a:hover { color: var(--ink); border-color: var(--ink); text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero, .split, .cards.three, .grid-two, .gallery, .video-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 46px; gap: 34px; }
  .hero-visual { max-width: 340px; margin: 0 auto; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; align-items: flex-start;
    padding: 14px 22px 22px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 6px; width: 100%; }
  .menu-toggle { display: block; }
  .footer-wrap { align-items: flex-start; flex-direction: column; }
  .repo { grid-template-columns: 1fr; align-items: start; }
}
