/* Hallmark · genre: modern-minimal · macrostructure: Narrative Workflow · hero: H9 (label pad, Tier-A CSS)
 * theme: custom · vibe: "thermal-label datasheet, clinical, measured, signal yellow"
 * paper: oklch(98.2% 0.006 100) · accent: oklch(90% 0.17 103)
 * display: Archivo (wdth 75, 800) · body: IBM Plex Sans · mono: IBM Plex Mono · axes: light / display-condensed-bold / chromatic-yellow ~103°
 * sections: H9 hero · scroll print story (centrepiece) · Kesit anatomy + Rulo maker · navy chapter (film window + map timeline) · label-format modules · annotated plate · FAQ printout · farewell-label footer
 * nav: N5 pill + thermal reading strip · footer: Ft5 (label) + tear-off tabs · motion budget: print story, maker, film window
 * critical CSS: base, nav, label, hero, titles. Below-the-fold sections live in sections.css (loaded without blocking render).
 * pre-emit critique: P5 H4 E4 S5 R4 V5 · plain HTML/CSS/JS
 */

/* ---------- Fonts ------------------------------------------------------- */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600 800; font-stretch: 62% 75%; font-display: swap; src: url(../fonts/archivo-lat.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600 800; font-stretch: 62% 75%; font-display: swap; src: url(../fonts/archivo-ext.woff2) format("woff2"); unicode-range: U+011E-011F, U+0130, U+015E-015F, U+20BA; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/plex-sans-lat.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/plex-sans-ext.woff2) format("woff2"); unicode-range: U+011E-011F, U+0130, U+015E-015F, U+20BA; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/plex-sans-cyr.woff2) format("woff2"); unicode-range: U+0400-045F; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/plex-mono-400-lat.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/plex-mono-400-ext.woff2) format("woff2"); unicode-range: U+011E-011F, U+0130, U+015E-015F, U+20BA; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/plex-mono-500-lat.woff2) format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/plex-mono-500-ext.woff2) format("woff2"); unicode-range: U+011E-011F, U+0130, U+015E-015F, U+20BA; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/plex-sans-arabic-500-page.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/plex-sans-arabic-700-page.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }

/* ---------- Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-paper);
  font-variant-numeric: tabular-nums;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { margin: 0; font-style: normal; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
p { margin: 0; text-wrap: pretty; }
ol, ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
figure { margin: 0; }
address { font-style: normal; }
sup { font-size: .55em; line-height: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .02em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.flag { width: 1.35em; height: .9em; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px var(--color-rule); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: var(--space-sm); top: calc(-1 * var(--space-3xl)); z-index: var(--z-skip);
  padding: var(--space-xs) var(--space-sm); background: var(--color-ink); color: var(--color-paper);
}
.skip-link:focus { top: var(--space-sm); }

.section-title {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -.01em;
  line-height: 1;
}

/* ---------- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-height: 3rem; padding: 0 var(--space-md);
  border: var(--rule-hair) solid var(--color-ink);
  border-radius: var(--radius-cut);
  font: 600 var(--text-md)/1 var(--font-body);
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn--sm { min-height: 2.375rem; padding: 0 var(--space-sm); font-size: var(--text-sm); }

.btn--accent { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-label-black); }
.btn--accent:hover { background: var(--color-accent-deep); }

.btn--line { background: transparent; color: var(--color-ink); }
.btn--line:hover { background: var(--color-paper-3); }

.btn--line-light { background: transparent; color: var(--color-navy-ink); border-color: var(--color-navy-line); }
.btn--line-light:hover { background: var(--color-navy-deep); }

/* ---------- Nav · N5 floating pill ------------------------------------- */
.nav {
  position: fixed; z-index: var(--z-nav);
  top: var(--space-sm); left: 50%; translate: -50% 0;
  width: max-content; max-width: calc(100% - 2 * var(--gutter));
}
.nav__pill {
  position: relative;
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-3xs) var(--space-3xs) var(--space-3xs) var(--space-md);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-pill);
}
.nav__brand .logo { display: block; height: 1.6rem; width: auto; aspect-ratio: 494 / 121.5; color: var(--color-brand); }
.logo { fill: currentColor; }
.nav__links { display: flex; gap: var(--space-md); }
.nav__links a {
  font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2);
  text-decoration: none; white-space: nowrap;
  text-underline-offset: .35em;
}
.nav__links a:hover { color: var(--color-ink); text-decoration: underline; text-decoration-thickness: 1px; }
.nav__links a[aria-current="true"] { color: var(--color-ink); text-decoration: underline; text-decoration-thickness: 2px; }
.nav__cta { border-radius: var(--radius-pill); }
.nav__toggle {
  display: none; place-items: center;
  width: 2.375rem; height: 2.375rem; border: 0; border-radius: var(--radius-pill);
  background: var(--color-paper-2); color: var(--color-ink); cursor: pointer;
}
.nav__toggle .i { grid-area: 1 / 1; width: 1.25rem; height: 1.25rem; }
.nav__toggle .i--close, .nav.is-open .nav__toggle .i--open { display: none; }
.nav.is-open .nav__toggle .i--close { display: block; }

