/* Sadaf Tayefeh portfolio — Pratibha Joshi–inspired minimal layout */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e8e6e1;
  --accent: #c45c4a;
  --accent-soft: rgba(196, 92, 74, 0.08);
  --radius: 12px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --max: 1120px;
  --nav-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  line-height: 1.15;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo:hover .logo-sub {
  color: var(--muted);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.logo-name {
  display: block;
}

.logo-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Banner: same width as main column (not full viewport) — Pratibha-style contained hero */
.hero-banner {
  width: 100%;
  margin: 0 0 2.5rem;
  padding: 0;
  line-height: 0;
  background: #1a1a1a;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 2.2 / 1;
  max-height: min(420px, 42vw);
}

.hero-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-bio {
  padding: 2.75rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-bio__intro-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 280px);
  grid-template-areas: "bio photo";
  gap: 2rem 2.5rem;
  align-items: stretch;
}

.hero-bio__main {
  grid-area: bio;
  min-width: 0;
}

.hero-bio__aside {
  grid-area: photo;
  margin: 0;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  align-self: stretch;
  justify-self: stretch;
}

.hero-bio__aside img {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: left 78%;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

.hero-bio__caption {
  margin: 0;
  padding-top: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: left;
  width: 100%;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .hero-bio__intro-row {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "bio";
    align-items: start;
  }

  .hero-bio__aside {
    max-width: min(100%, 280px);
    justify-self: center;
    height: auto;
    align-self: center;
  }

  .hero-bio__aside img {
    flex: none;
    height: auto;
    aspect-ratio: 3 / 2;
    object-position: left 78%;
  }
}

.hero-bio h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  max-width: 22ch;
}

.hero-bio .lead {
  font-size: 1.08rem;
  color: var(--text);
  max-width: 62ch;
  margin: 0 0 1.25rem;
}

.hero-bio .lead:last-of-type {
  margin-bottom: 0;
}

