/* Hallmark · shape: kept (live surface, 7 acts) · genre: editorial · theme: custom (origin: forest, amber, ivory) · redesign: restyle
 * paper: oklch(96.4% 0.011 85) · accent: oklch(41.5% 0.075 155) · display: Fraunces · body: Be Vietnam Pro · hero: kept (Stage, four planes) · nav: kept (app chrome) · footer: kept (inside the close) · signature: kept (live SHA-256 fingerprint flip)
 * axes: light/roman-serif/chromatic-green · posture: Stage · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4 · weakest: P, the cobalt logo now sits on a forest palette; owner chose the origin direction */
/* Hallmark · waive 77 · one line on the pale ground before "Một chữ số thôi cũng lộ" · khoảng lặng trước dấu vân tay, so the flip lands */
/* Hallmark · dropped heading "Cà phê Robusta rang mộc 500 g" in the hero record · it is illustration, now aria-hidden text, not a page heading */
/* Hallmark · reworded "Người mua quét mã. Hồ sơ lô hàng của bạn mở ra." to "Truy xuất nguồn gốc, từng lô hàng." · 19 hero headline over seven words */
/* Hallmark · dropped eyebrow "Truy xuất nguồn gốc hàng hóa" · 54 (its words now lead the headline) */

@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/be-vietnam-pro/be-vietnam-pro-normal-400.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/be-vietnam-pro/be-vietnam-pro-normal-600.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/be-vietnam-pro/be-vietnam-pro-normal-700.ttf") format("truetype"); }

