/* ------------------------------------------------------------
   Dr. Sahar Ijaz Khan — portfolio
   Light, calm palette. No external fonts or requests.
------------------------------------------------------------ */

:root {
  color-scheme: light;

  --bg: #faf8f4;
  --bg-tint: #f2f6f4;
  --surface: #ffffff;
  --ink: #1d2a2e;
  --ink-soft: #44565b;
  --muted: #6f8186;
  --line: #e2e8e5;

  --accent: #2b7a7c;
  --accent-strong: #1e5d5f;
  --accent-soft: #d8ebe8;
  --accent-wash: #eaf4f2;
  --blush: #f6e7e1;
  --sand: #f3ede3;

  --shadow: 0 1px 2px rgba(29, 42, 46, 0.04), 0 10px 28px -16px rgba(29, 42, 46, 0.14);
  --shadow-lift: 0 2px 4px rgba(29, 42, 46, 0.05), 0 22px 44px -20px rgba(29, 42, 46, 0.24);

  --radius: 20px;
  --radius-sm: 12px;
  --max: 1120px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent-soft);
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Soft moving backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}

.blob-a {
  width: 520px;
  height: 520px;
  top: -160px;
  right: -120px;
  background: var(--accent-soft);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.blob-b {
  width: 440px;
  height: 440px;
  top: 30vh;
  left: -180px;
  background: var(--blush);
  animation: drift-b 32s ease-in-out infinite alternate;
}

.blob-c {
  width: 380px;
  height: 380px;
  bottom: -140px;
  right: 18vw;
  background: var(--sand);
  animation: drift-c 28s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate(-90px, 70px) scale(1.08);
  }
}

@keyframes drift-b {
  to {
    transform: translate(110px, -60px) scale(1.12);
  }
}

@keyframes drift-c {
  to {
    transform: translate(-70px, -90px) scale(0.94);
  }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.7);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.4s var(--ease),
    background-color 0.4s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(250, 248, 244, 0.86);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent-wash), var(--blush));
  border: 1px solid var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.brand-mark.lg {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.08rem;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition:
    color 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.site-nav a:hover {
  color: var(--accent-strong);
  background: var(--accent-wash);
}

.site-nav a.is-active {
  color: var(--accent-strong);
  background: var(--accent-wash);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  place-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.35s var(--ease);
}

.nav-open .nav-toggle span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-open .nav-toggle span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 72px 0 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: soft-pulse 3.2s var(--ease) infinite;
}

@keyframes soft-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70%,
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.04;
}

.h1-prefix {
  font-style: italic;
  color: var(--accent);
}

.lead {
  margin-top: 22px;
  max-width: 36em;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.motto {
  margin: 26px 0 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent-strong);
  max-width: 30em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 0.97rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    background-color 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(43, 122, 124, 0.7);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
}

/* Hero card */

.hero-card {
  position: relative;
  padding: 36px 30px 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.monogram {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent-wash) 10%, var(--blush) 90%);
  border: 1px solid var(--accent-soft);
}

.monogram span {
  font-family: var(--serif);
  font-size: 2.6rem;
  color: var(--accent-strong);
  letter-spacing: 0.04em;
}

.monogram::before,
.monogram::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid var(--accent-soft);
  animation: breathe 7s ease-in-out infinite;
}

.monogram::after {
  inset: -26px;
  opacity: 0.55;
  animation-delay: -3.5s;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.35;
  }
}

.hero-card-title {
  margin-top: 40px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.glance {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.glance li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}

.glance strong {
  display: block;
  font-weight: 600;
  font-size: 0.97rem;
}

.glance small {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.glance-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
}

.glance-icon .icon {
  width: 19px;
  height: 19px;
}

/* ECG line */

.ecg {
  max-width: var(--max);
  margin: 56px auto 0;
  padding: 0 24px;
  height: 72px;
}

.ecg svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ecg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.ecg-base {
  stroke: var(--accent-soft);
  stroke-width: 1.6;
}

.ecg-pulse {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 0 1000;
}

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

.section {
  padding: 104px 0;
  scroll-margin-top: 60px;
}

.section.tint {
  background: linear-gradient(180deg, rgba(242, 246, 244, 0) 0%, var(--bg-tint) 14%, var(--bg-tint) 86%, rgba(242, 246, 244, 0) 100%);
}

.section-head {
  margin-bottom: 48px;
  max-width: 40em;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head h2 {
  margin-top: 12px;
  font-size: clamp(1.9rem, 3.8vw, 2.7rem);
  line-height: 1.15;
}

.section-intro {
  margin-top: 14px;
  color: var(--ink-soft);
}

.period-pill {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--accent-strong);
  box-shadow: var(--shadow);
}

/* Cards */

.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent-soft);
}

.card h3 {
  font-size: 1.3rem;
  line-height: 1.3;
}

.card p {
  color: var(--ink-soft);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.card-top h3 + p {
  margin-top: 2px;
  font-size: 0.92rem;
}

.icon-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  background: var(--accent-wash);
  color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}

.about-grid .section-head {
  margin-bottom: 0;
}

.about-copy {
  display: grid;
  gap: 16px;
  font-size: 1.06rem;
  color: var(--ink-soft);
  padding-top: 34px;
}

.values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}

.value-card {
  padding: 26px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}

.value-card h3 {
  margin-top: 18px;
  font-size: 1.2rem;
}

.value-card p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* House job timeline */

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-soft));
  transform-origin: left center;
  transition: transform 1.6s var(--ease);
}

