/* ============================================================================
   Titrately — Marketing Website
   Neurodiverse-safe, clinical calm, professional B2B healthcare
   ============================================================================ */

:root {
  --primary: #1F6F6B;
  --primary-dark: #155350;
  --primary-light: #E4F0EF;
  --primary-lighter: #F2F8F7;
  --ink: #1B2A2A;
  --slate: #6A7B7A;
  --muted: #8A9B9A;
  --canvas: #F6F9F8;
  --white: #FFFFFF;
  --border: #D4DFDE;
  --border-subtle: #E8EDEC;
  --stable: #2E8B6F;
  --stable-bg: #E3F2EC;
  --caution: #C9892B;
  --caution-bg: #FBF1DE;
  --alert: #B5483C;
  --alert-bg: #FAE7E4;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(27,42,42,0.06);
  --shadow-md: 0 4px 12px rgba(27,42,42,0.08);
  --shadow-lg: 0 8px 32px rgba(27,42,42,0.10);
  --shadow-xl: 0 16px 48px rgba(27,42,42,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }

/* ── Navigation ──────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav--scrolled {
  border-bottom-color: var(--border);
  background: rgba(255,255,255,0.96);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav__name {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  gap: 4px;
}

.nav__link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.nav__link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.nav__actions { display: flex; align-items: center; gap: 12px; }

.nav__cta {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.nav__cta:hover { background: var(--primary-dark); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav__toggle--active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle--active span:nth-child(2) { opacity: 0; }
.nav__toggle--active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(31,111,107,0.25);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn--white {
  background: var(--white);
  color: var(--primary);
}
.btn--white:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(255,255,255,0.2);
}

.btn--lg { padding: 14px 32px; font-size: 16px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding: 140px 32px 80px;
  background: linear-gradient(170deg, var(--white) 0%, var(--primary-lighter) 50%, var(--primary-light) 100%);
  overflow: hidden;
}

.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero__badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero__accent { color: var(--primary); }

.hero__subtitle {
  font-size: 17px;
  line-height: 1.65;
  color: var(--slate);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero__cta-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* Mockup */
.hero__mockup {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.mockup__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border-subtle);
}

.mockup__dots {
  display: flex;
  gap: 6px;
}

.mockup__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.mockup__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
}

.mockup__body { padding: 20px; }

.mockup__patient { margin-bottom: 16px; }

.mockup__patient-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.mockup__patient-meta {
  font-size: 13px;
  color: var(--slate);
  margin-top: 4px;
}

.mockup__chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.mockup__chip--watch {
  background: var(--alert-bg);
  color: var(--alert);
}

.mockup__timeline {
  background: var(--primary-lighter);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.mockup__timeline svg {
  width: 100%;
  height: 80px;
}

.mockup__legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--slate);
}

.mockup__legend i {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}

.mockup__flags { display: flex; flex-direction: column; gap: 6px; }

.mockup__flag {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

.mockup__flag--red {
  background: var(--alert-bg);
  color: var(--alert);
  border-left: 3px solid var(--alert);
}

.mockup__flag--amber {
  background: var(--caution-bg);
  color: var(--caution);
  border-left: 3px solid var(--caution);
}

.mockup__flag--green {
  background: var(--stable-bg);
  color: var(--stable);
  border-left: 3px solid var(--stable);
}

/* ── Metrics Bar ─────────────────────────────────────────────────────────── */

.metrics {
  padding: 48px 32px;
  background: var(--white);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.metrics__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.metric__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.metric__label {
  font-size: 14px;
  color: var(--slate);
  font-weight: 500;
}

/* ── Section Common ──────────────────────────────────────────────────────── */

.section__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

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

.section__badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  margin-bottom: 20px;
}

.section__title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.section__subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate);
}

/* ── Features Grid ───────────────────────────────────────────────────────── */

.features {
  padding: 96px 32px;
  background: var(--canvas);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.25s, border-color 0.25s;
}