/* Theme = the six scrollcraft tokens plus page roles. Never restyle .sc-stage / [data-sc-*]. */
:root {
  --sc-canvas: #F6F3EC;          /* ivory */
  --sc-surface: #FFFDF8;
  --sc-ink: #1C2420;             /* green-black ink */
  --sc-ink-soft: #4E5850;
  --sc-accent: #1E5A3C;          /* forest */
  --sc-accent-ink: #F6F3EC;
  --sc-font-display: "Fraunces", Georgia, serif;
  --sc-font-text: "Be Vietnam Pro", system-ui, sans-serif;
  --sc-font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sc-shadow-color: 35 25% 22%;

  --ht-accent-2: #154630;        /* forest, pressed */
  --ht-amber: #B7791F;           /* marks only: dots, lines, borders */
  --ht-amber-ink: #7F5410;       /* amber when it has to be read */
  --ht-amber-bg: #F4E8D0;
  --ht-amber-light: #D9A54A;     /* logo facet */
  --ht-font-brand: "Plus Jakarta Sans", system-ui, sans-serif;
  --ht-pale: #E6EDE3;            /* forest wash */
  --ht-rule: #E2DDD1;
  --ht-rule-strong: #C9C2B2;
  --ht-field: #857F70;
  --ht-placeholder: #6B675C;
  --ht-chip: #EDE9DF;
  --ht-ok: #1E6B45;
  --ht-ok-bg: #E2EFE4;
  --ht-bad: #A8352B;
  --ht-bad-bg: #F7E5E0;
  --ht-photo-ground: #1B1512;
  --ht-pattern: color-mix(in oklab, var(--sc-accent) 9%, transparent);
  --ht-pattern-strong: color-mix(in oklab, var(--sc-accent) 16%, transparent);
  --ht-gap: clamp(2rem, 4vw, 4.5rem);
  --ht-bar: 60px;
  --ht-side: 236px;
  --ht-top: var(--ht-bar);

  /* Pattern shapes, painted through mask-image so their colour stays a token. */
  --ht-guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='20' viewBox='0 0 96 20'%3E%3Cg fill='none' stroke='black' stroke-width='.7'%3E%3Cpath d='M0 10Q12 0 24 10T48 10T72 10T96 10'/%3E%3Cpath d='M0 10Q12 20 24 10T48 10T72 10T96 10'/%3E%3Cpath d='M0 4Q12 -6 24 4T48 4T72 4T96 4' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
  --ht-whorl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 480'%3E%3Cg fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cellipse cx='200' cy='250' rx='24' ry='34'/%3E%3Cellipse cx='200' cy='248' rx='48' ry='64' stroke-dasharray='120 14'/%3E%3Cellipse cx='200' cy='246' rx='72' ry='94' stroke-dasharray='200 18 40 12'/%3E%3Cellipse cx='200' cy='244' rx='96' ry='124'/%3E%3Cellipse cx='200' cy='242' rx='120' ry='154' stroke-dasharray='300 20'/%3E%3Cellipse cx='200' cy='240' rx='144' ry='184' stroke-dasharray='90 16 260 22'/%3E%3Cellipse cx='200' cy='238' rx='168' ry='212'/%3E%3Cellipse cx='200' cy='236' rx='192' ry='232' stroke-dasharray='420 30'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-padding-top: var(--ht-top); }
body { line-height: 1.6; }
.ht h1, .ht h2, .ht h3, .ht p, .ht figure, .ht dl, .ht dd, .ht ul, .ht ol { margin: 0; }
.ht ul, .ht ol { padding: 0; list-style: none; }
.ht h1, .ht h2, .ht h3 { text-wrap: balance; }
.ht-mono { font-family: var(--sc-font-mono); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.ht-print__stored .ht-mono { white-space: normal; }
.ht-small { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.ht img { width: 100%; height: 100%; object-fit: cover; }

.ht-skip { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--sc-ink); color: var(--sc-canvas); border-radius: 8px; }
.ht-skip:focus { top: 1rem; }
.ht-skip:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }

/* ------------------------------------------------------------ type -- */
.ht-h1 {
  font-family: var(--sc-font-display);
  font-size: clamp(2.5rem, 1.4rem + 2.6vw, 4rem);
  font-weight: 600; line-height: 1.04; letter-spacing: -0.022em; font-optical-sizing: auto;
  text-wrap: balance; max-width: 16ch; overflow-wrap: break-word; min-width: 0;
}
.ht-h2 {
  font-family: var(--sc-font-display);
  font-size: clamp(1.75rem, 1.25rem + 1.5vw, 2.6rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.018em; font-optical-sizing: auto;
  text-wrap: balance; overflow-wrap: break-word; min-width: 0;
}
.ht-lede { font-size: var(--sc-t-lg); color: var(--sc-ink-soft); max-width: 30ch; margin-top: var(--sc-5) !important; text-wrap: pretty; }
.ht p { text-wrap: pretty; }

/* ------------------------------------------------- controls & chips -- */
.ht-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1.15rem; border-radius: 10px; border: 1px solid transparent;
  background: var(--sc-accent); color: var(--sc-accent-ink);
  font-family: var(--sc-font-text); font-weight: 600; font-size: var(--sc-t-sm);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--sc-accent-ink) 22%, transparent), 0 1px 2px hsl(var(--sc-shadow-color) / .25);
  transition: background-color 150ms var(--sc-ease-out), transform 120ms var(--sc-ease-out), border-color 150ms var(--sc-ease-out);
}
.ht-btn:hover { background: var(--ht-accent-2); }
.ht-btn:active { transform: translateY(1px); }
.ht-btn:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
.ht-btn--lg { min-height: 52px; padding: 0 1.6rem; font-size: var(--sc-t-base); }
.ht-btn--ghost { background: var(--sc-surface); color: var(--sc-ink); border-color: var(--ht-field); box-shadow: none; }
.ht-btn--ghost:hover { background: var(--ht-pale); }
.ht-btn:disabled { opacity: .5; cursor: not-allowed; }
.ht-link { color: var(--ht-accent-2); font-weight: 600; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em; transition: color 150ms var(--sc-ease-out); }
.ht-link:hover { color: var(--sc-ink); }
.ht-link:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
.ht-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-4) var(--sc-6); margin-top: var(--sc-7) !important; }

.ht-chip { display: inline-flex; align-items: center; padding: .22rem .7rem; border-radius: 999px; background: var(--ht-chip); color: var(--sc-ink-soft); font-size: var(--sc-t-xs); font-weight: 600; white-space: nowrap; }
.ht-chip--ok { background: var(--ht-ok-bg); color: var(--ht-ok); }
.ht-chip--demo { background: var(--ht-amber-bg); color: var(--ht-amber-ink); }

.ht-panel { background: var(--sc-surface); border: 1px solid var(--ht-rule); border-radius: 14px; padding: 1.25rem 1.5rem; box-shadow: var(--sc-e1), var(--sc-edge); }
.ht-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: .8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--ht-rule); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.ht-dl { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.5rem; }
.ht-dl--row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ht-dl dt { font-size: var(--sc-t-xs); color: var(--sc-ink-soft); }
.ht-dl dd { font-weight: 600; font-size: var(--sc-t-sm); }

