/* serenrx.ca — site styles. Every colour comes from tokens.css (serenrx-brand). */

/* Dark-mode values for tints the brand tokens only define for light surfaces. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sx-tint2: #4A5382;
    --sx-success-tint: #22362E;
    --sx-warning-tint: #3A3222;
    --sx-danger-tint: #3D2A2A;
    --sx-accent-tint: #3B3024;
    --sx-accent-text: #E0B386;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--sx-bg); color: var(--sx-text-primary);
  font-family: var(--sx-font-ui); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--sx-primary-dark); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sx-primary); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.18; text-wrap: balance; color: var(--sx-text-primary); }
h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: clamp(27px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--sx-primary); color: var(--sx-on-primary); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 760px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 20px; border-radius: var(--sx-radius-control); font-weight: 700; font-size: 16px;
  text-decoration: none; border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--sx-primary); color: var(--sx-on-primary); }
.btn-primary:hover { background: var(--sx-primary-dark); color: var(--sx-on-primary); }
.btn-ghost { color: var(--sx-text-primary); border-color: var(--sx-border); background: transparent; }
.btn-ghost:hover { border-color: var(--sx-primary); color: var(--sx-primary-dark); }
.btn-on-ink { background: var(--sx-primary-light); color: var(--sx-ink); }
.btn-on-ink:hover { background: var(--sx-on-ink); color: var(--sx-ink); }
.btn-outline-ink { color: var(--sx-on-ink); border-color: rgba(238,240,246,0.35); }
.btn-outline-ink:hover { border-color: var(--sx-on-ink); color: var(--sx-on-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* --- Header --- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--sx-surface-raised); border-bottom: 1px solid var(--sx-border); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; display: block; }
.brand-word { height: 30px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav > a { color: var(--sx-text-secondary); text-decoration: none; font-weight: 600; font-size: 15.5px; padding: 8px 12px; border-radius: 8px; }
.site-nav > a:hover { color: var(--sx-text-primary); background: var(--sx-tint); }
.site-nav > a[aria-current="page"] { color: var(--sx-primary-dark); background: var(--sx-tint); }
.nav-actions { display: flex; gap: 10px; margin-left: 14px; }
.nav-actions .btn { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--sx-border); border-radius: 8px; background: transparent; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: var(--sx-text-primary); border-radius: 2px; position: relative; margin: 0 auto; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--sx-surface-raised); border-bottom: 1px solid var(--sx-border); padding: 10px 20px 20px; box-shadow: var(--sx-shadow-modal); }
  .site-nav.is-open { display: flex; }
  .site-nav > a { padding: 12px; font-size: 17px; }
  .nav-actions { margin: 10px 0 0; flex-direction: column; }
  .nav-actions .btn { min-height: 46px; }
  .site-header .container { position: relative; }
}

/* --- Sections --- */
.section { padding-block: clamp(64px, 9vw, 104px); }
.section-alt { background: var(--sx-surface-raised); border-block: 1px solid var(--sx-border); }
.section-head { display: grid; gap: 14px; max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sx-primary-dark); }
.lead { font-size: clamp(18px, 2vw, 20px); color: var(--sx-text-secondary); line-height: 1.55; max-width: 62ch; }
.muted { color: var(--sx-text-secondary); }
.small { font-size: 14.5px; }

/* --- Ink hero --- */
.hero { background: linear-gradient(160deg, var(--sx-ink) 0%, var(--sx-ink-light) 100%); color: var(--sx-on-ink); position: relative; overflow: hidden; }
.hero::after { /* one oversized capsule silhouette, echoing the mark */
  content: ""; position: absolute; width: 520px; height: 1240px; right: -170px; top: -330px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(174,183,230,0.10), rgba(90,103,168,0.05)); transform: rotate(38deg); pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1, .hero h2 { color: var(--sx-on-ink); }
.hero .eyebrow { color: var(--sx-primary-light); }
.hero .lead { color: var(--sx-nav-text); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; padding-block: clamp(56px, 8vw, 96px); }
.hero-copy { display: grid; gap: 22px; }
.hero-copy h1 { font-size: clamp(32px, 4.2vw, 48px); }
.hero-note { font-size: 14.5px; color: var(--sx-nav-text); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero-note span::before { content: "✓"; color: var(--sx-primary-light); margin-right: 6px; font-weight: 700; }
.page-hero { padding-block: clamp(52px, 7vw, 84px); }
.page-hero .container { display: grid; gap: 18px; max-width: 860px; }
.page-hero .product-lockup { height: 64px; width: auto; justify-self: start; margin-bottom: 8px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

/* --- Layout helpers --- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.split.flip > :first-child { order: 2; }
.split + .split { margin-top: clamp(64px, 9vw, 104px); }
@media (max-width: 900px) { .split, .split.flip { grid-template-columns: 1fr; gap: 28px; } .split.flip > :first-child { order: 0; } }
.split-copy { display: grid; gap: 16px; align-content: start; }
.checks { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--sx-tint); box-shadow: inset 0 0 0 4px var(--sx-primary); }

/* --- Cards --- */
.card { background: var(--sx-surface-raised); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-card); padding: 26px; display: grid; gap: 12px; align-content: start; }
.section-alt .card { background: var(--sx-bg); }
.icon { width: 44px; height: 44px; border-radius: 10px; background: var(--sx-tint); color: var(--sx-primary-dark); display: grid; place-items: center; }
.icon svg { width: 22px; height: 22px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--sx-tint); color: var(--sx-primary-dark); white-space: nowrap; }
.pill.soon { background: var(--sx-accent-tint); color: var(--sx-accent-text); }
.pill.ok { background: var(--sx-success-tint); color: var(--sx-success); }

