/* PatientVault — patientvaultsoftware.com
   Hub home page + one deep page per section. One accent (the logo's orange), navy ink, white paper.
   Tokens are declared on :root and only redefined for the dark scheme. */

:root {
  --paper: #ffffff;
  --tint: #f4f5fa;
  --rule: #dfe1ee;
  --text: #1c2040;
  --ink: #151b6b;
  --muted: #5d6184;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --video: #151b6b;
  --focus: #151b6b;
  --logo-plate: transparent;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1130;
    --tint: #161a40;
    --rule: #282d5c;
    --text: #e6e7f3;
    --ink: #ffffff;
    --muted: #a7abcc;
    --accent: #ff6b36;
    --accent-ink: #1a0d06;
    --video: #080a1f;
    --focus: #ff6b36;
    --logo-plate: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1130;
  --tint: #161a40;
  --rule: #282d5c;
  --text: #e6e7f3;
  --ink: #ffffff;
  --muted: #a7abcc;
  --accent: #ff6b36;
  --accent-ink: #1a0d06;
  --video: #080a1f;
  --focus: #ff6b36;
  --logo-plate: #ffffff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.wrap { max-width: none; margin: 0; padding: 0 clamp(1.25rem, 4vw, 4rem); }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: .3rem; }
h3:first-child { margin-top: 0; }
p { margin: 0 0 1rem; max-width: 64rem; }
/* Thai pages: Be Vietnam Pro has no Thai letters, the system Thai face draws them; looser lines for the stacked marks. */
html:lang(th) body { font-family: "Be Vietnam Pro", "Leelawadee UI", "Noto Sans Thai", Thonburi, Tahoma, system-ui, sans-serif; line-height: 1.8; }
html:lang(th) h1, html:lang(th) h2, html:lang(th) h3 { line-height: 1.4; letter-spacing: 0; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.2rem; margin: 0 0 1rem; max-width: 64rem; }
li { margin-bottom: .35rem; }
code { font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; font-size: .92em; }
small, .small { font-size: .875rem; color: var(--muted); }
.eyebrow { font-size: .78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header.site { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 700; letter-spacing: .08em; font-size: .95rem; text-transform: uppercase; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .v { color: var(--accent); }
.brand svg { width: 28px; height: 28px; }
nav.site { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin-left: auto; font-size: .9rem; }
nav.site a { color: var(--muted); text-decoration: none; }
nav.site a:hover { color: var(--accent); }
nav.site a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: .35em; }
nav.site a.lang { color: var(--ink); font-weight: 500; }
/* Language control: a US flag that opens the English page, then a drop-down of every language (flag + name). */
nav.site .langs { display: inline-flex; align-items: center; gap: .5rem; }
.langs .flag { display: block; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(21, 27, 107, .22); }
nav.site .langs a.lang-en { display: inline-flex; padding: .3rem; margin: -.3rem 0; border-radius: 4px; }
nav.site .langs a.lang-en:hover { background: var(--tint); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-weight: 500; padding: .25rem .55rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; width: .38em; height: .38em; margin: 0 .1rem 0 .15rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-.12em) rotate(45deg); }
.lang-menu[open] summary::after { transform: translateY(.1em) rotate(-135deg); }
.lang-menu summary:hover { border-color: var(--muted); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 30; list-style: none; margin: 0; padding: .3rem; min-width: 11.5rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 10px 28px rgba(10, 12, 40, .16); }
.lang-menu li { margin: 0; }
nav.site .lang-menu li a { display: grid; grid-template-columns: 25px auto; column-gap: .6rem; align-items: center; padding: .45rem .6rem; border-radius: 4px; color: var(--ink); text-decoration: none; }
nav.site .lang-menu li a:hover { background: var(--tint); color: var(--ink); }
nav.site .lang-menu li a.cur { font-weight: 700; background: var(--tint); }
.lang-menu ul.from-left { right: auto; left: 0; }

/* Home: hero */
.hero-home { padding: 3rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2.5rem clamp(2rem, 5vw, 6rem); align-items: center; }
@media (max-width: 56em) { .hero-grid { grid-template-columns: 1fr; } }
.hero-copy .logo { display: block; width: 200px; height: 200px; object-fit: contain; margin: 0 0 1.25rem -.5rem; background: var(--logo-plate); border-radius: 12px; padding: 4px; }
.hero-copy h1 { margin-bottom: 1rem; }
.definition { font-size: 1.2rem; line-height: 1.55; color: var(--ink); font-weight: 500; margin-bottom: 1.5rem; max-width: 48rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin-bottom: 0; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: .75rem 1.2rem; border-radius: 4px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { color: var(--accent-ink); filter: brightness(1.06); }
.trial-note { margin-top: .9rem; max-width: 40rem; }

/* Video slot. With an empty data-video-src it is a static "coming soon" frame and loads
   nothing from anywhere. With a src, /assets/video.js turns the frame into a poster button and
   the film (a <video>) is requested only after the viewer presses play. No iframe. */
.video { position: relative; aspect-ratio: 16 / 9; background: var(--video); border-radius: 6px; overflow: hidden; margin-bottom: .75rem; color: #fff; }
.video .video-frame { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 1rem; background: transparent; border: 0; color: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center; }
.video button.video-frame { cursor: pointer; }
.video .play { flex: none; width: 84px; height: 84px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.video .play svg { width: 34px; height: 34px; margin-left: 4px; }
.video .video-title { font-weight: 600; font-size: clamp(.95rem, 2.2vw, 1.2rem); line-height: 1.3; max-width: 30rem; text-wrap: balance; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.video .video-soon { font-size: .78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.video .video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; filter: brightness(.62); }
.video .video-poster ~ * { position: relative; z-index: 1; }
.video video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; background: #000; object-fit: contain; }
.video-alt { margin: 0 0 .75rem; }
.video button.video-frame:hover .play { filter: brightness(1.06); }
/* overflow:hidden on .video would clip an outset outline, so the ring is drawn inside the frame. */
.video button.video-frame:focus-visible { outline: 3px solid #fff; outline-offset: -4px; border-radius: 6px; }
/* Not playable yet: the glyph is drawn as an outline so it does not read as a control. */
.video:not(.is-live) .play { background: transparent; border: 2px solid rgba(255, 255, 255, .55); box-shadow: none; }
.video:not(.is-live) .play svg path { fill: rgba(255, 255, 255, .7); }
@media (max-width: 30em) {
  .video .play { width: 56px; height: 56px; }
  .video .play svg { width: 24px; height: 24px; margin-left: 3px; }
  .video .video-frame { gap: .4rem; padding: .75rem; }
}
/* Section pages: the film sits at the top of the content column, not wider than a reading measure. */
.video-intro { max-width: 46rem; margin: 0 0 2.5rem; }

/* Home: three pillars */
.pillars { padding: 2.5rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pillar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem clamp(2rem, 4vw, 5rem); }
@media (max-width: 56em) { .pillar-grid { grid-template-columns: 1fr; } }
.pillar-grid h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
.pillar-grid h3::before { content: ""; display: block; width: 2.25rem; height: 3px; background: var(--accent); margin-bottom: .8rem; }
.pillar-grid p { font-size: .98rem; }

/* Home: section tiles (these are links, so they get an edge) */
.explore { padding: 3rem 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (min-width: 90em) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 64em) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40em) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem 1.3rem 1.1rem; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--text); background: var(--paper); transition: border-color .15s; }
.tile:hover { border-color: var(--accent); color: var(--text); }
.tile h3 { margin: 0; font-size: 1.1rem; }
.tile p { font-size: .95rem; color: var(--muted); margin: 0; flex: 1; }
.tile .more { font-size: .9rem; font-weight: 600; color: var(--accent); }

/* Home: fact strip */
.facts { padding: 2rem 0 3rem; border-top: 1px solid var(--rule); }
.fact-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 2rem; margin: 0 0 1.25rem; }
@media (max-width: 56em) { .fact-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fact-strip dt { font-size: .78rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact-strip dd { margin: .15rem 0 0; color: var(--ink); font-weight: 500; }

/* Section pages */
.crumbs { font-size: .875rem; color: var(--muted); padding-top: 1.5rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head { padding: 1.25rem 0 2rem; border-bottom: 1px solid var(--rule); }
.page-head h1 { margin-bottom: 1rem; max-width: 60rem; }
.page-head .definition { margin-bottom: 0; max-width: 60rem; }
.docs { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 6rem); padding: 2rem 0 3rem; }
@media (max-width: 56em) { .docs { grid-template-columns: 1fr; } }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: .9rem; }
@media (max-width: 56em) { .toc { position: static; } }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .3rem 0; color: var(--muted); text-decoration: none; border-top: 1px solid var(--rule); }
.toc li:last-child a { border-bottom: 1px solid var(--rule); }
.toc a:hover { color: var(--accent); }
.content section { padding: 0 0 2.5rem; margin: 0 0 2.5rem; border-bottom: 1px solid var(--rule); }
.content section:last-child { border-bottom: 0; margin-bottom: 0; }
.content h2 { scroll-margin-top: 1.5rem; }
.content .faq h3 { margin-top: 1.5rem; }
.related { list-style: none; padding: 0; }
.related li { margin-bottom: .5rem; }

/* Tables */
.tablewrap { overflow-x: auto; margin: 0 0 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .65rem .9rem .65rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 500; color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
table.spec th { width: 30%; padding-top: .8rem; }
table.compare th[scope="col"] { color: var(--ink); font-size: .85rem; letter-spacing: .02em; text-transform: none; font-weight: 600; }
table.compare th[scope="row"] { width: 26%; }
table.compare td:first-of-type { color: var(--ink); font-weight: 500; }
table.controls th { width: 26%; }

.note { background: var(--tint); padding: 1rem 1.15rem; border-radius: 4px; font-size: .95rem; margin: 1.25rem 0 0; }

footer.site { padding: 1.75rem 0 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .875rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
footer.site a { color: var(--muted); }

/* Quick reference: the page's essentials, kept at the very end and set quietly */
.reference { margin: 0 0 3rem; padding: 2rem clamp(1.25rem, 3vw, 2.5rem) 2.25rem; background: var(--tint); border-radius: 8px; font-size: .95rem; }
.reference h2 { font-size: 1.25rem; margin-bottom: .25rem; }
.reference > .small { margin-bottom: 1.5rem; }
.reference-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3rem; }
@media (max-width: 56em) { .reference-grid { grid-template-columns: 1fr; } }
.reference .ref-h { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem; }
.reference section { padding: 0; margin: 0; border: 0; }
.reference table { font-size: .9rem; }
.reference .faq h3 { font-size: .98rem; margin-top: 1rem; }
.reference .faq h3:first-of-type { margin-top: 0; }
.reference .faq p { font-size: .92rem; }

.reference-grid.single { grid-template-columns: 1fr; }

/* Prices and contact (home) */
.pricing { padding: 2.5rem 0 1.5rem; border-top: 1px solid var(--rule); }
.pricing table.compare td:last-of-type { white-space: nowrap; font-weight: 600; color: var(--ink); }
.pricing table.compare th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 600; color: var(--ink); width: 28%; }
.pricing table.compare td:first-of-type { font-weight: 400; color: var(--muted, inherit); }
.contact-line { font-weight: 500; color: var(--ink); }
.contact-line a, .foot-contact a { white-space: nowrap; }