/* ------------------------------------------------- app chrome (nav) -- */
.ht-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--ht-bar);
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem;
  background: color-mix(in oklab, var(--sc-canvas) 94%, transparent); border-bottom: 1px solid var(--ht-rule);
  backdrop-filter: saturate(1.4) blur(10px);
}
.ht-bar__logo { width: calc(var(--ht-side) - 1.25rem); flex: none; }
/* Forest lockup: the brand V redrawn in the page palette, the wordmark set live in the brand face. */
.ht-logo { display: inline-flex; align-items: center; gap: .35rem; color: var(--sc-ink); text-decoration: none; }
.ht-logo svg { width: 34px; height: 34px; flex: none; }
.ht-logo__v { fill: var(--sc-accent); }
.ht-logo__facet { fill: var(--ht-amber-light); }
.ht-logo span { font-family: var(--ht-font-brand); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.035em; line-height: 1; }
.ht-bar__logo:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 6px; }
.ht-bar__crumb { display: flex; gap: .5rem; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.ht-bar__actions { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.ht-bar__actions .ht-link { font-size: var(--sc-t-sm); }
.ht-lang { margin: 0; }
.ht-lang button {
  min-width: 44px; min-height: 44px; padding: 0 .6rem; border: 1px solid var(--ht-rule-strong); border-radius: 10px;
  background: transparent; color: var(--sc-ink); font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); font-weight: 600; cursor: pointer;
  transition: background-color 150ms var(--sc-ease-out), border-color 150ms var(--sc-ease-out);
}
.ht-lang button:hover { background: var(--ht-pale); border-color: var(--ht-field); }
.ht-lang button:active { transform: translateY(1px); }
.ht-lang button:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }

.ht-side {
  position: fixed; z-index: 50; top: var(--ht-bar); bottom: 0; left: 0; width: var(--ht-side);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.25rem .75rem; background: var(--sc-canvas); border-right: 1px solid var(--ht-rule);
}
.ht-side ul { display: grid; gap: .25rem; }
.ht-side a {
  position: relative; display: flex; align-items: center; gap: .7rem; min-height: 42px; padding: 0 .75rem; border-radius: 8px;
  color: var(--sc-ink-soft); font-size: var(--sc-t-sm); text-decoration: none; white-space: nowrap;
  transition: background-color 150ms var(--sc-ease-out), color 150ms var(--sc-ease-out);
}
.ht-side a:hover { background: color-mix(in oklab, var(--ht-pale) 70%, transparent); color: var(--sc-ink); }
.ht-side a:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: -2px; }
.ht-side a[aria-current="true"] { background: var(--ht-pale); color: var(--ht-accent-2); font-weight: 600; }
.ht-side svg, .ht-search__field svg, .ht-files svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ht-side__note { font-size: var(--sc-t-xs); color: var(--sc-ink-soft); padding: 0 .75rem; line-height: 1.5; }

.ht-main { margin-left: var(--ht-side); }
/* Pinned stages stick below the app bar, not under it; the act's travel is unchanged. */
.ht-chaos__stage, .ht-road__stage, .ht-proof__stage { top: var(--ht-top); height: calc(100svh - var(--ht-top)); }

/* ----------------------------------------------------------- 1 hero -- */
.ht-hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: var(--ht-gap);
  padding: calc(var(--ht-top) + 2.5rem) var(--sc-gutter) 3.5rem;
}
/* ledger dot grid, fading out from behind the scene */
.ht-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--ht-rule-strong) 1px, transparent 1.3px);
  background-size: 22px 22px; background-position: 11px 11px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 48%, black, transparent 72%);
          mask-image: radial-gradient(ellipse 60% 70% at 72% 48%, black, transparent 72%);
}
.ht-hero__scene { position: relative; height: clamp(30rem, 70svh, 40rem); }
.ht-plane { position: absolute; margin: 0; }
.ht-plane--photo { right: 0; top: 0; width: 74%; height: 80%; }
.ht-plane--record { left: 0; top: 20%; width: 56%; }
.ht-plane--phone { right: 5%; top: 30%; width: 13.25rem; }
.ht-plane--tag { left: 18%; bottom: 0; width: 20rem; }

.ht-plane--photo img { border-radius: 20px; background: var(--ht-photo-ground); box-shadow: var(--sc-e2); }
.ht-record { padding: 1.3rem 1.5rem 1.5rem; box-shadow: var(--sc-e3), var(--sc-edge); }
.ht-record__title { font-family: var(--sc-font-display); font-size: var(--sc-t-lg); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 1rem !important; text-wrap: balance; }