@media (max-width: 899.98px) {
  .nav { width: calc(100% - 2 * var(--gutter)); }
  .nav__pill { gap: var(--space-xs); justify-content: space-between; }
  .nav__toggle { display: grid; }
  .nav__cta { margin-left: auto; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: calc(100% + var(--space-2xs));
    flex-direction: column; gap: 0;
    padding: var(--space-2xs);
    background: var(--color-paper); border: var(--rule-hair) solid var(--color-rule);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-pill);
    opacity: 0; visibility: hidden; transform: translateY(-.5rem);
    transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), visibility 0s var(--dur-short);
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav__links a { padding: var(--space-xs) var(--space-sm); font-size: var(--text-md); border-radius: var(--radius-xs); }
  .nav__links a:hover { background: var(--color-paper-2); text-decoration: none; }
}
@media (max-width: 359.98px) { .nav__cta { display: none; } }

/* ---------- Label · the 60×40 mm thermal label ----------------------------
   Sized in container-query units so the same markup reads at any width. */
.label {
  container-type: inline-size;
  display: flex; flex-direction: column;
  aspect-ratio: 3 / 2; width: 100%;
  background: var(--color-label);
  color: var(--color-label-black);
  border-radius: 1.6cqi;
  overflow: hidden;
  font-family: var(--font-display);
  font-stretch: 72%;
  line-height: 1.18;
  box-shadow: var(--shadow-label);
}
.label[lang="ru"] { font-family: var(--font-body); font-stretch: normal; }
.label[lang="ar"] { font-family: var(--font-arabic); font-stretch: normal; }
.label > * { padding: 1.3cqi 3.2cqi; }
.label__row { display: flex; justify-content: space-between; gap: 2cqi; font-size: 4cqi; font-weight: 700; }
.label__row--dark { background: var(--color-label-black); color: var(--color-label); }
.label__dose { font-size: 4.3cqi; }
.label__body { flex: 1; font-size: 5cqi; font-weight: 750; overflow: hidden; }
.label__warn { font-size: 3.5cqi; font-weight: 500; }
.label__foot { border-top: .4cqi solid var(--color-label-black); text-align: center; font-size: 3.8cqi; font-weight: 700; }
.label[lang="ru"] .label__body, .label[lang="ru"] .label__row { font-weight: 600; }
.label[lang="ru"] .label__body { font-size: 4.3cqi; }
.label[lang="ar"] { line-height: 1.1; }
.label[lang="ar"] .label__body { font-size: 4.2cqi; }
.label[lang="ar"] .label__dose { font-size: 3.9cqi; }
.label[lang="ar"] .label__row { font-size: 3.6cqi; }

