/* YonSe design kit: the look of gram.yonse.org, made reusable for any YonSe site.
   Values come from the live site (October 2026); class names are generic where the site's were
   product-specific (see references/tokens.md for the mapping). Load fonts/fonts.css first.
   Radii: panels 28, cards 26, scenes 18, UI sheets 16, buttons 14 (small 12), chips 10-12. */

:root {
  color-scheme: dark;

  --field: #3a22a6;
  --field-hi: #6d45f4;
  --field-mid: #4f2ed0;
  --field-lo: #301c94;
  --on-field: #ffffff;
  --on-field-2: #ddd5ff;
  --on-field-3: #b4a8ef;

  --card: #fdfcff;
  --card-ink: #170d45;
  --card-sub: #5a5384;

  --vig: #f1edff;
  --vig-line: #e6e0fa;
  --ui-text: #1d1640;
  --ui-sub: #655e8c;
  --ui-violet: #6a42f2;
  --ui-violet-2: #8f73ff;
  --ok: #117a3f;
  --bad: #cf3a3f;

  --ink: #140b3b;
  --ink-2: #1f1557;
  --peach: #fbe3c8;
  --peach-hi: #fff0de;
  --on-peach: #140b3b;
  --on-peach-2: #4a3d6e;

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-panel: 28px;
  --r-card: 26px;
  --r-btn: 14px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

/* -------------------------------------------------------------------- base */

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

html { background: var(--field); scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--field);
  color: var(--on-field);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* English pages wait for kit.js to swap the text in (the head script lifts this after 2 s). */
html[data-lang="en"] body:not(.i18n-ready) { visibility: hidden; }

::selection { background: rgba(251, 227, 200, 0.4); }

img { max-width: 100%; height: auto; display: block; }
/* Components set their own display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h2, h3 { text-wrap: balance; }
/* A long Russian word in a 34px phone heading must wrap rather than widen the page; "anywhere"
   also lets grid and flex items shrink below that word. */
h1, h2, h3 { overflow-wrap: anywhere; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { fill: currentColor; }

:focus-visible { outline: 2px solid var(--peach); outline-offset: 3px; border-radius: 6px; }
/* Peach is invisible on white cards. */
.card:not(.dark) :focus-visible { outline-color: var(--ui-violet); }

.skip {
  position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 18px; border-radius: var(--r-btn);
  background: #fff; color: var(--card-ink); font-weight: 600; text-decoration: none;
  opacity: 0; pointer-events: none; transform: translateY(-160%);
}
.skip:focus-visible { opacity: 1; pointer-events: auto; transform: none; outline-color: var(--ui-violet); }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.ico { width: 22px; height: 22px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Command names in running text stay on one line and keep plain hyphens for copying. */
.nw { white-space: nowrap; }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
              box-shadow 0.35s var(--ease-out), scale 0.18s var(--ease-out);
}
.btn:active { scale: 0.98; }
.btn-primary { background: var(--peach); color: var(--on-peach); }
.btn-primary:hover { background: var(--peach-hi); }
.btn-ghost { color: var(--on-field); background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.45); }
.btn-ghost .ico { width: 18px; height: 18px; }
/* Dark button on white cards (the download buttons on gram.yonse.org). */
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #241a63; }
.btn-ink .ico { width: 20px; height: 20px; color: var(--peach); }
.btn-soft { background: var(--vig); color: var(--ui-text); }
.btn-soft:hover { background: #e4ddfb; }
.btn-soft .ico { color: var(--ui-violet); }
.btn-sm { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; gap: 8px; }
.btn-lg { height: 58px; padding: 0 28px; font-size: 17px; }
/* The site's small mark inside the primary button (YonSeGram's is its paper plane). */
.btn-primary:has(.btn-mark) { padding-left: 16px; }
.btn-mark { display: block; flex: none; width: 26px; height: 25px; }
.btn-sm .btn-mark { width: 21px; height: 20px; }
.btn-mark > * { display: block; width: 100%; height: 100%; }
@media (max-width: 360px) {
  .btn { height: auto; min-height: 52px; padding-block: 12px; white-space: normal; text-align: center; line-height: 1.25; }
}

/* --------------------------------------------------------------------- nav */

.nav {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(12px, 2.2vw, 24px);
  border: 1px solid transparent;
  border-radius: 20px;
  transition: background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out),
              -webkit-backdrop-filter 0.4s, backdrop-filter 0.4s;
}
.nav.is-scrolled {
  background: rgba(44, 24, 138, 0.74);
  border-color: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 16px/1 var(--font-display); letter-spacing: -0.02em; }
.brand img, .brand svg { width: 32px; height: 32px; border-radius: 9px; }
.nav-links { display: flex; gap: clamp(18px, 2.4vw, 32px); }
.nav-links a { white-space: nowrap; text-decoration: none; font-weight: 500; font-size: 15px; color: rgba(255, 255, 255, 0.9); transition: color 0.3s var(--ease-out); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; }
.nav-end { display: flex; align-items: center; gap: 10px; }
/* RU | EN: a sliding thumb that follows html[data-lang]. */
.lang { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 12px; }
.lang::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 2);
  border-radius: 9px; background: rgba(255, 255, 255, 0.18); transition: transform 0.35s var(--ease-out);
}
html[data-lang="en"] .lang::before { transform: translateX(100%); }
.lang button {
  position: relative; appearance: none; border: 0; background: transparent; color: rgba(255, 255, 255, 0.88);
  font: 600 12.5px/1 var(--font-body); letter-spacing: 0.04em;
  height: 32px; min-width: 38px; border-radius: 9px; cursor: pointer; transition: color 0.3s var(--ease-out);
}
.lang button:hover, .lang button[aria-pressed="true"] { color: #fff; }
@media (prefers-reduced-motion: reduce) { .lang::before { transition: none; } }
@media (max-width: 860px) { .nav-links { display: none; } }
@media (max-width: 420px) {
  .nav { left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)); }
  /* The mark alone stays; the name is kept for screen readers. */
  .nav .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 12px;
  border-radius: var(--r-panel);
  min-height: calc(100svh - 24px);
  display: flex;
  align-items: center;
  padding-block: 112px 72px;
  color: #fff;
  background:
    radial-gradient(55% 65% at 76% 44%, rgba(168, 140, 255, 0.42), transparent 70%),
    linear-gradient(180deg, var(--field-hi) 0%, var(--field-mid) 52%, var(--field-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
/* A hero without art (a site with no mark yet) is one column with the light on the left. */
.hero-solo { background:
    radial-gradient(50% 60% at 20% 30%, rgba(168, 140, 255, 0.36), transparent 70%),
    linear-gradient(180deg, var(--field-hi) 0%, var(--field-mid) 52%, var(--field-lo) 100%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-solo .hero-inner { grid-template-columns: minmax(0, 1fr); }
.hero-copy { container-type: inline-size; }
.hero-eyebrow { font-weight: 500; font-size: clamp(15px, 1.2vw, 17px); color: #f4f1ff; }
/* Sized from its own column: set --title-em to the title's width in em (YonSeGram is 7.32). */
.hero-title { margin-top: 16px; font: 700 clamp(48px, 8vw, 104px)/0.98 var(--font-display); font: 700 min(112px, calc(100cqi / (var(--title-em, 7.32) + 0.2)))/0.98 var(--font-display); letter-spacing: -0.035em; padding-bottom: 0.04em; }
/* A second title line, the page's one peach accent ("YonSeGram Desktop"). */
.hero-title-2 { display: block; color: var(--peach); }
.hero-sub { margin-top: 26px; max-width: 34ch; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.55; color: #ece7ff; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.cta-item { display: inline-flex; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 18px; color: var(--on-field-2); font-size: 14.5px; line-height: 1.5; }
.hero-meta a { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.hero-art { display: grid; place-items: center; }
.logo-wrap { width: clamp(200px, 27vw, 360px); }
@media (prefers-reduced-motion: no-preference) {
  html:not(.noanim) .logo-wrap { animation: tile-in 1.2s var(--ease-out) 0.35s both; }
}
@keyframes tile-in { from { opacity: 0; transform: translateY(28px) scale(0.92) rotate(-5deg); } }
/* kit.js tilts it toward the pointer through --rx and --ry. */
.logo-tile {
  position: relative; aspect-ratio: 1; border-radius: 24%; overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  box-shadow: 0 60px 100px -40px rgba(16, 5, 60, 0.85), 0 24px 48px -22px rgba(16, 5, 60, 0.7);
}
.logo-tile img, .logo-tile svg { width: 100%; height: 100%; object-fit: cover; }
.logo-tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), transparent 38%);
}
@media (max-width: 900px) {
  .hero {
    padding-block: 104px 56px;
    background:
      radial-gradient(60% 34% at 22% 16%, rgba(168, 140, 255, 0.36), transparent 70%),
      linear-gradient(180deg, var(--field-hi) 0%, var(--field-mid) 52%, var(--field-lo) 100%);
  }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; justify-items: start; }
  .logo-wrap { width: clamp(112px, 30vw, 168px); }
  .hero-title { margin-top: 12px; }
}
@media (max-width: 480px) {
  .hero-cta { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cta-item, .cta-item .btn { width: 100%; }
}
@media (max-width: 420px) { .hero { margin: 8px; border-radius: 22px; min-height: calc(100svh - 16px); } }
/* Inner pages: a shorter hero that still frames the title. */
.hero-page { min-height: 0; padding-block: 132px 64px; }

/* ---------------------------------------------------------------- sections */

.sec { padding-block: clamp(80px, 10vw, 136px); }
.sec + .sec { padding-top: clamp(24px, 4vw, 48px); }

.sec-head { max-width: 820px; }
.sec-head h2, .end-panel h2, .split h2 {
  font: 700 clamp(34px, 5.2vw, 70px)/1.02 var(--font-display);
  letter-spacing: -0.045em;
}
/* The one peach heading word of the page. */
.hl { color: var(--peach); }
.intro { margin-top: 22px; max-width: 58ch; font-size: clamp(17px, 1.4vw, 19.5px); line-height: 1.6; color: var(--on-field-2); }
.intro a { color: #fff; font-weight: 600; text-underline-offset: 3px; }

.chip {
  display: inline-flex; align-items: center; margin-bottom: 22px; padding: 8px 12px;
  border-radius: 10px; background: var(--peach); color: var(--on-peach);
  font-weight: 700; font-size: 13.5px; line-height: 1;
}

/* Colour panels break the violet rhythm: peach once, ink once per page. */
.panel { margin: clamp(24px, 4vw, 48px) 12px; border-radius: var(--r-panel); padding-block: clamp(72px, 9vw, 120px); }
.panel-peach { background: var(--peach); color: var(--on-peach); }
.panel-peach .intro { color: var(--on-peach-2); }
.panel-ink { background: var(--ink); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.panel-ink .intro { color: #c9bff5; }
@media (max-width: 420px) { .panel { margin-inline: 8px; border-radius: 22px; } }

/* Copy on one side, a scene or a number on the other. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
.stat { display: flex; align-items: baseline; gap: 14px; margin-top: 28px; }
.stat b { font: 700 clamp(44px, 5vw, 64px)/1 var(--font-display); letter-spacing: -0.04em; color: var(--peach); font-variant-numeric: tabular-nums; }
.stat span { max-width: 26ch; color: var(--on-field-2); font-size: 16px; line-height: 1.4; }

/* -------------------------------------------------------------------- grid */

.grid {
  margin-top: clamp(36px, 5vw, 56px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.s3 { grid-column: span 3; }
.s4 { grid-column: span 4; }
.s5 { grid-column: span 5; }
.s6 { grid-column: span 6; }
.s7 { grid-column: span 7; }
.s8 { grid-column: span 8; }
.s12 { grid-column: span 12; }
@media (max-width: 1024px) {
  .s3, .s4, .s5, .s6, .s7, .s8 { grid-column: span 6; }
  .grid > .card:last-child:nth-child(odd) { grid-column: span 12; }
}
@media (max-width: 680px) {
  .grid > .card, .grid > .card:last-child:nth-child(odd) { grid-column: span 12; }
}

/* ------------------------------------------------------------------- cards */

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 12px 26px;
  border-radius: var(--r-card);
  background: var(--card);
  color: var(--card-ink);
  box-shadow: 0 30px 60px -36px rgba(10, 3, 50, 0.7), inset 0 -1px 0 rgba(23, 13, 69, 0.06);
}
.card-body { display: grid; align-content: start; gap: 8px; padding: 0 12px; }
/* Scene on one subgrid row, text on the next: scenes in a row share one height, so the titles
   line up whatever the scene or the text length. Older browsers keep the flex column. */
@supports (grid-template-rows: subgrid) {
  .grid > .card:has(> .vig + .card-body:last-child) { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 18px; }
}
.card h3 { font: 700 19.5px/1.25 var(--font-body); letter-spacing: -0.01em; }
.card p { color: var(--card-sub); font-size: 15.5px; line-height: 1.55; }
/* A whole card that is a link may lift; a card that is not a link never does. */
a.card { text-decoration: none; transition: translate 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out); }
a.card:hover { translate: 0 -3px; box-shadow: 0 36px 64px -34px rgba(10, 3, 50, 0.78), inset 0 -1px 0 rgba(23, 13, 69, 0.06); }

.card.dark {
  padding: 26px;
  background: var(--ink-2);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  gap: 10px;
}
.card.dark p { color: #c9bff5; }

/* Action card: a mark, a name, one line of spec, a big button, a meta line and a note pinned to
   the bottom (the download cards on gram.yonse.org; a product or service card elsewhere). */
.act-card { gap: 22px; padding: clamp(20px, 2.6vw, 30px); }
.act-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.act-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--vig); color: var(--card-ink); }
.act-mark svg, .act-mark img { width: 30px; height: 30px; }
.act-head h3 { font: 700 clamp(24px, 2.4vw, 30px)/1.1 var(--font-display); letter-spacing: -0.035em; }
.act-head p { margin-top: 4px; font-size: 15px; line-height: 1.45; }
.act-tag { align-self: start; padding: 6px 10px; border-radius: 10px; background: var(--ui-violet); color: #fff; font-weight: 700; font-size: 12.5px; line-height: 1; white-space: nowrap; }
.act-card.is-mine { box-shadow: 0 30px 60px -36px rgba(10, 3, 50, 0.7), inset 0 0 0 2px var(--ui-violet-2); }
.act-btns { display: grid; gap: 8px; }
.act-btns .btn { width: 100%; justify-content: flex-start; padding-left: 20px; }
.act-meta { padding-left: 4px; color: var(--card-sub); font-size: 14px; }
.act-note { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--vig-line); color: var(--card-sub); font-size: 15px; line-height: 1.55; }
@media (max-width: 480px) { .act-head { grid-template-columns: auto minmax(0, 1fr); } .act-tag { grid-column: 1 / -1; justify-self: start; } }

/* Status for services: built from the scene colours; a word always goes with the dot. */
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; color: var(--ui-sub); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

/* ------------------------------------------------------------------- lists */

/* The rest of a section's items: a plain list in columns, read like a spec sheet. */
.more {
  columns: 3 220px; column-gap: clamp(24px, 3vw, 40px);
  margin-top: clamp(28px, 4vw, 40px); padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.more li { padding: 7px 0; break-inside: avoid; color: #f3efff; font-size: 15.5px; font-weight: 500; line-height: 1.4; }
/* On phones the columns become settings-style rows, and a long list folds after six rows
   (kit.js adds .is-folded and shows the button). Lists inside .index fold at every width. */
.more-toggle {
  display: none; align-items: center; gap: 6px; width: 100%; padding: 13px 0 12px;
  appearance: none; background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--peach); font: 600 15px/1.35 var(--font-body); text-align: left; cursor: pointer;
}
.more-toggle .ico { width: 16px; height: 16px; transform: rotate(90deg); transition: transform 0.3s var(--ease-out); }
.more-toggle[aria-expanded="true"] .ico { transform: rotate(-90deg); }
.more-toggle[aria-expanded="true"] .more-open, .more-toggle[aria-expanded="false"] .more-close { display: none; }
.index .more.is-folded > li:nth-child(n+7) { display: none; }
.index .more-toggle:not([hidden]) { display: flex; }
@media (max-width: 600px) {
  .more { columns: auto; padding-top: 0; border-top: 0; }
  .more li { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 15px; line-height: 1.35; }
  .more.is-folded > li:nth-child(n+7) { display: none; }
  .more-toggle:not([hidden]) { display: flex; }
}
@media (prefers-reduced-motion: no-preference) {
  .more.is-foldable:not(.is-folded) > li:nth-child(n+7) { animation: more-in 0.45s var(--ease-out) both; }
}
@keyframes more-in { from { opacity: 0; transform: translateY(8px); } }

/* An index of many small items, grouped, with a count per group. */
.index-title { margin-top: clamp(56px, 7vw, 88px); color: #fff; font: 700 clamp(24px, 2.4vw, 32px)/1.15 var(--font-display); letter-spacing: -0.03em; }
.index { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 36px clamp(24px, 3vw, 40px); margin-top: 26px; }
.index-group h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; color: #fff; font: 700 17px/1.3 var(--font-display); letter-spacing: -0.02em; }
.index-group h4 small { color: var(--on-field-2); font: 600 14px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.index-group .more { columns: auto; margin-top: 0; padding-top: 0; border-top: 0; }
.index-group .more li { padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 15px; line-height: 1.35; }

/* One shared tick for every row; never an icon per item. */
.ticks { display: grid; gap: 14px; margin-top: 30px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; line-height: 1.5; font-weight: 500; }
.ticks svg { width: 18px; height: 18px; flex: none; color: var(--ui-violet); margin-top: 4px; }
.panel-ink .ticks svg, .ticks-light svg { color: var(--peach); }

/* -------------------------------------------------------------- scene kit
   Small faithful copies of a real screen: settings sheets, rows, switches. Static by default
   (a meaningful frame); loops run only while the card is on screen (.live gets .is-live from
   kit.js) and never under reduced motion. */

.vig {
  position: relative;
  flex: 1 1 auto;
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 22px 18px;
  border-radius: 18px;
  background: var(--vig);
  color: var(--ui-text);
  font-size: 13.5px;
  overflow: hidden;
}
.vig > * { max-width: 100%; }
@media (max-width: 360px) { .vig { padding-inline: 12px; font-size: 12.5px; } }

.ui-sheet {
  width: min(100%, 380px);
  padding: 4px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 13, 69, 0.06), 0 14px 30px -18px rgba(23, 13, 69, 0.35);
}
.ui-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--vig-line); }
.ui-row:last-child { border-bottom: 0; }
.ui-row > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: break-word; }
.ui-row svg { width: 16px; height: 16px; color: var(--ui-violet); flex: none; }
.ui-val { flex: none; font-style: normal; font-weight: 600; color: var(--ui-violet); font-variant-numeric: tabular-nums; }
.ui-cap { font-size: 12px; font-weight: 600; color: var(--ui-violet); padding: 10px 0 2px; letter-spacing: 0.01em; justify-self: center; }
.ui-sheet .ui-cap { justify-self: start; }
.ui-title { display: flex; align-items: center; gap: 8px; padding: 10px 0 4px; font-weight: 700; font-size: 15px; }
.ui-title svg { width: 18px; height: 18px; color: var(--ui-violet); }

.ui-switch { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: #d8d2ee; transition: background-color 0.3s; }
.ui-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.3s var(--ease-out); }
.ui-switch.on { background: var(--ui-violet); }
.ui-switch.on::after { transform: translateX(14px); }
.ui-radio { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #b9b0dd; }
.ui-radio.on { border-color: var(--ui-violet); }
.ui-radio.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ui-violet); }
.ui-btn { display: flex; justify-content: center; margin: 10px 0 8px; padding: 10px 14px; border-radius: 10px; background: var(--ui-violet); color: #fff; font-weight: 600; font-size: 13px; }
.ui-btn.danger { background: var(--bad); }

.seg { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #e9e3fb; font-size: 12px; font-weight: 600; color: var(--ui-sub); width: min(100%, 380px); }
.seg > span { position: relative; z-index: 1; flex: 1; text-align: center; padding: 8px 6px; border-radius: 8px; white-space: nowrap; transition: background-color 0.3s, color 0.3s; }
.seg > span.on { background: #fff; color: var(--ui-violet); box-shadow: 0 1px 3px rgba(23, 13, 69, 0.12); }

/* Grey bars for text that doesn't carry meaning in the scene. */
.ln { display: block; height: 8px; margin: 5px 0; border-radius: 4px; background: #d9d2f3; }
.ln.dim { background: #ebe6f9; }
.w40 { width: 40%; } .w55 { width: 55%; } .w70 { width: 70%; } .w85 { width: 85%; }
.av { display: block; flex: none; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #c9bbff, #8f73ff); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

/* Terminal output inside a scene: real lines from the real system, monospace on ink. */
.ui-term { width: min(100%, 420px); padding: 14px 16px; border-radius: 14px; background: var(--ink); color: #e9e4ff; font: 500 12.5px/1.6 var(--font-mono); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 14px 30px -18px rgba(23, 13, 69, 0.5); }
.ui-term .ok { color: #7fe0a6; }
.ui-term .bad { color: #ff9a9e; }
.ui-term .dim { color: #9d93c9; }

/* -------------------------------------------------- commands, hashes, copying */

.cmd { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--vig); }
.cmd code { flex: 1; min-width: 0; color: var(--ui-text); font: 500 13.5px/1.45 var(--font-mono); overflow-wrap: anywhere; user-select: all; }
.card.dark .cmd, .panel-ink .cmd { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.card.dark .cmd code, .panel-ink .cmd code { color: #f3efff; }
@media (max-width: 480px) { .cmd { padding-left: 12px; } .cmd code { font-size: 12.5px; } }

.copy { appearance: none; display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--vig); color: var(--ui-violet); cursor: pointer; transition: background-color 0.3s var(--ease-out), color 0.3s; }
.copy:hover { background: #e4ddfb; }
.copy svg { width: 20px; height: 20px; }
.copy.done { background: #178a49; color: #fff; }
.cmd .copy { background: #fff; }
.card.dark .copy, .panel-ink .copy { background: rgba(255, 255, 255, 0.08); color: var(--peach); }
.card.dark .copy:hover, .panel-ink .copy:hover { background: rgba(255, 255, 255, 0.14); }
.card.dark .copy.done, .panel-ink .copy.done { background: #178a49; color: #fff; }

/* Rows of label, value and copy button: checksums, keys, addresses. */
.hash-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 28px clamp(18px, 3vw, 36px) 32px; }
.hash-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 6px; }
.hash-head p { color: var(--card-sub); }
.hash-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.hash-row b { font-weight: 700; white-space: nowrap; }
.hash-row code { min-width: 0; padding: 11px 14px; border-radius: 12px; background: var(--vig); font: 500 13.5px/1.4 var(--font-mono); color: var(--ui-text); overflow-wrap: anywhere; user-select: all; }
@media (max-width: 600px) { .hash-row { grid-template-columns: minmax(0, 1fr) auto; } .hash-row b { grid-column: 1 / -1; } }

/* ----------------------------------------------------------- folding cards
   <details class="card dark fold-card">: a summary line, then numbered steps beside notes. */

.fold-grid { gap: 12px; }
.card.fold-card { padding: 0; gap: 0; }
.fold-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 18px; padding: 22px clamp(20px, 3vw, 32px); list-style: none; cursor: pointer; border-radius: inherit; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary:focus-visible { outline: 2px solid var(--peach); outline-offset: -2px; }
.fold-card h3 { display: flex; align-items: center; gap: 12px; font: 700 clamp(22px, 2.2vw, 26px)/1.1 var(--font-display); letter-spacing: -0.03em; }
.fold-card h3 svg { width: 24px; height: 24px; color: var(--peach); }
.fold-sum { color: #c9bff5; font-size: 15px; }
.fold-caret { width: 18px; height: 18px; color: var(--peach); transform: rotate(90deg); transition: transform 0.3s var(--ease-out); }
.fold-card[open] .fold-caret { transform: rotate(-90deg); }
.fold-body { display: grid; gap: 16px; padding: 4px clamp(20px, 3vw, 32px) clamp(22px, 3vw, 30px); }
@media (min-width: 1025px) { .fold-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px clamp(28px, 4vw, 56px); align-items: start; } }
@media (max-width: 600px) { .fold-card > summary { grid-template-columns: minmax(0, 1fr) auto; } .fold-sum { grid-row: 2; grid-column: 1 / -1; } }
.fold-side { display: grid; gap: 16px; align-content: start; }
.note { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: #c9bff5; font-size: 14.5px; line-height: 1.55; }
.fold-side > .note:first-child, .note + .note { padding-top: 0; border-top: 0; }

.steps { display: grid; gap: 12px; counter-reset: step; }
.steps li { position: relative; padding-left: 40px; color: #e9e4ff; font-size: 15.5px; line-height: 1.55; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px; background: rgba(251, 227, 200, 0.14); color: var(--peach);
  font: 700 13px/1 var(--font-body); font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) { .steps li { padding-left: 36px; } }

/* A footnote line on the violet field, with one icon. */
.foot-line { display: flex; align-items: flex-start; gap: 10px; max-width: 72ch; margin-top: 28px; color: var(--on-field-2); font-size: 15.5px; line-height: 1.5; }
.foot-line .ico { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--peach); }
.foot-line a { color: #fff; font-weight: 600; text-underline-offset: 3px; }

/* --------------------------------------------------------- version history
   A sticky rail of versions beside one white article per release. */

.hist { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; padding-block: clamp(48px, 7vw, 88px) clamp(80px, 10vw, 128px); }
.hist-rail { position: sticky; top: 112px; }
.hist-rail ol { position: relative; display: grid; gap: 22px; padding-left: 30px; border-left: 2px solid rgba(255, 255, 255, 0.16); margin-left: 7px; }
.hist-rail a { position: relative; display: grid; gap: 3px; color: var(--on-field-3); text-decoration: none; transition: color 0.3s var(--ease-out); }
.hist-rail a::before {
  content: ""; position: absolute; left: -37px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--field); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); transition: background-color 0.3s, box-shadow 0.3s;
}
.hist-rail a:hover, .hist-rail a[aria-current] { color: #fff; }
.hist-rail a[aria-current]::before { background: var(--peach); box-shadow: 0 0 0 2px var(--peach); }
.hist-rail b { font: 700 17px/1.25 var(--font-display); letter-spacing: -0.02em; }
.hist-rail a span { font-size: 13.5px; }
.hist-list { display: grid; gap: 16px; min-width: 0; }
.release { scroll-margin-top: 96px; padding: clamp(22px, 3.4vw, 44px); border-radius: var(--r-card); background: var(--card); color: var(--card-ink); box-shadow: 0 30px 60px -36px rgba(10, 3, 50, 0.7); }
.rel-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font: 700 clamp(40px, 5vw, 64px)/1 var(--font-display); letter-spacing: -0.04em; }
.rel-date { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; color: var(--card-sub); font-weight: 500; }
.rel-date > * + * { position: relative; }
.rel-date > * + *::before { content: ""; position: absolute; left: -13px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.rel-lead { margin-top: 16px; max-width: 48ch; font-size: 18px; line-height: 1.5; }
.rel-group { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 12px 32px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--vig-line); }
.rel-group h3 { font: 700 17px/1.35 var(--font-body); }
.rel-list { display: grid; gap: 12px; }
.rel-list li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.55; }
.rel-list li::before { content: ""; position: absolute; left: 3px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--ui-violet); }
.rel-list li.fix::before { background: var(--ok); }
.rel-list a { color: var(--ui-violet); font-weight: 600; text-underline-offset: 3px; }
.tag { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 8px; background: #ece7ff; color: var(--ui-violet); font: 600 12.5px/1 var(--font-body); letter-spacing: 0.01em; }
@media (max-width: 900px) {
  .hist { grid-template-columns: minmax(0, 1fr); }
  .hist-rail { position: static; }
  .hist-rail ol { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 0; margin-left: 0; border-left: 0; }
  .hist-rail a { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 13px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px; color: #f1edff; }
  .hist-rail a::before { display: none; }
  .hist-rail b { font-size: 15px; }
}
@media (max-width: 680px) { .rel-group { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------- end panel */

.end { padding: 0 12px 12px; }
.end-panel {
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center;
  padding: clamp(72px, 9vw, 128px) var(--gutter);
  border-radius: var(--r-panel);
  background:
    radial-gradient(60% 70% at 50% 0%, rgba(190, 168, 255, 0.5), transparent 70%),
    linear-gradient(180deg, var(--field-hi), var(--field-mid));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.end-logo { width: clamp(88px, 9vw, 116px); height: auto; margin-bottom: 30px; border-radius: 24%; box-shadow: 0 30px 60px -24px rgba(16, 5, 60, 0.85); }
.end .intro { margin-inline: auto; color: #ece7ff; }
.end-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.end-meta { margin-top: 18px; color: var(--on-field-2); font-size: 14.5px; }
.end-meta a { color: #fff; font-weight: 600; text-underline-offset: 3px; }
@media (max-width: 480px) { .end-cta { display: grid; width: 100%; } }
@media (max-width: 420px) { .end { padding: 0 8px 8px; } .end-panel { border-radius: 22px; } }

/* ------------------------------------------------------------------ footer */

.foot { padding-block: 36px calc(40px + env(safe-area-inset-bottom, 0px)); }
.foot-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; }
.foot .brand { font-size: 15px; }
.foot .brand img, .foot .brand svg { width: 28px; height: 28px; border-radius: 8px; }
.foot-note { color: var(--on-field-3); font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14.5px; color: var(--on-field-2); }
.foot-links a { text-decoration: none; transition: color 0.3s var(--ease-out); }
.foot-links a:hover { color: #fff; }
@media (max-width: 820px) { .foot-inner { grid-template-columns: minmax(0, 1fr); } }
