/* IntakeConnect landing page — CareConnect design tokens (same values as the app). */
:root {
  --teal: #2aa6ac;            /* logo teal — accents only */
  --primary: #1a7d83;         /* buttons & links (AA with white) */
  --primary-hover: #166a6f;
  --primary-soft: #eff8f8;
  --navy: #0d2930;
  --text: #0d2930;
  --muted: #5b6e77;
  --bg: #f4f9fa;
  --surface: #ffffff;
  --surface-2: #eef4f5;
  --border: #d9e3e5;
  --success: #1a7552;
  --success-soft: #e7f5ee;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(13 41 48 / .06), 0 8px 24px rgb(13 41 48 / .08);
  --shadow-lg: 0 2px 4px rgb(13 41 48 / .06), 0 24px 60px rgb(13 41 48 / .16);
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* motion tokens */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px; font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }                 /* press feedback */
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--navy); border-color: var(--border); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--primary-hover); }
  .btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
}

/* ---------------- header ---------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(244 249 250 / .9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color 200ms ease, box-shadow 200ms ease; }
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 20px rgb(13 41 48 / .06); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 18px; font-weight: 700; }
.brand-text small { font-size: 12px; color: var(--muted); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--navy); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: background-color 160ms ease, color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { background: var(--primary-soft); color: var(--primary); } }

/* ---------------- hero ---------------- */
.hero { padding: 56px 0 72px; background: radial-gradient(1200px 520px at 85% 10%, rgb(42 166 172 / .14), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgb(42 166 172 / .07), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--primary); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.eyebrow.on-dark { color: var(--teal); }
h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 700; }
.hl { color: var(--primary); }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); margin-top: 20px; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-row.center { justify-content: center; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 15px; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

/* load entrance — staggered, rare (once per visit) */
.enter { animation: enter 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

/* ---------------- hero demo (explanation) ---------------- */
.hero-visual { position: relative; }
.demo { position: relative; padding: 18px 0 40px 48px; }
.demo-phone {
  position: relative; width: min(360px, 100%); margin-left: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 28px; box-shadow: var(--shadow-lg); padding: 22px 22px 24px;
}
.demo-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--navy); }
.demo-top .lock { margin-left: auto; font-weight: 500; color: var(--success); background: var(--success-soft); padding: 3px 8px; border-radius: 99px; font-size: 11px; }
.demo-title { font-size: 19px; margin: 14px 0 10px; }
.demo-progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.demo-progress span { display: block; height: 100%; background: var(--teal); border-radius: inherit; transform-origin: left; transform: scaleX(1); }
.demo-field { margin-bottom: 12px; }
.demo-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.demo-input { position: relative; display: flex; align-items: center; height: 40px; padding: 0 12px; border: 1px solid #c3d1d5; border-radius: 10px; font-size: 15px; }
.typed { white-space: nowrap; clip-path: inset(0 0 0 0); }
.demo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--navy); }
.chip-pick { background: var(--primary); border-color: var(--primary); color: #fff; }
.demo-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--navy); margin: 14px 0 12px; }
.box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--primary); background: var(--primary); display: grid; place-items: center; }
.box svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.box path { stroke-dasharray: 16; stroke-dashoffset: 0; }
.demo-sign { border: 1px dashed #c3d1d5; border-radius: 12px; padding: 6px 10px 4px; }
.demo-sign svg { width: 100%; height: 52px; }
.sig { fill: none; stroke: var(--navy); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 0; }
.sign-line { display: block; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); padding-top: 3px; }
.demo-submit { margin-top: 14px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 15px; }

