/* ════════════════════════════════════════════════════════════════════
   Shouka AI — Executive profile page (people/MReza.html)
   ────────────────────────────────────────────────────────────────────
   Standalone dark / LTR theme. Shares the site's brand tokens but is
   deliberately NOT built on page.css: that file is hard-coded
   direction:rtl + a light theme, which is the opposite of this page.
   Design rules that hold here:
     · gold = ROI only (eyebrows, primary CTA, focus ring, metric
       numerals, timeline markers, years). Never on decorative
       borders, dividers or tiles.
     · mono = labels, dates, tags, legal only.
   ════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* ─── Official Shouka AI brand tokens (single source of truth) ─── */
  --shouka-deep-petrol: #0B3B3C;
  --shouka-teal: #146B68;
  --shouka-gold: #D6A84F;
  --shouka-off-white: #F7F7F2;
  --shouka-dark: #10191A;
  --shouka-text-primary: #1D2929;
  --shouka-text-secondary: #657474;

  /* ─── Dark-theme tokens ───
     Declared as literal dark values on purpose. These must NOT alias
     the light-mode text tokens above, or a brand edit to the light
     theme would silently restyle this dark page. */
  --bg: var(--shouka-dark);
  --surface: #182425;   /* card surface — real separation from --bg */
  --surface-2: #1F2D2E; /* nested fills: pills, quiet chips */
  --line: #334647;      /* divider — carries the grids on cheap panels */
  --text: #F4F7F4;
  --text-muted: #A7B8B6;
  --text-faint: #93A6A4; /* captions, sources, footer tier */
  --accent: var(--shouka-gold);
  --accent-soft: rgba(214, 168, 79, 0.14);
  --accent-2: #9CC7C3;
  --accent-2-soft: rgba(156, 199, 195, 0.14);
  --radius: 4px;
  --maxw: 1120px;
  --header-h: 76px;     /* sticky header height — anchor offsets */
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent-soft); color: var(--accent); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* The filled gold button is gold-on-gold for a gold ring (1.00:1). */
.btn-primary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px);
}

/* ═══ Skip link (mirrors assets/page.css, LTR) ═══ */
.skip-link {
  position: absolute;
  top: -60px;
  left: 1rem;
  z-index: 200;
  background: var(--accent);
  color: #10191A;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ═══ Eyebrow — the strongest brand signal on the page ═══ */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  flex: none;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
}

/* Every nav anchor must clear the sticky header. */
section[id] { scroll-margin-top: var(--header-h); }

/* ══════════════ NAV ══════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 59, 60, 0.88); /* deep petrol — matches site chrome */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.wordmark span { color: var(--accent); }
.wordmark:hover { color: var(--text-muted); }
.wordmark:hover span { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
nav ul a { display: block; padding: 2px 0; }
nav ul a:hover { color: var(--text); }

/* Under 720px the nav becomes a scrollable chip row — never hidden.
   This page is usually opened on a phone from a sent link. */
@media (max-width: 720px) {
  .nav-inner {
    padding: 14px clamp(20px, 5vw, 32px) 10px;
    flex-wrap: wrap;
    gap: 10px;
  }
  nav {
    flex: 1 0 100%;
    margin: 0 calc(-1 * clamp(20px, 5vw, 32px));
    padding: 0 clamp(20px, 5vw, 32px);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav ul {
    width: max-content;
    white-space: nowrap;
    gap: 10px;
    padding-bottom: 6px;
  }
  nav ul li {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 5px 13px;
  }
  nav ul a:hover { color: var(--text); }
}

/* ══════════════ HERO ══════════════ */
.hero {
  padding: clamp(44px, 7vw, 64px) 0 clamp(44px, 6vw, 72px);
  border-top: none;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  margin: 18px 0 20px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-lede {
  font-size: clamp(16.5px, 1.1vw + 14px, 18px);
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 32px;
  text-wrap: pretty;
}
.hero-lede em { font-style: normal; color: var(--text); }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 13px 20px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #10191A;
  border-color: var(--accent);
  font-weight: 500;
}
.btn-ghost:hover { border-color: var(--text-faint); }

@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover { transform: translateY(-1px); }
}

/* ─── Hero metrics panel (replaces the old pipeline diagram) ───
   Same box treatment as the diagram: surface, border, radius.
   The panel owns the two grid tracks so that all three .metric rows
   share ONE numeral column — each row used to size its own `auto`
   track, which is why the labels started at three different x. */
.hero-metrics {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--inset-hi);
  padding: clamp(20px, 3vw, 30px) clamp(16px, 2.5vw, 26px);
  display: grid;
  grid-template-columns: auto 1fr;
}
/* `subgrid` inherits those same tracks, so the widest numeral sizes the
   column for every row and the labels line up exactly. The `auto 1fr`
   line above is the pre-subgrid fallback. Keep the numerals short: a long
   figure widens this one column for all rows, which is why `Up to 70%`
   became `70%` with the hedge moved into the label. */
