/* ==========================================================================
   Philip Obhenimen John — Portfolio
   Mobile-first: base styles target phones, media queries scale up.
   Type system: serif display (Instrument Serif), mono labels (JetBrains Mono),
   sans body (Inter). Loaded from Google Fonts in each page's <head>.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f1efeb;
  --text: #1b1a18;
  --text-muted: #5f5c57;
  --border: #e5e2dc;
  --accent: #c2410c;          /* flame orange — nod to combustion research */
  --accent-soft: #fdeee4;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 20px rgb(0 0 0 / 0.06);

  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 12px;
  --gutter: 16px;
  --max-w: 1120px;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110;
    --surface: #1a1918;
    --surface-2: #242220;
    --text: #efece6;
    --text-muted: #a29e96;
    --border: #2f2c29;
    --accent: #fb923c;
    --accent-soft: #2b1b10;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #121110;
  --surface: #1a1918;
  --surface-2: #242220;
  --text: #efece6;
  --text-muted: #a29e96;
  --border: #2f2c29;
  --accent: #fb923c;
  --accent-soft: #2b1b10;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Typography ---------- */
h1, h2, .serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
h3 { font-weight: 600; letter-spacing: -0.01em; }
em.accent, .accent { color: var(--accent); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: 64px; }
.section-title { font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.1; margin-bottom: 12px; }
.section-lead { color: var(--text-muted); margin-bottom: 32px; max-width: 62ch; }

/* "01 — About ──────" numbered section label */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 20px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}
.mono { font-family: var(--font-mono); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.skip-link:focus { left: 8px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 12px; }
.brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;               /* 44px = minimum comfortable touch target */
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* Mobile: links live in a dropdown panel */
.nav-links {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) 16px;
  list-style: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.nav-links.is-open { transform: none; opacity: 1; visibility: visible; }
.nav-links a {
  display: block;
  padding: 13px 4px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}
.nav-links li:last-child a { border-bottom: 0; }
.nav-links a[aria-current="page"], .nav-links a.is-active { color: var(--accent); }

.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }

/* ---------- Hero ---------- */
.hero { padding-block: 48px 64px; }
.hero-inner { display: grid; gap: 28px; }
.hero-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(3rem, 13vw, 6rem); line-height: 0.95; letter-spacing: -0.02em; }
.hero h1 em { display: block; font-style: italic; color: var(--accent); }
.hero-tagline {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-top: 20px;
  max-width: 56ch;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #1a0e05; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #1a0e05; } }

/* "Open to roles" callout */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 14px 16px;
  max-width: 620px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.callout-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgb(34 197 94 / 0.18);
}
.callout strong { color: var(--text); }
.callout a { font-weight: 600; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 40px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 16px; background: var(--surface); }
.stat-num { font-family: var(--font-serif); font-size: 2.2rem; line-height: 1; }
.stat-label { margin-top: 6px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.35; }

/* ---------- About ---------- */
.statement { font-size: clamp(2.4rem, 10vw, 3.6rem); line-height: 1.05; }
.statement em { font-style: italic; color: var(--accent); }
.about-grid { display: grid; gap: 28px; }
.pillars { display: grid; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 40px; overflow: hidden; }
.pillar { padding: 20px; background: var(--surface); }
.pillar + .pillar { border-top: 1px solid var(--border); }
.pillar h3 { font-family: var(--font-serif); font-weight: 400; font-style: italic; font-size: 1.6rem; color: var(--accent); }
.pillar p { margin-top: 6px; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); line-height: 1.8; }

