@font-face {
  font-family: "Inter";
  src: url("assets/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Vitaq brand: blue is identity and the main action, white and grey for the work, red only for
   clinical alerts. Flat: no shadows except the printed paper, which is a physical object. */
:root {
  --brand: #0457cb;
  --brand-deep: #033a8a;
  --brand-soft: #e6effb;
  --ink: #0a1317;
  --muted: #5f6b75;
  --faint: #8a949c;
  --line: #e3e7eb;
  --tile: #f1f4f7;
  --canvas: #f6f8fa;
  --paper: #fffdf6;
  --danger: #a32d2d;
  --danger-soft: #fdf0f0;
  --whatsapp: #1fa855;
  --radius: 20px;
  --hand: "Caveat", "Segoe Print", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.55 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2 { letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 650; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  font-size: 0.78rem; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.eyebrow-light { color: #b9d3ff; }
.muted-h { color: var(--faint); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 14px 26px; font: 600 1rem Inter, sans-serif;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:disabled { background: #a9c3ea; cursor: not-allowed; }
.btn-ghost { background: var(--tile); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-wide { width: 100%; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #178a45; }
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- nav ---- */
.nav {
  position: fixed; inset: 12px 12px auto; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 20px; border-radius: 999px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  max-width: 1180px; margin: 0 auto;
}
.logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--brand); text-decoration: none; }
.logo svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.soon-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--whatsapp); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.nav-cta { margin-left: auto; padding: 10px 20px; }

/* ---- 1. hero ---- */
.hero { height: 230vh; position: relative; background: var(--canvas); }
.hero-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#slips { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy {
  position: absolute; left: max(24px, calc((100vw - 1180px) / 2)); top: 50%; transform: translateY(-46%);
  width: min(560px, calc(100vw - 48px)); z-index: 2;
}
.hero h1 { font-size: clamp(2.7rem, 6.6vw, 5.4rem); font-weight: 700; }
.hero h1 .line { display: block; }
.chaos-line { color: var(--ink); }
.strike { position: relative; white-space: nowrap; }
.strike::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 54%; height: .09em; background: var(--danger);
  transform-origin: left; transform: scaleX(var(--strike, 0)) rotate(-2deg); border-radius: 4px;
}
.calm-line { color: var(--brand); opacity: var(--calm, 0); transform: translateY(calc((1 - var(--calm, 0)) * 18px)); }
.calm-line em { font-style: normal; position: relative; }
.lede { margin-top: 22px; font-size: 1.15rem; color: var(--muted); max-width: 470px; }
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.scroll-hint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-size: .85rem; color: var(--faint); opacity: calc(1 - var(--calm, 0) * 2);
}

/* ---- 2. token board ---- */
.board-section {
  max-width: 1180px; margin: 0 auto; padding: 120px 24px;
  display: grid; gap: 56px; align-items: center; grid-template-columns: 1.05fr 1fr;
}
.board {
  background: #071226; color: #fff; border-radius: 28px; padding: 34px;
  display: grid; gap: 26px; position: relative; overflow: hidden;
}
.board::before { /* LED-panel texture */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.2px); background-size: 6px 6px;
}
.board-label { display: block; font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; color: #7fb0ff; margin-bottom: 10px; }
.flip { display: flex; gap: 10px; }
.digit {
  width: clamp(72px, 9vw, 110px); height: clamp(100px, 12.5vw, 150px); border-radius: 16px;
  background: #0f2142; display: grid; place-items: center; overflow: hidden; position: relative;
  font: 700 clamp(4rem, 8.5vw, 6.6rem)/1 Inter, sans-serif; color: #ffd166; font-variant-numeric: tabular-nums;
}
.digit::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #071226; }
.digit span { display: block; }
.digit.flipping span { animation: flipIn .5s cubic-bezier(.2,.8,.2,1); }
@keyframes flipIn { from { transform: translateY(-70%) rotateX(80deg); opacity: 0; } to { transform: none; opacity: 1; } }
.board-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-next li {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: rgba(255,255,255,.06); font-size: 1rem; animation: slideIn .5s ease both;
}
.board-next li b { color: #ffd166; font-variant-numeric: tabular-nums; }
.board-next li span:last-child { color: #8fa3c2; font-size: .9rem; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.board-copy p:last-child { margin-top: 18px; color: var(--muted); font-size: 1.1rem; }

/* ---- 3. demo ---- */
.demo-section { background: var(--brand); color: #fff; padding: 110px 24px; }
.section-head { max-width: 1180px; margin: 0 auto 48px; }
.demo-section .eyebrow { color: #b9d3ff; }
.section-head p:last-child { margin-top: 14px; color: #d6e5ff; font-size: 1.1rem; }
.demo {
  max-width: 1180px; margin: 0 auto; display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: start;
}
.demo-app { background: #fff; color: var(--ink); border-radius: 28px; padding: 26px; }
.demo-patient { display: flex; align-items: center; gap: 14px; }
.token-badge { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 650; }
.p-name { font-weight: 650; font-size: 1.1rem; }
.p-meta { color: var(--muted); font-size: .88rem; }
.timer { margin-left: auto; font: 600 .95rem Inter; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--tile); padding: 6px 12px; border-radius: 999px; }
.timer.running { color: var(--brand); background: var(--brand-soft); }
.allergy { margin-top: 14px; background: var(--danger-soft); color: var(--danger); padding: 9px 14px; border-radius: 12px; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: var(--tile); border-radius: 999px; padding: 5px 11px; font-size: .82rem; }
.chip-red { background: var(--danger-soft); color: var(--danger); }
.step-label { margin: 24px 0 10px; font-size: .82rem; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .75rem; }
.templates { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 18px;
  font: 600 .95rem Inter; color: var(--ink); cursor: pointer; transition: all .15s;
}
.tpl:hover { border-color: var(--brand); color: var(--brand); }
.tpl[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.meds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-height: 64px; }
.meds-empty { color: var(--faint); font-size: .9rem; padding: 18px; border: 2px dashed var(--line); border-radius: 14px; text-align: center; }
.med { background: var(--tile); border-radius: 14px; padding: 12px 14px; animation: medIn .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes medIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.med-top { display: flex; justify-content: space-between; gap: 8px; }
.med-name { font-weight: 650; }
.med-generic { color: var(--muted); font-size: .8rem; }
.doses { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.dose {
  border: 0; background: #fff; border-radius: 999px; padding: 5px 10px; font: 600 .8rem Inter;
  font-variant-numeric: tabular-nums; cursor: pointer; color: var(--ink);
}
.dose[aria-pressed="true"] { background: var(--brand); color: #fff; }
.med-days { color: var(--muted); font-size: .82rem; white-space: nowrap; }
#printBtn { margin-top: 2px; }

.printer { position: relative; padding-top: 18px; }
.printer-slot { height: 18px; border-radius: 10px; background: #022c69; margin: 0 6%; position: relative; z-index: 2; }
.paper {
  margin: -9px 9% 0; background: #fff; color: var(--ink); border-radius: 0 0 8px 8px; padding: 26px 26px 18px;
  font-size: .85rem; box-shadow: 0 30px 60px rgba(0,20,60,.35);
  clip-path: inset(9px 0 0 0); display: none;
}
/* Hidden until printed (so it takes no space), then slides out of the printer slot. */
.paper.out { display: block; animation: printOut 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes printOut { from { transform: translateY(-100%); } to { transform: none; } }
.paper-head { display: flex; justify-content: space-between; gap: 10px; border-bottom: 3px solid var(--brand); padding-bottom: 10px; }
.paper-head div { display: grid; }
.paper-clinic { color: var(--brand); font-size: 1.1rem; }
.paper-head span { color: var(--muted); font-size: .78rem; }
.paper-patient { background: var(--tile); border-radius: 8px; padding: 8px 10px; margin-top: 12px; font-size: .8rem; }
.paper-allergy { color: var(--danger); font-weight: 600; }
.paper-dx { margin-top: 10px; font-weight: 650; }
.rx-mark { color: var(--brand); font: 700 1.6rem Georgia, serif; margin-top: 6px; }
.paper-meds { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 7px; }
.paper-meds b { display: block; }
.paper-meds span { color: var(--muted); font-size: .76rem; }
.paper-follow { display: inline-block; margin-top: 14px; border: 1.5px solid var(--brand); color: var(--brand); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: .78rem; }
.paper-foot { text-align: center; color: var(--faint); font-size: .68rem; margin-top: 14px; }
.demo-result { margin-top: 22px; text-align: center; font-size: 1.15rem; font-weight: 600; min-height: 1.6em; }

/* ---- 4. scribble → print ---- */
.morph { height: 220vh; position: relative; }
.morph-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; max-width: 1180px; margin: 0 auto; padding: 90px 24px 30px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.morph-copy p:last-child { margin-top: 18px; color: var(--muted); font-size: 1.1rem; max-width: 440px; }
.morph-stage { position: relative; aspect-ratio: 1100 / 1556; max-height: 78vh; width: auto; justify-self: center; height: 78vh; }
.scrawl, .printed { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; }
.scrawl {
  background: var(--paper) repeating-linear-gradient(transparent 0 38px, #dde6f3 38px 39px);
  border: 1px solid #ece4cf; padding: 9% 9%; font-family: var(--hand); color: #1d3f8f;
  font-size: clamp(1.3rem, 2.4vw, 2.1rem); line-height: 1.25;
}
.scrawl p { transform-origin: left; }
.s1 { transform: rotate(-2deg); font-weight: 700; }
.s2 { transform: rotate(1.5deg) translateX(10px); }
.s3 { font-size: 2.4em; transform: rotate(-6deg); margin: 4px 0 -6px; }
.s4 { transform: rotate(-1deg) translateX(18px); }
.s5 { transform: rotate(2.5deg) translateX(6px); }
.s6 { transform: rotate(-3deg) translateX(22px); }
.s7 { transform: rotate(1deg); margin-top: 10px; }
.s8 { transform: rotate(-4deg) translateX(55%); margin-top: 18px; font-weight: 700; }
.printed { clip-path: inset(0 0 calc(100% - var(--wipe, 0%)) 0); background: #fff; border: 1px solid var(--line); }
.printed img { width: 100%; height: 100%; object-fit: cover; }
.scanbar {
  position: absolute; left: -4%; right: -4%; height: 4px; top: var(--wipe, 0%); border-radius: 4px;
  background: var(--brand); opacity: var(--scan-visible, 1);
}

/* ---- 5. features ---- */
.features { background: var(--canvas); padding: 110px 24px; }
.feature-grid {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1180px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.feature-grid li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 6px; }
.feature-grid b { font-size: 1.1rem; }
.feature-grid span:not(.f-big) { color: var(--muted); }
.f-big { font-size: 2.2rem; font-weight: 700; color: var(--brand); letter-spacing: -0.03em; line-height: 1.1; }
.peek { max-width: 1180px; margin: 40px auto 0; }
.peek img { border-radius: var(--radius); border: 1px solid var(--line); }
.peek figcaption { text-align: center; color: var(--faint); font-size: .85rem; margin-top: 12px; }

/* ---- 6. CTA ---- */
.cta {
  background: var(--ink); color: #fff; padding: 120px 24px;
  display: grid; grid-template-columns: minmax(0, 560px) minmax(320px, 420px); gap: 80px; align-items: center;
  justify-content: center;
}
.cta-copy p { color: #b7c2cf; font-size: 1.1rem; margin-top: 18px; }
.cta-small { font-weight: 600; color: #ffd166 !important; }
.ticket {
  background: #fff; color: var(--ink); border-radius: 22px; padding: 26px; position: relative;
  display: grid; gap: 14px; transform: rotate(-1.5deg); transition: transform .3s;
}
.ticket:hover, .ticket:focus-within { transform: rotate(0); }
.ticket::before, .ticket::after { /* punched holes */
  content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); top: calc(100% - 120px);
}
.ticket::before { left: -14px; }
.ticket::after { right: -14px; }
.ticket-top { display: flex; justify-content: space-between; align-items: baseline; }
.ticket-brand { font-size: .8rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.ticket-no { font-size: .9rem; color: var(--muted); }
.ticket-no b { font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.ticket label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ticket input {
  font: 500 1rem Inter; color: var(--ink); background: var(--tile); border: 2px solid transparent;
  border-radius: 12px; padding: 12px 14px; outline: none;
}
.ticket input:focus { border-color: var(--brand); background: #fff; }
.ticket input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.ticket-tear { border-top: 2px dashed var(--line); margin: 8px -26px 4px; }
.ticket-note { font-size: .78rem; color: var(--faint); text-align: center; }

.footer {
  display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center;
  padding: 28px max(24px, calc((100vw - 1180px) / 2)); font-size: .88rem; color: var(--muted);
}
.footer a { color: var(--brand); text-decoration: none; font-weight: 600; }
.logo-small { font-size: 1.05rem; }
.logo-small svg { width: 20px; height: 20px; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .board-section, .demo, .morph-sticky, .cta { grid-template-columns: 1fr; }
  .board-section { padding: 80px 20px; gap: 36px; }
  .hero-copy { top: auto; bottom: 9vh; transform: none; left: 20px; width: calc(100vw - 40px); }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.6rem); }
  .lede { font-size: 1rem; margin-top: 14px; }
  .scroll-hint { display: none; }
  .soon-pill { display: none; }
  .demo-section { padding: 80px 16px; }
  .demo-app { padding: 18px; }
  .morph { height: 200vh; }
  .morph-sticky { padding: 80px 20px 20px; gap: 22px; align-content: center; }
  .morph-copy p:last-child { display: none; }
  .morph-stage { height: 56vh; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .features { padding: 80px 16px; }
  .cta { padding: 90px 20px; gap: 40px; }
  .ticket { transform: none; }
}
@media (max-width: 520px) {
  .feature-grid { grid-template-columns: 1fr; }
  .nav { padding-left: 16px; }
  .nav-cta { padding: 9px 16px; font-size: .9rem; }
  .paper { margin: -9px 3% 0; padding: 20px 18px 14px; }
}

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