/* Dr. Archana Joshi · site styles
   Palette: Morning Sky #CAE4DB · Honey #DCAE1D · Cerulean #00303F · Mist #7A9D96
   Motion follows Emil Kowalski's apple-design skill: instant press feedback,
   critically damped springs, symmetric enter/exit paths, reduced-motion fallbacks. */

:root {
  --sky: #CAE4DB;
  --sky-soft: #E6F2EE;
  --honey: #DCAE1D;
  --honey-deep: #C2960C;
  --cerulean: #00303F;
  --cerulean-2: #0A4253;
  --mist: #7A9D96;
  --mist-ink: #4A6B65;     /* mist dark enough for body text (≥4.5:1) */

  --bg: #F6FAF8;
  --surface: #FFFFFF;
  --surface-2: #EEF5F2;
  --ink: #0E2A32;
  --ink-2: #3F5D58;
  --line: rgba(0, 48, 63, 0.12);
  --line-strong: rgba(0, 48, 63, 0.22);
  --focus: #0A6E8A;
  --danger: #A33A2A;
  --danger-bg: #FBEDEA;
  --ok: #2F6B4F;
  --ok-bg: #E4F2EA;
  --on-honey: #00303F;
  --glass: rgba(246, 250, 248, 0.72);
  --shadow-1: 0 1px 2px rgba(0, 48, 63, 0.06), 0 2px 8px rgba(0, 48, 63, 0.05);
  --shadow-2: 0 2px 6px rgba(0, 48, 63, 0.06), 0 18px 40px -12px rgba(0, 48, 63, 0.22);

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1120px;

  /* critically damped spring approximation (damping 1.0, response ~0.35s) */
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 340ms;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #001F29;
  --surface: #032B37;
  --surface-2: #073745;
  --ink: #E6F2EE;
  --ink-2: #A9C6BF;
  --mist-ink: #9DBDB6;
  --line: rgba(202, 228, 219, 0.13);
  --line-strong: rgba(202, 228, 219, 0.24);
  --focus: #7FD3E6;
  --danger: #F2A595;
  --danger-bg: rgba(242, 165, 149, 0.12);
  --ok: #9ED9B8;
  --ok-bg: rgba(158, 217, 184, 0.12);
  --glass: rgba(0, 31, 41, 0.7);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #001F29;
    --surface: #032B37;
    --surface-2: #073745;
    --ink: #E6F2EE;
    --ink-2: #A9C6BF;
    --mist-ink: #9DBDB6;
    --line: rgba(202, 228, 219, 0.13);
    --line-strong: rgba(202, 228, 219, 0.24);
    --focus: #7FD3E6;
    --danger: #F2A595;
    --danger-bg: rgba(242, 165, 149, 0.12);
    --ok: #9ED9B8;
    --ok-bg: rgba(158, 217, 184, 0.12);
    --glass: rgba(0, 31, 41, 0.7);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

*, *::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: 400 1rem/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 400ms ease, color 400ms ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ── type ─────────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
}
h1, h2, h3 { margin: 0; }
.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── buttons ──────────────────────────────────────────── */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast) ease-out, background-color var(--t-fast) ease, box-shadow var(--t-fast) ease, border-color var(--t-fast) ease, opacity var(--t-fast) ease;
}
.btn:active { transform: scale(0.97); transition-duration: 80ms; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--honey); color: var(--on-honey); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 16px -6px rgba(194,150,12,.6); }
.btn-primary:hover:not([disabled]) { background: #E4B92A; }
.btn-dark { background: var(--cerulean); color: #fff; }
:root[data-theme="dark"] .btn-dark { background: var(--sky); color: var(--cerulean); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-dark { background: var(--sky); color: var(--cerulean); } }
.btn-dark:hover:not([disabled]) { background: var(--cerulean-2); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--ink); min-height: 40px; padding: 0 12px; }
.btn-quiet:hover:not([disabled]) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #2A0B05; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link:hover { text-decoration-color: currentColor; }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; }

/* ── header (translucent material) ────────────────────── */
.preview-bar {
  background: #FFF4CC; color: #5B4706;
  font-size: 0.875rem; text-align: center; padding: 8px var(--gutter);
}
:root[data-theme="dark"] .preview-bar { background: #3A3105; color: #F4E3A1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .preview-bar { background: #3A3105; color: #F4E3A1; } }
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  transition: box-shadow 240ms ease, background-color 240ms ease;
}
.site-head.scrolled { box-shadow: 0 1px 0 var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-name small { display: block; font-family: var(--font-text); font-size: 0.75rem; color: var(--ink-2); letter-spacing: 0; margin-top: -2px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 0.9375rem; color: var(--ink-2); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.head-cta { margin-left: 8px; }
.site-head .wrap > .head-cta:nth-child(2) { margin-left: auto; }
@media (max-width: 820px) {
  .site-nav { display: none; }
  .head-cta { margin-left: auto; }
  .brand-name small { display: none; }
}
@media (max-width: 480px) { .call-num { display: none; } }
@media (max-width: 380px) { .brand-name { font-size: 1.1rem; } .head-cta { padding: 0 16px; } }

/* ── forms ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-s);
  font-size: 1rem; /* 16px stops iOS zoom */
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select { -webkit-appearance: none; appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237A9D96' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--mist); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--mist); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.field.bad .input, .field.bad .select { border-color: var(--danger); }
.field .err { font-size: 0.8125rem; color: var(--danger); min-height: 0; }
.field .err:empty { display: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9375rem; line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cerulean); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; position: relative; isolation: isolate; }
.seg button {
  position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer;
  min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; color: var(--ink-2);
  transition: color var(--t-fast) ease, transform var(--t-fast) ease-out;
}
.seg button:active { transform: scale(0.97); }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--spring), width var(--t-med) var(--spring); }

/* ── sheet / dialog ───────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 24, 32, 0.42); opacity: 0; transition: opacity 280ms ease; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 81; left: 50%; bottom: 0;
  width: min(560px, 100%); max-height: min(92vh, 900px);
  transform: translate(-50%, 100%);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; overflow: hidden;
  will-change: transform;
}
.sheet .grab { flex: none; height: 26px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet .grab::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sheet .sheet-head { padding: 0 24px 8px; display: flex; align-items: flex-start; gap: 12px; }
.sheet .sheet-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; letter-spacing: -0.015em; line-height: 1.1; flex: 1; }
.sheet .sheet-body { padding: 8px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform var(--t-fast) ease-out; }
.icon-btn:active { transform: scale(0.94); }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: var(--r-l); transform: translate(-50%, -46%) scale(0.98); opacity: 0; }
  .sheet .grab { visibility: hidden; height: 18px; }
}

/* ── misc ─────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }
.pill.warn { background: #FFF4CC; color: #6B5306; }
.notice { padding: 14px 16px; border-radius: var(--r-m); background: var(--surface-2); font-size: 0.9375rem; line-height: 1.5; }
.notice.bad { background: var(--danger-bg); color: var(--danger); }
.toast-host { position: fixed; z-index: 100; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: min(440px, calc(100% - 32px)); }
.toast { pointer-events: auto; background: var(--cerulean); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-2); font-size: 0.9375rem;
  transform: translateY(16px) scale(0.98); opacity: 0; transition: transform var(--t-med) var(--spring), opacity 200ms ease; }
.toast.on { transform: none; opacity: 1; }
.toast.bad { background: var(--danger); }
:root[data-theme="dark"] .toast { background: var(--sky); color: var(--cerulean); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: var(--sky); color: var(--cerulean); } }

.site-foot { border-top: 1px solid var(--line); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--ink-2); font-size: 0.9375rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; }
.site-foot strong { color: var(--ink); font-weight: 600; }
.site-foot a { color: var(--ink-2); }
.emergency { color: var(--danger); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .scrim, .toast { transition: opacity 200ms ease !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-head { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 0 var(--line); }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 48, 63, 0.4); --line-strong: rgba(0, 48, 63, 0.7); --ink-2: #213F44; }
}
