/* ---------- Tokens ---------- */
:root {
  --paper: #EDF0E7;        /* pale sage paper */
  --paper-deep: #E2E7D8;   /* quiet panels */
  --ink: #1F2E27;          /* deep forest, body text */
  --ink-soft: #4A5A50;     /* secondary text */
  --moss: #4E6555;         /* rules, small accents */
  --sage: #A9B9A0;
  --apricot: #F1B79A;      /* warmth, used sparingly */
  --plum: #4A2B3F;         /* from her abaya: actions + closing section */
  --plum-deep: #341E2C;
  --on-plum: #F5EEF0;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  /* Modular scale, ratio 1.25 from 17px body */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.328rem;
  --step-2: 1.66rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.2vw, 5.2rem);

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --measure: 34rem;

  /* Gentle spring, settles without a hard stop */
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.089 24.5%, 1.088 27%, 1.059 32.4%, 1.008 42.4%, 0.993 51%, 1.001 75%, 1);
  --ease-out: cubic-bezier(.22, .8, .24, 1);
}

*, *::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: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; font-variation-settings: "SOFT" 100; margin: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  border-radius: 999px; border: 1.5px solid var(--plum);
  background: var(--plum); color: var(--on-plum);
  font: 500 var(--step-0)/1 var(--sans);
  text-decoration: none; cursor: pointer;
  transition: transform .5s var(--spring), background-color .25s;
}
.btn:hover { background: var(--plum-deep); }
.btn:active { transform: scale(.97); }
.btn-small { min-height: 40px; padding: 0 1.1rem; font-size: var(--step--1); }
.btn-ghost { background: transparent; color: var(--plum); }
.btn-ghost:hover { background: rgba(74, 43, 63, .07); }
.btn-ghost[aria-pressed="true"] { background: var(--plum); color: var(--on-plum); }
.btn-light { background: var(--on-plum); color: var(--plum-deep); border-color: var(--on-plum); }
.btn-light:hover { background: #fff; }
.btn-outline-light { background: transparent; color: var(--on-plum); border-color: rgba(245, 238, 240, .5); }
.btn-outline-light:hover { background: rgba(245, 238, 240, .08); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: box-shadow .3s;
}
.top.scrolled { box-shadow: 0 1px 0 rgba(31, 46, 39, .1); }
.wordmark { font-family: var(--serif); font-size: 1.35rem; text-decoration: none; font-variation-settings: "SOFT" 100, "opsz" 30; }
.top nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.top nav a { text-decoration: none; font-size: var(--step--1); color: var(--ink-soft); }
.top nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 860px) { .top nav { display: none; } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2rem;
  min-height: calc(100svh - 70px);
  padding: 2rem var(--gutter) 3rem;
  max-width: 1280px; margin: 0 auto;
}
.hero-title {
  font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.025em;
  font-variation-settings: "SOFT" 100, "opsz" 144; font-weight: 300;
  margin-bottom: 1.6rem;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; }
.hero-lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 30rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.6rem; }
.hero-langs { font-size: var(--step--1); color: var(--ink-soft); }
.hero-langs .hi { font-family: "Noto Serif Devanagari", serif; font-size: 1.1em; }
.hero-langs .ur { font-family: "Noto Nastaliq Urdu", serif; font-size: 1.05em; line-height: 1; }

.hero-visual { position: relative; aspect-ratio: 4 / 5; max-height: 78svh; justify-self: center; width: 100%; max-width: 520px; }
.blob { position: absolute; inset: 8% -6% 0 -6%; width: 112%; height: 92%; overflow: visible; }
.blob path { transform-origin: center; }
.portrait {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  height: 100%; width: auto; max-width: none;
  /* soft fade so the cut-out sits into the page rather than on it */
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}
.breath-cue {
  position: absolute; left: 50%; bottom: -.5rem; transform: translateX(-50%);
  margin: 0; min-height: 1.6em; white-space: nowrap;
  font-family: var(--serif); font-size: var(--step-1); font-style: italic; color: var(--plum);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  padding: .1rem .9rem; border-radius: 999px;
  opacity: 0; transition: opacity .6s;
}
.breathing .breath-cue { opacity: 1; }

