/* =====================================================================
   Doc2Go Health — Design System
   A warm, premium, editorial medical aesthetic.
   Teal + cream + coral. Built for motion and clarity.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --cream:        #FBF8F3;
  --cream-2:      #F3ECE0;
  --white:        #ffffff;

  --ink:          #0C2A27;
  --ink-2:        #173A36;
  --ink-soft:     rgba(12, 42, 39, 0.66);
  --ink-faint:    rgba(12, 42, 39, 0.42);
  --line:         rgba(12, 42, 39, 0.10);
  --line-strong:  rgba(12, 42, 39, 0.16);

  --teal-900:     #07332E;
  --teal-800:     #0A4239;
  --teal-700:     #0E5F55;
  --teal-600:     #11806F;
  --teal-500:     #169C86;
  --teal-400:     #36B89F;
  --teal-300:     #74D8C2;
  --mint:         #E8F6F1;
  --mint-2:       #D7EFE7;

  --coral:        #FF6B4A;
  --coral-600:    #F4502C;
  --coral-soft:   #FFE6DF;
  --amber:        #FFB23E;

  /* Official Doc2Go logo colours */
  --logo-teal:    #0E7B86;
  --logo-blue:    #1C6CA8;
  --logo-green:   #2E9C5A;
  --logo-red:     #E5302A;

  /* Semantic */
  --bg:           var(--cream);
  --surface:      var(--white);
  --primary:      var(--teal-600);
  --primary-ink:  var(--teal-900);
  --accent:       var(--coral);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:    "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 128px;

  /* Radii */
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px; --r-pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(12,42,39,.06), 0 2px 6px rgba(12,42,39,.05);
  --sh-2: 0 6px 18px rgba(12,42,39,.08), 0 2px 6px rgba(12,42,39,.05);
  --sh-3: 0 18px 48px rgba(12,42,39,.14), 0 6px 16px rgba(12,42,39,.08);
  --sh-glow: 0 18px 50px rgba(17,128,111,.28);
  --sh-coral: 0 14px 34px rgba(255,107,74,.34);

  /* Motion */
  --e-out: cubic-bezier(.16,1,.3,1);
  --e-in-out: cubic-bezier(.65,0,.35,1);
  --e-spring: cubic-bezier(.34,1.56,.64,1);
  --t-fast: .18s var(--e-out);
  --t-med: .4s var(--e-out);
  --t-slow: .7s var(--e-out);

  --maxw: 1200px;
  --header-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--teal-300); color: var(--teal-900); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; color: var(--ink); }