.ht-phone { width: 100%; aspect-ratio: 9 / 18.5; padding: .5rem; border-radius: 2.1rem; background: var(--sc-ink); box-shadow: var(--sc-e3), inset 0 0 0 1px color-mix(in oklab, var(--sc-accent-ink) 14%, transparent); }
.ht-phone__screen { height: 100%; overflow: hidden; border-radius: 1.65rem; background: var(--sc-surface); padding: 1.6rem 1rem 1rem; display: grid; align-content: start; gap: .6rem; font-size: .8rem; line-height: 1.45; }
.ht-phone__status { background: var(--ht-ok-bg); color: var(--ht-ok); font-weight: 700; padding: .45rem .65rem; border-radius: 8px; }
.ht-phone__note { color: var(--sc-ink-soft); font-size: .75rem; }
.ht-phone__name { font-family: var(--sc-font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.2; margin-top: .3rem !important; }
.ht-phone__meta { display: grid; color: var(--sc-ink-soft); }
.ht-phone__list { display: grid; gap: .45rem; border-top: 1px solid var(--ht-rule); padding-top: .7rem !important; }
.ht-phone__list li { padding-left: 1.2rem; position: relative; }
.ht-phone__list li::before { content: ""; position: absolute; left: .1rem; top: .3em; width: .45rem; height: .75rem; border: solid var(--ht-ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ht-phone__report { color: var(--ht-accent-2); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }

/* the tag: a punched hole, a perforation, a QR that is being read */
.ht-tag {
  position: relative; display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: 1rem; align-items: center;
  padding: 1rem 1.1rem 1rem 2rem; background: var(--sc-surface); border: 1px solid var(--ht-rule); border-radius: 12px;
  box-shadow: var(--sc-e3); rotate: -3deg;
}
.ht-tag::before { content: ""; position: absolute; left: .6rem; top: 50%; width: .6rem; height: .6rem; margin-top: -.3rem; border-radius: 50%; background: var(--sc-canvas); box-shadow: inset 0 1px 2px hsl(var(--sc-shadow-color) / .35); }
.ht-tag::after { content: ""; position: absolute; left: 1.45rem; top: .6rem; bottom: .6rem; width: 2px; background: radial-gradient(circle, var(--ht-rule-strong) 1px, transparent 1.2px) 0 0 / 2px 7px repeat-y; }
.ht-tag__qr { position: relative; overflow: hidden; border-radius: 4px; }
.ht-tag__qr svg { width: 100%; height: auto; }
.ht-tag figcaption { display: grid; gap: .2rem; font-size: var(--sc-t-sm); min-width: 0; }
.ht-tag figcaption b { font-weight: 600; }
.ht-tag small { font-size: var(--sc-t-xs); color: var(--sc-ink-soft); line-height: 1.4; margin-top: .2rem; }

/* one entrance for the scene, then it holds */
@media (prefers-reduced-motion: no-preference) {
  .ht-plane > * { animation: ht-rise 900ms var(--sc-ease-out) both; }
  .ht-plane--record > * { animation-delay: 120ms; }
  .ht-plane--phone > * { animation-delay: 240ms; }
  .ht-plane--tag > * { animation-delay: 360ms; }
  .ht-plane--tag .ht-tag__qr::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, transparent 46%, var(--ht-pattern-strong) 49%, var(--sc-accent) 50%, transparent 51%);
    animation: ht-scan 2.8s 1.2s var(--sc-ease-in-out) infinite alternate both;
  }
}
@keyframes ht-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@keyframes ht-scan { from { transform: translateY(-50%); } to { transform: translateY(50%); } }

/* ----------------------------------------------------- 2 the search -- */
.ht-chaos__stage {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: var(--ht-gap);
  padding: 2rem var(--sc-gutter);
}
.ht-cues { display: grid; margin-top: var(--sc-5); }
.ht-cues > p { grid-area: 1 / 1; font-size: var(--sc-t-lg); line-height: 1.5; max-width: 46ch; }
.ht-search { position: relative; height: min(34rem, calc(100svh - var(--ht-top) - 4rem)); display: flex; flex-direction: column; overflow: hidden; }
.ht-search__field { display: flex; align-items: center; gap: .6rem; padding: .8rem .95rem; border: 1px solid var(--ht-field); border-radius: 10px; color: var(--sc-ink-soft); box-shadow: 0 0 0 4px var(--ht-pale); }
.ht-search__q { color: var(--sc-ink); white-space: pre; }
.ht-search__caret { width: 1.5px; height: 1.2em; background: var(--sc-accent); animation: ht-blink 1s steps(2, start) infinite; }
@keyframes ht-blink { to { visibility: hidden; } }
.ht-search__status { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); margin-top: .8rem !important; }
.ht-search__status.is-empty { color: var(--ht-bad); font-weight: 600; }
.ht-files { position: relative; flex: 1; margin-top: 1rem !important; }
.ht-files li {
  --v: clamp(0, (var(--sc-p, 0) - var(--at)) * 10, 1);
  position: absolute; left: var(--x); top: var(--y);
  display: flex; align-items: center; gap: .55rem; padding: .6rem .9rem .6rem .7rem;
  background: var(--sc-surface); border: 1px solid var(--ht-rule); border-radius: 8px; box-shadow: var(--sc-e2);
  font-size: var(--sc-t-sm); white-space: nowrap; color: var(--sc-ink);
  opacity: var(--v); transform: translate3d(0, calc((1 - var(--v)) * 18px), 0) rotate(var(--r));
}
.ht-files svg { color: var(--sc-ink-soft); width: 16px; height: 16px; }