/* Page-load sequence. JS adds .is-ready to <html> once fonts are in. */
.js .hero-title .line > span { transform: translateY(105%); }
.js .hero-lede, .js .hero-actions, .js .hero-langs { opacity: 0; transform: translateY(12px); }
.js .portrait { opacity: 0; transform: translate(-50%, 6%); }
.js .blob { opacity: 0; transform: scale(.7); }
.is-ready .hero-title .line > span { transform: none; transition: transform 1.1s var(--ease-out); }
.is-ready .hero-title .line:nth-child(2) > span { transition-delay: .09s; }
.is-ready .hero-title .line:nth-child(3) > span { transition-delay: .18s; }
.is-ready .blob { opacity: 1; transform: none; transition: opacity 1.2s .1s, transform 1.6s .1s var(--spring); }
.is-ready .portrait { opacity: 1; transform: translate(-50%, 0); transition: opacity 1s .35s, transform 1.3s .35s var(--ease-out); }
.is-ready .hero-lede, .is-ready .hero-actions, .is-ready .hero-langs { opacity: 1; transform: none; transition: opacity .9s, transform .9s var(--ease-out); }
.is-ready .hero-lede { transition-delay: .45s; }
.is-ready .hero-actions { transition-delay: .55s; }
.is-ready .hero-langs { transition-delay: .65s; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 1.5rem; gap: 2.5rem; }
  .hero-visual { max-width: 340px; max-height: none; }
}

/* ---------- Shared section rhythm ---------- */
main > section:not(.hero) { padding: clamp(4rem, 9vw, 7.5rem) var(--gutter); max-width: 1280px; margin: 0 auto; }
.section-title { font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 2.5rem; font-variation-settings: "SOFT" 100, "opsz" 72; }
.section-intro { color: var(--ink-soft); max-width: var(--measure); margin-top: -1.5rem; margin-bottom: 2.5rem; }

/* ---------- Who I work with ---------- */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid rgba(31, 46, 39, .18); }
.people li { padding: 2rem 2rem 0 0; }
.people li + li { padding-left: 2rem; border-left: 1px solid rgba(31, 46, 39, .18); }
.people h3 { font-size: var(--step-2); margin-bottom: .75rem; }
.people p { color: var(--ink-soft); max-width: 22rem; }
@media (max-width: 760px) {
  .people { grid-template-columns: 1fr; }
  .people li, .people li + li { padding: 1.6rem 0; border-left: 0; border-bottom: 1px solid rgba(31, 46, 39, .18); }
}

