/* ===================================================================
   AFG MedPrep Pro — site stylesheet
   Design direction: "Clinical precision" — a physician-built exam app.
   Ink-navy field, vitals-monitor waveform as signature motif,
   textbook-serif display paired with a humanist body face and a
   monospace utility face for data/readouts.
   =================================================================== */

:root{
  /* --- Color tokens --- */
  --ink:        #0A0E17;
  --ink-2:      #0D1320;
  --panel:      #121828;
  --panel-2:    #1A2236;
  --line:       rgba(233, 237, 245, 0.09);
  --line-strong: rgba(233, 237, 245, 0.16);
  --text:       #E9EDF5;
  --muted:      #8C96AC;
  --muted-2:    #626C82;
  --teal:       #3FDCC8;
  --teal-dim:   rgba(63, 220, 200, 0.14);
  --amber:      #E8A94E;
  --amber-dim:  rgba(232, 169, 78, 0.14);
  --rose:       #E8697C;

  /* --- Type tokens --- */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* --- Layout tokens --- */
  --maxw: 1180px;
  --gap: 24px;
  --radius: 14px;
  --radius-sm: 8px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg{ display: block; max-width: 100%; }

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

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

/* Ambient background: faint radial glow + hairline grid, fixed */
.bg-field{
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 18% -6%, rgba(63,220,200,0.10), transparent 60%),
    radial-gradient(45% 35% at 100% 10%, rgba(232,169,78,0.06), transparent 60%),
    var(--ink);
}

/* ===================== NAV ===================== */
.site-nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--text);
}
.brand-mark{ width: 30px; height: 30px; flex-shrink: 0; }
.brand small{
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 500;
  margin-top: 2px;
}