/* ------------------------------------------------------ 3 the order -- */
.ht-order {
  display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: center; gap: var(--ht-gap);
  padding: clamp(3rem, 6vw, 6rem) var(--sc-gutter) var(--sc-section);
}
.ht-order__copy p { color: var(--sc-ink-soft); font-size: var(--sc-t-lg); max-width: 46ch; }
.ht-order__copy .ht-h2 + p { margin-top: var(--sc-5); }
.ht-order__record { margin: 0; }
.ht-batch { box-shadow: var(--sc-e2), var(--sc-edge); }
.ht-batch__name { display: flex; flex-wrap: wrap; gap: .25rem .75rem; color: var(--sc-ink); font-weight: 600; }
.ht-batch__name .ht-mono { color: var(--sc-ink-soft); }
.ht-evidence { width: 100%; border-collapse: collapse; margin-top: 1.25rem; font-size: var(--sc-t-sm); }
.ht-evidence caption { text-align: left; font-weight: 600; padding-bottom: .5rem; }
.ht-evidence th { text-align: left; font-size: var(--sc-t-xs); font-weight: 600; color: var(--sc-ink-soft); padding: .5rem .5rem .5rem 0; }
.ht-evidence td { padding: .65rem .5rem .65rem 0; border-top: 1px solid var(--ht-rule); }
.ht-evidence td:first-child { font-weight: 600; }
.ht-evidence td.ht-mono { color: var(--sc-ink-soft); font-size: var(--sc-t-xs); }

/* ------------------------------------------------------- 4 the road -- */
.ht-road__stage { display: flex; align-items: center; }
.ht-rail { display: flex; align-items: stretch; gap: 1.25rem; width: max-content; padding-inline: var(--sc-gutter) calc(var(--sc-gutter) + var(--ht-side)); }
.ht-rail__lead, .ht-rail__end { flex: none; align-self: center; width: min(25rem, 78vw); }
.ht-rail__lead { padding-right: 2rem; }
.ht-rail__lead p { margin-top: var(--sc-5) !important; color: var(--sc-ink-soft); font-size: var(--sc-t-lg); }
.ht-rail__end { padding-left: 2rem; display: grid; gap: 1rem; font-size: var(--sc-t-lg); }
.ht-rail__end p + p { color: var(--sc-ink-soft); }
.ht-event {
  position: relative; flex: none; width: clamp(16rem, 21vw, 19rem); margin-top: 2.6rem;
  display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem 1.3rem 1.2rem;
  background: var(--sc-surface); border: 1px solid var(--ht-rule); border-radius: 14px; box-shadow: var(--sc-e1), var(--sc-edge);
  font-size: var(--sc-t-sm);
  transition: translate 220ms var(--sc-ease-out), box-shadow 220ms var(--sc-ease-out);
}
.ht-event::before { content: ""; position: absolute; top: -1.6rem; left: -1.4rem; right: -1px; height: 2px; background: var(--ht-rule-strong); }
.ht-event::after { content: ""; position: absolute; top: calc(-1.6rem - 5px); left: 1.3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--ht-amber); box-shadow: 0 0 0 4px var(--sc-canvas); }
.ht-event--fix { border: 1px dashed var(--ht-amber); }
.ht-event--photo { padding-top: .6rem; }
.ht-event__media { height: 8.5rem; margin: 0 -.7rem .4rem !important; border-radius: 10px; overflow: hidden; }
.ht-event__media img { object-position: 55% 62%; }
.ht-event__type { font-family: var(--sc-font-display); font-size: var(--sc-t-lg); font-weight: 600; letter-spacing: -0.01em; }
.ht-event__when { font-family: var(--sc-font-mono); font-size: .78rem; color: var(--sc-ink-soft); }
.ht-event__by { margin-top: auto !important; padding-top: .5rem; color: var(--sc-ink-soft); font-size: var(--sc-t-xs); }
@media (hover: hover) and (pointer: fine) {
  .ht-event:hover { translate: 0 -3px; box-shadow: var(--sc-e2), var(--sc-edge); }
}
@media (prefers-reduced-motion: no-preference) {
  .ht-event {
    --s: clamp(0, var(--sc-p, 0) * 8 - var(--i) + 1.6, 1);
    opacity: calc(.55 + .45 * var(--s));
    transform: translate3d(0, calc((1 - var(--s)) * 14px), 0);
  }
}