.display { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.035em; }
.h-xl { font-size: clamp(2.1rem, 4.8vw, 3.6rem); }
.h-lg { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.h-md { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
.lead { font-size: clamp(1.06rem, 1.6vw, 1.28rem); color: var(--ink-soft); line-height: 1.62; }
.fra-italic { font-family: var(--font-display); font-style: italic; font-weight: 500; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal-600);
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--teal-500), var(--coral));
}
.eyebrow.center::before { display: none; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.wrap-wide { width: min(100% - 40px, 1340px); margin-inline: auto; }
section { position: relative; }
.section-pad { padding: clamp(64px, 10vw, 128px) 0; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.measure { max-width: 62ch; }
.measure-sm { max-width: 46ch; }
.grid { display: grid; gap: var(--sp-5); }
.stack > * + * { margin-top: var(--sp-4); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; padding: 15px 26px; border-radius: var(--r-pill);
  font-weight: 700; font-size: .98rem; letter-spacing: -0.01em;
  transition: transform var(--t-fast), box-shadow var(--t-med), background var(--t-med), color var(--t-med);
  will-change: transform; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; transition: transform var(--t-fast); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: var(--sh-coral); }
.btn-primary:hover { background: var(--coral-600); transform: translateY(-2px); box-shadow: 0 18px 40px rgba(255,107,74,.42); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { background: var(--teal-800); transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--teal-600); color: var(--teal-700); transform: translateY(-2px); background: var(--mint); }
.btn-light { background: var(--cream); color: var(--ink); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn-lg { padding: 18px 32px; font-size: 1.04rem; }
.btn-block { width: 100%; }
.btn-icon { width: 46px; height: 46px; padding: 0; border-radius: 50%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--teal-700);
  transition: gap var(--t-fast), color var(--t-fast);
}
.link-arrow svg { width: 18px; height: 18px; transition: transform var(--t-fast); }
.link-arrow:hover { gap: 12px; color: var(--coral-600); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  transition: background var(--t-med), box-shadow var(--t-med), height var(--t-med), border-color var(--t-med);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(251,248,243,.82); backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: var(--sh-1); border-bottom-color: var(--line); height: 64px;
}
.nav { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; letter-spacing: -0.02em; color: var(--ink); z-index: 2; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--teal-500), var(--teal-700));
  box-shadow: var(--sh-1); transition: transform var(--t-med) var(--e-spring);
}
.brand:hover .mark { transform: rotate(-8deg) scale(1.06); }
.brand .mark svg { width: 22px; height: 22px; }
.brand b { color: var(--teal-600); font-weight: 600; }
/* Official logo lockup */
.logo-ico { width: 34px; height: 38px; flex: none; transition: transform var(--t-med) var(--e-spring); }
.brand:hover .logo-ico { transform: rotate(-6deg) scale(1.07); }
.wm { font-family: var(--font-sans); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.035em; line-height: 1; }
.wm-doc { color: var(--logo-blue); }
.wm-go { color: var(--logo-green); }
.site-header.scrolled .logo-ico { width: 31px; height: 35px; }
/* Real PNG logo (header) — falls back to the SVG lockup if the file is absent */
.brand-img { height: 42px; width: auto; display: block; transition: height var(--t-med), transform var(--t-med) var(--e-spring); }
.site-header.scrolled .brand-img { height: 34px; }
.brand:hover .brand-img { transform: scale(1.04) rotate(-2deg); }
.brand-lockup { align-items: center; gap: 11px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  position: relative; padding: 9px 14px; border-radius: var(--r-pill);
  font-weight: 600; font-size: .96rem; color: var(--ink-soft);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover { color: var(--ink); background: rgba(12,42,39,.05); }
.nav-links a.active { color: var(--teal-700); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--coral);
}
.nav-cta { display: flex; align-items: center; gap: 12px; z-index: 2; }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; position: relative; z-index: 2; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform var(--t-med), opacity var(--t-fast), top var(--t-med); }
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
body.nav-open .nav-toggle span:nth-child(1) { top: 22px; transform: rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; background: var(--cream);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 0 32px; opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med);
}
body.nav-open .mobile-menu { opacity: 1; visibility: visible; transform: none; }
.mobile-menu a {
  font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3.2rem); font-weight: 600;
  letter-spacing: -0.03em; padding: 6px 0; color: var(--ink);
  opacity: 0; transform: translateY(18px);
}
body.nav-open .mobile-menu a { animation: menuIn .5s var(--e-out) forwards; }
body.nav-open .mobile-menu a:nth-child(1){animation-delay:.06s}
body.nav-open .mobile-menu a:nth-child(2){animation-delay:.12s}
body.nav-open .mobile-menu a:nth-child(3){animation-delay:.18s}
body.nav-open .mobile-menu a:nth-child(4){animation-delay:.24s}
body.nav-open .mobile-menu a:nth-child(5){animation-delay:.30s}
body.nav-open .mobile-menu a:nth-child(6){animation-delay:.36s}
.mobile-menu .mm-cta { margin-top: 24px; color: #fff; }
.mobile-menu a.btn-ghost { color: var(--ink); }
@keyframes menuIn { to { opacity: 1; transform: none; } }

/* Scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 120;
  transform: scaleX(0); transform-origin: 0 50%; will-change: transform;
  background: linear-gradient(90deg, var(--teal-500), var(--coral));
  box-shadow: 0 0 12px rgba(255,107,74,.4);
}

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; border-radius: 50%; mix-blend-mode: normal; will-change: transform; }
.cursor-dot { width: 7px; height: 7px; background: var(--coral); transform: translate(-50%,-50%); transition: opacity .2s; }
.cursor-ring { width: 38px; height: 38px; border: 1.6px solid rgba(17,128,111,.55); transform: translate(-50%,-50%); transition: width .25s var(--e-out), height .25s var(--e-out), border-color .25s, background .25s, opacity .25s; }
.cursor-ring.hover { width: 60px; height: 60px; background: rgba(17,128,111,.08); border-color: var(--teal-500); }
.cursor-ring.down { width: 30px; height: 30px; }
body.using-cursor { cursor: none; }
body.using-cursor a, body.using-cursor button { cursor: none; }
@media (hover: none) { .cursor-dot, .cursor-ring { display: none !important; } }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--e-out), transform .8s var(--e-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-32px); transition: opacity .8s var(--e-out), transform .8s var(--e-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal-left.is-visible { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(32px); transition: opacity .8s var(--e-out), transform .8s var(--e-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal-right.is-visible { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(.94); transition: opacity .8s var(--e-out), transform .8s var(--e-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal-scale.is-visible { opacity: 1; transform: none; }

/* word-by-word hero reveal */
.word { display: inline-block; overflow: hidden; vertical-align: top; }
.word > span { display: inline-block; transform: translateY(110%); transition: transform .9s var(--e-out); transition-delay: calc(var(--w, 0) * 55ms + .1s); }
.hero-ready .word > span { transform: none; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: .86rem; font-weight: 600; box-shadow: var(--sh-1); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); }
.chip .dot.live { background: #18c08a; box-shadow: 0 0 0 0 rgba(24,192,138,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(24,192,138,.5)} 70%{box-shadow:0 0 0 10px rgba(24,192,138,0)} 100%{box-shadow:0 0 0 0 rgba(24,192,138,0)} }
.pill-tag { display: inline-block; padding: 5px 12px; border-radius: var(--r-pill); font-size: .76rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.pill-tag.mint { background: var(--mint); color: var(--teal-700); }
.pill-tag.coral { background: var(--coral-soft); color: var(--coral-600); }
.pill-tag.amber { background: #FFF1D6; color: #B5781A; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--sh-1); transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med); }
.card:hover { transform: translateY(-6px); box-shadow: var(--sh-3); border-color: transparent; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-900); color: rgba(255,255,255,.78); padding: clamp(56px, 8vw, 96px) 0 32px; position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; inset: -40% -10% auto; height: 70%; background: radial-gradient(60% 60% at 30% 0%, rgba(54,184,159,.18), transparent 70%); pointer-events: none; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; position: relative; }
.site-footer .brand { color: #fff; --logo-teal: #9FE7D7; }
.site-footer .brand b { color: var(--teal-300); }
.site-footer .wm-doc, .site-footer .wm-go { color: #fff; }
.footer-col h4 { color: #fff; font-family: var(--font-sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: 18px; }
.footer-col a { display: block; padding: 6px 0; color: rgba(255,255,255,.72); transition: color var(--t-fast), transform var(--t-fast); }
.footer-col a:hover { color: #fff; transform: translateX(4px); }
.footer-note { color: rgba(255,255,255,.7); max-width: 34ch; margin: 18px 0 22px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #fff; transition: background var(--t-fast), transform var(--t-fast); }
.footer-social a:hover { background: var(--coral); transform: translateY(-3px); }
.footer-social svg { width: 19px; height: 19px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; color: rgba(255,255,255,.6); }

/* ---------- Utilities ---------- */
.bg-mint { background: var(--mint); }
.bg-ink { background: var(--ink); color: var(--cream); }
.bg-teal { background: var(--teal-900); color: var(--cream); }
.on-dark { color: rgba(255,255,255,.78); }
.on-dark h1,.on-dark h2,.on-dark h3,.on-dark h4 { color: #fff; }
.on-dark .lead { color: rgba(255,255,255,.74); }
.text-coral { color: var(--coral); }
.text-teal { color: var(--teal-600); }
.grad-text { background: linear-gradient(95deg, var(--logo-green) 0%, var(--teal-500) 55%, var(--teal-700) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.legal-body h2 { font-size: 1.2rem; margin: 30px 0 8px; }
.legal-body p { color: var(--ink-soft); margin-bottom: 12px; }
.legal-body a { color: var(--teal-700); text-decoration: underline; }
.legal-body p b { color: var(--ink); }
.noise::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .035; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }
.divider { height: 1px; background: var(--line); border: 0; }

/* float anim for blobs */
@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(28px,-34px) scale(1.06)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-26px,30px) scale(1.08)} }
@keyframes float3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(18px,22px)} }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

/* Skip link / a11y */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--teal-400); outline-offset: 3px; border-radius: 6px; }
