/* ==========================================================================
   Divine Enow · personal site
   Palette matches the headshot and LinkedIn banner (slate + steel blue).
   ========================================================================== */

/* ---------- Fonts (self-hosted, IBM Plex, SIL Open Font License) ---------- */
@font-face { font-family: "Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Design tokens ---------- */
:root {
  --ink: #1b2634;          /* headings, main text */
  --ink-2: #3a4757;        /* body copy */
  --muted: #5d6b7d;        /* secondary text */
  --accent: #3f5a78;       /* steel blue */
  --accent-strong: #2f4760;
  --accent-soft: #e3e9f0;
  --line: #d5dce5;
  --bg: #f5f7fa;
  --bg-alt: #eaeff4;
  --surface: #ffffff;
  --hero-1: #e1e6ec;
  --hero-2: #aeb9c7;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27, 38, 52, .05), 0 8px 24px rgba(27, 38, 52, .06);
  --shadow-lg: 0 2px 6px rgba(27, 38, 52, .06), 0 18px 40px rgba(27, 38, 52, .10);
  --wrap: 1120px;
  --gutter: 20px;
  --header-h: 64px;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(245, 247, 250, .82); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 18px rgba(27, 38, 52, .05); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .5px; }
.brand:hover { color: var(--ink); }

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.nav-list a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-list a:hover { background: var(--accent-soft); color: var(--ink); }
.nav-list a.active { color: var(--accent); }
.nav-list .nav-cta a { background: var(--ink); color: #fff; margin-left: 6px; }
.nav-list .nav-cta a:hover { background: var(--accent-strong); color: #fff; }

.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; padding: 0; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform .25s, background .25s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 15.5px; text-decoration: none; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .2s; line-height: 1.2; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .55); color: var(--ink); border-color: rgba(63, 90, 120, .35); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--accent); }
.chip { display: inline-block; font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: var(--accent-soft); border-radius: 999px; padding: 4px 12px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.eyebrow, .section-head .eyebrow, .contact-inner .eyebrow { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse 80% 90% at 70% 30%, var(--hero-1) 0%, #d3dae2 45%, var(--hero-2) 100%);
  padding: 72px 0 84px;
}
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(27, 38, 52, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(27, 38, 52, .05) 1px, transparent 1px); background-size: 36px 36px; }
.hero-grid-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 52%, #000 68%); mask-image: linear-gradient(90deg, transparent 0%, transparent 52%, #000 68%); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.4vw, 60px); letter-spacing: -.02em; margin-bottom: 10px; }
.hero .tagline { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; color: var(--ink); line-height: 1.25; margin: 0 0 18px; }
.hero .tagline span { color: var(--accent); }
.hero .lede { font-size: 18px; max-width: 560px; color: var(--ink-2); margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-photo { position: relative; justify-self: center; width: 100%; max-width: 380px; }
.hero-photo .frame { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 1 / 1; background: var(--hero-1); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo .badge { position: absolute; left: -18px; bottom: 26px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 500; color: var(--ink); max-width: 250px; line-height: 1.35; }
.badge-dot { width: 9px; height: 9px; border-radius: 50%; background: #3b8f6a; box-shadow: 0 0 0 4px rgba(59, 143, 106, .15); flex: none; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); }
.section-head p { color: var(--muted); font-size: 17.5px; margin: 0; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-text p { font-size: 17.5px; }
.about-text p:first-child { font-size: 19px; color: var(--ink); }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px; box-shadow: var(--shadow); }
.fact { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { font-family: var(--mono); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.fact dd { margin: 0; color: var(--ink); font-weight: 500; line-height: 1.45; }
.fact dd small { display: block; font-weight: 400; color: var(--muted); font-size: 14.5px; }

/* Focus areas */
.focus-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.focus-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.focus-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c5cfdb; }
.focus-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.focus-icon svg { width: 24px; height: 24px; }
.focus-card h3 { font-size: 17.5px; margin-bottom: 8px; }
.focus-card p { font-size: 15px; color: var(--muted); margin: 0; line-height: 1.55; }

/* Research */
.research-list { display: grid; gap: 20px; }
.research-item { display: grid; grid-template-columns: 240px 1fr; gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); align-items: start; }
.research-item h3 { font-size: 19.5px; line-height: 1.35; margin-bottom: 8px; }
.research-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14.5px; color: var(--muted); margin-bottom: 12px; }
.status { font-family: var(--mono); font-size: 12px; letter-spacing: .8px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: #fdf3e1; color: #8a5a12; font-weight: 500; }
.status.ongoing { background: #e4f3ec; color: #2c6e50; }
.research-item p { font-size: 16px; margin-bottom: 14px; }

/* Media slot (image with branded fallback) */
.media { position: relative; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #dfe6ee 0%, #c3cdd9 100%); aspect-ratio: 16 / 10; }
.media::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(27, 38, 52, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(27, 38, 52, .06) 1px, transparent 1px); background-size: 22px 22px; }
.media::after { content: attr(data-initials); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-weight: 500; font-size: 30px; letter-spacing: 2px; color: rgba(63, 90, 120, .55); }
.media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.research-item .media { aspect-ratio: 4 / 3; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-card .media { border-radius: 0; }
.project-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.project-card .project-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.project-card h3 { font-size: 19.5px; margin-bottom: 8px; }
.project-card p { font-size: 15.5px; color: var(--ink-2); line-height: 1.6; }
.project-card .chips { margin-top: auto; padding-top: 4px; }
.project-card .chip { font-size: 12.5px; padding: 3px 10px; }
.project-links { display: flex; gap: 16px; margin-top: 16px; font-size: 15px; font-weight: 600; }
.project-links a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.project-links a:hover { text-decoration: underline; }
.project-links svg { width: 15px; height: 15px; }

/* Experience */
.xp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 40px; }
.xp-col h3 { font-family: var(--mono); font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 18px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline h4 { font-size: 17.5px; margin-bottom: 2px; }
.timeline .org { color: var(--accent); font-weight: 500; font-size: 15.5px; }
.timeline .when { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.timeline p { font-size: 15.5px; color: var(--muted); margin: 6px 0 0; line-height: 1.55; }

/* Contact */
.contact { background: var(--ink); color: #c9d3de; }
.contact .eyebrow { color: #9fb6cf; }
.contact h2 { color: #fff; font-size: clamp(28px, 3.6vw, 40px); }
.contact-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.contact-inner p { font-size: 18px; color: #c9d3de; margin: 0; }
.contact-links { display: grid; gap: 12px; }
.contact-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; transition: background .2s, border-color .2s; min-width: 0; }
.contact-link:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.contact-link svg { width: 22px; height: 22px; flex: none; color: #9fb6cf; }
.contact-link span { display: flex; flex-direction: column; min-width: 0; }
.contact-link small { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #8ea3ba; }
.contact-link strong { font-weight: 500; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: #141d28; color: #8ea3ba; font-size: 14.5px; padding: 26px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; }
.site-footer a { color: #b8c7d6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* Hidden until JS confirms (CV button, LinkedIn link) */
[hidden] { display: none !important; }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .focus-grid { grid-template-columns: repeat(3, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid-bg { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav { position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px rgba(27, 38, 52, .12); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; }
  .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; padding: 10px var(--gutter) 18px; gap: 2px; }
  .nav-list a { padding: 13px 12px; font-size: 16.5px; }
  .nav-list .nav-cta a { margin: 8px 0 0; text-align: center; }

  .hero { padding: 40px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; max-width: 260px; justify-self: start; }
  .hero-photo .badge { left: auto; right: -70px; bottom: 16px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .research-item { grid-template-columns: 1fr; gap: 18px; }
  .research-item .media { aspect-ratio: 16 / 9; }
  .xp-grid { grid-template-columns: 1fr; gap: 44px; }
  .contact-inner { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 72px 0; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .focus-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .focus-card { padding: 18px 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .hero-photo { max-width: 200px; }
  .hero-photo .badge { position: static; margin-top: 14px; max-width: none; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .section { padding: 60px 0; }
  .section-head { margin-bottom: 32px; }
}
@media (max-width: 560px) {
  .focus-grid { grid-template-columns: 1fr; gap: 10px; }
  .focus-card { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; align-items: start; padding: 16px; }
  .focus-icon { grid-row: span 2; margin: 0; }
  .focus-card h3 { margin-bottom: 4px; }
}
@media (max-width: 340px) {
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