/* -------------------------------------------------- 5 the silence -- */
.ht-quiet { padding: 34vh var(--sc-gutter) 30vh; }
.ht-quiet__line { font-family: var(--sc-font-display); font-size: var(--sc-t-xl); font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; max-width: 30ch; text-wrap: balance; }

/* --------------------------------------------- 6 the fingerprint -- */
.ht-proof__stage {
  isolation: isolate; /* stays sticky: the engine's position is the positioning context */
  display: grid; grid-template-rows: auto 1fr; gap: clamp(1rem, 3vh, 2rem);
  padding: clamp(1rem, 4vh, 2.5rem) var(--sc-gutter);
}
/* a whorl, drawn faint behind the work: the page's one motif for "fingerprint" */
.ht-proof__stage::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: -4%; top: 6%; width: min(46vw, 40rem); aspect-ratio: 400 / 480;
  background: var(--ht-pattern-strong);
  -webkit-mask: var(--ht-whorl) center / contain no-repeat; mask: var(--ht-whorl) center / contain no-repeat;
}
.ht-proof__copy { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1rem var(--ht-gap); align-items: start; }
.ht-proof__copy .ht-cues { margin-top: 0; }
.ht-proof__work { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--ht-gap); align-items: start; }

/* the certificate: double frame and guilloche, the way security paper is printed */
.ht-cert {
  position: relative; isolation: isolate;
  background: var(--sc-surface); border: 1px solid var(--ht-rule-strong); border-radius: 4px; padding: 1.6rem 1.8rem;
  box-shadow: var(--sc-e2); outline: 1px solid var(--ht-rule); outline-offset: -8px;
}
.ht-cert::before {
  content: ""; position: absolute; inset: 9px; z-index: -1; pointer-events: none; background: var(--ht-pattern);
  -webkit-mask: var(--ht-guilloche) 0 0 / 96px 20px repeat; mask: var(--ht-guilloche) 0 0 / 96px 20px repeat;
}
.ht-cert header { border-bottom: 2px solid var(--sc-ink); padding-bottom: .8rem; margin-bottom: .6rem; }
.ht-cert__org { font-size: var(--sc-t-xs); font-weight: 600; color: var(--sc-ink-soft); }
.ht-cert h3 { margin: .25rem 0 0; font-family: var(--sc-font-display); font-size: var(--sc-t-lg); font-weight: 600; letter-spacing: -0.01em; }
.ht-cert__rows label { display: grid; grid-template-columns: 5.75rem minmax(0, 1fr); align-items: center; gap: .75rem; border-bottom: 1px solid var(--ht-rule); }
.ht-cert__rows span { font-size: var(--sc-t-xs); color: var(--sc-ink-soft); }
.ht-cert__rows input {
  width: 100%; min-height: 44px; border: 0; background: transparent; padding: 0 .4rem; margin-left: -.4rem; border-radius: 4px;
  font-size: var(--sc-t-sm); font-weight: 600; color: var(--sc-ink);
  box-shadow: inset 0 -1px 0 var(--ht-field);
  transition: background-color 200ms var(--sc-ease-out), box-shadow 200ms var(--sc-ease-out);
}
.ht-cert__rows input:hover { background: var(--ht-pale); }
.ht-cert__rows input:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 0; background: var(--sc-surface); }
.ht-cert__rows input.is-changed { background: var(--ht-bad-bg); color: var(--ht-bad); box-shadow: inset 0 -2px 0 var(--ht-bad); }