.demo-status { position: absolute; left: 0; top: 70px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.demo-status li { display: inline-flex; align-items: center; gap: 8px; width: max-content; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 7px 12px 7px 10px; font-size: 13px; font-weight: 600; color: var(--navy); box-shadow: var(--shadow); }
.demo-status li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.demo-status .s4::before { background: var(--success); }

.demo-pdf { position: absolute; left: 8px; bottom: 0; display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); z-index: 2; }
.demo-pdf small { display: block; color: #c5d6da; font-size: 12px; font-weight: 400; }
.pdf-icon { font-size: 11px; font-weight: 700; background: #e96b70; color: #fff; border-radius: 6px; padding: 6px 6px; }

.replay { position: absolute; right: 0; bottom: 0; font: 600 13px var(--font); color: var(--primary); background: none; border: 0; padding: 8px; cursor: pointer; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.replay.show { opacity: 1; pointer-events: auto; }

/* The timeline only runs with .is-playing (added by JS when motion is allowed). Base styles above ARE the end state. */
.demo.is-playing .demo-progress span { animation: progress 5.6s var(--ease-in-out) both; }
.demo.is-playing .t1 { animation: type 600ms steps(6, end) 900ms both; }
.demo.is-playing .t2 { animation: type 800ms steps(14, end) 1750ms both; }
.demo.is-playing .chip-pick { animation: pick 260ms ease-out 2850ms both; }
.demo.is-playing .box { animation: boxfill 220ms ease-out 3350ms both; }
.demo.is-playing .box path { animation: draw 260ms var(--ease-out) 3450ms both; }
.demo.is-playing .sig { animation: sign 1100ms var(--ease-in-out) 3800ms both; }
.demo.is-playing .demo-submit { animation: press 260ms var(--ease-out) 5100ms both; }
.demo.is-playing .s1 { animation: chipIn 450ms var(--ease-out) 450ms both; }
.demo.is-playing .s2 { animation: chipIn 450ms var(--ease-out) 1100ms both; }
.demo.is-playing .s3 { animation: chipIn 450ms var(--ease-out) 5250ms both; }
.demo.is-playing .s4 { animation: chipIn 450ms var(--ease-out) 5450ms both; }
.demo.is-playing .demo-pdf { animation: rise 550ms var(--ease-out) 5750ms both; }

/* Armed but not yet on screen: hold every step at its first frame. */
.demo.is-waiting, .demo.is-waiting * { animation-play-state: paused !important; }

@keyframes progress { 0% { transform: scaleX(0.04); } 30% { transform: scaleX(0.35); } 55% { transform: scaleX(0.62); } 85% { transform: scaleX(0.86); } 100% { transform: scaleX(1); } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pick { from { background-color: var(--surface); border-color: var(--border); color: var(--navy); } }
@keyframes boxfill { from { background-color: var(--surface); } }
@keyframes draw { from { stroke-dashoffset: 16; } }
@keyframes sign { from { stroke-dashoffset: 420; } }
@keyframes press { 0% { transform: scale(1); } 45% { transform: scale(0.96); } 100% { transform: scale(1); } }
@keyframes chipIn { from { opacity: 0; transform: translateX(-10px) scale(0.96); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

/* ---------------- sections ---------------- */
.section { padding: 88px 0; }
.section-tint { background: var(--surface-2); }
.section-dark { background: var(--navy); color: #fff; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head.left { text-align: left; margin: 0; }
.section-head h2, .privacy-grid h2, .cta-box h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; }
.section-head p:not(.eyebrow) { color: var(--muted); margin-top: 14px; font-size: 18px; }
.on-dark-muted { color: #c5d6da; margin-top: 14px; font-size: 18px; }

/* video */
.video-frame { position: relative; aspect-ratio: 16 / 9; max-width: 960px; margin: 0 auto; border-radius: 20px; overflow: hidden; background: var(--navy); box-shadow: var(--shadow-lg); }
.video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: radial-gradient(600px 300px at 30% 20%, rgb(42 166 172 / .35), transparent 70%), radial-gradient(500px 300px at 80% 90%, rgb(42 166 172 / .2), transparent 70%), var(--navy); }
.video-placeholder::after { content: ""; position: absolute; inset: 0; background: url("assets/careconnect-mark.svg") no-repeat right -60px bottom -60px / 320px; opacity: .08; pointer-events: none; }
.play { position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px rgb(0 0 0 / .25); transition: transform 200ms var(--ease-out); }
.play svg { width: 34px; height: 34px; fill: var(--primary); margin-left: 4px; }
.play:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .play:hover { transform: scale(1.06); } }
.play[disabled] { cursor: default; opacity: .9; }
.video-note { position: relative; z-index: 1; color: #c5d6da; font-weight: 500; }
.video-frame video, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; animation: fade 300ms ease-out both; }
@keyframes fade { from { opacity: 0; } }

/* features */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: 0 1px 2px rgb(13 41 48 / .04); transition: border-color 200ms ease, box-shadow 200ms ease; }
@media (hover: hover) and (pointer: fine) { .card:hover { border-color: #c3d1d5; box-shadow: var(--shadow); } }
.card h3 { font-size: 19px; margin: 16px 0 8px; }
.card p { color: var(--muted); }
.icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* steps */
.steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.step { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.step h3 { font-size: 20px; margin: 14px 0 8px; }
.step p { color: var(--muted); }
.step-no { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.steps-line { position: absolute; left: 8%; right: 8%; top: 46px; height: 2px; background: linear-gradient(90deg, var(--teal), var(--primary)); transform-origin: left; transform: scaleX(1); z-index: 0; }

/* languages */
.lang-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lang { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 18px; }
.lang .code { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 15px; }
.lang[lang="ar"] { font-family: "Readex Pro", "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif; }
.lang[lang="zh-CN"] { font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", var(--font); }
.lang[lang="zh-TW"] { font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", var(--font); }

/* privacy */
.privacy-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .1); border-radius: 12px; padding: 16px; color: #e4eef0; }
.checks li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* cta & footer */
.cta-box { text-align: center; background: linear-gradient(135deg, var(--primary-soft), #fff); border: 1px solid var(--border); border-radius: 24px; padding: 56px 24px; }
.cta-box p { color: var(--muted); font-size: 18px; margin-top: 12px; }
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; background: var(--surface); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.fine { color: var(--muted); font-size: 14px; max-width: 46em; }

/* ---------------- scroll reveal (only when JS is running, so content never hides without it) ---------------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .steps-line { transform: scaleX(0); transition: transform 1000ms var(--ease-in-out) 250ms; }
.js .steps.in .steps-line { transform: scaleX(1); }

/* ---------------- responsive ---------------- */
@media (max-width: 960px) {
  .hero-grid, .lang-grid, .privacy-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
  .header-row .btn { margin-left: auto; }
  .demo { padding-left: 0; }
  .demo-phone { margin: 0 auto; }
  .demo-status { top: auto; bottom: 64px; left: 0; }
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: 32px 0 56px; }
  .grid-3, .steps, .checks { grid-template-columns: 1fr; }
  .steps-line { left: 39px; right: auto; top: 30px; bottom: 30px; width: 2px; height: auto; transform-origin: top; background: linear-gradient(180deg, var(--teal), var(--primary)); }
  .js .steps-line { transform: scaleY(0); }
  .js .steps.in .steps-line { transform: scaleY(1); }
  .brand-text small { display: none; }
  .demo-status { position: static; flex-direction: row; flex-wrap: wrap; margin-top: 14px; justify-content: center; }
  .demo-pdf { position: relative; left: auto; bottom: auto; margin: 12px auto 0; width: max-content; max-width: 100%; }
  .demo { padding-bottom: 32px; }
  .cta-row .btn { flex: 1 1 100%; }
}

/* ---------------- reduced motion: fewer, gentler — fades only, no travel ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter { animation-name: fade; animation-duration: 400ms; }
  .js .reveal { transform: none; transition: opacity 400ms ease-out; }
  .js .steps-line, .js .steps.in .steps-line { transform: none; transition: none; }
  .btn:active, .play:active { transform: none; }
  .video-frame video, .video-frame iframe { animation: none; }
}