/* Product cards */
.product-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.product-card .product-body { padding: 32px; display: grid; gap: 14px; align-content: start; }
.product-card .product-visual { background: var(--sx-bg); border-left: 1px solid var(--sx-border); padding: 28px; display: grid; align-items: center; }
.product-card .product-lockup { height: 52px; width: auto; }
@media (max-width: 900px) { .product-card { grid-template-columns: 1fr; } .product-card .product-visual { border-left: 0; border-top: 1px solid var(--sx-border); } }
.soon-card { border-style: dashed; background: transparent; text-align: center; justify-items: center; padding: 40px 26px; }
.section-alt .soon-card { background: transparent; }

/* Steps (a real sequence: getting a pharmacy started) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; padding-top: 18px; border-top: 2px solid var(--sx-border); }
.steps li::before { content: counter(step); font-weight: 800; font-size: 14px; color: var(--sx-on-primary); background: var(--sx-primary); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Stat-like facts row (true facts about the product, not vanity metrics) */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--sx-border); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-card); overflow: hidden; }
.facts div { background: var(--sx-surface-raised); padding: 22px; display: grid; gap: 4px; }
.facts strong { font-size: 26px; font-weight: 800; color: var(--sx-primary-dark); font-variant-numeric: tabular-nums; line-height: 1.1; }
.facts span { font-size: 14.5px; color: var(--sx-text-secondary); }
@media (max-width: 800px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* CTA band */
.cta-band { background: linear-gradient(160deg, var(--sx-ink), var(--sx-ink-light)); color: var(--sx-on-ink); border-radius: 16px; padding: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; }
.cta-band h2 { color: var(--sx-on-ink); font-size: clamp(24px, 3vw, 32px); }
.cta-band p { color: var(--sx-nav-text); margin-top: 10px; max-width: 58ch; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--sx-surface-raised); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-card); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 700; font-size: 17.5px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--sx-primary-dark); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 22px 20px; color: var(--sx-text-secondary); display: grid; gap: 10px; max-width: 72ch; }
.faq-group { display: grid; gap: 14px; }
.faq-group + .faq-group { margin-top: 44px; }

/* Prose (legal, about) */
.prose { max-width: 72ch; display: grid; gap: 16px; }
.prose h2 { font-size: 24px; margin-top: 18px; }
.prose h3 { font-size: 19px; margin-top: 8px; }
.prose ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.prose .meta { color: var(--sx-text-secondary); font-size: 15px; }

