/* =========================================================================
   themehedihasan.com — design system (spec 001)
   Tokens → base → layout → components → page blocks → themes → motion
   ========================================================================= */

/* ---------- Tokens ------------------------------------------------------ */
:root {
  color-scheme: light dark;

  --bg: #faf8f4;
  --bg-2: #f1ede6;
  --surface: #ffffff;
  --text: #1a1d24;
  --muted: #5c6370;
  --accent: #0e7c86;
  --accent-soft: rgba(14, 124, 134, 0.10);
  --accent-ink: #ffffff;
  --line: #e6e1d8;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 12px 32px -12px rgba(20, 20, 30, 0.18);
  --shadow-lg: 0 2px 4px rgba(20, 20, 30, 0.06), 0 28px 60px -20px rgba(20, 20, 30, 0.28);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.20vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.40vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.30rem + 0.90vw, 2.05rem);
  --step-3: clamp(2rem, 1.55rem + 1.90vw, 3.1rem);
  --step-4: clamp(2.6rem, 1.80rem + 3.60vw, 4.8rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6.5rem;

  --container: 72rem;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --bg-2: #141820;
    --surface: #161a20;
    --text: #e8e6e1;
    --muted: #a0a5ae;
    --accent: #3fc1c9;
    --accent-soft: rgba(63, 193, 201, 0.14);
    --accent-ink: #0f1216;
    --line: #262b33;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 28px 60px -20px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 600; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.2rem; }

strong { font-weight: 600; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-3); top: -100%;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  z-index: 100; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--space-3); }

/* ---------- Layout ------------------------------------------------------ */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.section { padding-block: var(--space-7); }
.section + .section { border-top: 1px solid var(--line); }
.section--tint { background: var(--bg-2); }

.section-head { max-width: 40rem; margin-bottom: var(--space-5); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-3);
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 2px; background: currentColor; border-radius: 2px;
}

.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.5; }

.grid-2 { display: grid; gap: var(--space-5); }
@media (min-width: 60rem) {
  .grid-2 { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}

/* ---------- Header / nav ------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  letter-spacing: -0.02em; color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.brand__mark {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; font-family: var(--font-body);
}

.nav-toggle {
  display: none;
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem; font: inherit; font-size: var(--step--1); font-weight: 600;
  cursor: pointer;
}

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(0.25rem, 1vw, 0.75rem); flex-wrap: wrap;
}
.site-nav a {
  display: inline-block; padding: 0.45rem 0.75rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: var(--step--1);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="true"],
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

@media (max-width: 50rem) {
  .nav-toggle { display: inline-block; }
  .site-nav { flex-basis: 100%; }
  .site-nav ul { flex-direction: column; gap: 0.15rem; padding-bottom: var(--space-3); }
  .site-nav a { display: block; padding: 0.65rem 0.75rem; }
  /* JS present: collapse until toggled. Without JS the list stays visible. */
  .js .site-nav[data-open="false"] { display: none; }
}

/* ---------- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.35rem; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 600; text-decoration: none; font-size: var(--step--1);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn svg { width: 1em; height: 1em; }

.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- Cards ------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--space-4);
  box-shadow: var(--shadow);
}

.chip {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}

/* ---------- Footer ------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line); padding-block: var(--space-5);
  color: var(--muted); font-size: var(--step--1);
}
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-3); flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* =========================================================================
   Home page (spec 002)
   ========================================================================= */

