/* rafiqmind.com — site styles */
:root {
  --ink: #0f1b2d;
  --ink-soft: #2b3a4f;
  --muted: #5b6675;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #e4e1d9;
  --accent: #1c7a59;
  --accent-strong: #145e44;
  --accent-soft: #e5f2ec;
  --gold: #b9862d;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 12px 32px -18px rgba(15, 27, 45, .28);
  --radius: 14px;
  --wrap: 1120px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2f6;
    --ink-soft: #cfd8e3;
    --muted: #9aa7b6;
    --paper: #0c1420;
    --surface: #131d2b;
    --line: #243244;
    --accent: #4fc79c;
    --accent-strong: #7ddcb8;
    --accent-soft: #14302a;
    --gold: #e0b25a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -18px rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.12rem; white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--sans); font-weight: 700; font-size: .82rem; letter-spacing: .04em; }
.nav { display: flex; gap: .15rem; align-items: center; }
.nav a { text-decoration: none; color: var(--ink-soft); font-size: .93rem; font-weight: 500; padding: .45rem .7rem; border-radius: 8px; }
.nav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; padding: .5rem .7rem; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: .6rem 1.25rem 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .6rem; font-size: 1rem; }
}

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: 0; pointer-events: none;
}
.hero::before { width: 520px; height: 520px; right: -140px; top: -180px; background: radial-gradient(circle, #9fe0c4, transparent 68%); animation: drift 18s ease-in-out infinite alternate; }
.hero::after { width: 420px; height: 420px; left: -160px; bottom: -200px; background: radial-gradient(circle, #f1d9a6, transparent 68%); animation: drift 22s ease-in-out infinite alternate-reverse; }
@media (prefers-color-scheme: dark) {
  .hero::before { background: radial-gradient(circle, #1f6f55, transparent 68%); }
  .hero::after { background: radial-gradient(circle, #5a4517, transparent 68%); }
}
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-40px, 50px, 0) scale(1.12); } }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 1.1rem; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.hero h1 { margin-bottom: .25em; }
.hero .role { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.5rem); color: var(--ink-soft); margin-bottom: 1.1rem; }
.hero .lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 58ch; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 1.4rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .78rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .96rem; text-decoration: none; border: 1.5px solid transparent; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px var(--accent); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #06140f; } .brand-mark { color: #06140f; } }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.portrait { position: relative; justify-self: end; width: min(340px, 100%); }
.portrait::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--accent); border-radius: 26px; opacity: .5; }
.portrait img, .portrait .fallback { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 26px; box-shadow: var(--shadow); background: var(--accent-soft); }
.portrait .fallback { display: grid; place-items: center; font-family: var(--serif); font-size: 5rem; color: var(--accent-strong); }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .portrait { justify-self: start; width: min(240px, 70%); order: -1; }
}

/* Profile chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chips a { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: .86rem; font-weight: 500; text-decoration: none; }
.chips a:hover { border-color: var(--accent); color: var(--accent-strong); }
.chips a::after { content: "↗"; font-size: .8em; opacity: .6; }

/* Stats */
.stats { border-block: 1px solid var(--line); background: var(--surface); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 1.6rem 1rem; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 600; color: var(--accent-strong); line-height: 1.1; }
.stat span { font-size: .86rem; color: var(--muted); }
.stats-note { text-align: center; font-size: .78rem; color: var(--muted); padding: .55rem 1rem .8rem; margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .stats .wrap { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* Sections */
section { padding: clamp(2.6rem, 6vw, 4.6rem) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.section-head p { color: var(--muted); max-width: 60ch; margin: 0; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: .5rem; display: block; }
.alt { background: var(--surface); border-block: 1px solid var(--line); }
.page-hero { padding: clamp(2.6rem, 6vw, 4.2rem) 0 clamp(1.4rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent); }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.page-hero p { color: var(--ink-soft); font-size: 1.08rem; max-width: 66ch; margin: 0; }
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { color: var(--muted); }

/* Cards and grids */
.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--shadow); transition: transform .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.alt .card { background: var(--paper); }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--ink-soft); font-size: .96rem; margin-bottom: .8rem; }
.card .num { font-family: var(--serif); font-size: .95rem; color: var(--gold); font-weight: 600; display: block; margin-bottom: .6rem; }
.meta { font-size: .88rem; color: var(--muted); margin: 0 0 .5rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: .78rem; font-weight: 500; padding: .2rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.tags li.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 1.9rem 1.6rem; }
.timeline > li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--paper); }
.alt .timeline > li::before { box-shadow: 0 0 0 4px var(--surface); }
.timeline h3 { margin-bottom: .15rem; }
.timeline .where { font-weight: 600; color: var(--ink-soft); margin: 0; }
.timeline .when { font-size: .86rem; color: var(--muted); margin: 0 0 .5rem; }
.timeline ul { color: var(--ink-soft); font-size: .96rem; margin: 0; }

/* Publications */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 2rem; }
.filters button { font: inherit; font-size: .88rem; font-weight: 600; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .filters button[aria-pressed="true"] { color: #06140f; } }
.pub-group { margin-bottom: 2.4rem; }
.pub-group > h2 { display: flex; align-items: baseline; gap: .7rem; font-size: 1.5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.pub-group > h2 small { font-family: var(--sans); font-size: .82rem; font-weight: 500; color: var(--muted); }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; line-height: 1.4; letter-spacing: 0; margin: 0 0 .3rem; }
.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--accent-strong); text-decoration: underline; }
.pub .cite { font-size: .93rem; color: var(--ink-soft); margin: 0 0 .5rem; }
.pub .cite strong { color: var(--ink); }

/* Lists */
.clean { list-style: none; padding: 0; margin: 0; }
.clean li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.clean li:last-child { border-bottom: 0; }
.clean b { display: block; }
.clean span { font-size: .9rem; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.prose p { color: var(--ink-soft); max-width: 70ch; }
.callout { background: var(--accent-soft); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.4rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.callout h2 { margin: 0 0 .2rem; font-size: 1.5rem; }
.callout p { margin: 0; color: var(--ink-soft); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2.6rem 0 2rem; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; }
.site-footer b { color: var(--ink); font-family: var(--serif); font-size: 1.1rem; }
.site-footer .small { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1.1rem; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* Motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero::before, .hero::after { animation: none; }
  .btn, .card { transition: none; }
}

/* Print (used by the CV page) */
@media print {
  .site-header, .site-footer, .actions, .filters, .skip, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  section, .page-hero { padding: .6rem 0; border: 0; background: none; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .reveal { opacity: 1; transform: none; }
}
