/* ==========================================================================
   TrackDX marketing site
   Palette matches the in-app "warm coral & cream" theme (Theme.swift)
   ========================================================================== */

:root {
  --coral: #E06A4E;
  --coral-dark: #C5533A;
  --peach: #F6E0D2;
  --cream: #FAF3EC;
  --card: #FFFFFF;
  --ink: #3E2C24;
  --muted: #9A8074;
  --sage: #7E9E6E;
  --amber: #D9A441;

  --radius: 16px;
  --radius-lg: 28px;
  --max-width: 1120px;
  --shadow: 0 10px 30px rgba(62, 44, 36, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}

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

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--coral);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 243, 236, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(62, 44, 36, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 500;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--coral); }

.nav-cta {
  background: var(--coral);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--coral-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: #2c1f19; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(62, 44, 36, 0.25);
}
.btn-ghost:hover { border-color: var(--ink); }

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

.hero {
  padding: 48px 0 28px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--coral-dark);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 1.1rem;
  color: #5b463c;
  max-width: 52ch;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-disclaimer {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 48ch;
  margin: 0;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
}

.phone-shot {
  width: 230px;
  border-radius: 26px;
  box-shadow: 0 24px 50px rgba(62, 44, 36, 0.22);
  border: 6px solid #fff;
}

.phone-shot--back {
  position: absolute;
  right: 0;
  top: 10px;
  opacity: 0.85;
  transform: rotate(6deg);
}

.phone-shot--front {
  position: relative;
  left: -20px;
  transform: rotate(-4deg);
}

/* ---------- Bands / sections ---------- */

.band {
  padding: 44px 0;
}

.band-cream { background: var(--cream); }
.band-peach { background: var(--peach); }

.band-coral {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
  color: #fff;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.section-title--light { color: #fff; }

.section-lead {
  font-size: 1.05rem;
  color: #5b463c;
  max-width: 68ch;
  margin: 0 0 8px;
}

.section-lead--light { color: rgba(255, 255, 255, 0.92); }

/* Pills */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  background: var(--card);
  border: 1px solid rgba(62, 44, 36, 0.08);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.pill-accent {
  background: var(--peach);
  border-color: transparent;
  color: var(--coral-dark);
}

/* Feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 22px;
}

.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: #5b463c;
  font-size: 0.94rem;
}

/* Insights band */

.insights-inner {
  display: block;
  max-width: 760px;
}


/* Two column */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

/* Medication spotlight */

.spotlight-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
}

.spotlight-art {
  display: flex;
  justify-content: center;
}

.spotlight-art .phone-shot {
  width: 260px;
  box-shadow: 0 24px 50px rgba(62, 44, 36, 0.22);
}

/* Screens grid */

.screens-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.screen-item {
  margin: 0;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.screen-item img {
  border-radius: 12px;
  margin-bottom: 12px;
}

.screen-item figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* Privacy */

.privacy-inner { max-width: 760px; }

/* Disclaimer box */

.disclaimer-box {
  background: var(--card);
  border: 1.5px solid var(--peach);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.disclaimer-box h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

.disclaimer-box p {
  margin: 0;
  color: #5b463c;
  font-size: 0.98rem;
}

/* Download */

.download-inner { text-align: center; }
.download-inner .section-lead--light { margin: 0 auto 36px; }

.store-badges {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.store-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 10px 26px 12px;
  min-width: 190px;
  cursor: default;
}

.store-badge-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.75);
}

.store-badge-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.download-note {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.download-note a {
  color: #fff;
  text-decoration: underline;
}

/* Support */

.support-inner { text-align: center; }
.support-inner .section-lead { margin: 0 auto 28px; }

/* Policy document (Privacy) */

.policy-meta {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 760px;
  margin: 0 auto 8px;
}

.policy-content {
  max-width: 760px;
  margin: 0 auto;
}

.policy-content h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  margin: 40px 0 12px;
}

.policy-content h2:first-child {
  margin-top: 0;
}