/* ---------- Hero -------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(3rem, 8vw, 6.5rem) var(--space-6);
}
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto;
  width: 60vw; max-width: 46rem; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero__grid {
  display: grid; gap: var(--space-5); align-items: center;
}
@media (min-width: 56rem) {
  .hero__grid { grid-template-columns: 1.1fr 0.9fr; }
}
.hero h1 { margin-bottom: var(--space-3); }
.hero__title { font-size: var(--step-1); color: var(--muted); max-width: 30ch; line-height: 1.45; }
.hero__title strong { color: var(--text); font-weight: 600; }
.hero__actions { margin-top: var(--space-5); }

.portrait {
  position: relative; justify-self: center; width: min(100%, 26rem);
}
.portrait img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  background: #ecebe7;
}
.portrait::after {
  content: ""; position: absolute; inset: 1rem -1rem -1rem 1rem; z-index: -1;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.portrait__caption {
  position: absolute; left: 1rem; bottom: 1rem;
  background: var(--surface); color: var(--text);
  padding: 0.5rem 0.85rem; border-radius: var(--radius-sm);
  font-size: var(--step--1); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.portrait__caption::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #2fb36a;
}

.stats {
  list-style: none; margin: var(--space-6) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 48rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); padding: var(--space-4); }
.stat__value {
  display: block; font-family: var(--font-display); font-size: var(--step-3); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1; color: var(--text);
}
.stat__label { display: block; margin-top: 0.4rem; color: var(--muted); font-size: var(--step--1); }

/* ---------- About ------------------------------------------------------- */
.prose p { max-width: 62ch; }
.prose a { color: var(--text); text-decoration-color: var(--accent); }
.prose a:hover { color: var(--accent); }

.highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.highlights li { display: flex; gap: 0.75rem; align-items: flex-start; }
.highlights li::before {
  content: ""; flex: 0 0 auto; width: 0.5rem; height: 0.5rem; margin-top: 0.6rem;
  border-radius: 50%; background: var(--accent);
}
.highlights strong { display: block; }
.highlights small { color: var(--muted); }

.about-figure { margin: var(--space-4) 0 0; }
.about-figure img { border-radius: var(--radius); background: #fff; }
.about-figure__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.about-figure__grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.about-figure figcaption { margin-top: var(--space-2); font-size: var(--step--1); color: var(--muted); }

/* ---------- Timeline ---------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: 0.5rem;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding-left: 2.5rem; padding-bottom: var(--space-5); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 0.45rem;
  width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.timeline__head { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.timeline__head h3 { margin: 0; font-size: var(--step-1); }
.timeline__org { color: var(--muted); font-weight: 500; }
.timeline__org a { color: inherit; }
.timeline__dates { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.timeline p { margin: 0.4rem 0 0; max-width: 62ch; color: var(--muted); }

/* ---------- Education --------------------------------------------------- */
.edu-grid { display: grid; gap: var(--space-4); }
@media (min-width: 56rem) { .edu-grid { grid-template-columns: repeat(3, 1fr); } }
.edu h3 { font-size: var(--step-1); margin-bottom: 0.25rem; }
.edu__meta { color: var(--muted); font-size: var(--step--1); margin-bottom: var(--space-3); }
.edu ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.edu li + li { margin-top: 0.4rem; }

/* ---------- Press tiles (home teaser) ----------------------------------- */
.tiles { display: grid; gap: var(--space-4); }
@media (min-width: 56rem) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.tile__body { padding: var(--space-4); }
.tile__meta { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.5rem; }
.tile h3 { font-size: var(--step-1); margin: 0; }
.tile:hover h3 { color: var(--accent); }

/* ---------- Contact ----------------------------------------------------- */
.contact-grid { display: grid; gap: var(--space-4); }
@media (min-width: 48rem) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card { display: block; text-decoration: none; color: inherit; }
.contact-card__label { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 0.25rem; }
.contact-card__value { font-weight: 600; overflow-wrap: break-word; }
a.contact-card:hover .contact-card__value { color: var(--accent); }

/* =========================================================================
   Press page (spec 003)
   ========================================================================= */
.page-intro { padding-block: clamp(3rem, 8vw, 6rem) var(--space-5); }
.page-intro h1 { font-size: var(--step-4); }
.page-intro .lede { max-width: 48ch; }

.era-nav {
  position: sticky; top: var(--header-h); z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-block: 1px solid var(--line);
}
.era-nav ol {
  list-style: none; margin: 0; padding: 0.5rem 0;
  display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: thin;
}
.era-nav a {
  display: inline-block; white-space: nowrap; padding: 0.4rem 0.75rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: var(--step--1); font-weight: 500;
}
.era-nav a:hover { color: var(--text); background: var(--accent-soft); }
.era-nav a[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }

.era { padding-block: var(--space-6); }
.era + .era { border-top: 1px solid var(--line); }
.era-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); max-width: 44rem; }
.era-head .eyebrow { margin: 0; }
.era-head h2 { margin: 0; }
.era-head p { color: var(--muted); }