/* ---------- Hero · H9 --------------------------------------------------- */
/* brand surface: #0E71B8 with soft window light and pharmacy shelves out of focus behind */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  padding-block: calc(var(--space-3xl) + var(--space-sm)) var(--space-2xl);
  background:
    radial-gradient(70% 90% at 82% 8%, var(--color-brand-light) 0%, transparent 70%),
    radial-gradient(80% 70% at 0% 100%, var(--color-brand-deep) 0%, transparent 70%),
    var(--color-brand);
  color: var(--color-navy-ink);
}
.hero__shelves {
  position: absolute; inset: -12px; z-index: -1; width: calc(100% + 24px); height: calc(100% + 24px);
  filter: blur(7px);
  -webkit-mask: linear-gradient(100deg, rgb(0 0 0 / .35) 0%, rgb(0 0 0 / .55) 40%, black 75%);
  mask: linear-gradient(100deg, rgb(0 0 0 / .35) 0%, rgb(0 0 0 / .55) 40%, black 75%);
}
.hero__boxes { fill: var(--color-brand-light); }
.hero__tags { fill: var(--color-navy-ink); opacity: .12; }
.hero__board { fill: var(--color-brand-deep); }
.hero::after {   /* light falls in from the top right, the floor goes deep */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, var(--color-brand-deep) 100%);
  opacity: .55;
}
.hero .hero__title { color: var(--color-navy-ink); }
.hero .hero__lede { color: var(--color-navy-ink); opacity: .88; }
.hero .hero__meta { color: var(--color-navy-ink); }
.hero .hero__meta a:hover { color: var(--color-navy-ink); }
.hero .btn--accent { border-color: var(--color-navy-deep); }
.hero .btn--line-light:hover { background: var(--color-brand-deep); }
.hero .spec__dim { color: var(--color-navy-ink); }
.hero .spec__dim--w { border-color: var(--color-navy-line); background: linear-gradient(to right, var(--color-navy-line) 0 calc(50% - 2.4rem), transparent 0 calc(50% + 2.4rem), var(--color-navy-line) 0) center / 100% 1px no-repeat; }
.hero .spec__dim--h { border-color: var(--color-navy-line); background: linear-gradient(to bottom, var(--color-navy-line) 0 calc(50% - 2.4rem), transparent 0 calc(50% + 2.4rem), var(--color-navy-line) 0) center / 1px 100% no-repeat; }
.hero .spec__dim span { background: none; }
.hero .spec__langs { border-color: var(--color-navy-line); box-shadow: var(--shadow-pill); }
.hero__grid { display: grid; gap: var(--space-2xl); align-items: center; }
.hero__copy { min-width: 0; }
.hero__title {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 800;
  font-size: var(--text-display);
  line-height: .92;
  letter-spacing: -.02em;
  max-width: 9ch;
}
.hero__lede { margin-top: var(--space-md); max-width: 34rem; color: var(--color-ink-2); font-size: var(--text-lg); line-height: 1.45; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-lg); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); margin-top: var(--space-md); color: var(--color-ink-2); font-size: var(--text-sm); }
.hero__meta a { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 2.75rem; text-decoration: none; }
.hero__meta a:hover { color: var(--color-ink); text-decoration: underline; }
@media (max-width: 699.98px) { .hero__lede { font-size: var(--text-md); } }

.spec { --dim: 1.75rem; --fan: 6px; --stack: calc(var(--fan) * 3); min-width: 0; }
@media (min-width: 700px) { .spec { --fan: 11px; } }
.spec__drawing { position: relative; padding: var(--dim) var(--dim) var(--stack) var(--stack); }
.spec__dim { position: absolute; display: grid; place-items: center; color: var(--color-ink-2); }
.spec__dim span { background: var(--color-paper); padding: 0 var(--space-2xs); }
.spec__dim--w {
  top: 0; left: var(--stack); right: var(--dim); height: var(--dim);
  border-inline: var(--rule-hair) solid var(--color-ink-2);
  background: linear-gradient(var(--color-ink-2), var(--color-ink-2)) center / 100% 1px no-repeat;
}
.spec__dim--h {
  right: 0; top: var(--dim); bottom: var(--stack); width: var(--dim);
  border-block: var(--rule-hair) solid var(--color-ink-2);
  background: linear-gradient(var(--color-ink-2), var(--color-ink-2)) center / 1px 100% no-repeat;
}
.spec__dim--h span { writing-mode: vertical-rl; padding: var(--space-2xs) 0; }
/* the label pad: four languages stacked, the chosen one on top */
.spec__labels { display: grid; isolation: isolate; }
.spec__labels .label {
  grid-area: 1 / 1;
  transform-origin: 50% 100%;
  transition: transform var(--dur-med) var(--ease-out), filter var(--dur-med) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}