.ht-print { background: var(--sc-surface); border: 1px solid var(--ht-rule); border-radius: 14px; padding: 1.4rem 1.6rem; box-shadow: var(--sc-e1), var(--sc-edge); display: grid; gap: .9rem; justify-items: start; }
.ht-print__label { font-size: var(--sc-t-sm); font-weight: 600; }
.ht-hash {
  justify-self: stretch; display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: .22rem .16rem; perspective: 600px;
  font-family: var(--sc-font-mono); font-weight: 600; font-size: clamp(.85rem, .5rem + .9vw, 1.45rem); line-height: 1.25; text-transform: uppercase;
}
.ht-hash span {
  text-align: center; padding: .2em 0; border-radius: 5px; color: var(--ht-ok); background: var(--ht-ok-bg);
  transition: color 260ms var(--sc-ease-out), background-color 260ms var(--sc-ease-out);
  transition-delay: calc(var(--k) * 7ms);
}
.ht-hash span.is-diff { color: var(--ht-bad); background: var(--ht-bad-bg); }
@media (prefers-reduced-motion: no-preference) {
  .ht-hash span.is-flip { animation: ht-flip 460ms var(--sc-ease-out) both; animation-delay: calc(var(--k) * 7ms); }
}
@keyframes ht-flip { 0% { transform: rotateX(0); } 45% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.ht-print__stored { font-size: var(--sc-t-xs); color: var(--sc-ink-soft); overflow-wrap: anywhere; }
.ht-print__stored .ht-mono { font-size: .75rem; }
.ht-verdict { font-family: var(--sc-font-display); font-size: var(--sc-t-lg); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; color: var(--ht-ok); }
.ht-proof.is-broken .ht-verdict { color: var(--ht-bad); }

/* ----------------------------------------------------- 7 the start -- */
.ht-start { padding: var(--sc-section) var(--sc-gutter) 2rem; }
.ht-start__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ht-gap); align-items: center; }
.ht-start__form > p { color: var(--sc-ink-soft); font-size: var(--sc-t-lg); max-width: 46ch; }
.ht-start__form > .ht-small { font-size: var(--sc-t-sm); }
.ht-start__form > .ht-actions { font-size: var(--sc-t-base); }
.ht-start__form > .ht-h2 + p { margin-top: var(--sc-5); }
.ht-start__form > .ht-fields { margin-top: var(--sc-6); }
.ht-fields { display: grid; gap: 1rem; max-width: 30rem; }
.ht-fields label { display: grid; gap: .35rem; font-size: var(--sc-t-sm); font-weight: 600; }
.ht-fields input {
  min-height: 48px; padding: 0 .95rem; border: 1px solid var(--ht-field); border-radius: 10px; background: var(--sc-surface);
  font-weight: 400; color: var(--sc-ink); transition: border-color 150ms var(--sc-ease-out);
}
.ht-fields input::placeholder { color: var(--ht-placeholder); }
.ht-fields input:hover { border-color: var(--sc-ink-soft); }
.ht-fields input:focus-visible { border-color: var(--sc-accent); outline: 2px solid var(--sc-accent); outline-offset: 1px; box-shadow: 0 0 0 5px var(--ht-pale); }
.ht-tag--big { width: min(100%, 30rem); grid-template-columns: 9.5rem minmax(0, 1fr); padding: 1.4rem 1.5rem 1.4rem 2.6rem; rotate: 2deg; justify-self: center; }
.ht-tag--big::after { left: 1.75rem; }
.ht-tag--big figcaption { font-size: var(--sc-t-base); gap: .3rem; }
.ht-tag__name { font-family: var(--sc-font-display); font-size: var(--sc-t-lg); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ht-tag__qr--pending { aspect-ratio: 1; display: grid; place-items: center; padding: .6rem; border: 1.5px dashed var(--ht-field); border-radius: 6px; text-align: center; font-size: var(--sc-t-xs); color: var(--sc-ink-soft); line-height: 1.35; }
.ht-foot { margin-top: clamp(4rem, 10vw, 8rem); padding-top: 1.25rem; border-top: 1px solid var(--ht-rule); display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; font-size: var(--sc-t-xs); color: var(--sc-ink-soft); }
.ht-foot a { color: inherit; }
.ht-foot a:hover { color: var(--sc-ink); }
.ht-foot a:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.ht-foot__credits { flex-basis: 100%; }

/* ----------------------------------------------------------- motion -- */
@media (prefers-reduced-motion: reduce) {
  .ht-files li { opacity: 1; transform: rotate(var(--r)); }
  .ht-search__caret { animation: none; }
  .ht-hash span, .ht-event { transition: none; }
}

/* ----------------------------------------------------------- tablet -- */
@media (max-width: 1080px) {
  :root { --ht-side: 0px; --ht-top: calc(var(--ht-bar) + 46px); }
  .ht-bar__logo { width: auto; }
  .ht-side { top: var(--ht-bar); bottom: auto; right: 0; width: auto; height: 46px; padding: 0 .5rem; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ht-rule); scrollbar-width: none; }
  .ht-side ul { display: flex; gap: .15rem; align-items: center; }
  .ht-side a { min-height: 36px; padding: 0 .65rem; }
  .ht-side__note { display: none; }
  .ht-proof__work { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ------------------------------------------------------------ phone -- */
@media (max-width: 760px) {
  .ht-bar { gap: .75rem; padding: 0 1rem; }
  .ht-logo svg { width: 28px; height: 28px; }
  .ht-logo span { font-size: 1.1rem; }
  .ht-bar__crumb, .ht-bar__actions .ht-link { display: none; }
  .ht-bar__actions { gap: .75rem; }
  .ht-bar .ht-btn { min-height: 40px; padding: 0 .85rem; }
  .ht-bar .ht-chip { flex: none; }
  .ht-side svg { display: none; }

  .ht-hero { grid-template-columns: minmax(0, 1fr); padding-top: calc(var(--ht-top) + 2rem); gap: 2.5rem; }
  .ht-h1 { max-width: 12ch; }
  .ht-hero__scene { height: 31rem; }
  .ht-plane--photo { width: 88%; height: 62%; }
  .ht-plane--record { width: 84%; top: 26%; }
  .ht-plane--phone { width: 9.5rem; top: auto; bottom: 3rem; right: -.25rem; }
  .ht-plane--tag { left: 0; width: 15.5rem; bottom: 0; }
  .ht-record { padding: 1.1rem 1.15rem 1.2rem; }
  .ht-tag { grid-template-columns: 5.2rem minmax(0, 1fr); padding: .8rem .9rem .8rem 1.8rem; }
  .ht-tag::after { left: 1.25rem; }
  .ht-tag small { display: none; }

  .ht-chaos__stage { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1.25rem; }
  .ht-cues > p { font-size: var(--sc-t-base); }
  .ht-search { height: calc(100svh - var(--ht-top) - 13rem); min-height: 18rem; padding: 1rem; }
  .ht-files li { font-size: var(--sc-t-xs); left: calc(var(--x) * .6); }

  .ht-order { grid-template-columns: minmax(0, 1fr); }
  .ht-dl--row { grid-template-columns: 1fr 1fr; }
  .ht-evidence th:nth-child(2), .ht-evidence td:nth-child(2), .ht-evidence th:nth-child(4), .ht-evidence td:nth-child(4) { display: none; }
  .ht-batch { padding: 1.1rem 1.15rem; }
  .ht-panel__head { flex-wrap: wrap; }

  .ht-proof__stage { gap: .9rem; padding-top: 1rem; }
  .ht-proof__stage::before { width: 80vw; right: -30%; }
  .ht-proof__copy, .ht-proof__work { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .ht-proof__copy .ht-cues > p { font-size: var(--sc-t-sm); }
  .ht-cert { padding: .9rem 1.1rem; }
  .ht-cert header { padding-bottom: .4rem; margin-bottom: .2rem; }
  .ht-cert__org, .ht-print__stored { display: none; }
  .ht-cert__rows label { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .ht-cert__rows input { min-height: 34px; }
  .ht-print { padding: .9rem 1rem; gap: .55rem; }

  .ht-start__grid { grid-template-columns: minmax(0, 1fr); }
  .ht-tag--big { grid-template-columns: 7rem minmax(0, 1fr); padding: 1.1rem 1.1rem 1.1rem 2.2rem; }
  .ht-tag--big::after { left: 1.45rem; }
}

/* Narrow phones: the hero and the close each carry the primary action; the bar keeps the sample-data notice and language. */
@media (max-width: 420px) {
  .ht-bar .ht-btn { display: none; }
}
