/* ==========================================================================
   Hanoona Rasheed — profile page
   Plain CSS, no build step. Colors, fonts and sizes live in :root below.
   ========================================================================== */

/* Nunito (SIL Open Font License), self-hosted from assets/fonts */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fefefc;  /* almost white with a trace of warmth (originally #f8f6f2) */
  --surface: #ffffff;
  --ink: #1c1a19;
  --ink-2: #4b4744;
  --ink-3: #7b756f;
  --line: #e7e2db;
  --accent: #8a2c55;
  --accent-strong: #6b1f40;
  --accent-soft: #f5e9ef;

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --maxw: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3 { text-wrap: balance; }
.project h3 { text-wrap: pretty; }  /* fill each line; only avoid a lone last word */

h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ---------- Intro ---------- */

.hero { padding: 48px 0 40px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 44px;
  align-items: center;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.bio {
  margin: 0;
  color: var(--ink-2);
}
.bio + .bio { margin-top: 10px; }
/* Bio justified, like the project descriptions */
.bio { text-align: justify; }
.viz-note[hidden] { display: none; }
.bio a { white-space: nowrap; }
.bio strong { color: var(--accent); font-weight: 700; }

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn .count {
  margin: -2px -7px -2px 2px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
}

.portrait {
  position: relative;
  margin: 0;
  isolation: isolate;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  z-index: -1;
  border-radius: 20px;
  background: var(--accent-soft);
}
.portrait-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 24px 50px -28px rgba(20, 15, 10, 0.5);
}
.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}


/* ---------- Sections ---------- */

.section {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.section-head a { font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.head-left { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.viz-note { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.viz-note::before {
  content: "";
  border-left: 7px solid var(--accent);
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

/* ---------- News: one line per item, full width ---------- */

.news {
  margin: 0;
  padding: 0;
  list-style: none;
}
.news li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.news li:last-child { border-bottom: 0; }
.news time {
  flex: none;
  width: 72px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.news .item { flex: 1; color: var(--ink-2); }
.news .item a { font-weight: 700; }

/* ---------- Projects: full-width title, figure left, text right ---------- */

.project {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.project:first-of-type { border-top: 0; padding-top: 6px; }
.project:last-of-type { padding-bottom: 0; }

.project h3 {
  margin: 0 0 8px;
  font-size: 20.5px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.project h3 a { color: var(--accent); }
.project h3 a:hover { color: var(--accent-strong); text-decoration: underline; text-decoration-thickness: 2px; }
/* the venue tag sits right after the title (it moves with the last word when the title wraps) */
.project h3 .venue { margin: 0 0 0 10px; }

.venue {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 64fr) minmax(0, 36fr);
  gap: 28px;
  align-items: center;
}

/* Every project gets the same 5:2 animated visualization (assets/viz/<project>.html). */
.visual {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.visual:hover {
  border-color: #d9d1c7;
  box-shadow: 0 18px 36px -24px rgba(30, 20, 10, 0.4);
}
.viz {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 2;
  border: 0;
  background: var(--surface);
}
/* Still image of each teaser: shown on phones (and if scripts are off). On larger screens the
   script adds .viz-live to <html>, loads the animated teaser and hides the still. */
.viz-still { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: cover; }
html:not(.viz-live) .viz { display: none; }
.viz-live .viz-still { display: none; }

.project-text { min-width: 0; }
/* Each project has a one-sentence summary (.desc-short) that replaces the full text on phones */
.project .desc-short { display: none; }
@media (max-width: 640px), (hover: none) and (max-height: 500px) {
  .project .desc { display: none; }
  .project .desc.desc-short { display: block; font-size: 14px; line-height: 1.55; }
  .project h3 { font-size: 16.5px; }
  .project h3 .venue { font-size: 10px; margin-left: 8px; }
  .links a { font-size: 12.5px; padding: 2px 10px; }
}

.project .desc {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.links a {
  display: inline-block;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Beyond research ---------- */

.moment {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  max-width: 760px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* Small clickable thumbnail */
.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #000;
  cursor: pointer;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.video-thumb:hover img { transform: scale(1.04); }
.video-thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.video-thumb:hover .play { transform: scale(1.08); }
.video-thumb .play svg { width: 24px; height: 24px; margin-left: 3px; fill: var(--accent); }

/* Enlarged video (opens on click) */
.video-dialog {
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}
.video-dialog::backdrop {
  background: rgba(15, 12, 10, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.video-dialog video {
  height: min(88vh, 1280px);
  width: auto;
  max-width: 94vw;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 700 22px/1 var(--font);
  cursor: pointer;
}
.dialog-close:hover { background: var(--accent); }
.moment .venue { margin-bottom: 8px; }
.moment h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
}
.moment p {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink-2);
}
.moment .credit { margin: 0; font-size: 14px; color: var(--ink-3); }
.moment .credit a { font-weight: 700; }
.moment .watch a { font-weight: 700; }

/* "In the news": articles about me, listed under the commencement card */
.press { margin-top: 22px; }
.press h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.press .src { margin-left: 8px; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }
.press .src::before { content: "· "; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 22px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}
.footer-row nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-row nav a { color: var(--ink-2); font-weight: 700; }
.footer-row nav a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

/* Mid-size screens: a slightly smaller title so it still fits beside the teaser */
@media (max-width: 1180px) and (min-width: 901px) {
  .project h3 { font-size: 19px; }
  .project .desc { font-size: 14px; line-height: 1.55; }
}

@media (max-width: 900px) {
  .hero { padding: 32px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .portrait { order: -1; max-width: 200px; }
  .portrait::before { inset: 12px -12px -12px 12px; }
  .portrait img { aspect-ratio: 4 / 5; object-position: 50% 12%; }

  .project-body { grid-template-columns: 1fr; gap: 12px; }
  /* one column: title first, then the teaser, then the text */
  .project-text { display: contents; }
  .project h3 { order: -1; margin: 0; }
  .project .desc { margin: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  /* Smaller type scale on phones */
  h1 { font-size: 30px; }
  h2 { font-size: 20px; }
  .bio { font-size: 14.5px; }
  .btn { font-size: 13.5px; }
  .moment h3 { font-size: 17px; }
  .moment p { font-size: 14px; }
  .moment .credit { font-size: 13px; }
  .site-footer { font-size: 13px; }
  /* Justified on phones too; word breaks and wrapping links keep the gaps between words small */
  .bio { hyphens: auto; -webkit-hyphens: auto; }
  .bio a { white-space: normal; }
  .section { padding: 28px 0; }
  /* News and "In the news": smaller text, date kept in a narrow column on the left */
  .news li { gap: 10px; padding: 6px 0; }
  .news time { width: 56px; font-size: 12px; }
  .news .item { font-size: 13.5px; line-height: 1.45; }
  .press h3 { font-size: 16px; }
  .press .src { margin-left: 6px; font-size: 12px; }
  .moment { grid-template-columns: 90px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; }
  .moment .venue { font-size: 10.5px; letter-spacing: 0.04em; white-space: nowrap; }
}

/* Rows fade up gently as they scroll into view. Only rows that start below the
   screen are hidden (by the script), so nothing can get stuck invisible. */
.reveal { transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.pending { opacity: 0; transform: translateY(16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .visual, .btn { transition: none; }
  .visual:hover { transform: none; }
  .reveal { transition: none; }
}