.metric {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-columns: subgrid;
  gap: 4px 18px;
  /* `center`, not `baseline`. Both the numeral and the body share the one
     implicit row, so that row is as tall as the label+source block and
     the numeral lands on the block's optical centre. `baseline` pinned it
     to the label's FIRST baseline instead, which rides high against a
     two-line label+source block (−15px at 1280). Because the row grows
     with the block, a label that wraps to two lines still centres. */
  align-items: center;
  padding: 14px 0;
}
.metric + .metric { border-top: 1px solid var(--line); }
.metric-num { grid-column: 1; grid-row: 1; }
.metric-body { grid-column: 2; }
.metric-label {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text);
}
.metric-src {
  margin-top: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-wrap: pretty;
}
/* At phone widths a side-by-side number + label squeezes the label
   to a few characters per line — stack instead. */
@media (max-width: 520px) {
  .metric { grid-template-columns: 1fr; gap: 4px; }
  .metric-num, .metric-body { grid-column: 1; grid-row: auto; }
}

/* credential line under hero */
.credential-line {
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.credential-line .dot { color: var(--text-faint); }
@media (max-width: 560px) {
  .credential-line { flex-direction: column; gap: 6px; }
  .credential-line .dot { display: none; }
}

/* ══════════════ SECTION SHELL ══════════════ */
section {
  padding: clamp(56px, 8vw, 88px) 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  margin-top: 10px;
  text-wrap: balance;
}
.section-intro {
  max-width: 58ch;
  color: var(--text-muted);
  font-size: clamp(15px, 0.6vw + 13px, 16px);
  text-wrap: pretty;
}

/* ══════════════ IMPACT ══════════════ */
/* Tabular data — a hairline lattice is the right construction here. */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* Equalise the rows explicitly so the source rules of every cell in
     a row land on one line, whatever the numerals and descriptions do. */
  grid-auto-rows: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 900px) { .impact-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .impact-grid { grid-template-columns: 1fr; } }
/* 3 + 2 leaves a dead slot — let the last cell span it rather than
   show an empty block. */
@media (min-width: 641px) and (max-width: 900px) {
  .impact-grid .impact-cell:last-child { grid-column: span 2; }
}
/* Flex column + margin-top:auto on .impact-src decouples the source rule
   from the content above it: the rule is pinned to the bottom of the
   cell, so its y position depends only on the row height — never on how
   many lines the numeral or the description happens to wrap to. */
.impact-cell {
  background: var(--surface);
  box-shadow: var(--inset-hi);
  padding: clamp(20px, 2.5vw, 26px) clamp(16px, 2vw, 20px);
  display: flex;
  flex-direction: column;
}
.impact-num {
  font-family: 'IBM Plex Mono', monospace;
  /* Every figure is now 3–4 chars ("70%", "0.2%"), so the panel reads as one
     even column. Kept as a single clamp shared by the hero numerals and
     these — do not fork it. Longest figure is 0.2%, 4 mono chars = 2.4em:
     ceiling 32px → 77px against a 170px content box at the widest layout,
     floor 24px → 58px against a 127px content box at 901px, the tightest
     5-column cell. */
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
  /* A figure is one atomic value. Never let it break onto two lines and
     change the row rhythm — here and in the hero panel. */
  white-space: nowrap;
}
.impact-num span { color: var(--accent); }
.impact-desc {
  margin: 10px 0 14px;
  font-size: clamp(14px, 0.5vw + 12.5px, 15px);
  color: var(--text-muted);
  line-height: 1.55;
  text-wrap: pretty;
}
/* margin-top:auto absorbs every pixel of leftover height; the 14px the
   description contributes below keeps the 25px (14 + 11) breathing
   room under the description even when it is one short line.
   The reserved min-height is the other half of the fix: source strings
   wrap to one, two or three lines depending on how narrow the cell is,
   and because the box is bottom-pinned a taller box would lift its own
   rule. Reserving the number of lines the current cell width can actually
   produce makes every source box the same height, so every rule in the
   row lands on the same y — while description length, which varies far
   more, is absorbed by the auto margin above.
   Two lines is the ceiling everywhere the grid has more than one column;
   the 901–1010px query covers the narrow five-column band, where
   "Sharif Hamrah Pazhohan · 2022–2023" breaks to three. Measured: three
   lines up to 1005px, two from 1007px. Below 641px there is one cell per
   row, so nothing has to line up and no space is reserved. If a source
   string is ever made longer, widen the band to the width at which it
   stops wrapping. */
