/* ------------------------------------------------------------
   Muhammad Fazeel, personal site
   Two pages share this file: index.html and cv.html
   ------------------------------------------------------------ */

:root {
  --bg: #f6f7f9;
  --bg-2: #ffffff;
  --ink: #0f1720;
  --muted: #5b6673;
  --line: #e2e6eb;
  --accent: #0f9f8f;
  --accent-ink: #0a7c6f;
  --accent-wash: rgba(15, 159, 143, 0.10);
  --hero-bg: #0c1420;
  --hero-bg-2: #12203a;
  --hero-ink: #eef3f7;
  --hero-muted: #a9b6c4;
  --shadow: 0 1px 2px rgba(15, 23, 32, 0.05), 0 8px 24px rgba(15, 23, 32, 0.06);
  --radius: 14px;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0b1016;
  --bg-2: #111821;
  --ink: #e7edf3;
  --muted: #98a6b3;
  --line: #1f2a35;
  --accent: #2fd4c0;
  --accent-ink: #5be3d2;
  --accent-wash: rgba(47, 212, 192, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1016;
    --bg-2: #111821;
    --ink: #e7edf3;
    --muted: #98a6b3;
    --line: #1f2a35;
    --accent: #2fd4c0;
    --accent-ink: #5be3d2;
    --accent-wash: rgba(47, 212, 192, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(28px, 3.4vw, 38px); margin-bottom: 26px; }
h3 { font-size: 21px; }
p { margin: 0 0 14px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--bg-2); padding: 8px 12px; z-index: 50; }

/* Top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 20, 32, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--hero-ink);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-family: var(--display); font-size: 19px; color: var(--hero-ink); }
.brand:hover { text-decoration: none; color: #fff; }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--hero-muted); font-size: 14.5px; font-weight: 500; }
.nav a:hover, .nav a.active { color: #fff; text-decoration: none; }
.nav-cv {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff !important;
}
.theme-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--hero-ink);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

.menu-btn { display: none; }

/* Hero */

.hero {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(15, 159, 143, 0.28), transparent 60%),
    linear-gradient(180deg, var(--hero-bg-2), var(--hero-bg));
  color: var(--hero-ink);
  padding: 72px 0 40px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 56px;
  align-items: center;
}
.eyebrow {
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 500;
  color: #fff;
  margin-bottom: 20px;
}
.hero-p { color: var(--hero-muted); font-size: 18px; max-width: 58ch; margin-bottom: 28px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #062b27; }
.btn-primary:hover { background: #1cc0ad; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.24); color: #fff; }
.btn-ghost:hover { border-color: #fff; }

.hero-photo { margin: 0; justify-self: end; position: relative; }
.hero-photo img {
  display: block;
  width: min(100%, 340px);
  height: auto;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border-radius: 22px;
  border: 1px solid rgba(15, 159, 143, 0.45);
  z-index: -1;
}

.modalities {
  list-style: none;
  margin: 56px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.modalities li { display: flex; gap: 12px; align-items: flex-start; }
.modalities svg { width: 26px; height: 26px; flex: none; stroke: var(--accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.modalities b { display: block; color: #fff; font-weight: 600; font-size: 15px; }
.modalities span { color: var(--hero-muted); font-size: 13.5px; line-height: 1.45; }

/* Sections */

.section { padding: 84px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.label {
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); gap: 56px; align-items: start; }
.prose p { max-width: 64ch; font-size: 17px; }

.facts {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.facts dl { margin: 0; }
.facts div { padding: 10px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.facts dd { margin: 3px 0 0; font-size: 15px; }

/* Timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.timeline > li:first-child { border-top: 0; padding-top: 4px; }
.tl-when { font-weight: 700; font-size: 15px; color: var(--ink); }
.tl-when span { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }
.tl-body h3 { margin-bottom: 2px; }
.tl-where { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.tl-body p { max-width: 70ch; }
.tl-body ul { margin: 0 0 14px; padding-left: 20px; max-width: 70ch; list-style: disc; }
.tl-body ul li { margin-bottom: 8px; }
.tl-tags { color: var(--muted); font-size: 14px; margin: 0; }

/* Publications */

.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.pubs li:first-child { border-top: 0; padding-top: 4px; }
.pub-year { font-family: var(--display); font-size: 24px; color: var(--muted); line-height: 1.1; }
.pub-title { font-weight: 700; font-size: 17px; margin-bottom: 6px; max-width: 70ch; }
.pub-meta { color: var(--muted); font-size: 14.5px; margin-bottom: 8px; max-width: 80ch; }
.doi {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-ink);
}
.doi:hover { text-decoration: none; background: var(--accent); color: #062b27; }

/* Cards */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
}
.card-kicker { color: var(--accent-ink); font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.card h3 { font-size: 20px; margin-bottom: 10px; }
.card p:last-child { margin: 0; color: var(--muted); font-size: 15px; }

/* Skills */

.skill-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.skill-groups h3 { font-size: 18px; margin-bottom: 14px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

/* Contact */

.contact { background: var(--bg-2); border-top: 1px solid var(--line); }
.contact-p { color: var(--muted); font-size: 17px; max-width: 56ch; }
.contact-mail {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 34px);
  margin: 10px 0 22px;
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  word-break: break-all;
}
.contact-mail:hover { text-decoration: none; color: var(--accent-ink); }
.contact-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; font-weight: 600; }

.foot { padding: 26px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Reveal */

.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ------------------------------------------------------------
   CV page
   ------------------------------------------------------------ */

.cv-hero { background: linear-gradient(180deg, var(--hero-bg-2), var(--hero-bg)); color: var(--hero-ink); padding: 48px 0 36px; }
.cv-hero h1 { font-size: clamp(32px, 4.5vw, 46px); color: #fff; margin-bottom: 6px; }
.cv-hero .role { color: var(--hero-muted); font-size: 17px; margin-bottom: 18px; }
.cv-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14.5px; color: var(--hero-muted); }
.cv-contact a { color: #fff; }
.cv-actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

.cv-main { padding: 48px 0 72px; }
.cv-section { padding: 0; margin-bottom: 46px; }
.cv-section h2 {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.cv-section > p { max-width: 74ch; }

.cv-entry { margin-bottom: 24px; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.cv-entry h3 { font-size: 19px; }
.cv-entry .when { margin: 0; font-size: 14px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.cv-entry .where { margin: 2px 0 8px; font-size: 15px; color: var(--muted); }
.cv-entry ul { margin: 0; padding-left: 20px; max-width: 78ch; }
.cv-entry li { margin-bottom: 6px; }
.cv-entry > p { margin: 4px 0 0; max-width: 78ch; }

.cv-list { margin: 0; padding-left: 20px; }
.cv-list li { margin-bottom: 6px; }
.kv { margin: 0; }
.kv div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.kv div:first-child { border-top: 0; padding-top: 0; }
.kv dt { font-weight: 700; font-size: 14.5px; }
.kv dd { margin: 0; font-size: 15px; color: var(--muted); }
.print-hint { color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); padding-top: 14px; }

/* Responsive */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { justify-self: start; order: -1; }
  .hero-photo img { width: 200px; }
  .hero { padding-top: 44px; }
  .modalities { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .cards, .skill-groups { grid-template-columns: 1fr; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .pubs li { grid-template-columns: 1fr; gap: 4px; }
  .pub-year { font-size: 16px; }
  .section { padding: 60px 0; }
  .kv div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 720px) {
  .menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px;
    background: transparent; border: 1px solid rgba(255,255,255,0.22); border-radius: 8px;
    cursor: pointer;
  }
  .menu-btn span { display: block; width: 18px; height: 2px; background: #fff; margin: 0 auto; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 62px;
    flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 14px 28px 18px;
    background: var(--hero-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav.open { display: flex; }
  .nav a { padding: 8px 0; font-size: 16px; }
  .nav-cv { margin-top: 6px; }
  .theme-btn { margin-top: 10px; }
  .modalities { grid-template-columns: 1fr; }
  .wrap { padding: 0 20px; }
}

/* Print, CV page */

@media print {
  :root { --bg: #fff; --bg-2: #fff; --ink: #000; --muted: #444; --line: #bbb; --accent-ink: #0a7c6f; }
  body { font-size: 10.5pt; line-height: 1.4; }
  .top, .cv-actions, .print-hint, .skip, .foot { display: none !important; }
  .cv-hero { background: none; color: #000; padding: 0 0 12px; border-bottom: 2px solid #0a7c6f; }
  .cv-hero h1, .cv-contact a { color: #000; }
  .cv-hero .role, .cv-contact { color: #444; }
  .cv-main { padding: 18px 0 0; }
  .wrap { max-width: none; padding: 0; }
  .cv-entry li, .cv-entry-head { break-inside: avoid; }
  .cv-section h2, .cv-entry h3 { break-after: avoid; }
  a { color: #000; }
}

/* Narrower measure for the CV page */
.cv-hero .wrap, .cv-main .wrap { max-width: 920px; }