/* Contact */
.contact-email { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--sx-ink); color: var(--sx-nav-text); margin-top: 0; padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); gap: 32px; padding-bottom: 40px; }
.footer-brand { display: grid; gap: 14px; align-content: start; }
.footer-brand p { font-size: 15px; max-width: 34ch; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h2 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sx-on-ink); margin-bottom: 4px; }
.footer-col a { color: var(--sx-nav-text); text-decoration: none; font-size: 15.5px; overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--sx-on-ink); text-decoration: underline; }
.footer-base { border-top: 1px solid var(--sx-divider); padding-block: 20px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13.5px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ============================================================================================
   Product views: the Formulator UI rebuilt in HTML with example data, so they stay sharp,
   match the brand exactly, and can be read by screen readers.
   ========================================================================================== */
.shot { background: var(--sx-surface-raised); border: 1px solid var(--sx-border); border-radius: 14px; box-shadow: 0 18px 48px rgba(20, 24, 40, 0.18); overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--sx-text-primary); }
.hero .shot { border-color: rgba(174,183,230,0.25); box-shadow: 0 28px 70px rgba(8, 10, 22, 0.45); }
.shot-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--sx-surface); border-bottom: 1px solid var(--sx-border); font-size: 12px; color: var(--sx-text-secondary); }
.shot-bar .lock { width: 9px; height: 11px; border: 2px solid currentColor; border-top-width: 5px; border-radius: 2px; opacity: .7; }
.shot-bar .addr { background: var(--sx-bg); border: 1px solid var(--sx-border); border-radius: 999px; padding: 2px 12px; font-family: var(--sx-font-mono); font-size: 11.5px; }
.shot-body { padding: 16px; display: grid; gap: 12px; }
.shot-app { display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.shot-side { background: linear-gradient(180deg, var(--sx-ink), var(--sx-ink-light)); padding: 14px 10px; display: grid; gap: 3px; align-content: start; }
.shot-side img { height: 36px; width: auto; margin: 2px 4px 12px; }
.shot-side span { color: var(--sx-nav-text); font-size: 12px; padding: 6px 8px; border-radius: 6px; border-left: 2px solid transparent; }
.shot-side span.on { color: var(--sx-nav-active); background: var(--sx-nav-active-bg); border-left-color: var(--sx-primary-light); font-weight: 700; }
@media (max-width: 560px) { .shot-app { grid-template-columns: 1fr; } .shot-side { display: none; } }
.shot-title { font-weight: 800; font-size: 15px; }
.shot-sub { color: var(--sx-text-secondary); font-size: 12px; }
.shot-card { border: 1px solid var(--sx-border); border-radius: 10px; background: var(--sx-surface-raised); overflow: hidden; }
.shot-card-h { padding: 8px 12px; border-bottom: 1px solid var(--sx-border); font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shot-card-h .pill { font-size: 11px; padding: 1px 8px; }
.shot table { width: 100%; border-collapse: collapse; }
.shot th { text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--sx-text-secondary); font-weight: 700; padding: 7px 12px; border-bottom: 1px solid var(--sx-border); white-space: nowrap; }
.shot td { padding: 7px 12px; border-bottom: 1px solid var(--sx-border); }
.shot tr:last-child td { border-bottom: 0; }
.shot td.n, .shot th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shot .total td { font-weight: 800; }
.shot .x-scroll { overflow-x: auto; }
.shot-actions { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.shot-btn { background: var(--sx-primary); color: var(--sx-on-primary); border-radius: 7px; padding: 6px 12px; font-weight: 700; font-size: 12px; }
.shot-btn.ghost { background: transparent; color: var(--sx-text-secondary); border: 1px solid var(--sx-border); }
.writeup { font-family: var(--sx-font-mono); font-size: 11.5px; line-height: 1.75; padding: 12px; white-space: pre-wrap; word-break: break-word; }
.writeup .instr { font-family: var(--sx-font-ui); font-size: 12.5px; line-height: 1.5; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sx-border); white-space: normal; }
.writeup .instr strong { display: block; margin-bottom: 2px; }
.writeup .note { font-style: italic; color: var(--sx-text-secondary); white-space: normal; font-family: var(--sx-font-ui); font-size: 12.5px; margin-top: 8px; }
.toast { display: inline-flex; align-items: center; gap: 8px; background: var(--sx-success-tint); color: var(--sx-success); font-weight: 700; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; justify-self: start; }
.hint { color: var(--sx-text-secondary); font-size: 12px; }

/* Capsule sizing bars */
.sizes { display: grid; gap: 12px; padding: 14px 14px 16px; }
.size-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.size-row b { font-variant-numeric: tabular-nums; }
.size-track { position: relative; height: 22px; background: var(--sx-bg); border: 1px solid var(--sx-border); border-radius: 6px; overflow: visible; }
.size-fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px 0 0 5px; background: var(--sx-tint2); }
.size-fill.api { background: var(--sx-primary); }
.size-fill.filler { background: var(--sx-tint2); }
.size-row.pick .size-track { box-shadow: 0 0 0 2px var(--sx-primary); }
.size-row .pct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--sx-text-secondary); padding: 0 14px 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Conversion cards */
.convert { display: grid; gap: 10px; padding: 14px; }
.convert-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; background: var(--sx-bg); border: 1px solid var(--sx-border); border-radius: 10px; padding: 12px; }
.convert-row .arrow { color: var(--sx-primary); font-size: 18px; font-weight: 800; }
.convert-row .v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.convert-row .k { font-size: 11.5px; color: var(--sx-text-secondary); }

/* Result figure */
.result { display: flex; align-items: baseline; gap: 10px; padding: 12px; background: var(--sx-success-tint); border-radius: 10px; flex-wrap: wrap; }
.result .big { font-size: 22px; font-weight: 800; color: var(--sx-success); font-variant-numeric: tabular-nums; }

/* Members */
.role { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.role.admin { background: var(--sx-tint); color: var(--sx-primary-dark); }
.role.staff { background: var(--sx-bg); color: var(--sx-text-secondary); border: 1px solid var(--sx-border); }

/* Feature index chips on the product page */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { text-decoration: none; background: rgba(174,183,230,0.12); color: var(--sx-on-ink); border: 1px solid rgba(174,183,230,0.28); border-radius: 999px; padding: 6px 14px; font-size: 14.5px; font-weight: 600; }
.chips a:hover { background: rgba(174,183,230,0.22); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
