/*
 * UniKiosk — site styles.
 *
 * The whole language is a hairline ruled onto a sheet: one pixel of
 * --line-strong, a shared edge, square corners, no shadow anywhere. Depth is a
 * rule, not a drop shadow. Where the app draws a cell, the site draws a cell.
 */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The ruled ground, a hair off the sheet. */
.ground {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  opacity: .55;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 20%, transparent 78%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ------------------------------------------------------------ type ------- */
h1, h2, h3, h4 {
  font-family: var(--disp);
  font-weight: 900;
  color: var(--ink);
  margin: 0;
  line-height: 1.02;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -.045em; }
h3 { font-size: 1.18rem; letter-spacing: -.03em; line-height: 1.25; }
h4 { font-size: 1rem; letter-spacing: -.02em; }
p { margin: 0 0 var(--space-4); }
strong { color: var(--ink); font-weight: 600; }

.eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}
.eyebrow--accent { color: var(--accent); }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; }
.mono { font-family: var(--mono); font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------ shell ------ */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
section { padding: var(--space-8) 0; border-top: var(--hairline) solid var(--line); }
section:first-of-type { border-top: 0; }
.section-head { margin-bottom: var(--space-7); }
.section-head p { max-width: 54ch; margin-top: var(--space-3); }

/* ------------------------------------------------------------ nav -------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--hairline) solid var(--line);
}
.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-family: var(--disp);
  font-weight: 900;
  font-size: 1.12rem;
  letter-spacing: -.04em;
  color: var(--ink);
  white-space: nowrap;
}
.brand img { width: 26px; height: 26px; }
.nav__links { display: flex; gap: var(--space-5); margin-left: auto; }
.nav__links a {
  text-decoration: none;
  font-size: .9rem;
  color: var(--muted);
  transition: color var(--motion-fast) ease;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--ink); }
.nav__cta { display: flex; gap: var(--space-2); }
.nav__toggle {
  display: none;
  background: none;
  border: var(--hairline) solid var(--line-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .72rem;
  padding: 8px 10px;
  cursor: pointer;
}

@media (max-width: 940px) {
  .nav__inner { gap: var(--space-3); flex-wrap: nowrap; }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: var(--hairline) solid var(--line-strong);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: var(--space-4) var(--space-5); border-top: var(--hairline) solid var(--line); }

  /* One row, always: brand · download · menu. The demo link and the palette
   * switch live in the drawer instead of crowding the bar. */
  .nav__toggle { display: block; order: 99; margin-left: var(--space-2); }
  .nav__cta { margin-left: auto; gap: var(--space-2); }
  /* Scoped to .nav__cta so these beat the base .theme-toggle rule, which is
   * defined later in this file and would otherwise win on equal specificity. */
  .nav__cta .btn--ghost, .nav__cta .theme-toggle { display: none; }
  .nav__cta .btn { white-space: nowrap; padding: 10px 12px; font-size: .68rem; }
}

/* ------------------------------------------------------------ buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 20px;
  border: var(--hairline) solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease,
              border-color var(--motion-fast) ease;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 84%, var(--ink)); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 9px 14px; font-size: .72rem; }

/* ------------------------------------------------------------ cells ------ */
.cell {
  background: var(--bg-elevated);
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--space-5);
}
/* min-width:0 on every grid child, or a long line inside <pre> or a wide
 * table stretches its track instead of scrolling inside it, and the whole
 * page scrolls sideways. */
.grid { display: grid; gap: var(--space-4); }
.grid > * { min-width: 0; }
.cell pre { overflow-x: auto; max-width: 100%; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.ic { width: 22px; height: 22px; background: var(--accent); }
.ic--muted { background: var(--muted); }
.feature h3 { margin-bottom: var(--space-2); }
.feature p { font-size: .93rem; margin: 0; }
.feature .ic { margin-bottom: var(--space-4); }

/* Coming-soon marker: same cell, drained of colour, said plainly. */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: var(--hairline) solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: middle;
  margin-left: var(--space-2);
}
.badge--soon { border-color: var(--line-strong); background: transparent; color: var(--muted); }
.is-soon { opacity: .72; }
.is-soon h3, .is-soon h4 { color: var(--ink-soft); }

/* ------------------------------------------------------------ hero ------- */
.hero { padding: var(--space-8) 0 var(--space-7); border-top: 0; }
.hero h1 { margin-bottom: var(--space-5); }
.hero .lede { font-size: 1.2rem; margin-bottom: var(--space-6); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.hero__note { font-family: var(--mono); font-size: .74rem; color: var(--muted-2); margin-top: var(--space-4); }

/* Landscape wall screen beside a portrait totem. */
.screens {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: end;
  margin-top: var(--space-8);
}
.screen { border: var(--hairline) solid var(--line-strong); background: var(--bg-elevated); }
.screen img { width: 100%; }
.screen__label {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px var(--space-3);
  border-top: var(--hairline) solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}
@media (max-width: 760px) { .screens { grid-template-columns: 1fr; } .screen--portrait { display: none; } }

/* ------------------------------------------------------------ stats ------ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: var(--hairline) solid var(--line-strong); }
.stat { padding: var(--space-5); border-right: var(--hairline) solid var(--line-strong); }
.stat:last-child { border-right: 0; }
.stat__n { font-family: var(--disp); font-weight: 900; font-size: 2.1rem; letter-spacing: -.05em; color: var(--ink); line-height: 1; }
.stat__l { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: var(--space-2); }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: var(--hairline) solid var(--line-strong); }
}

/* ------------------------------------------------------------ steps ------ */
.steps { counter-reset: step; }
.step { position: relative; padding-left: var(--space-8); }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent);
}