/* ---------- How it works (a real sequence, so it's numbered) ---------- */
.process { background: var(--paper-deep); border-radius: 32px; max-width: calc(1280px - 2 * var(--gutter)) !important; }
.steps-wrap { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 1.5rem; max-width: 46rem; }
.steps-line { width: 12px; height: 100%; justify-self: center; overflow: visible; }
.steps-line path { fill: none; stroke: var(--moss); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 3.5rem; }
.steps li { counter-increment: step; position: relative; }
.steps li::before {
  content: counter(step);
  position: absolute; left: calc(-1.5rem - 40px); top: -.1rem;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: 1.5px solid var(--moss);
  font-family: var(--serif); font-size: 1.1rem; color: var(--moss);
  transition: background-color .4s, color .4s, transform .6s var(--spring);
}
.steps li.reached::before { background: var(--moss); color: var(--paper); transform: scale(1.08); }
.steps h3 { font-size: var(--step-2); margin-bottom: .5rem; }
.steps p { color: var(--ink-soft); max-width: var(--measure); margin: 0; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 6rem); }
.about-lede { font-family: var(--serif); font-size: var(--step-2); line-height: 1.35; font-variation-settings: "SOFT" 100, "opsz" 36; margin-bottom: 1.4rem; }
.about-text p:not(.about-lede) { max-width: var(--measure); color: var(--ink-soft); line-height: 1.7; }
.fact-block + .fact-block { margin-top: 2.5rem; }
.fact-block h3 { font-family: var(--sans); font-weight: 600; font-size: var(--step--1); color: var(--moss); margin-bottom: 1rem; }
.timeline, .edu { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid rgba(31, 46, 39, .14); }
.timeline .when { font-variant-numeric: tabular-nums; color: var(--moss); font-size: var(--step--1); padding-top: .15rem; }
.edu li { padding: .8rem 0; border-top: 1px solid rgba(31, 46, 39, .14); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Short reads ---------- */
.read-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.read {
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1.8rem 1.6rem 2rem; min-height: 15rem;
  background: transparent; border: 1.5px solid rgba(31, 46, 39, .2); border-radius: 22px;
  transition: border-color .3s, background-color .3s, transform .6s var(--spring);
}
.read:hover { border-color: var(--moss); background: rgba(255, 255, 255, .35); }
.read:active { transform: scale(.985); }
.read-title { font-family: var(--serif); font-size: var(--step-2); line-height: 1.15; font-variation-settings: "SOFT" 100, "opsz" 48; }
.read-sub { color: var(--ink-soft); margin-top: auto; }
@media (max-width: 860px) { .read-list { grid-template-columns: 1fr; } .read { min-height: 0; } }

/* Reader dialog: grows out of the card that opened it (origin set in JS) */
.reader {
  width: min(44rem, 100vw - 2rem); max-height: min(88svh, 60rem);
  padding: 0; border: 0; border-radius: 26px;
  background: #F7F8F3; color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(31, 46, 39, .35);
  opacity: 0; transform: scale(.94) translateY(16px);
  transform-origin: var(--origin-x, 50%) var(--origin-y, 50%);
  transition: opacity .35s, transform .55s var(--spring), overlay .35s allow-discrete, display .35s allow-discrete;
}
.reader[open] { opacity: 1; transform: none; }
@starting-style { .reader[open] { opacity: 0; transform: scale(.94) translateY(16px); } }
.reader::backdrop { background: rgba(31, 46, 39, 0); backdrop-filter: blur(0); transition: background-color .35s, backdrop-filter .35s, overlay .35s allow-discrete, display .35s allow-discrete; }
.reader[open]::backdrop { background: rgba(31, 46, 39, .35); backdrop-filter: blur(4px); }
@starting-style { .reader[open]::backdrop { background: rgba(31, 46, 39, 0); backdrop-filter: blur(0); } }
.reader-inner { padding: clamp(1.5rem, 5vw, 3rem); overflow-y: auto; max-height: inherit; }
.reader-close {
  position: sticky; top: 0; float: right; margin: -.5rem -.5rem 0 1rem;
  font: 500 var(--step--1) var(--sans); color: var(--ink);
  background: var(--paper); border: 0; border-radius: 999px; padding: .55rem 1rem; cursor: pointer;
}
.reader h2 { font-size: var(--step-3); line-height: 1.1; margin-bottom: 1.2rem; font-variation-settings: "SOFT" 100, "opsz" 72; }
.reader h3 { font-size: var(--step-1); margin: 1.8rem 0 .5rem; }
.reader p, .reader li { line-height: 1.7; color: #33433A; }
.reader ul, .reader ol { padding-left: 1.2rem; }
.reader li { margin-bottom: .35rem; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 48rem; border-top: 1px solid rgba(31, 46, 39, .18); }
.faq details { border-bottom: 1px solid rgba(31, 46, 39, .18); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.3rem 0; font-family: var(--serif); font-size: var(--step-1);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(var(--moss), var(--moss)) center/100% 1.5px no-repeat,
              linear-gradient(var(--moss), var(--moss)) center/1.5px 100% no-repeat;
  transition: transform .5s var(--spring);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); max-width: 40rem; padding-bottom: 1.3rem; margin: 0; }
/* Smooth open/close where supported */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height .45s var(--ease-out), content-visibility .45s allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

/* ---------- Contact ---------- */
.contact {
  background: var(--plum); color: var(--on-plum);
  border-radius: 32px; text-align: left;
  max-width: calc(1280px - 2 * var(--gutter)) !important;
  margin-bottom: 3rem !important;
}
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact h2 { font-size: var(--step-4); line-height: 1; letter-spacing: -0.025em; font-weight: 300; font-variation-settings: "SOFT" 100, "opsz" 144; margin-bottom: 1.4rem; }
.contact-intro p { max-width: 26rem; font-size: var(--step-1); color: rgba(245, 238, 240, .82); margin-bottom: 1.2rem; }
.contact-intro .contact-private { font-size: var(--step-0); color: var(--apricot); }
.contact-intro .contact-alt { font-size: var(--step--1); color: rgba(245, 238, 240, .65); margin-top: 2rem; }
.contact-intro a { color: var(--on-plum); text-underline-offset: 3px; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

/* Form on plum */
.contact-panel { position: relative; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1rem; }
.contact-form .field { margin: 0; min-width: 0; }
.contact-form .field:nth-of-type(n+3), .contact-form .btn-send, .contact-form .field-choices { grid-column: 1 / -1; }
@media (max-width: 560px) { .contact-form { grid-template-columns: 1fr; } .contact-form .field { grid-column: 1 / -1; } }

.field label, .field legend { display: block; font-size: var(--step--1); font-weight: 500; color: rgba(245, 238, 240, .9); margin-bottom: .45rem; padding: 0; }
.field .optional { font-weight: 400; color: rgba(245, 238, 240, .6); }
fieldset.field { border: 0; padding: 0; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; font: 400 1rem/1.5 var(--sans); /* 16px stops iOS zooming on focus */
  color: var(--on-plum); background: rgba(245, 238, 240, .08);
  border: 1.5px solid rgba(245, 238, 240, .22); border-radius: 14px;
  padding: .8rem 1rem; transition: border-color .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 8.5rem; }
.field input::placeholder, .field textarea::placeholder { color: rgba(245, 238, 240, .45); }
.field input:hover, .field textarea:hover { border-color: rgba(245, 238, 240, .4); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--apricot); background: rgba(245, 238, 240, .12); }
.field [aria-invalid="true"] { border-color: #F3A08B; }
.field-error { margin: .4rem 0 0; font-size: var(--step--1); color: #FFC4B3; min-height: 0; }
.field-error:empty { display: none; }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; margin: 0 !important; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem;
  border-radius: 999px; border: 1.5px solid rgba(245, 238, 240, .3);
  font-size: var(--step--1); color: var(--on-plum); cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .5s var(--spring);
}
.choice input:hover + span { border-color: rgba(245, 238, 240, .6); }
.choice input:checked + span { background: var(--on-plum); color: var(--plum-deep); border-color: var(--on-plum); transform: scale(1.04); }
.choice input:focus-visible + span { outline: 2px solid var(--apricot); outline-offset: 3px; }
.field-choices[aria-invalid="true"] .choice span { border-color: #F3A08B; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn-send { justify-self: start; min-width: 12rem; margin-top: .4rem; position: relative; }
.btn-send[aria-busy="true"] { pointer-events: none; }
.btn-send[aria-busy="true"] .btn-label { opacity: .55; }
.btn-send[aria-busy="true"]::after {
  content: ""; width: 16px; height: 16px; margin-left: .7rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .btn-send { justify-self: stretch; } }

.form-status { margin: 0 0 1.2rem; padding: .9rem 1.1rem; border-radius: 14px; background: rgba(243, 160, 139, .16); color: #FFD9CE; font-size: var(--step--1); }
.form-status a { color: inherit; }

/* Sent state: the form folds away and a tick draws itself */
.contact-form.leaving { opacity: 0; transform: translateY(-10px) scale(.98); transition: opacity .35s, transform .45s var(--ease-out); }
.form-sent { padding: clamp(1rem, 4vw, 2.5rem) 0; }
.form-sent:focus { outline: none; }
.form-sent h3 { font-size: var(--step-3); line-height: 1.1; font-weight: 300; font-variation-settings: "SOFT" 100, "opsz" 72; margin: 1.2rem 0 .8rem; }
.form-sent p { color: rgba(245, 238, 240, .82); font-size: var(--step-1); max-width: 28rem; }
.sent-mark { width: 64px; height: 64px; fill: none; stroke: var(--apricot); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sent-mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; }
.sent-mark path { stroke-dasharray: 36; stroke-dashoffset: 36; }
.form-sent.show circle { animation: draw .7s var(--ease-out) forwards; }
.form-sent.show path { animation: draw .45s .55s var(--ease-out) forwards; }
.form-sent.show h3, .form-sent.show p { animation: rise-in .7s .3s var(--ease-out) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Footer ---------- */
.foot { padding: 0 var(--gutter) 3rem; max-width: 1280px; margin: 0 auto; font-size: var(--step--1); color: var(--ink-soft); }
.crisis { max-width: 48rem; padding: 1.2rem 1.4rem; border-left: 3px solid var(--apricot); background: rgba(241, 183, 154, .14); border-radius: 0 12px 12px 0; }
.crisis strong { color: var(--ink); }
.fine { margin-top: 1.5rem; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; }
  .js .hero-title .line > span, .js .hero-lede, .js .hero-actions, .js .hero-langs, .js .blob { transform: none; opacity: 1; }
  .js .portrait { transform: translateX(-50%); opacity: 1; }
}
