/* The Med Stack — clinical brand system */

:root {
  /* Surfaces */
  --graphite-0: #08090B;
  --graphite-1: #0E1013;
  --graphite-2: #15181C;
  --graphite-3: #1C2026;
  --graphite-4: #262B33;
  --graphite-5: #3A4049;

  --paper: #F4F1EA;
  --paper-2: #EBE7DD;
  --paper-3: #DCD6C8;

  /* Clinical accents */
  --green: #3DBE7B;
  --green-deep: #1F8F58;
  --green-soft: #C7E8D4;

  --blue: #3D7BFF;
  --blue-deep: #2456D6;
  --blue-soft: #C9D7FB;

  --amber: #E9A23B;
  --red: #D9484A;

  /* Type */
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Geist", "Söhne", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Radii */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;
  --r-4: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--graphite-1);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(61,123,255,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(61,190,123,0.06), transparent 60%),
    var(--graphite-1);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* === Type primitives === */
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--font-mono); font-feature-settings: "ss01","cv11"; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.6;
}

/* === Layout === */
.page { width: 100%; }
html, body { overflow-x: hidden; }
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r-2);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--paper);
  color: var(--graphite-1);
}
.btn-primary:hover { background: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--graphite-4);
}
.btn-ghost:hover { border-color: var(--graphite-5); background: var(--graphite-2); }
.btn-green {
  background: var(--green);
  color: var(--graphite-0);
}
.btn-green:hover { background: #4BD089; }

/* === Cards === */
.card {
  background: var(--graphite-2);
  border: 1px solid var(--graphite-3);
  border-radius: var(--r-3);
  position: relative;
}
.card-paper {
  background: var(--paper);
  color: var(--graphite-1);
  border: 1px solid var(--paper-3);
  border-radius: var(--r-3);
}

/* === Hairlines === */
.hr {
  height: 1px;
  background: var(--graphite-3);
  width: 100%;
}

/* === Tag === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--graphite-4);
  color: var(--paper);
  background: var(--graphite-2);
}
.tag .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--green);
  box-shadow: 0 0 0 3px rgba(61,190,123,0.18);
}
.tag.tag-blue .dot { background: var(--blue); box-shadow: 0 0 0 3px rgba(61,123,255,0.18); }
.tag.tag-amber .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(233,162,59,0.18); }

/* === Inputs === */
input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  background: var(--graphite-2);
  color: var(--paper);
  border: 1px solid var(--graphite-4);
  border-radius: var(--r-2);
  padding: 12px 14px;
  outline: none;
  transition: border-color 140ms;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }

/* === Animations === */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
@keyframes ecg {
  0% { stroke-dashoffset: 1200; }
  100% { stroke-dashoffset: 0; }
}
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 600ms ease both; }

/* === Utilities === */
.divider-cross {
  position: relative;
  border-top: 1px solid var(--graphite-3);
}
.divider-cross::before, .divider-cross::after {
  content: "";
  position: absolute; top: -5px;
  width: 9px; height: 9px;
  border: 1px solid var(--graphite-4);
  background: var(--graphite-1);
}
.divider-cross::before { left: 0; }
.divider-cross::after { right: 0; }

/* Print labels */
.rx-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.55;
}

/* Section spacing */
section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 64px 0; } }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--graphite-4); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* Selection */
::selection { background: var(--green); color: var(--graphite-0); }

/* ============================================================
   MOBILE OVERRIDES — apply for screens narrower than 860px
   These flatten desktop grids, scale headlines, hide
   absolutely-positioned floating elements that overflow,
   and stack forms.
   ============================================================ */

@media (max-width: 860px) {
  html, body { font-size: 15px; }

  /* Hide decorative ECG line on mobile — it overlaps copy */
  .scroll-ecg { display: none !important; }

  .container { padding: 0 18px !important; }

  section { padding: 56px 0 !important; }

  /* Stack ANY 2+ column inline grid into a single column on mobile.
     This catches every inline `gridTemplateColumns: "..."` without us
     having to edit each one. */
  [style*="gridTemplateColumns"],
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Allow the hero stat strip and ship-schedule rows (which want
     a "label · text · dot" layout) to keep some structure */
  .stat-strip [style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
  }

  /* Headlines */
  h1.serif { font-size: clamp(36px, 9vw, 52px) !important; line-height: 1.04 !important; }
  h2.serif, .section { font-size: clamp(28px, 7vw, 40px) !important; line-height: 1.08 !important; }
  h3.serif { font-size: clamp(22px, 5.5vw, 30px) !important; line-height: 1.1 !important; }

  /* Hide the floating callouts on mobile — they overflow off-screen
     and don't add value at narrow widths */
  .hero-floating-callout,
  [data-mobile-hide="true"] {
    display: none !important;
  }

  /* Forms: input + button should stack and go full width */
  form > div[style*="display:flex"],
  form > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 10px !important;
  }
  form input[type="email"],
  form button[type="submit"] {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }

  /* Nav: hide the inline anchor links (Pathway, Stack OS, etc) on
     mobile since they cramp the bar; keep wordmark + CTA */
  header nav a:not(.btn) { display: none !important; }
  header nav .hr { display: none !important; }
  header nav { gap: 12px !important; }

  /* Trust strip: stack vertically with smaller gap */
  .trust-strip {
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Cards / window chrome — make sure they don't overflow horizontally */
  .card, .card-paper {
    max-width: 100% !important;
  }

  /* Knowledge graph & dashboards: scale down */
  svg { max-width: 100%; height: auto; }

  /* Eyebrow tag rows that wrap awkwardly */
  .tag, .rx-label {
    font-size: 10px !important;
  }

  /* Body padding for safe-area on iPhone */
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* Buttons full-width when stacked */
  .btn-primary, .btn-ghost, .btn-green {
    justify-content: center;
  }

  /* Reduce huge gaps */
  [style*="gap:80"], [style*="gap: 80"] { gap: 32px !important; }
  [style*="gap:48"], [style*="gap: 48"] { gap: 24px !important; }
  [style*="gap:36"], [style*="gap: 36"] { gap: 20px !important; }
  [style*="gap:32"], [style*="gap: 32"] { gap: 18px !important; }

  /* Reduce huge padding values */
  [style*="padding:56"], [style*="padding: 56"] { padding: 24px !important; }
  [style*="padding:48"], [style*="padding: 48"] { padding: 20px !important; }
}

/* Extra-narrow phones */
@media (max-width: 420px) {
  html, body { font-size: 14px; }
  h1.serif { font-size: clamp(30px, 8.5vw, 42px) !important; }
  .container { padding: 0 14px !important; }
}