.nav-links{
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a{
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible{ color: var(--text); }
.nav-links a[aria-current="page"]{ color: var(--teal); }
.nav-links a[aria-current="page"]::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}

.nav-cta{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: #06251F;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.nav-cta:hover{ transform: translateY(-1px); box-shadow: 0 8px 24px rgba(63,220,200,0.25); }

.nav-toggle{
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 40px; height: 40px;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 860px){
  .nav-links{
    position: fixed;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    padding: 12px 28px 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a{ padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav-links .nav-cta{ margin-top: 10px; justify-content: center; }
  .nav-toggle{ display: inline-flex; align-items: center; justify-content: center; }
}

/* ===================== WAVEFORM RULE (signature motif) ===================== */
.pulse-rule{
  width: 100%;
  height: 34px;
  color: var(--teal);
  opacity: 0.55;
}
.pulse-rule.dim{ opacity: 0.25; height: 22px; }

/* ===================== HERO ===================== */
.hero{
  padding: 88px 0 56px;
}
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid rgba(232,169,78,0.28);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.eyebrow .dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

.hero h1{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 26px;
  max-width: 15ch;
}
.hero h1 em{
  font-style: italic;
  font-weight: 500;
  color: var(--teal);
}
.hero .lede{
  font-size: 19px;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 40px;
}

.hero-actions{ display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  padding: 15px 26px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:focus-visible{ outline: 2px solid var(--teal); outline-offset: 3px; }
.btn-primary{ background: var(--teal); color: #06251F; }
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 12px 30px rgba(63,220,200,0.28); }
.btn-secondary{ background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover{ border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }
.btn-ghost{ background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-ghost:hover{ border-color: var(--line-strong); }
.btn-lg{ padding: 18px 32px; font-size: 17px; }
.btn-block{ width: 100%; justify-content: center; }

.hero-note{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

/* ===================== VITALS STRIP ===================== */
.vitals{
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: var(--radius);
  padding: 30px 8px 10px;
  margin-top: 56px;
  position: relative;
  overflow: hidden;
}
.vitals-wave{
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 64px;
  color: var(--teal);
  opacity: 0.4;
}
.vitals-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
  z-index: 1;
}
.vital{
  text-align: center;
  padding: 18px 10px 22px;
  border-right: 1px solid var(--line);
}
.vital:last-child{ border-right: none; }
.vital-num{
  font-family: var(--font-mono);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.vital-num .unit{ font-size: 15px; color: var(--teal); margin-left: 2px; }
.vital-label{
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
@media (max-width: 760px){
  .vitals-grid{ grid-template-columns: repeat(2, 1fr); }
  .vital{ border-bottom: 1px solid var(--line); }
}

/* ===================== SECTIONS ===================== */
.section{ padding: 88px 0; }
.section-tight{ padding: 56px 0; }
.section-head{ max-width: 62ch; margin-bottom: 52px; }
.section-kicker{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 14px;
}
.section-head h2{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.section-head p{ color: var(--muted); font-size: 17px; margin: 0; }

.divider{ border: none; border-top: 1px solid var(--line); margin: 0; }

/* ===================== FEATURE CARDS ===================== */
.grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 920px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .grid{ grid-template-columns: 1fr; } }

.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover{ border-color: var(--line-strong); transform: translateY(-3px); }
.card-icon{
  width: 40px; height: 40px;
  color: var(--teal);
  margin-bottom: 18px;
}
.card h3{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 10px;
}
.card p{ color: var(--muted); font-size: 15px; margin: 0; }

/* ===================== COVERAGE / INDEX LIST ===================== */
.index-list{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.index-row{
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}
.index-row:last-child{ border-bottom: none; }
.index-subject{
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.index-source{
  font-size: 14px;
  color: var(--muted);
}
.index-tag{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid rgba(63,220,200,0.25);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  justify-self: end;
}
@media (max-width: 640px){
  .index-row{ grid-template-columns: 1fr; row-gap: 8px; }
  .index-tag{ justify-self: start; }
}

/* ===================== CTA BAND ===================== */
.cta-band{
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(80% 120% at 15% 0%, rgba(63,220,200,0.12), transparent 60%),
    var(--panel);
  padding: 64px 48px;
  text-align: center;
}
.cta-band h2{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 38px);
  margin: 0 0 16px;
}
.cta-band p{ color: var(--muted); margin: 0 0 32px; font-size: 17px; }
.cta-band .hero-actions{ justify-content: center; }

/* ===================== FOOTER ===================== */
.site-footer{
  border-top: 1px solid var(--line);
  padding: 56px 0 36px;
  margin-top: 40px;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-brand p{ color: var(--muted); font-size: 14.5px; max-width: 34ch; margin: 14px 0 0; }
.footer-col h4{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 16px;
}
.footer-col ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a{ color: var(--muted); font-size: 14.5px; transition: color 0.2s ease; }
.footer-col a:hover{ color: var(--teal); }
.footer-bottom{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted-2);
  font-family: var(--font-mono);
}
@media (max-width: 760px){
  .footer-grid{ grid-template-columns: 1fr; }
}

/* ===================== REVEAL ON SCROLL ===================== */
.reveal{ opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in{ opacity: 1; transform: translateY(0); }

/* ===================== PAGE HEADER (sub-pages) ===================== */
.page-head{ padding: 72px 0 40px; }
.page-head h1{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.4vw, 52px);
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.page-head p{ color: var(--muted); font-size: 18px; max-width: 52ch; margin: 0; }

/* ===================== DOWNLOAD PAGE ===================== */
.download-panel{
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: 20px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
@media (max-width: 760px){
  .download-panel{ grid-template-columns: 1fr; text-align: center; padding: 36px 26px; }
  .download-panel .hero-actions{ justify-content: center; }
}
.download-meta{
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.download-meta span{ color: var(--teal); }
.download-icon-wrap{
  width: 108px; height: 108px;
  border-radius: 20px;
  background: var(--teal-dim);
  border: 1px solid rgba(63,220,200,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}
.download-icon-wrap svg{ width: 52px; height: 52px; }

.steps{
  display: grid;
  gap: 18px;
}
.step{
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.step:last-child{ border-bottom: none; }
.step-num{
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--teal);
  border: 1px solid rgba(63,220,200,0.3);
  background: var(--teal-dim);
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3{ font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.step p{ color: var(--muted); font-size: 15px; margin: 0; }

.notice{
  border: 1px solid rgba(232,169,78,0.3);
  background: var(--amber-dim);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 14.5px;
  color: #F0D9AE;
  display: flex;
  gap: 12px;
}
.notice svg{ width: 20px; height: 20px; flex-shrink: 0; color: var(--amber); margin-top: 1px; }
.notice a{ color: var(--amber); text-decoration: underline; }

.share-box{
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 8px 18px;
}
.share-box input{
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13.5px;
  outline: none;
}
.copy-btn{
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.copy-btn:hover{ border-color: var(--teal); color: var(--teal); }
.copy-btn.copied{ border-color: var(--teal); color: var(--teal); }

/* ===================== ABOUT PAGE ===================== */
.about-layout{
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px){ .about-layout{ grid-template-columns: 1fr; } }
.about-figure{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 36px 30px;
  position: sticky;
  top: 100px;
}
.about-figure .role{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.about-figure h3{
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 6px;
}
.about-figure .place{ color: var(--muted); font-size: 14.5px; margin-bottom: 22px; }
.tag-list{ display: flex; flex-wrap: wrap; gap: 8px; }
.tag{
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
}
.about-copy p{ color: var(--muted); font-size: 17px; margin: 0 0 22px; }
.about-copy p:first-of-type{ color: var(--text); font-size: 19px; }
.about-copy h3{
  font-family: var(--font-display);
  font-size: 22px;
  margin: 36px 0 14px;
}

/* ===================== MORE APPS PAGE ===================== */
.app-card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 30px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.app-icon{
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--teal-dim);
  border: 1px solid rgba(63,220,200,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}
.app-icon svg{ width: 32px; height: 32px; }
.app-card h3{ font-family: var(--font-display); font-size: 20px; margin: 0 0 6px; }
.app-card p{ color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.app-card .btn{ padding: 10px 18px; font-size: 14px; }
.app-card.placeholder{
  border-style: dashed;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  color: var(--muted-2);
}
.app-card.placeholder .app-icon{ background: transparent; border-style: dashed; }