.tl-item {
  position: relative;
  isolation: isolate;
  padding: 44px 24px 26px;
  text-align: center;
}

.tl-item::after {
  content: "";
  position: absolute;
  inset: 34px 0 0;
  z-index: -1;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.5s var(--ease),
    transform 0.5s var(--ease);
}

.tl-item:hover::after {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.tl-dot {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 6px var(--bg-tint);
}

.tl-step {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 0.95rem;
}

.tl-item h3 {
  margin-top: 6px;
  font-size: 1.28rem;
  line-height: 1.3;
}

.tl-meta {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.tl-date {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-strong);
  font-size: 0.84rem;
}

.note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
  color: var(--ink-soft);
  font-size: 0.97rem;
  text-align: center;
}

.note .icon {
  color: var(--accent);
}

/* Experience */

.exp-intern {
  margin-bottom: 20px;
}

.intern-depts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.intern-dept {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  border: 1px solid var(--accent-soft);
}

.dept-name {
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--ink);
}

.card .dept-date {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--accent-strong);
}

.intern-note {
  margin-top: 18px;
  font-size: 0.97rem;
}

.exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.rotations {
  margin: 24px 0 0;
  display: grid;
  gap: 18px;
}

.rotations > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.rotations dt {
  padding-top: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.rotations dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.plain-list li {
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
}

.plain-list li:last-child {
  border-bottom: 0;
}

/* Skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.skill h3 {
  margin-top: 18px;
}

.skill p {
  margin-top: 8px;
}

.skill .chips {
  margin-top: 16px;
}

.skill-wide {
  grid-column: 1 / -1;
}

/* Education */

.edu-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
}

.edu .year {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-strong);
  font-size: 0.84rem;
}

.edu h3 {
  margin-top: 18px;
  font-size: 1.5rem;
}

.edu p:not(.year) {
  margin-top: 6px;
}


.edu-main {
  background: linear-gradient(160deg, var(--surface) 40%, var(--accent-wash));
}

.credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.cred {
  background: linear-gradient(160deg, var(--surface) 45%, var(--blush));
}

/* Academics */

.academics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.acad-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.acad-research {
  background: linear-gradient(160deg, var(--surface) 45%, var(--blush));
}

.acad-research h3 {
  font-size: 1.4rem;
}

.acad-research h3 + p {
  margin-top: 12px;
  font-size: 0.95rem;
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.entries li {
  display: grid;
  gap: 2px;
}

.entries li + li {
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.entry-date {
  font-size: 0.82rem;
  color: var(--accent-strong);
}

.entry-title {
  font-family: var(--serif);
  font-size: 1.14rem;
  line-height: 1.35;
}

.entries .muted {
  font-size: 0.92rem;
}

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

.site-footer {
  padding: 88px 0 56px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--accent-wash) 100%);
}

.footer-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.footer-quote {
  max-width: 28em;
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.45;
  color: var(--accent-strong);
}

.footer-name {
  color: var(--ink-soft);
}

.to-top {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--accent);
  text-decoration: none;
}

.to-top:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.copyright {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Motion (only when JS + motion allowed) ---------- */

.motion .rise {
  animation: rise 1.1s var(--ease) both;
}

.motion .d1 {
  animation-delay: 0.05s;
}
.motion .d2 {
  animation-delay: 0.18s;
}
.motion .d3 {
  animation-delay: 0.32s;
}
.motion .d4 {
  animation-delay: 0.46s;
}
.motion .d5 {
  animation-delay: 0.6s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.motion .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}

.motion .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* keep card hover lift working after reveal */
.motion .card.reveal.is-visible:hover {
  transform: translateY(-3px);
}

.motion .timeline::before {
  transform: scaleX(0);
}

.motion .timeline.is-visible::before {
  transform: scaleX(1);
}

.motion .ecg-base {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: ecg-draw 2.6s 0.5s var(--ease) forwards;
}

.motion .ecg-pulse {
  stroke-dasharray: 70 930;
  stroke-dashoffset: 1000;
  opacity: 0;
  animation:
    ecg-fade 0.6s 3s ease forwards,
    ecg-travel 7s 3s linear infinite;
}

@keyframes ecg-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ecg-fade {
  to {
    opacity: 0.85;
  }
}

@keyframes ecg-travel {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

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

@media (max-width: 980px) {
  .hero-grid,
  .about-grid,
  .exp-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid {
    gap: 48px;
  }

  .hero-card {
    max-width: 460px;
    width: 100%;
  }

  .about-grid {
    gap: 0;
  }

  .about-copy {
    padding-top: 22px;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }

  .timeline::before {
    display: none;
  }

  .edu-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: grid;
  }

  .site-nav {
    position: absolute;
    top: 68px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.3s var(--ease),
      transform 0.3s var(--ease),
      visibility 0s linear 0.3s;
  }

  .site-nav a {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 0.3s var(--ease),
      transform 0.3s var(--ease);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .container,
  .ecg {
    padding: 0 16px;
  }

  .hero {
    padding-top: 44px;
  }

  .section {
    padding: 72px 0;
  }

  .section-head {
    margin-bottom: 32px;
  }

  .card {
    padding: 22px;
  }

  .values,
  .timeline,
  .skills-grid,
  .academics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .values {
    margin-top: 36px;
  }

  .intern-depts,
  .credentials {
    grid-template-columns: minmax(0, 1fr);
  }

  .rotations > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  .ecg {
    margin-top: 40px;
    height: 56px;
  }
}

@media (max-width: 340px) {
  .brand-name {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .ecg-pulse {
    display: none;
  }
}
