/* glaze-os.com: the page borrows Glaze's own look (lib/include/glaze/ui.h):
 * pinstripes, a steel nav bar, grouped tables, and Bitstream Vera. */

@font-face {
  font-family: "Vera Sans";
  src: url("fonts/Vera.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vera Sans";
  src: url("fonts/VeraBd.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Vera Sans Mono";
  src: url("fonts/VeraMono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --stripe-base: #c5ccd4;     /* UI_GROUP_BG */
  --stripe: #cbd2d8;          /* UI_GROUP_STRIPE */
  --nav-top: #b0bccd;         /* UI_NAV_TOP */
  --nav-bottom: #6d84a2;      /* UI_NAV_BOTTOM */
  --nav-line: #2d3642;        /* UI_NAV_LINE */
  --cell: #ffffff;
  --cell-border: #a9abae;     /* UI_CELL_BORDER */
  --ink: #000000;
  --ink-soft: #4c566c;        /* grouped-section header grey */
  --detail: #385487;          /* UI_TEXT_DETAIL */
  --select-top: #058cf5;      /* UI_SELECT_TOP */
  --select-bottom: #015ee6;   /* UI_SELECT_BOTTOM */
  --emboss: rgba(255, 255, 255, 0.75);
  --code-bg: #f3f5f8;
  --radius: 9px;
  --page: 1000px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Vera Sans", "DejaVu Sans", Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--stripe-base);
  /* Vertical pinstripes: 2 px light, 2 px dark, as in Settings. */
  background-image: repeating-linear-gradient(90deg, var(--stripe-base) 0 2px, var(--stripe) 2px 4px);
}

a { color: var(--detail); }
a:hover { color: #1f3a6e; }

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--cell); padding: 6px 10px; }

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

.navbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 44px;
  background: linear-gradient(var(--nav-top), var(--nav-bottom));
  border-bottom: 1px solid var(--nav-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.navbar-inner {
  position: relative;
  max-width: var(--page);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.navbar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 -1px 0 rgba(45, 54, 66, 0.8);
  text-decoration: none;
}
.bar-button {
  position: absolute;
  right: 16px;
  top: 7px;
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 -1px 0 rgba(42, 52, 66, 0.9);
  border: 1px solid rgba(42, 52, 66, 0.85);
  border-radius: 6px;
  background: linear-gradient(#7e93af, #4a6383);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.bar-button:hover { color: #fff; background: linear-gradient(#6f84a0, #3f5676); }

/* ---- layout ------------------------------------------------------------ */

main { max-width: var(--page); margin: 0 auto; padding: 0 16px 48px; }

section { margin-top: 56px; }

/* Grouped-table section headers: bold, grey, embossed. */
h2 {
  margin: 0 0 10px 12px;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 var(--emboss);
}
.section-note {
  max-width: 62ch;
  margin: -4px 0 16px 12px;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 var(--emboss);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  margin-top: 40px;
}
.hero h1 {
  margin: 0 0 18px;
  max-width: 15ch;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 var(--emboss);
}
.lede {
  max-width: 44ch;
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.6;
  text-shadow: 0 1px 0 var(--emboss);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
}
.button-primary {
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0, 40, 120, 0.6);
  background: linear-gradient(var(--select-top), var(--select-bottom));
  border: 1px solid #0a4bb4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 var(--emboss);
}
.button-primary:hover { color: #fff; background: linear-gradient(#0a7fe0, #0152cc); }
.button-plain {
  color: var(--detail);
  background: var(--cell);
  border: 1px solid var(--cell-border);
  box-shadow: 0 1px 0 var(--emboss);
}
.hint {
  max-width: 46ch;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 var(--emboss);
}

/* The device: the frame artwork over a 240x320 screen. The screen sits at
 * the frame's LCD window (be300 web/styles.css) and, at the default width,
 * at exactly one CSS pixel per device pixel. */
.device {
  --lcd-left: 21.09375%;
  --lcd-top: 16.36328%;
  --lcd-width: 57.8125%;
  position: relative;
  width: 415px;
  max-width: 100%;
  aspect-ratio: 1024 / 1536;
  filter: drop-shadow(0 18px 28px rgba(30, 40, 60, 0.35));
}
.device-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
.screen {
  position: absolute;
  left: var(--lcd-left);
  top: var(--lcd-top);
  width: var(--lcd-width);
  aspect-ratio: 240 / 320;
  overflow: hidden;
  background: #000;
  z-index: 1;
  container-type: inline-size;
}
.screen img {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}
.layer { inset: 0; width: 100%; height: 100%; }
.lock-part { transition: opacity 0.35s ease; }
.screen.unlocked .lock-part {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

/* Track pieces, placed in screen pixels (sb_internal.h): the label from
 * x 70, the knob at 17 + travel (0..156), y 262. 1 screen px = 100cqw/240. */
.label {
  left: calc(100cqw * 70 / 240);
  top: calc(100cqw * 262 / 240);
  width: calc(100cqw * 145 / 240);
  height: calc(100cqw * 36 / 240);
}
.shimmer {
  position: absolute;
  left: calc(100cqw * 70 / 240);
  top: calc(100cqw * 262 / 240);
  width: calc(100cqw * 145 / 240);
  height: calc(100cqw * 36 / 240);
  background: linear-gradient(90deg, transparent 0 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65% 100%);
  background-size: 300% 100%;
  -webkit-mask: url("img/label-mask.png") 0 0 / 100% 100%;
  mask: url("img/label-mask.png") 0 0 / 100% 100%;
  animation: shimmer 2.6s linear infinite;
  pointer-events: none;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
.knob {
  position: absolute;
  left: calc(100cqw * 17 / 240);
  top: calc(100cqw * 262 / 240);
  width: calc(100cqw * 50 / 240);
  height: calc(100cqw * 36 / 240);
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  transform: translateX(calc(100cqw * var(--travel, 0) / 240));
}
.knob img { inset: 0; width: 100%; height: 100%; }
.knob:active { cursor: grabbing; }
.knob.settling { transition: transform 0.25s ease-out; }
.knob:focus-visible { outline-offset: 0; border-radius: 4px; }
.screen.dragging .shimmer, .screen.unlocked .shimmer { animation: none; opacity: 0; }

/* The frame's power button locks the device again. */
.power {
  position: absolute;
  left: 76%;
  top: 74.5%;
  width: 11%;
  height: 7.5%;
  z-index: 3;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .shimmer { animation: none; opacity: 0; }
  .lock-part, .screen.unlocked .lock-part, .knob.settling { transition: none; }
}

/* ---- screens gallery ---------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  gap: 28px 24px;
  margin: 0;
  padding: 0 0 0 12px;
  list-style: none;
}
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 240px;
  height: 320px;
  image-rendering: pixelated;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(45, 54, 66, 0.55), 0 6px 14px rgba(30, 40, 60, 0.25);
}
.gallery figcaption {
  margin-top: 10px;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 var(--emboss);
}
.gallery figcaption strong { display: block; font-size: 14px; color: var(--ink); }

/* ---- grouped tables ------------------------------------------------------ */

.group {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--cell);
  border: 1px solid var(--cell-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--emboss);
  overflow: hidden;
}
.group dl, dl.group { margin: 0; }
.row {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr);
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid #d9dbdf;
}
.row:first-child { border-top: 0; }
.group.specs .row { grid-template-columns: 6.5em minmax(0, 1fr); }
.row dt { font-weight: 700; }
.row dd { margin: 0; color: var(--detail); }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px;
  align-items: start;
}

/* ---- steps ---------------------------------------------------------------- */

.steps { counter-reset: step; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-top: 1px solid #d9dbdf;
}
.step:first-child { border-top: 0; }
.step::before {
  content: counter(step);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(var(--nav-top), var(--nav-bottom));
  box-shadow: inset 0 0 0 1px rgba(45, 54, 66, 0.5);
}
.step p { margin: 3px 0 10px; }
pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: "Vera Sans Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: var(--code-bg);
  border: 1px solid #d3d8df;
  border-radius: 6px;
}
code { font-family: "Vera Sans Mono", Menlo, monospace; font-size: 0.9em; }

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

footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 24px 28px 40px;
  font-size: 13px;
  color: var(--ink-soft);
  text-shadow: 0 1px 0 var(--emboss);
}
footer p { max-width: 70ch; margin: 0 0 6px; }

/* ---- narrow screens ------------------------------------------------------- */

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 28px; }
  .hero h1 { font-size: 34px; }
  .device { margin: 0 auto; }
  .columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gallery { grid-template-columns: 240px; justify-content: center; padding-left: 0; }
  .navbar-title { font-size: 18px; }
}