.impact-src {
  --src-lines: 2;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.65;
  min-height: calc(var(--src-lines) * 1.65em + 12px); /* + 11px pad + 1px rule */
  letter-spacing: 0.07em;
  color: var(--text-faint);
  text-wrap: pretty;
}
@media (min-width: 901px) and (max-width: 1010px) {
  .impact-src { --src-lines: 3; }
}
@media (max-width: 640px) { .impact-src { --src-lines: 0; } }

/* ══════════════ PILLARS ══════════════ */
/* Prose capability statements — real cards, not a lattice. */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 20px);
}
@media (max-width: 960px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--inset-hi);
  padding: clamp(22px, 2.5vw, 30px) clamp(18px, 2vw, 24px);
  display: flex;
  flex-direction: column;
}
.pillar-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.pillar h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  text-wrap: balance;
}
.pillar p {
  font-size: clamp(14.5px, 0.5vw + 13px, 15.5px);
  color: var(--text-muted);
  line-height: 1.7;
  text-wrap: pretty;
}

/* ══════════════ TIMELINE ══════════════ */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.tl-item {
  position: relative;
  padding-bottom: clamp(34px, 4vw, 44px);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.04em;
}
.tl-role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 600;
  margin: 8px 0 2px;
  text-wrap: balance;
}
.tl-org {
  font-size: 14.5px;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.tl-item ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 68ch;
}
.tl-item li {
  font-size: clamp(15px, 0.5vw + 13.5px, 15.5px);
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  text-wrap: pretty;
}
.tl-item li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-faint);
}
.tl-item li strong { color: var(--text); font-weight: 500; }

/* ══════════════ RESEARCH ══════════════ */
.pubs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.pub {
  background: var(--surface);
  box-shadow: var(--inset-hi);
  padding: 22px clamp(18px, 2vw, 24px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(12px, 2vw, 20px);
  align-items: start;
}
.pub-year {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  justify-self: start;
  white-space: nowrap;
}
.pub-title {
  font-size: clamp(15px, 0.6vw + 13.5px, 16px);
  font-weight: 600;
  margin-bottom: 5px;
  text-wrap: pretty;
}
.pub-venue {
  font-size: 13.5px;
  color: var(--text-faint);
  font-style: italic;
  text-wrap: pretty;
}

.edu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 640px) { .edu-row { grid-template-columns: 1fr; } }
.edu-cell {
  background: var(--surface);
  box-shadow: var(--inset-hi);
  padding: 20px clamp(18px, 2vw, 24px);
}
.edu-degree {
  font-size: clamp(15px, 0.6vw + 13.5px, 16px);
  font-weight: 600;
  margin-bottom: 5px;
  text-wrap: balance;
}
.edu-school { font-size: 14.5px; color: var(--text-muted); }
.edu-year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-top: 7px;
}

/* ══════════════ CTA ══════════════ */
.cta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--inset-hi);
  padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 48px);
  text-align: center;
}
.cta h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  text-wrap: balance;
}
.cta p {
  color: var(--text-muted);
  max-width: 54ch;
  margin: 0 auto 32px;
  font-size: clamp(15.5px, 0.5vw + 14px, 16.5px);
  text-wrap: pretty;
}
.cta .eyebrow { justify-content: center; margin-bottom: 18px; }
.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.print-action { margin-top: 24px; }

footer {
  padding: 36px 0 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

/* ══════════════ REDUCED MOTION ══════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
  .btn-primary:hover { transform: none; }
}

/* ══════════════ PRINT (forwarding as PDF is a real use) ══════════════ */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f6f4;
    --line: #c9d1ce;
    --text: #16211f;
    --text-muted: #465352;
    --text-faint: #5c6a69;
    --accent: #8a6410;
    --accent-2: #245f5c;
    color-scheme: light;
  }
  html { scroll-behavior: auto; }
  body { background: #fff; color: #16211f; font-size: 11pt; line-height: 1.5; }

  header, .skip-link, .hero-actions, .cta-actions, .print-action, footer { display: none !important; }

  .wrap { max-width: none; padding: 0; }
  .hero { padding: 0 0 18pt; }
  section { padding: 16pt 0; border-top: 1px solid var(--line); break-inside: auto; }
  .section-head { margin-bottom: 14pt; }

  .hero-metrics, .pillar, .impact-cell, .pub, .edu-cell, .cta {
    background: #fff !important;
    box-shadow: none;
    break-inside: avoid;
  }
  .tl-item { break-inside: avoid; padding-bottom: 14pt; }
  .tl-item::before { background: #fff; }
  .eyebrow { color: var(--accent); }
  .eyebrow::before { box-shadow: none; }
  .credential-line { border-top-color: var(--line); }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #465352; }
}