.spec__labels .label[data-pos="0"] { z-index: 4; }
.spec__labels .label[data-pos="1"] { z-index: 3; transform: translate(calc(var(--fan) * -1), var(--fan)) rotate(-1.5deg); filter: brightness(.95); }
.spec__labels .label[data-pos="2"] { z-index: 2; transform: translate(calc(var(--fan) * -2), calc(var(--fan) * 2)) rotate(-3deg); filter: brightness(.9); }
.spec__labels .label[data-pos="3"] { z-index: 1; transform: translate(calc(var(--fan) * -3), calc(var(--fan) * 3)) rotate(-4.5deg); filter: brightness(.85); }
.spec__labels .label.is-peeling {
  z-index: 5; opacity: 0;
  transform: translate(45%, -30%) rotate(16deg);
  transition: transform 360ms var(--ease-in), opacity 360ms var(--ease-in);
}
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes unfan { from { transform: none; filter: none; opacity: 0; } }

.spec__caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-xs); margin-top: var(--space-md); color: var(--color-muted); }
.spec__langs { display: inline-flex; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-sm); overflow: hidden; }
html:not(.js) .spec__langs { display: none; }
.spec__langs button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-width: 3rem; min-height: 2.5rem; padding: 0 var(--space-xs);
  border: 0; border-left: var(--rule-hair) solid var(--color-rule);
  background: var(--color-paper); color: var(--color-ink-2);
  font: 500 var(--text-sm)/1 var(--font-mono); cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.spec__langs button:first-child { border-left: 0; }
.spec__langs button:hover { background: var(--color-paper-2); }
.spec__langs button:active { background: var(--color-paper-3); }
.spec__langs button[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper); }

/* page-load orchestration: dimension lines draw, the label prints */
html.js .hero .spec__dim--w { animation: draw-x var(--dur-med) var(--ease-out) both; }
html.js .hero .spec__dim--h { animation: draw-y var(--dur-med) var(--ease-out) 120ms both; }
html.js .hero .spec__labels.is-intro .label[data-pos="0"] { animation: print 1.1s steps(18, end) 300ms both; }
html.js .hero .spec__labels.is-intro .label:not([data-pos="0"]) { animation: unfan var(--dur-long) var(--ease-out) 1.35s both; }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes draw-y { from { transform: scaleY(0); } }

@media (min-width: 1024px) {
  .hero { padding-block: calc(var(--space-3xl) + var(--space-lg)) var(--space-3xl); }
  .hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-3xl); }
}

/* ---------- Chapter titles (three type tiers: display · chapter · section) */
.chapter-title {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: var(--text-2xl);
  line-height: .95;
  letter-spacing: -.015em;
  max-width: 16ch;
}

/* ---------- Nav: thermal-paper reading strip + tone over dark sections -- */
.nav__tape { position: absolute; left: 1.5rem; right: 1.5rem; bottom: -4px; height: 4px; overflow: hidden; border-radius: 0 0 2px 2px; pointer-events: none; }
.nav__fed { position: absolute; inset: 0; background: var(--color-label); transform-origin: 0 50%; transform: scaleX(var(--read, 0)); }
.nav__tick { position: absolute; top: 0; bottom: 0; width: 1px; left: calc(var(--at) * 100%); background: var(--color-label-black); opacity: .25; }
.nav__tick.is-past { opacity: .9; }
.nav__pill { transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.nav.is-dark .nav__pill { background: var(--color-navy-deep); border-color: var(--color-navy-line); }
.nav.is-dark .nav__brand .logo { color: var(--color-navy-ink); }
.nav.is-dark .nav__links a { color: var(--color-navy-ink); }
.nav.is-dark .nav__toggle { background: var(--color-navy); color: var(--color-navy-ink); }
@media (max-width: 899.98px) {
  .nav.is-dark .nav__links { background: var(--color-navy-deep); border-color: var(--color-navy-line); }
  .nav.is-dark .nav__links a:hover { background: var(--color-navy); }
}

/* ---------- Hero label pad tilt + glare (fine pointers only) ----------- */
.spec__labels { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--dur-med) var(--ease-out); }
.spec__labels.is-tilting { transition: none; }
.spec__labels::after {
  content: ""; grid-area: 1 / 1; z-index: 6; pointer-events: none; border-radius: 1.6cqi;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), var(--glare), transparent 62%);
  opacity: 0; transition: opacity var(--dur-short) var(--ease-out);
}
.spec__labels.is-tilting::after { opacity: 1; }

/* ---------- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
  .spec__labels { transform: none; }
}
