/* BugBnB website — the app's own materials: stitched leather, aged paper, walnut and brass.
   The look is material, not themed: it stays the same in light and dark mode, like the app. */

@font-face {
  font-family: "IM Fell English";
  src: url("fonts/IMFellEnglish-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("fonts/IMFellEnglish-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("fonts/CourierPrime-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("fonts/CourierPrime-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --leather: #3a2518;
  --leather-deep: #21150c;
  --paper: #f1e9d2;
  --card: #fbf6e7;
  --ink: #35271b;
  --ink-soft: #6b5643;
  --ink-faint: #8f7a63;
  --rule: #c9b58c;
  --parchment: #f6ead0;
  --parchment-soft: rgba(246, 234, 208, 0.78);
  --stitch: #efd9a7;
  --brass-hi: #f4dea2;
  --brass: #c89d4b;
  --brass-lo: #6e4f1f;
  --signal: #d9432f;
  --lamp-green: #58c24a;
  --walnut: #4f3220;
  --focus: #e9b949;

  --display: "IM Fell English", Baskerville, "Baskerville Old Face", Georgia, "Songti SC", serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, "PingFang SC", monospace;

  --step--1: 0.8125rem;   /* 13 */
  --step-0: 1rem;         /* 16 */
  --step-1: 1.1875rem;    /* 19 */
  --step-2: 1.4375rem;    /* 23 */
  --step-3: clamp(1.625rem, 1.2rem + 1.2vw, 1.875rem);  /* 26–30 */
  --step-4: clamp(2rem, 1.3rem + 2.4vw, 2.75rem);       /* 32–44 */
  --step-5: clamp(2.5rem, 1.4rem + 4.6vw, 4.25rem);     /* 40–68 */

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

html:lang(zh-Hans) {
  --display: "Songti SC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* The app's fine card fibres, tinted to paper (its blotchy paper tile repeats visibly at page scale). */
  background-color: var(--paper);
  background-image: url("generated/textures/card.png");
  background-size: 128px 128px;
  background-blend-mode: multiply;
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  text-wrap: balance;
}

p {
  margin: 0;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 8px 14px;
  background: var(--card);
  color: var(--ink);
  border-radius: 6px;
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Leather surfaces ---------- */

.masthead,
.hero,
.footer {
  background-color: var(--leather);
  background-image: url("generated/textures/leather.png");
  background-size: 128px 128px;
  color: var(--parchment);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--leather-deep);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 8px 18px rgba(20, 12, 6, 0.28);
}

.masthead-row {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-inline-start: -6px;
}
.brand-name {
  font: 400 1.55rem/1 "IM Fell English", Baskerville, Georgia, serif;
  letter-spacing: 0.01em;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7);
}

.nav {
  display: flex;
  gap: clamp(12px, 2vw, 26px);
  margin-inline-start: auto;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav a {
  text-decoration: none;
  color: var(--parchment-soft);
  padding-block: 6px;
}
.nav a:hover {
  color: var(--parchment);
}

/* The app's brushed-steel segmented control. */
.language {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 1px 0 1px rgba(255, 255, 255, 0.06);
  background: linear-gradient(#f4f4f4, #c7c7cb);
  background-image: url("generated/textures/brushed-metal.png"), linear-gradient(#fbfbfb, #c6c6ca);
  background-size: 128px 128px, auto;
  background-blend-mode: multiply;
}
.language button {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 5px 10px;
  font: 700 0.75rem/1.2 var(--body);
  color: #3d3d40;
  background: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.language button + button {
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.28);
}
.language button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(#474749, #7a7a7d);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.45);
}

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

.brass-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px 13px 20px;
  border: 1px solid #4f3812;
  border-radius: 10px;
  background: linear-gradient(#f7e5ab, #d3a854 52%, #95692a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(0, 0, 0, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.32);
  color: #2b1d0d;
  font: 700 1.0625rem/1 var(--body);
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  transition: filter 120ms ease, transform 120ms ease;
}
.brass-button:hover {
  filter: brightness(1.05) saturate(1.05);
}
.brass-button:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}
.brass-button--small {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
}
.brass-button--dark {
  border-color: #2a1c0a;
  background: linear-gradient(#5b3d24, #3a2415 55%, #26170c);
  color: var(--parchment);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 18px rgba(60, 35, 10, 0.35);
}

.text-link {
  color: var(--parchment);
  font-weight: 600;
  text-underline-offset: 4px;
  text-decoration-color: rgba(239, 217, 167, 0.5);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 84px) clamp(64px, 8vw, 104px);
  background-image:
    radial-gradient(90% 70% at 72% 40%, rgba(255, 214, 150, 0.14), transparent 60%),
    linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35)),
    url("generated/textures/leather.png");
  background-size: auto, auto, 128px 128px;
}
/* The stitched seam where leather meets paper, as in the app's panel. */
.hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 14px;
  border-bottom: 2px dashed var(--stitch);
  opacity: 0.8;
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.7));
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.eyebrow {
  font: 700 var(--step--1) / 1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-hi);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--display);
  font-size: var(--step-5);
  line-height: 1.02;
  letter-spacing: -0.012em;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.75), 0 12px 30px rgba(0, 0, 0, 0.25);
}
html:lang(zh-Hans) .hero h1 {
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hero-lede {
  margin-top: 22px;
  max-width: 34em;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--parchment-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 30px;
}

.fine-print {
  margin-top: 18px;
  font: 400 var(--step--1) / 1.5 var(--mono);
  color: rgba(246, 234, 208, 0.62);
  letter-spacing: 0.02em;
}

/* ---------- Live desktop ---------- */

.demo {
  margin: 0;
}
.demo figcaption {
  margin-top: 16px;
  font: 400 var(--step--1) / 1.5 var(--mono);
  color: rgba(246, 234, 208, 0.66);
}

.desktop {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(70% 55% at 18% 108%, #263647 0 62%, transparent 63%),
    radial-gradient(80% 60% at 86% 112%, #2d4053 0 60%, transparent 61%),
    radial-gradient(120% 90% at 32% 0%, #9bb2c4 0%, #62798d 42%, #33475a 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 0 0 9px #140c06,
    0 0 0 10px rgba(255, 236, 200, 0.1),
    0 28px 60px rgba(0, 0, 0, 0.55);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.menubar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 25px;
  padding-inline: 14px 12px;
  background: rgba(236, 236, 240, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.3);
  font: 500 13px/1 var(--body);
  color: #1d1d1f;
}
.menubar-app {
  font-weight: 700;
}
.menubar-spacer {
  flex: 1;
}
.menubar-glyph {
  display: grid;
  place-items: center;
  height: 21px;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  opacity: 0.86;
}
.menubar-glyph img {
  display: block;
  width: 23px;
  height: 18px;
}
.menubar-glyph[aria-expanded="true"],
.menubar-glyph:hover {
  background: rgba(0, 0, 0, 0.12);
  opacity: 1;
}
.menubar-clock {
  font-variant-numeric: tabular-nums;
}

.desk-window {
  position: absolute;
  left: 6%;
  top: 15%;
  width: 36%;
  aspect-ratio: 16 / 10.5;
  border-radius: 9px;
  overflow: hidden;
  background: #f0efec;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(8, 16, 26, 0.45);
}
.desk-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22%;
  padding-inline: 9px;
  background: linear-gradient(#e9e8e6, #dcdad7);
  box-shadow: inset 0 -0.5px 0 rgba(0, 0, 0, 0.2);
  font: 600 11px/1 var(--body);
  color: #4c4c4f;
}
.desk-window-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}
.desk-window-bar i:nth-child(2) {
  background: #febc2e;
}
.desk-window-bar i:nth-child(3) {
  background: #28c840;
}
.desk-window-bar span {
  margin-inline: auto;
  transform: translateX(-18px);
}
.desk-window-rows {
  display: grid;
  gap: 9%;
  padding: 8% 9%;
}
.desk-window-rows b {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: #d9d6d0;
}
.desk-window-rows b:nth-child(2n) {
  width: 72%;
}

.desk-bin {
  position: absolute;
  left: 63%;
  bottom: 13%;
  width: 76px;
  height: 92px;
  z-index: 1;
  filter: drop-shadow(0 10px 12px rgba(8, 14, 22, 0.45));
}

.desk-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.desk-panel {
  position: absolute;
  z-index: 4;
  right: 6px;
  top: 22px;
  width: min(78%, 424px);
  height: auto;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.45));
}

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

.section {
  padding-block: clamp(64px, 9vw, 116px);
}
.section + .section {
  padding-top: clamp(24px, 4vw, 48px);
}

.section-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px clamp(28px, 5vw, 64px);
  align-items: start;
}
.section-grid--intro {
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* A typed museum label, pinned in the margin. */
.specimen-tag {
  justify-self: start;
  position: relative;
  margin-top: 10px;
  padding: 7px 12px 6px 22px;
  background: #fffaf0;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(80, 55, 25, 0.18);
  font: 700 0.78rem/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.specimen-tag::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8f8f94, #2e2e31);
}

.section h2 {
  font-family: var(--display);
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
html:lang(zh-Hans) .section h2 {
  line-height: 1.3;
}

.lede {
  margin-top: 14px;
  max-width: 60ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Steps */

.steps {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto 1fr;
  column-gap: clamp(20px, 3vw, 40px);
}
/* Subgrid keeps pictures, titles and text on shared lines across the three steps. */
.step {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
}
.step img {
  margin-bottom: 16px;
}
.step img {
  width: 57px;
  height: auto;
  filter: drop-shadow(0 6px 6px rgba(70, 45, 20, 0.3));
}
.step-count {
  font: 700 var(--step--1) / 1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.step h3,
.feature h3,
.promise h3,
.qa h3,
.download-side h3 {
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.2;
  margin-block: 4px 8px;
}
.step p:not(.step-count),
.feature p,
.promise p,
.qa p {
  color: var(--ink-soft);
  max-width: 62ch;
}

/* Specimen drawer */

.section--drawer {
  padding-top: clamp(48px, 7vw, 88px);
}

.drawer {
  padding: clamp(12px, 2.2vw, 26px);
  border-radius: 14px;
  background-color: var(--walnut);
  background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.18)), url("generated/textures/walnut.png");
  background-size: auto, 128px 256px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 26px 50px rgba(60, 35, 12, 0.35);
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 16px);
}

.specimen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 10px 10px 12px;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 38%, #fcf8ec 0%, #e6dcc2 70%, #d6c8a6 100%);
  box-shadow:
    inset 0 0 0 3px #b98f45,
    inset 0 0 0 4px #7a5824,
    inset 0 5px 10px rgba(80, 55, 20, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.4);
}
.specimen img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  transition: transform 300ms ease;
}
.specimen:hover img {
  transform: scale(1.04) rotate(-1.5deg);
}
.specimen-label {
  flex: 1;
  padding: 9px 11px 10px;
  background: #fffcf3;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(80, 55, 25, 0.2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.specimen-label h3 {
  font-family: var(--display);
  font-size: 1.3125rem;
  line-height: 1.1;
  color: var(--ink);
}
.binomial {
  margin-block: 1px 6px;
  font-family: "IM Fell English", Baskerville, Georgia, serif;
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

/* Check-in ledger */

.ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  margin-top: 30px;
}