.policy-content p {
  color: #5b463c;
  font-size: 1rem;
  margin: 0 0 14px;
}

.policy-content ul {
  margin: 0 0 14px;
  padding-left: 22px;
  color: #5b463c;
}

.policy-content li {
  margin-bottom: 8px;
}

.policy-content a {
  color: var(--coral-dark);
  text-decoration: underline;
}

/* ALL-CAPS legal blocks in the Terms (warranty disclaimer, medical notice).
   Capitalisation is what makes these enforceable in many jurisdictions, so the
   text can't be lowercased — instead it's set smaller, tighter and offset so a
   wall of capitals reads as legal emphasis rather than as shouting. */

.policy-content p.policy-caps {
  font-size: 0.86rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: #6b4a3a;
  background: var(--peach);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 14px;
}

.policy-note {
  background: var(--peach);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.92rem;
  color: #6b4a3a;
  margin: 0 0 32px;
}

/* Simple content pages (About / Support) */

.page-hero {
  padding: 40px 0 8px;
  text-align: center;
}

.page-hero .section-lead { margin: 0 auto; }

.contact-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.contact-card h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.contact-card p {
  color: #5b463c;
  margin: 0 0 18px;
}

/* How-to-use grid (Support page) */

.howto-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin: 28px 0 0;
  align-items: start;
}

.howto-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.howto-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--ink);
}

.howto-card img {
  border-radius: 12px;
}

.company-block {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.philosophy-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  max-width: 68ch;
  display: grid;
  gap: 16px;
}

.philosophy-list li {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  color: #5b463c;
  font-size: 0.98rem;
}

.philosophy-list li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.02rem;
}

/* Import page */

.import-cta-wrap {
  text-align: center;
  margin: 0 0 8px;
}

.btn-secondary {
  background: var(--peach);
  color: var(--coral-dark) !important;
}
.btn-secondary:hover { background: #f0d0bb; }

.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 24px auto 0;
  max-width: 720px;
  display: grid;
  gap: 16px;
}

.steps-list li {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px 16px 62px;
  box-shadow: var(--shadow);
  color: #5b463c;
  font-size: 0.96rem;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps-list li strong {
  display: block;
  color: var(--ink);
  margin-bottom: 3px;
}

.download-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.download-card .file-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  background: var(--peach);
  color: var(--coral-dark);
  padding: 5px 12px;
  border-radius: 6px;
  margin-top: 14px;
}

.prompt-wrap {
  max-width: 820px;
  margin: 22px auto 0;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.prompt-header span {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
}

.copy-btn {
  background: var(--coral);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.copy-btn:hover { background: var(--coral-dark); }
.copy-btn.copied { background: var(--sage); }

.prompt-box {
  background: #2c1f19;
  color: #f5ece4;
  border-radius: var(--radius);
  padding: 22px 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
  margin: 0;
}

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

.site-footer {
  background: #2c1f19;
  color: rgba(255, 255, 255, 0.85);
  padding: 44px 0 32px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fff;
}

.footer-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.footer-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
}
.footer-nav a:hover { color: #fff; }

.footer-legal {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 60ch;
  margin: 6px 0 0;
}

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

@media (max-width: 900px) {
  .hero-inner,
  .two-col,
  .spotlight-inner {
    grid-template-columns: 1fr;
  }
  .hero-art { order: -1; min-height: 340px; }
  .spotlight-art { order: -1; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .screens-grid { grid-template-columns: repeat(2, 1fr); }
  .howto-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 20px;
    border-bottom: 1px solid rgba(62, 44, 36, 0.06);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(62, 44, 36, 0.06);
  }
  .nav-cta { margin-top: 10px; text-align: center; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .screens-grid { grid-template-columns: 1fr; }
  .howto-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .band { padding: 32px 0; }
  .phone-shot { width: 190px; }
  .phone-shot--front { left: 0; }
  .phone-shot--back { right: 20px; }
}