/* ---------- Research pipeline (CFD → ROM → ML → GenAI) ---------- */
.section-title em { font-style: italic; }
.pipeline { list-style: none; padding: 0; display: grid; gap: 28px; margin-bottom: 32px; }
.step {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* arrow to the next step: down on mobile, right on desktop */
.step:not(:last-child)::after {
  content: "↓";
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}
.step-num { font-family: var(--font-serif); font-size: 2.6rem; line-height: 1; color: var(--accent); }
.step .card-meta { margin: 10px 0 4px; }
.step h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.55rem; line-height: 1.15; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.93rem; }
.step .step-metric {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

/* ---------- Toolkit (keyword groups recruiters scan) ---------- */
.toolkit { display: grid; gap: 1px; margin-top: 16px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.toolkit > div { padding: 14px 16px; background: var(--surface); }
.toolkit dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.toolkit dd { margin: 4px 0 0; font-size: 0.93rem; }

.timeline-note { font-size: 0.88rem; color: var(--text-muted); }
.about-cols { display: grid; gap: 0 48px; }

/* ---------- Expertise ---------- */
.expertise { display: grid; gap: 16px; }
.card.skill h3 { font-size: 1.8rem; }
.card .skill-lead { color: var(--text); font-size: 1rem; margin-top: 4px; }
.proof { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 12px; }
.proof li { position: relative; padding-left: 20px; font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; }
.proof li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.proof a { font-weight: 600; }
.skill-featured {
  gap: 8px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background:
    radial-gradient(120% 90% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
}
.card.skill-featured h3 { font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1.05; }
.skill-featured .card-meta { color: var(--accent); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; }
.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.card h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.5rem; line-height: 1.2; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }
.card-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.card-link { margin-top: auto; padding-top: 16px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); text-decoration: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 0; list-style: none; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ---------- Numbered project list ---------- */
.project-list { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.project-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 12px;
  padding: 24px 4px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background 0.2s, padding 0.2s;
}
.project-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); padding-top: 10px; }
.project-row h3 { font-family: var(--font-serif); font-weight: 400; font-size: 2rem; line-height: 1.15; transition: color 0.2s; }
.project-row p { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }
.project-side { grid-column: 2; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.project-arrow { display: none; }
.project-row:hover h3 { color: var(--accent); }

/* ---------- Timeline (experience) ---------- */
.timeline { list-style: none; padding: 0; display: grid; gap: 20px; }
.timeline li { padding-left: 20px; border-left: 1px solid var(--border); position: relative; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-date { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

/* ---------- Publications ---------- */
.pubs { list-style: none; padding: 0; display: grid; gap: 14px; }
.pub { padding: 18px 20px; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 4px var(--radius) var(--radius) 4px; }
.pub-title { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.3; }
.pub-title a { color: var(--text); text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.pub-title a:hover { color: var(--accent); }
.pub-meta { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; }
.pub-meta em { color: var(--text); }

/* ---------- News ---------- */
.news { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.news li { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.news time { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }

/* ---------- Detail pages (project / research) ---------- */
.page-hero { padding-block: 40px 24px; }
.page-hero h1 { font-size: clamp(2.6rem, 10vw, 4.2rem); line-height: 1.02; }
.page-hero .hero-tagline { margin-top: 16px; }
.back-link { display: inline-block; margin-bottom: 24px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.9rem; line-height: 1.15; margin: 40px 0 10px; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.2em; margin-top: 8px; }
.prose li + li { margin-top: 6px; }
.prose .tags { padding-left: 0; margin-top: 24px; }
.prose .tags li + li { margin-top: 0; }
.media-frame {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-block: 24px;
}
.media-frame video, .media-frame img { width: 100%; height: 100%; object-fit: cover; }
/* Real media keeps its own aspect ratio (videos here are 4:3, 16:10, and portrait) */
.media-figure { margin-block: 28px; }
.media-figure video, .media-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #4a4a4a;   /* matches the ParaView grey so the poster-to-video swap is seamless */
}
.media-figure.is-portrait video, .media-figure.is-portrait img { max-width: 420px; margin-inline: auto; }
.media-figure figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--text-muted); max-width: 70ch; }
.media-figure.is-portrait figcaption { text-align: center; margin-inline: auto; }
.media-figure.is-banner img { max-width: 640px; margin-inline: auto; background: none; }
.media-figure.is-banner figcaption { text-align: center; margin-inline: auto; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-block: 24px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact { padding: 12px 14px; background: var(--surface); }
.fact dt { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.fact dd { margin: 4px 0 0; font-weight: 600; font-size: 0.95rem; }

/* ---------- Contact / footer ---------- */
.contact-big { font-size: clamp(2.4rem, 10vw, 4rem); line-height: 1.05; margin-bottom: 20px; }
.contact-big em { font-style: italic; color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; }
.site-footer { padding-block: 28px; border-top: 1px solid var(--border); color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Back to top (inserted by main.js) ---------- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top svg { width: 18px; height: 18px; }

/* ---------- Scroll reveal (enabled by JS only, so no-JS users see everything) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Breakpoints — scale up from mobile
   ========================================================================== */

/* Small tablets */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .pillar + .pillar { border-top: 0; border-left: 1px solid var(--border); }
  .news li { grid-template-columns: 110px 1fr; gap: 16px; }
  .toolkit { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: inline nav, side-by-side hero */
@media (min-width: 860px) {
  :root { --header-h: 68px; }
  .section { padding-block: 96px; }

  .menu-toggle { display: none; }
  .nav-links {
    position: static;
    flex-direction: row;
    gap: 2px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav-links a { padding: 8px 12px; border: 0; border-radius: 8px; font-size: 0.72rem; color: var(--text-muted); }
  .nav-links a:hover { color: var(--text); background: var(--surface-2); }

  .hero { padding-block: 96px 104px; }
  .hero-inner { grid-template-columns: 1fr auto; align-items: start; gap: 56px; }
  .hero-photo { width: 200px; height: 200px; order: 2; margin-top: 12px; }

  .about-grid { grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }

  .project-row { grid-template-columns: 64px 1fr 220px 32px; align-items: baseline; padding: 28px 8px; }
  .project-row:hover { background: var(--surface); padding-left: 16px; }
  .project-row h3 { font-size: 2.4rem; }
  .project-side { grid-column: auto; text-align: right; }
  .project-arrow { display: block; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s; }
  .project-row:hover .project-arrow { transform: translateX(4px); }
  .project-num { padding-top: 0; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .research-grid { grid-template-columns: repeat(2, 1fr); }

  .expertise { grid-template-columns: repeat(6, 1fr); }
  .skill { grid-column: span 2; }
  .skill-wide { grid-column: span 3; }
  .skill-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 5fr 7fr; gap: 48px; padding: 32px; }

  .pipeline { grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .step:not(:last-child)::after { content: "→"; left: auto; right: -21px; top: 50%; bottom: auto; transform: translateY(-50%); }
  .toolkit { grid-template-columns: repeat(3, 1fr); }
  .about-cols { grid-template-columns: 1fr 1fr; }
  .skill-featured .proof { margin-top: 0; }
}