/* ------------------------------------------------------------ shots ------ */
.shot { border: var(--hairline) solid var(--line-strong); background: var(--bg-elevated); }
.shot img { width: 100%; }
.shot figcaption {
  font-size: .84rem;
  color: var(--muted);
  padding: var(--space-3) var(--space-4);
  border-top: var(--hairline) solid var(--line);
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-7); align-items: center; }
.split--flip > *:first-child { order: 2; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: var(--space-5); }
  .split--flip > *:first-child { order: 0; }
}

/* ------------------------------------------------------------ table ------ */
.table-scroll { overflow-x: auto; border: var(--hairline) solid var(--line-strong); }
table { border-collapse: collapse; width: 100%; min-width: 900px; font-size: .88rem; }
th, td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: var(--hairline) solid var(--line); }
thead th {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  border-bottom: var(--hairline) solid var(--line-strong);
}
tbody th { font-family: var(--body); font-weight: 500; color: var(--ink); }
td { color: var(--ink-soft); text-align: center; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.col-us { background: var(--accent-soft); color: var(--ink); }
thead .col-us { background: var(--accent); color: var(--accent-ink); }
.yes { color: var(--success); font-weight: 600; }
.no { color: var(--muted-2); }
.part { color: var(--warning); }

/* ------------------------------------------------------------ docs ------- */
/* min-width:0 on the column, or a long line inside <pre> stretches the grid
 * track instead of scrolling inside it, and the whole page scrolls sideways. */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: var(--space-7); align-items: start; }
.doc { min-width: 0; }
.toc { position: sticky; top: 84px; border-left: var(--hairline) solid var(--line-strong); padding-left: var(--space-4); }
.toc a {
  display: block;
  text-decoration: none;
  font-size: .87rem;
  color: var(--muted);
  padding: 5px 0;
  transition: color var(--motion-fast) ease;
}
.toc a:hover { color: var(--accent); }
.toc__group { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin: var(--space-4) 0 var(--space-2); }
.doc h2 { margin: var(--space-8) 0 var(--space-4); scroll-margin-top: 84px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: var(--space-6) 0 var(--space-3); scroll-margin-top: 84px; }
.doc ul, .doc ol { padding-left: 1.15rem; margin: 0 0 var(--space-4); }
.doc li { margin-bottom: var(--space-2); }
.doc code {
  font-family: var(--mono);
  font-size: .84em;
  background: var(--bg-elevated);
  border: var(--hairline) solid var(--line);
  padding: 1px 5px;
  color: var(--ink);
}
.doc pre {
  font-family: var(--mono);
  font-size: .82rem;
  background: var(--bg-elevated);
  border: var(--hairline) solid var(--line-strong);
  padding: var(--space-4);
  overflow-x: auto;
  color: var(--ink-soft);
  margin: 0 0 var(--space-4);
}
.doc pre code { background: none; border: 0; padding: 0; }
.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
}
.note p:last-child { margin-bottom: 0; }
.note--warn { border-left-color: var(--warning); background: var(--warning-soft); }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; border-left: 0; border-top: var(--hairline) solid var(--line-strong); padding: var(--space-4) 0 0; }
}

/* ------------------------------------------------------------ cta band --- */
.band { border: var(--hairline) solid var(--accent-line); background: var(--accent-soft); padding: var(--space-8) var(--space-6); text-align: center; }
.band h2 { margin-bottom: var(--space-4); }
.band .hero__cta { justify-content: center; }

/* ------------------------------------------------------------ footer ----- */
.foot { border-top: var(--hairline) solid var(--line); padding: var(--space-7) 0 var(--space-6); }
.foot__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--space-6); }
.foot h4 { font-family: var(--mono); font-weight: 400; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: var(--space-3); }
.foot a { display: block; text-decoration: none; font-size: .88rem; color: var(--muted); padding: 4px 0; }
.foot a:hover { color: var(--accent); }
.foot__legal {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: var(--hairline) solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted-2);
}
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr 1fr; } }

.theme-toggle {
  background: none;
  border: var(--hairline) solid var(--line-strong);
  color: var(--muted);
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: .8rem;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------ template gallery -- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.filters { border: var(--hairline) solid var(--line-strong); background: var(--bg-elevated); }
.filters__row {
  display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center;
  padding: var(--space-4); border-bottom: var(--hairline) solid var(--line);
}
.filters__search { flex: 1 1 260px; }
.filters input[type="search"], .filters select {
  width: 100%;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink);
  background: var(--bg);
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  appearance: none;
}
.filters select { width: auto; min-width: 150px; }
.filters input[type="search"]:focus, .filters select:focus {
  outline: none; border-color: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-4); }