.press-grid { display: grid; gap: var(--space-4); }
@media (min-width: 44rem) { .press-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .press-grid { grid-template-columns: repeat(3, 1fr); } }
.press-grid--one { grid-template-columns: minmax(0, 40rem); }

.press-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.press-card__media {
  display: block; margin: 0; padding: 0; border: 0; width: 100%;
  background: var(--bg-2); cursor: default; text-align: left;
  border-bottom: 1px solid var(--line);
}
button.press-card__media { cursor: zoom-in; }
.press-card__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.press-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.press-card__meta { font-size: var(--step--1); color: var(--muted); margin: 0; }
.press-card__meta .pub { color: var(--text); font-weight: 600; }
.press-card h3 { margin: 0; font-size: var(--step-1); }
.press-card__body > p:not([class]) { color: var(--muted); font-size: 0.95em; margin: 0; }
.press-card__foot {
  margin-top: auto; padding-top: 0.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--muted);
}
.press-card__foot a { font-weight: 600; white-space: nowrap; }

.pull-quote { padding-block: var(--space-7); background: var(--bg-2); border-top: 1px solid var(--line); }
.pull-quote blockquote { margin: 0; max-width: 46rem; margin-inline: auto; text-align: center; }
.pull-quote blockquote p {
  font-family: var(--font-display); font-size: var(--step-2); line-height: 1.3; font-weight: 500; letter-spacing: -0.01em;
}
.pull-quote cite { display: block; margin-top: var(--space-3); color: var(--muted); font-style: normal; font-size: var(--step--1); }

.cta { padding-block: var(--space-7); text-align: center; }
.cta .lede { margin-inline: auto; }
.cta .cluster { justify-content: center; margin-top: var(--space-4); }

/* ---------- Lightbox ---------------------------------------------------- */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(96vw, 80rem); max-height: 96vh;
}
.lightbox::backdrop { background: rgba(8, 10, 14, 0.85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox img { max-height: 88vh; width: auto; max-width: 100%; margin: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.lightbox__close {
  position: fixed; top: 1rem; right: 1rem;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: #111; font-size: 1.4rem; line-height: 1;
}
.lightbox__caption { color: #fff; text-align: center; margin: 0.75rem 0 0; font-size: var(--step--1); }

/* =========================================================================
   404
   ========================================================================= */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: var(--space-7); }

/* =========================================================================
   Motion (progressive enhancement; off without JS or with reduced motion)
   ========================================================================= */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

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

@media print {
  .site-header, .era-nav, .skip-link, .btn, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: inherit; }
}

/* ---------- Award feature (home) and era photo (press) ----------------- */
.award-band { padding-block: 0 var(--space-6); }
.award {
  display: grid; gap: var(--space-4); padding: 0; overflow: hidden; align-items: center;
}
.award__media { margin: 0; position: relative; }
.award__media img { width: 100%; height: 100%; aspect-ratio: 16 / 10.5; object-fit: cover; display: block; }
.award__media figcaption {
  position: absolute; right: 0.75rem; bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.72rem;
  padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
}
.award__body { padding: 0 var(--space-4) var(--space-4); }
.award__body h2 { font-size: var(--step-3); margin-block: var(--space-2) var(--space-3); }
.award__body p:not(.eyebrow) { color: var(--muted); margin-bottom: var(--space-4); max-width: 36ch; }
@media (min-width: 48rem) {
  .award { grid-template-columns: 1.15fr 1fr; gap: var(--space-5); align-items: stretch; }
  .award__media img { aspect-ratio: auto; min-height: 20rem; }
  .award__body { align-self: center; padding: var(--space-5) var(--space-5) var(--space-5) 0; }
}

.era-photo { margin: 0 0 var(--space-5); }
.era-photo img {
  width: 100%; max-height: 38rem; object-fit: cover; object-position: center 45%;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.era-photo figcaption { margin-top: var(--space-2); font-size: var(--step--1); color: var(--muted); }