.ledger-rules {
  display: grid;
  border-top: 1px solid var(--rule);
}
.rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding-block: 14px;
  border-bottom: 1px dashed var(--rule);
}
.rule input[type="range"] {
  grid-column: 1 / -1;
}
.rule-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  cursor: pointer;
}
.rule-value {
  font: 700 0.9375rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}
.rule.is-off .rule-title,
.rule.is-off .rule-value {
  color: var(--ink-faint);
}

/* The app's physical switch, miniature. */
.rule input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 20px;
  margin: 0;
  border-radius: 10px;
  background: linear-gradient(#85858a, #d6d6d9);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: background 160ms ease;
}
.rule input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(#fbfbfb, #c9c9cd 55%, #86868b);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: transform 180ms cubic-bezier(0.3, 1.5, 0.6, 1);
}
.rule input[type="checkbox"]:checked {
  background: linear-gradient(#2b7321, #6ccd4d);
}
.rule input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.lamp {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #6a6a6d, #151516 70%);
  box-shadow: 0 0 0 1.5px #9d9da2, inset 0 -1px 1px rgba(255, 255, 255, 0.15);
}
.rule:not(.is-off) .lamp {
  background: radial-gradient(circle at 40% 35%, #fff, var(--lamp-green) 45%, #2f7a24);
  box-shadow: 0 0 0 1.5px #9d9da2, 0 0 8px rgba(88, 194, 74, 0.75);
}
.rule.is-met .lamp {
  background: radial-gradient(circle at 40% 35%, #fff, #f0553f 45%, #9b2213);
  box-shadow: 0 0 0 1.5px #9d9da2, 0 0 10px rgba(240, 70, 50, 0.85);
}

.rule input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.rule input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(#a8977a, #d9ccb1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.rule input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(#a8977a, #d9ccb1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.rule input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  border: 1px solid #5c4318;
  background: radial-gradient(circle at 38% 32%, #fff6d4, #d8ae58 50%, #8b6326);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}
.rule input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #5c4318;
  background: radial-gradient(circle at 38% 32%, #fff6d4, #d8ae58 50%, #8b6326);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}
.rule.is-off input[type="range"] {
  opacity: 0.45;
}

.meter-case {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 96px;
}
.meter svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(60, 40, 15, 0.35));
}
.meter-status {
  min-height: 3.2em;
  font: 700 0.9375rem/1.5 var(--mono);
  color: var(--ink-soft);
  text-align: center;
}
.meter-status.is-met {
  color: var(--signal);
}
.ledger-note {
  margin-top: 22px;
  max-width: 70ch;
  font-size: var(--step--1);
  color: var(--ink-faint);
}

/* Habits */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px clamp(28px, 4vw, 56px);
  margin-top: 30px;
}
.glyph-row {
  display: inline-flex;
  gap: 16px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(236, 236, 240, 0.9);
  box-shadow: inset 0 -0.5px 0 rgba(0, 0, 0, 0.25), 0 1px 2px rgba(60, 40, 20, 0.2);
}
.glyph-row img {
  display: block;
  opacity: 0.85;
}

/* Screenshots */

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.gallery-tabs button {
  appearance: none;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.7);
  color: var(--ink-soft);
  font: 700 var(--step--1) / 1 var(--body);
  cursor: pointer;
}
.gallery-tabs button:hover {
  color: var(--ink);
  background: #fffcf3;
}
.gallery-tabs button[aria-selected="true"] {
  border-color: #4b3316;
  background: linear-gradient(#5b3d24, #3a2415);
  color: var(--parchment);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.plate {
  margin: 0;
  padding: clamp(10px, 1.6vw, 20px);
  border-radius: 8px;
  background: var(--card) url("generated/textures/card.png");
  background-size: 128px 128px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 0 1px rgba(110, 80, 40, 0.22),
    0 24px 50px rgba(60, 38, 14, 0.28);
}
.plate figcaption {
  margin-top: 14px;
  font: 400 var(--step--1) / 1.5 var(--mono);
  color: var(--ink-soft);
}

.window-frame {
  position: relative;
  container-type: inline-size;
  border-radius: 10px;
  overflow: hidden;
  background: #2b1d12;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(40, 25, 10, 0.3);
}
.window-frame img {
  display: block;
  width: 100%;
  height: auto;
}
/* Traffic lights sit over the walnut sidebar, as in the real window. */
.window-frame .lights {
  position: absolute;
  top: 2.02cqw;
  left: 2.02cqw;
  display: flex;
  gap: 0.85cqw;
}
.window-frame .lights i {
  width: 1.28cqw;
  height: 1.28cqw;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.3);
}
.window-frame .lights i:nth-child(2) {
  background: #febc2e;
}
.window-frame .lights i:nth-child(3) {
  background: #28c840;
}
.window-frame.is-panel {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  display: grid;
  place-items: center;
  padding-block: clamp(8px, 3vw, 40px);
}
.window-frame.is-panel img {
  width: min(100%, 636px);
  filter: drop-shadow(0 18px 28px rgba(40, 25, 10, 0.4));
}
.window-frame.is-panel .lights {
  display: none;
}

/* House rules */

.features--native {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.promises {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin-top: 30px;
}
.num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86em;
  letter-spacing: 0.02em;
}
.figure {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.table-scroll {
  margin-top: 40px;
  overflow-x: auto;
}
.permissions {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  background: rgba(255, 252, 243, 0.65);
  box-shadow: 0 0 0 1px var(--rule);
}
.permissions caption {
  caption-side: top;
  text-align: start;
  padding-bottom: 12px;
  font: 700 var(--step--1) / 1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.permissions th,
.permissions td {
  padding: 12px 16px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px dashed var(--rule);
}
.permissions thead th {
  font: 700 var(--step--1) / 1.4 var(--body);
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
}
.permissions tbody th {
  font-weight: 600;
  white-space: nowrap;
}
.permissions td:last-child {
  color: var(--ink-soft);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font: 700 0.75rem/1.5 var(--mono);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge--required {
  border-color: rgba(217, 67, 47, 0.5);
  color: #a5301f;
  background: rgba(217, 67, 47, 0.08);
}

/* Download plate */

.download-plate {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(28px, 5vw, 56px);
  border-radius: 18px;
  border: 1px solid #5c421b;
  background:
    url("generated/textures/brushed-metal.png"),
    linear-gradient(160deg, #f6e2a5 0%, #d9b061 38%, #b58a3e 72%, #8f6a2e 100%);
  background-size: 128px 128px, auto;
  background-blend-mode: multiply, normal;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    0 30px 60px rgba(70, 45, 15, 0.35);
  color: #2b1d0d;
}
/* Four screws hold the plate. */
.download-plate::before,
.download-plate::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 44%, rgba(0, 0, 0, 0.55) 45% 55%, transparent 56%),
    radial-gradient(circle at 35% 30%, #f3e2b0, #9a7432 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  top: 16px;
  left: 16px;
}
.download-plate::after {
  left: auto;
  right: 16px;
  top: auto;
  bottom: 16px;
}

.plate-engraving {
  font: 700 var(--step--1) / 1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a4119;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.download-plate h2 {
  margin-block: 6px 22px;
  font-family: var(--display);
  font-size: var(--step-5);
  line-height: 1;
  color: #2b1d0d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.download-plate .version {
  font-family: var(--mono);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 0.5em;
  color: #5a4119;
}

.facts {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
}
.facts div {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.facts dt {
  font: 700 0.75rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a4119;
}
.facts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.facts-hash dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.facts-hash code {
  font: 400 0.75rem/1.4 var(--mono);
  overflow-wrap: anywhere;
  color: #3f2d12;
}
.copy {
  appearance: none;
  padding: 3px 9px;
  border: 1px solid rgba(60, 40, 10, 0.5);
  border-radius: 6px;
  background: rgba(255, 245, 215, 0.55);
  font: 700 0.75rem/1.2 var(--body);
  color: #3f2d12;
  cursor: pointer;
}
.copy:hover {
  background: rgba(255, 248, 225, 0.9);
}
.gatekeeper {
  margin-top: 20px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 246, 220, 0.6);
  box-shadow: inset 0 0 0 1px rgba(90, 65, 25, 0.35);
  font-size: var(--step--1);
}

.download-side {
  padding: clamp(18px, 3vw, 28px);
  border-radius: 12px;
  background: rgba(255, 250, 236, 0.72);
  box-shadow: inset 0 1px 3px rgba(60, 40, 10, 0.35), 0 1px 0 rgba(255, 255, 255, 0.6);
}
.download-side h3 + ol,
.download-side h3 + ul {
  margin-top: 6px;
}
.install,
.news {
  margin: 0 0 22px;
  padding-inline-start: 1.3em;
  color: #4a3718;
}
.install li,
.news li {
  padding-block: 4px;
}
.news {
  margin-bottom: 0;
}
.news-more {
  margin: 10px 0 0;
  font-size: var(--step--1);
  font-weight: 600;
}
.news-more a,
.releases-cta a {
  color: #5a3f14;
  text-underline-offset: 3px;
}
.news-more a::after,
.releases-cta a::after {
  content: " →";
}

/* Release notes come from releases.json in both languages; show the one on screen. */
html:not([lang="zh-Hans"]) .l10n[lang="zh-Hans"],
html[lang="zh-Hans"] .l10n[lang="en"] {
  display: none;
}

/* Release notes page */

.section--releases {
  min-height: 60vh;
}
.releases-lede {
  color: var(--ink-soft);
  max-width: 62ch;
  margin-top: 10px;
}
.releases-cta {
  margin: 12px 0 0;
  font-weight: 600;
}
.releases {
  display: grid;
  gap: 18px;
  margin-top: clamp(28px, 4vw, 40px);
  max-width: 760px;
}
.release {
  padding: clamp(16px, 3vw, 24px) clamp(18px, 3vw, 28px);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(80, 55, 25, 0.18), inset 0 0 0 1px rgba(201, 181, 140, 0.7);
  scroll-margin-top: 88px;
}
.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.release-head h3 {
  margin: 0;
  /* IM Fell's old-style figures read 1.0.1 as “I.O.I”. */
  font: 700 var(--step-2) / 1.1 var(--body);
  font-variant-numeric: tabular-nums;
}
.release-head h3 a {
  text-decoration: none;
}
.release-head h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.release-head time {
  font: 400 var(--step--1) / 1.4 var(--mono);
  color: var(--ink-faint);
}
.release-latest {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lamp-green);
  color: #fff;
  font: 700 0.6875rem/1.4 var(--body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}
.release .news {
  margin-top: 10px;
  color: var(--ink);
}

/* FAQ */

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px clamp(28px, 4vw, 56px);
  margin-top: 30px;
}

/* Footer */

.footer {
  position: relative;
  padding-block: 56px 40px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.45)), url("generated/textures/leather.png");
  background-size: auto, 128px 128px;
}
.footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 14px;
  border-top: 2px dashed var(--stitch);
  opacity: 0.8;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px 40px;
  align-items: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--parchment-soft);
}
.footer-brand img {
  margin-inline-start: -6px;
}
.footer-name {
  font: 400 1.75rem/1 "IM Fell English", Baskerville, Georgia, serif;
  color: var(--parchment);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: var(--step--1);
  font-weight: 600;
}
.footer-links a {
  color: var(--parchment-soft);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--parchment);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.footer-credits,
.footer-copy {
  font: 400 0.75rem/1.6 var(--mono);
  color: rgba(246, 234, 208, 0.55);
}
.footer-copy {
  justify-self: end;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .drawer-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .specimen {
    grid-column: span 2;
  }
  .specimen:nth-child(4),
  .specimen:nth-child(5) {
    grid-column: span 3;
  }
  .specimen:nth-child(4) img,
  .specimen:nth-child(5) img {
    max-height: 240px;
  }
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-lede {
    max-width: 40em;
  }
  .nav {
    display: none;
  }
  .language {
    margin-inline-start: auto;
  }
  .section-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ledger {
    grid-template-columns: 1fr;
  }
  .meter-case {
    position: static;
    max-width: 420px;
    width: 100%;
    margin-inline: auto;
    order: -1;
  }
  .features--native,
  .promises {
    grid-template-columns: 1fr;
  }
  .download-plate {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .steps,
  .features,
  .faq {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-rows: none;
    row-gap: 28px;
  }
  .step {
    grid-row: auto;
    grid-template-columns: 57px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 16px;
    align-items: start;
  }
  .step img {
    grid-row: 1 / span 3;
    margin-bottom: 0;
  }
  .drawer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .specimen,
  .specimen:nth-child(4),
  .specimen:nth-child(5) {
    grid-column: span 1;
  }
  .specimen:first-child {
    grid-column: 1 / -1;
  }
  .specimen:first-child img {
    max-height: 260px;
  }
  .specimen:nth-child(4) img,
  .specimen:nth-child(5) img {
    max-height: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-copy {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .masthead .brass-button--small {
    display: none;
  }
  .desktop {
    aspect-ratio: 4 / 3.4;
  }
  .desk-window {
    width: 46%;
  }
  .desk-bin {
    left: 58%;
  }
  .menubar-item {
    display: none;
  }
  .facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .specimen-label {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