.hero-bio .meta {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* About: row 1 headings | row 2 logos — aligned across columns */
.hero-bio-logos {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 2.5rem;
  row-gap: 0.65rem;
  align-items: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.hero-bio-logos__heading {
  margin: 0;
  align-self: end;
}

.hero-bio-logos__heading:first-of-type {
  grid-column: 1;
  grid-row: 1;
}

.hero-bio-logos__heading:last-of-type {
  grid-column: 2;
  grid-row: 1;
}

.hero-bio-logos__uiuc {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  justify-self: start;
  line-height: 0;
}

.hero-bio-logos__orgs {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  margin: 0;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  min-width: 0;
}

.hero-bio-logos .logo-uiuc-featured {
  display: block;
  max-width: min(420px, 62vw);
  height: 56px;
  width: auto;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.hero-bio-logos .logo-strip img {
  height: 40px;
  max-height: 40px;
  width: auto;
  max-width: min(140px, 30vw);
  object-fit: contain;
  object-position: center;
}

.hero-bio-logos .logo-strip li:nth-child(1) img {
  max-width: min(120px, 28vw);
  height: 40px;
}

@media (max-width: 640px) {
  .hero-bio-logos {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-bio-logos__heading:first-of-type {
    order: 1;
  }

  .hero-bio-logos__uiuc {
    order: 2;
  }

  .hero-bio-logos__heading:last-of-type {
    order: 3;
  }

  .hero-bio-logos__orgs {
    order: 4;
  }
}

.uiuc-logo-link {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.uiuc-logo-link:hover {
  opacity: 0.92;
}

.uiuc-logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.logo-uiuc-featured {
  display: block;
  height: 100%;
  object-position: left center;
}

.logo-strip-heading {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.5rem 0 0.85rem;
}

.logo-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

.logo-strip li {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.logo-strip img {
  display: block;
  height: 26px;
  width: auto;
  max-width: min(132px, 28vw);
  object-fit: contain;
  object-position: left center;
  opacity: 0.88;
  filter: grayscale(8%);
}

.logo-strip li:nth-child(1) img {
  /* NOMA wordmark — slightly wider */
  max-width: min(100px, 26vw);
  height: 22px;
}

@media (max-width: 520px) {
  .logo-strip {
    gap: 1rem 1.25rem;
  }

  .logo-strip img {
    height: 22px;
    max-width: min(112px, 40vw);
  }
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Home — “Selected work” only (case pages keep small .section-title in case-hero) */
.projects .section-title {
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 2rem;
}

.projects {
  padding-top: 3.5rem;
}

/* Full-width project rows — image | copy, alternating sides (odd: image left, even: image right) */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
}

.project-card {
  width: 100%;
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.project-card:hover {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.project-card a.block {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: clamp(440px, 52vh, 640px);
  color: inherit;
  text-decoration: none;
}

.project-card:nth-child(even) a.block {
  flex-direction: row-reverse;
}

.project-card a.block:hover {
  text-decoration: none;
}

.project-card a.block:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-card .thumb {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  min-height: clamp(380px, 48vh, 580px);
  background: #f0eeeb;
  overflow: hidden;
}

.project-card .thumb img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  max-width: calc(100% - 1.5rem);
  max-height: calc(100% - 1.5rem);
  object-fit: contain;
  object-position: center center;
  transform: translate(-50%, -50%);
  transition: transform 0.45s ease;
}

/* Tighter “snapshot” crop for wide UI mockups (e.g. dashboards) */
.project-card .thumb.thumb--cover img {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  transform: none;
  object-fit: cover;
  object-position: left 35%;
}

.project-card:hover .thumb img {
  transform: translate(-50%, -50%) scale(1.02);
}

.project-card:hover .thumb.thumb--cover img {
  transform: scale(1.04);
  transform-origin: left center;
}

/* Slightly larger mockup in thumb (e.g. Soupape) */
.project-card .thumb.thumb--enlarge img {
  max-width: 100%;
  max-height: 100%;
  transform: translate(-50%, -50%) scale(1.17);
}

.project-card:hover .thumb.thumb--enlarge img {
  transform: translate(-50%, -50%) scale(1.2);
}

.project-card .body {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 2.75rem);
  background: var(--surface);
}

.project-card .type {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.project-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 500;
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.project-card .card-desc {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 42ch;
}

@media (max-width: 800px) {
  .project-card a.block {
    flex-direction: column;
    max-height: none;
    min-height: 0;
  }

  .project-card:nth-child(even) a.block {
    flex-direction: column;
  }

  .project-card .thumb {
    flex: 0 0 auto;
    aspect-ratio: 4 / 3;
    min-height: min(72vw, 420px);
    max-height: 520px;
  }

  .project-card .body {
    padding: 1.35rem 1.25rem 1.5rem;
  }
}

.connect {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.connect h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.connect p {
  margin: 0;
  color: var(--muted);
}

/* Case study pages */
.case-hero {
  margin-bottom: 2.5rem;
}

.case-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.case-hero .subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 65ch;
  margin: 0;
}

.case-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.case-nav a {
  color: var(--muted);
}

.case-nav a strong {
  color: var(--text);
  font-weight: 600;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 2.25rem 0 0.75rem;
}

.prose h3,
.prose h4 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.75rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text);
}

.prose ul {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
  color: var(--text);
}

.prose li {
  margin-bottom: 0.35rem;
}

.figure-grid {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.figure-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.figure {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.figure figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.case-study-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.case-study-figure.figure--narrow {
  max-width: min(520px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.case-callout {
  background: var(--surface);
  padding: 1.5rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 0 auto 1.5rem;
  max-width: 65ch;
}

.case-callout p:last-child {
  margin-bottom: 0;
}

/* Long-form case study (e.g. HemoRisk) */
main.case-study .case-hero {
  margin-bottom: 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

main.case-study .case-hero__eyebrow {
  margin-bottom: 0.5rem;
}

main.case-study .case-hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--line);
}

main.case-study .case-hero-media figcaption {
  text-align: center;
}

main.case-study.case-study--center-hero .case-hero {
  text-align: center;
}

main.case-study.case-study--center-hero .case-hero .subtitle {
  margin-left: auto;
  margin-right: auto;
}

main.case-study .case-section {
  margin: 0 0 3.25rem;
}

main.case-study .case-section--closing {
  margin-bottom: 0;
  padding-top: 0.5rem;
}

main.case-study .prose--reading {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

main.case-study .case-lead {
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--text);
}

main.case-study .case-section .prose h2 {
  margin-top: 0;
  padding-top: 0.25rem;
}

main.case-study .case-section .prose h2:not(:first-child) {
  margin-top: 2.5rem;
}

main.case-study .case-section .case-callout + h2 {
  margin-top: 2.5rem;
}

main.case-study .figure-grid.figure-grid--case {
  margin: 2rem auto 0;
  max-width: 100%;
}

main.case-study .figure-grid.figure-grid--case.cols-2 .case-study-figure {
  margin: 0;
}

main.case-study .figure-grid.figure-grid--summative-pair {
  align-items: start;
}

/* Scenario B (error state) wider than hospital photo */
main.case-study .figure-grid.figure-grid--summative-pair.cols-2 {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

@media (max-width: 640px) {
  main.case-study .figure-grid.figure-grid--summative-pair.cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Hospital photo scales down to sit closer to the UI screenshot beside it */
main.case-study .summative-pair__hospital {
  display: flex;
  flex-direction: column;
}

main.case-study .summative-pair__hospital img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(300px, 38vw);
  object-fit: contain;
  object-position: center top;
  margin: 0 auto;
  display: block;
}

/* Research: journey + noma2 stacked; affinity map in second column */
main.case-study .case-research-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  margin: 2rem 0 2.5rem;
}

main.case-study .case-research-layout__journey-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

main.case-study .case-research-layout .case-study-figure {
  margin: 0;
}

main.case-study .case-section > .prose + .case-research-layout {
  margin-top: 1.75rem;
}

@media (max-width: 768px) {
  main.case-study .case-research-layout {
    grid-template-columns: 1fr;
  }
}

/* Fidelity: early concepts left; wireframes + explanation patterns stacked on the right */
main.case-study .case-fidelity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  margin: 2rem 0 2.5rem;
}

main.case-study .case-fidelity-layout__wireframes-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

main.case-study .case-fidelity-layout .case-study-figure {
  margin: 0;
}

main.case-study .case-section > .prose + .case-fidelity-layout {
  margin-top: 1.75rem;
}

@media (max-width: 768px) {
  main.case-study .case-fidelity-layout {
    grid-template-columns: 1fr;
  }
}

main.case-study .case-study-figure {
  margin: 2rem 0 2.5rem;
}

/* Hero dashboard: higher specificity than .case-study-figure so margin: auto centers */
main.case-study .case-study-figure.case-hero-media {
  display: block;
  max-width: min(900px, 92%);
  margin: 2rem auto 2.75rem;
}

main.case-study .case-section > .prose + .figure-grid,
main.case-study .case-section > .prose + .case-study-figure {
  margin-top: 1.75rem;
}

main.case-study .figure-grid.figure-grid--case + .case-study-figure {
  margin-top: 2rem;
}

main.case-study .case-study-figure--single {
  max-width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
}

main.case-study .figure.color-mapping-figure {
  margin: 2rem 0;
}

/* Case study: text + image side by side */
.case-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  margin: 1.75rem 0 2.25rem;
}

.case-split .case-split__text.prose h3:first-child {
  margin-top: 0;
}

.case-split .figure {
  margin: 0;
}

.case-split .figure img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .case-split {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Keep reading order: heading and body before image when stacked */
  .case-split--media-first .case-split__text {
    order: 1;
  }

  .case-split--media-first .figure {
    order: 2;
  }
}

/* Client-side password gate (see js/case-gate.js) */
html.case-gate-locked .site-header,
html.case-gate-locked main {
  display: none !important;
}

.case-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  font-family: var(--font-sans);
}

.case-gate__panel {
  width: 100%;
  max-width: 22rem;
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.case-gate__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.case-gate__hint {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.case-gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-gate__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-gate__input {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.case-gate__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.case-gate__submit {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1rem;
  margin-top: 0.25rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.case-gate__submit:hover {
  filter: brightness(1.05);
}

.case-gate__error {
  margin: 0;
  font-size: 0.88rem;
  color: #b33;
}

.case-gate__footer {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
}

.case-gate__footer a {
  color: var(--muted);
}

.case-gate__footer a:hover {
  color: var(--accent);
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 1rem 1.25rem;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
  }
}