.chip {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  background: transparent;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.chip span { color: var(--muted-2); margin-left: 4px; }
.chip:hover { color: var(--ink); border-color: var(--muted-2); }
.chip.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chip.is-on span { color: var(--accent-ink); opacity: .7; }

/* The grid is masonry-ish by column count; portrait cards simply run taller. */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
@media (max-width: 1000px) { .tpl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tpl-grid { grid-template-columns: 1fr; } }

.tpl {
  display: flex; flex-direction: column;
  border: var(--hairline) solid var(--line-strong);
  background: var(--bg-elevated);
}
/* The filter hides a card with the `hidden` attribute, and the rule above would
 * otherwise win over the browser's own `[hidden] { display: none }`. */
.tpl[hidden] { display: none; }
.tpl__shot {
  display: block; padding: 0; margin: 0; border: 0; cursor: zoom-in;
  background: var(--bg); border-bottom: var(--hairline) solid var(--line);
}
.tpl__shot img { width: 100%; display: block; }
.tpl--tall .tpl__shot { display: flex; justify-content: center; background: var(--bg); }
.tpl--tall .tpl__shot img { width: auto; max-height: 340px; }
.tpl__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.tpl__body h3 { font-size: 1rem; }
.tpl__meta { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin: 0; }
.tpl__tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 var(--space-2); }
.tpl__tags span {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .06em;
  color: var(--muted-2); border: var(--hairline) solid var(--line);
  padding: 2px 6px;
}
.tpl__body .btn { margin-top: auto; align-self: flex-start; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: var(--space-5);
}
.lightbox[hidden] { display: none; }
.lightbox__inner {
  margin: 0; max-width: min(1200px, 92vw); max-height: 90vh;
  display: flex; flex-direction: column;
  border: var(--hairline) solid var(--line-strong); background: var(--bg-elevated);
}
.lightbox__inner img { max-height: calc(90vh - 84px); width: auto; object-fit: contain; }
.lightbox__inner figcaption {
  display: flex; gap: var(--space-4); align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); border-top: var(--hairline) solid var(--line);
  flex-wrap: wrap;
}
.lightbox__inner figcaption strong { display: block; color: var(--ink); }
.lightbox__inner figcaption .mono { font-size: .7rem; }
.lightbox__close {
  position: absolute; top: var(--space-4); right: var(--space-5);
  background: none; border: var(--hairline) solid var(--line-strong);
  color: var(--ink); font-size: 1.4rem; line-height: 1;
  width: 40px; height: 40px; cursor: pointer;
}
.lightbox__close:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------- trades ---- */
/* One card per trade: the mark leads, because at a glance a shape is quicker
   to find in a list of 44 than a word is. */
.trades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
}
.trade {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  text-decoration: none;
  background: var(--bg-elevated);
  border: var(--hairline) solid var(--line-strong);
  border-top: 3px solid var(--trade-accent, var(--accent));
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.trade:hover { background: var(--bg); border-color: var(--trade-accent, var(--accent)); }
.trade__ic {
  width: 30px; height: 30px; flex: 0 0 30px;
  margin-bottom: var(--space-2);
  background: var(--trade-accent, var(--accent));
}
.trade__name {
  font-family: var(--disp); font-weight: 900; font-size: 1.02rem;
  letter-spacing: -.03em; color: var(--ink); line-height: 1.2;
}
.trade__blurb { font-size: .84rem; color: var(--muted); line-height: 1.5; flex: 1; }
.trade__n {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--trade-accent, var(--accent));
  margin-top: var(--space-2);
}

/* -------------------------------------------------- gallery, continued -- */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  background: var(--bg-elevated);
  border: var(--hairline) solid var(--line-strong);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__nav--prev { left: var(--space-5); }
.lightbox__nav--next { right: var(--space-5); }
.lightbox__nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.lightbox__nav:disabled { opacity: .3; cursor: default; }
.lightbox__actions { display: flex; align-items: center; gap: var(--space-4); }
@media (max-width: 760px) {
  .lightbox__nav { width: 40px; height: 56px; }
  .lightbox__nav--prev { left: 2px; }
  .lightbox__nav--next { right: 2px; }
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}


.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip__ic {
  width: 14px; height: 14px; flex: 0 0 14px;
  background: var(--trade-accent, var(--muted));
}
.chip.is-on .chip__ic { background: var(--accent-ink); }

/* ------------------------------------------------------------ nav icons -- */
.nav__ic {
  width: 15px; height: 15px; flex: 0 0 15px;
  background: currentColor;
  opacity: .65;
}
.nav__links a { display: inline-flex; align-items: center; gap: 7px; }
.nav__links a:hover .nav__ic,
.nav__links a[aria-current="page"] .nav__ic { opacity: 1; }

.foot__ic {
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  background: currentColor;
}

/* ---------------------------------------------------------- card icons -- */
.card__ic {
  display: block;
  width: 22px; height: 22px;
  margin-bottom: var(--space-4);
  background: var(--accent);
}
.is-soon .card__ic { background: var(--muted); }