.feature:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.feature__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.feature__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.feature__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate);
}

/* ── Split Sections ──────────────────────────────────────────────────────── */

.split {
  padding: 96px 32px;
  background: var(--white);
}

.split__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split--reversed .split__grid {
  direction: rtl;
}

.split--reversed .split__grid > * {
  direction: ltr;
}

.split__text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--slate);
  margin-bottom: 28px;
}

.split__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.split__list li {
  font-size: 15px;
  color: var(--ink);
  padding-left: 24px;
  position: relative;
}

.split__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
}

/* PK Card Demo */
.pk-demo {
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.pk-demo__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.pk-demo__icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.pk-demo__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.pk-demo__drug {
  font-size: 13px;
  color: var(--slate);
  margin-top: 2px;
}

.pk-demo__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 16px;
}

.pk-demo__guidance {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 16px;
}

.pk-demo__guidance strong { color: var(--primary-dark); }

.pk-demo__boundary {
  font-size: 12px;
  color: var(--primary-dark);
  font-style: italic;
  border-top: 1px dashed var(--primary);
  padding-top: 14px;
  line-height: 1.5;
}

/* Phone Demo */
.phone-demo {
  max-width: 340px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.phone-demo__bar {
  background: var(--primary);
  color: var(--white);
  padding: 24px 22px;
}

.phone-demo__greeting {
  font-size: 13px;
  opacity: 0.85;
}

.phone-demo__question {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

.phone-demo__body { padding: 20px 22px 24px; }

.phone-demo__section { margin-bottom: 20px; }

.phone-demo__label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--ink);
}

.phone-demo__faces {
  display: flex;
  gap: 8px;
}

.phone-demo__faces span {
  flex: 1;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.phone-demo__face--selected {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

.phone-demo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phone-demo__chips span {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  background: var(--white);
}

.phone-demo__chip--active {
  border-color: var(--stable) !important;
  background: var(--stable-bg) !important;
  color: var(--stable) !important;
  font-weight: 600 !important;
}

.phone-demo__adherence {
  display: flex;
  gap: 8px;
}

.phone-demo__adherence span {
  flex: 1;
  padding: 10px 6px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
}

.phone-demo__adh--taken {
  border-color: var(--stable) !important;
  background: var(--stable) !important;
  color: var(--white) !important;
}

/* ── Science / Principles ────────────────────────────────────────────────── */

.science {
  padding: 96px 32px;
  background: var(--canvas);
}

.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.principle {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 32px;
  transition: box-shadow 0.25s;
}

.principle:hover { box-shadow: var(--shadow-md); }

.principle__number {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 12px;
  line-height: 1;
}

.principle__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.principle__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate);
}

/* ── CTA ─────────────────────────────────────────────────────────────────── */

.cta {
  padding: 96px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.cta__content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta__title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.2;
}

.cta__text {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  padding: 48px 32px 32px;
  background: var(--ink);
  color: rgba(255,255,255,0.6);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
}

.footer__disclaimer {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,0.45);
  max-width: 800px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__links a {
  color: rgba(255,255,255,0.5);
  transition: color 0.15s;
}

.footer__links a:hover { color: rgba(255,255,255,0.8); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero__visual { order: -1; }
  .split__grid { grid-template-columns: 1fr; gap: 48px; }
  .split--reversed .split__grid { direction: ltr; }
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav__links--open { display: flex; }
  .nav__toggle { display: flex; }
  .nav__cta { display: none; }
  .metrics__inner { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .features__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 100px 20px 60px; }
  .hero__title { font-size: 28px; }
  .hero__cta-group { flex-direction: column; }
  .hero__cta-group .btn { width: 100%; }
  .metrics__inner { grid-template-columns: 1fr 1fr; }
  .nav__inner { padding: 0 20px; }
  .section__inner { padding: 0 20px; }
  .footer__bottom { flex-direction: column; gap: 12px; }
}
