/* walletblueprint.com — shared styles */

:root {
  --blue: #0a4ba8;
  --header-bg: rgba(8, 58, 130, 0.55);
  --panel: rgba(7, 52, 120, 0.45);
  --panel-dark: rgba(6, 44, 102, 0.5);
  --panel-darker: rgba(6, 44, 102, 0.6);
  --ice: #bfe0ff;
  --text: #ffffff;
  --body: #e4f0ff;
  --body-alt: #eaf3ff;
  --line-18: rgba(255, 255, 255, 0.18);
  --line-25: rgba(255, 255, 255, 0.25);
  --line-30: rgba(255, 255, 255, 0.3);
  --line-35: rgba(255, 255, 255, 0.35);
  --line-40: rgba(255, 255, 255, 0.4);
  --line-45: rgba(255, 255, 255, 0.45);
  --hover: rgba(255, 255, 255, 0.16);
  --warn: #ff8172;
  --warn-line: rgba(255, 129, 114, 0.6);
  --warn-fill: rgba(255, 129, 114, 0.12);
  --header-pad-x: 28px;
  --header-pad-y: 20px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Archivo, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; background: var(--blue); }

body {
  min-height: 100vh;
  background-color: var(--blue);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  font-family: var(--sans);
  color: var(--text);
  padding-bottom: 80px;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--ice); }
::selection { background: var(--text); color: var(--blue); }

.mono { font-family: var(--mono); }
.inline-link { border-bottom: 1px solid rgba(255, 255, 255, 0.6); }

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: var(--header-pad-y) var(--header-pad-x);
  border-bottom: 1px solid var(--line-35);
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand:hover { color: var(--text); }

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 2px solid var(--text);
  border-radius: 8px;
  display: grid;
  place-items: center;
  position: relative;
}
.brand-mark i {
  width: 20px;
  height: 14px;
  border: 2px solid var(--text);
  border-radius: 3px;
}
.brand-mark::before,
.brand-mark::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
}
.brand-mark::before {
  top: -5px;
  left: -5px;
  border-top: 2px solid var(--text);
  border-left: 2px solid var(--text);
}
.brand-mark::after {
  bottom: -5px;
  right: -5px;
  border-bottom: 2px solid var(--text);
  border-right: 2px solid var(--text);
}

.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand-name .b { color: var(--ice); }
.brand-name .tld { color: #a7b3c2; }
.brand-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ice);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

/* ---------- hamburger ---------- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-30);
  border-radius: 4px;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--hover); }
.nav-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.nav-toggle-bars {
  display: block;
  position: relative;
  width: 18px;
  height: 12px;
}
.nav-toggle-bars i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--text);
  transition: top 0.18s ease, transform 0.18s ease, opacity 0.12s ease;
}
.nav-toggle-bars i:nth-child(1) { top: 0; }
.nav-toggle-bars i:nth-child(2) { top: 5.25px; }
.nav-toggle-bars i:nth-child(3) { top: 10.5px; }

.nav-toggle.is-open .nav-toggle-bars i:nth-child(1) { top: 5.25px; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars i:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bars i:nth-child(3) { top: 5.25px; transform: rotate(-45deg); }

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

.btn-nav,
.btn-sort,
.btn-primary,
.btn-ghost,
.btn-clear {
  font-family: var(--mono);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.btn-nav {
  padding: 9px 14px;
  border: 1px solid var(--line-30);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.btn-nav:hover { background: var(--hover); color: var(--text); }
.btn-nav.is-active {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  padding: 9px 14px;
  border: 1px solid var(--line-30);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.btn-ghost:hover { background: var(--hover); color: var(--text); }

.btn-sort {
  padding: 9px 13px;
  border: 1px solid var(--line-30);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.btn-sort:hover { background: var(--hover); }
.btn-sort.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--blue);
  font-weight: 600;
}
.btn-sort.is-active:hover { background: var(--ice); color: var(--blue); }

.btn-primary {
  font-size: 12.5px;
  letter-spacing: 0.1em;
  padding: 13px 20px;
  background: var(--text);
  color: var(--blue);
  border: 1px solid var(--text);
  border-radius: 4px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--ice); border-color: var(--ice); color: var(--blue); }

.btn-clear {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line-35);
  border-radius: 3px;
  color: var(--ice);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 6px 9px;
}
.btn-clear:hover { background: var(--hover); color: var(--text); }

:is(.btn-nav, .btn-sort, .btn-primary, .btn-ghost, .btn-clear):focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

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

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--ice);
  margin-bottom: 18px;
}

/* ---------- hero (comparison) ---------- */

.hero {
  padding: 56px 0 36px;
  border-bottom: 1px dashed var(--line-40);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 40px;
  align-items: end;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.02;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero p {
  margin: 0;
  max-width: 56ch;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--body);
  text-wrap: pretty;
}
.hero img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-left: auto;
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 18px;
}
.sort-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.sort-label { padding: 9px 0; color: var(--ice); letter-spacing: 0.14em; }
.controls-hint {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ice);
  letter-spacing: 0.1em;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.search-field {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-40);
  background: var(--panel-dark);
  padding: 0 14px;
}
.search-field:focus-within { border-color: var(--text); }
.search-field .label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ice);
  flex: 0 0 auto;
}
.search-field input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 14px 10px;
  letter-spacing: 0.02em;
}
.search-field input::placeholder { color: rgba(191, 224, 255, 0.7); }
.result-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ice);
  letter-spacing: 0.12em;
  flex: 0 0 auto;
}

.no-results {
  border: 1px dashed var(--line-40);
  padding: 40px 24px;
  text-align: center;
  font-family: var(--mono);
  color: var(--ice);
  margin-bottom: 14px;
}
.no-results .headline {
  font-size: 13px;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}
.no-results .sub {
  font-size: 14px;
  color: var(--body-alt);
  font-family: var(--sans);
  letter-spacing: 0;
}

/* ---------- table ---------- */

.sheet {
  overflow-x: auto;
  border: 1px solid var(--line-40);
  background: var(--panel);
}
.sheet-inner { min-width: 1020px; }

.grid-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(4, minmax(0, 1fr)) 108px;
}

.sheet-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ice);
  border-bottom: 1px solid var(--line-40);
  background: var(--panel-darker);
}
.sheet-head > div { padding: 14px 16px; border-left: 1px dashed var(--line-25); }
.sheet-head > div:first-child { padding: 14px 20px; border-left: none; }
.sheet-head > div:last-child { text-align: right; }

.row { border-bottom: 1px solid var(--line-18); }
.row-main {
  align-items: center;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
}
.row-main:hover { background: rgba(255, 255, 255, 0.07); }
.row-main:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

.cell-device {
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}
.device-photo {
  width: 74px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid var(--line-45);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0 3px, transparent 3px 8px);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: #cfe6ff;
  text-align: center;
  line-height: 1.3;
}
.device-photo-img {
  width: 74px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--line-45);
  background: rgba(255, 255, 255, 0.04);
}

.device-name {
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.01em;
}
.device-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ice);
  margin-top: 4px;
}

.cell-label { display: none; }

.cell-score { padding: 16px; border-left: 1px dashed var(--line-25); }
.cell-score .value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
}
.bar { height: 8px; border: 1px solid var(--line-45); }
.bar > span { display: block; height: 100%; background: var(--text); }
.cell-score .note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ice);
  margin-top: 7px;
  letter-spacing: 0.06em;
}

.cell-total {
  padding: 16px;
  border-left: 1px dashed var(--line-25);
  text-align: right;
}
.cell-total .value {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.cell-total .tier {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ice);
  letter-spacing: 0.1em;
}

.teardown {
  padding: 4px 20px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  border-top: 1px dashed var(--line-30);
  background: var(--panel-dark);
}
.teardown > div { padding-top: 20px; }
.teardown .kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ice);
  margin-bottom: 10px;
}
.teardown p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--body-alt);
  text-wrap: pretty;
}

/* Devices with no sourced assessment read as blank rather than scored. */
.row.is-unrated .cell-score .value,
.row.is-unrated .cell-total .value {
  color: var(--ice);
  font-weight: 400;
}
.row.is-unrated .cell-total .tier {
  color: var(--ice);
  letter-spacing: 0.08em;
}
.row.is-unrated .cell-score .note {
  color: rgba(191, 224, 255, 0.65);
}

/* A published security advisory against a device, surfaced before the notes. */
.row-warning {
  grid-column: 1 / -1;
  margin-top: 20px;
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn);
  background: var(--warn-fill);
  padding: 14px 16px;
}
.row-warning-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--warn);
  margin-bottom: 8px;
}
.row-warning p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--body-alt);
  text-wrap: pretty;
}

.device-flag {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 7px;
  vertical-align: 1px;
  border: 1px solid var(--warn);
  border-radius: 50%;
  color: var(--warn);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

/* ---------- open source layer breakdown ---------- */

/* Spans the teardown's two columns rather than becoming a third, so neither
   mobile media block can conflict with .teardown's column count. */
.os-breakdown { grid-column: 1 / -1; }
/* Same reason: a full-width line rather than a cell in one of the two columns. */
.vendor-link { grid-column: 1 / -1; }

.os-layers {
  display: grid;
  gap: 1px;
  background: var(--line-25);
  border: 1px solid var(--line-25);
}
.os-layer {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 82px 112px minmax(0, 1.5fr);
  gap: 1px;
}
.os-layer > div {
  background: var(--blue);
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}
.os-layer-name { color: var(--ice); letter-spacing: 0.08em; }
.os-layer-pts { letter-spacing: 0.04em; }
.os-layer-note { color: var(--body-alt); }

/* The state word always carries the meaning; colour only reinforces it. */
.os-layer.is-open    .os-layer-state { color: var(--text); }
.os-layer.is-partial .os-layer-state { color: var(--ice); }
.os-layer.is-closed  .os-layer-state { color: rgba(191, 224, 255, 0.65); }
.os-layer.is-na      .os-layer-state,
.os-layer.is-na      .os-layer-pts   { color: rgba(191, 224, 255, 0.5); }
/* Not established by us, as opposed to established closed. */
.os-layer.is-unknown .os-layer-state {
  color: var(--ice);
  border-bottom: 1px dotted rgba(191, 224, 255, 0.6);
  display: inline-block;
}

.os-src {
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
.os-src:hover { color: var(--ice); }

.row-warning .os-src {
  color: var(--warn);
  border-bottom-color: var(--warn-line);
}
.row-warning .os-src:hover { color: var(--warn); border-bottom-color: var(--warn); }

.os-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--mono);
  color: var(--ice);
}
.os-total-value { font-size: 19px; color: var(--text); }
.os-total-sum { font-size: 11.5px; letter-spacing: 0.08em; }
/* Relies on .bar being globally scoped — do not move it under .cell-score. */
.os-total .bar { flex: 1 1 160px; max-width: 280px; }

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

.summary-section {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: start;
}
.card { border: 1px solid var(--line-35); padding: 24px; }
.card .kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ice);
  margin-bottom: 14px;
}
.scale-list {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2.1;
  color: var(--body-alt);
}
.scale-list .k {
  display: inline-block;
  min-width: 124px;
  padding-right: 12px;
  color: var(--ice);
}
.summary-section h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.summary-section p {
  margin: 0 0 18px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--body);
  max-width: 52ch;
  text-wrap: pretty;
}

.contact-section {
  margin-top: 40px;
  border: 1px solid var(--line-40);
  background: var(--panel);
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.contact-section .kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ice);
  margin-bottom: 14px;
}
.contact-section h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.contact-section p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--body);
  max-width: 54ch;
  text-wrap: pretty;
}
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}
.contact-actions .btn-primary,
.contact-actions .btn-ghost {
  width: 100%;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 15px 22px;
  text-align: left;
}
.contact-actions .btn-ghost { border-color: var(--line-45); }
.contact-email {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ice);
  padding-top: 4px;
}

/* ---------- document pages ---------- */

.doc-head {
  padding: 56px 0 30px;
  border-bottom: 1px dashed var(--line-40);
}
.doc-head h1 {
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.05;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.doc-head p {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
  max-width: 60ch;
  text-wrap: pretty;
}

.doc {
  padding: 40px 0 0;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--body-alt);
}
.doc p { margin: 0 0 16px; text-wrap: pretty; }
.doc h2 {
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.18em;
  color: var(--ice);
  margin: 44px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line-30);
  font-weight: 500;
}
.doc h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.pull {
  border-left: 2px solid var(--text);
  padding: 4px 0 4px 18px;
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.8;
}

.rubric {
  display: grid;
  margin: 4px 0 24px;
  gap: 1px;
  background: var(--line-30);
  border: 1px solid var(--line-30);
  font-family: var(--mono);
  font-size: 13.5px;
}
.rubric-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1px; }
.rubric-row > div { background: var(--blue); padding: 12px 14px; }
.rubric-row > div:first-child { color: var(--ice); }

.doc-footer {
  margin: 48px 0 0;
  padding: 26px;
  border: 1px solid var(--line-35);
}
.doc-footer p {
  margin: 0 0 18px;
  font-size: 15.5px;
  line-height: 1.65;
  text-wrap: pretty;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin: 0 0 8px;
}
.pillar { border: 1px solid var(--line-35); padding: 18px; }
.pillar .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ice);
  margin-bottom: 8px;
}
.pillar .body { font-size: 14.5px; line-height: 1.55; }

.author-links { display: flex; flex-wrap: wrap; gap: 12px; }
.author-links .btn-primary,
.author-links .btn-ghost {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 13px 18px;
}
.author-links .btn-ghost { border-color: var(--line-45); }

/* ---------- methodology metric tabs ---------- */

/* The tab strip is inert without the script, so it stays out of the page until
   the script adds .is-tabbed — at which point the panels collapse to one. */
.metric-tablist { display: none; }
.metric-tabs.is-tabbed .metric-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
}
.doc > .metric-tabs:first-child .metric-tablist { margin-top: 0; }

.metric-tab {
  font-family: var(--mono);
  cursor: pointer;
  padding: 9px 14px;
  border: 1px solid var(--line-30);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.metric-tab:hover { background: var(--hover); color: var(--text); }
.metric-tab[aria-selected="true"] {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.18);
}
.metric-tab:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.metric-tabs.is-tabbed .metric-panel { display: none; }
.metric-tabs.is-tabbed .metric-panel.is-active { display: block; }

/* The tab strip is the divider above the selected panel, so its heading drops
   the rule and the padding it would otherwise draw for itself. */
.metric-tabs.is-tabbed .metric-panel > h2:first-child {
  margin-top: 30px;
  padding-top: 0;
  border-top: none;
}

/* Narrow screens: the four tabs share the available width across two rows
   rather than pushing the page sideways. */
@media (max-width: 560px) {
  .metric-tabs.is-tabbed .metric-tablist { gap: 6px; }
  .metric-tab {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 8px;
    font-size: 11px;
    letter-spacing: 0.03em;
    text-align: center;
  }
}

/* ---------- diagrams ---------- */

.diagram { margin: 30px 0 34px; }

.diagram-frame {
  /* Scroll container only — the diagram sits directly on the page. */
  overflow-x: auto;
  font-size: 0;
}
.diagram img {
  display: block;
  width: 100%;
  height: auto;
}

/* Below the swap point the portrait variant is used; cap it at its natural
   size so it never scales up past the point of looking clumsy. */
@media (max-width: 700px) {
  .diagram img {
    max-width: 380px;
    margin: 0 auto;
  }
}


.diagram figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  letter-spacing: 0.05em;
  color: var(--ice);
  margin-top: 12px;
  text-wrap: pretty;
}

/* ---------- comparison table as cards ---------- */

@media (max-width: 900px) {
  /* The sheet frame dissolves; each device becomes its own card. */
  .sheet {
    overflow-x: visible;
    border: none;
    background: transparent;
  }
  .sheet-inner { min-width: 0; }
  .sheet-head { display: none; }

  #rows { display: flex; flex-direction: column; gap: 14px; }

  .row {
    border: 1px solid var(--line-40);
    background: var(--panel);
    border-bottom: 1px solid var(--line-40);
  }

  /* Device and composite share the top line; scores stack beneath. */
  .row-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
  }
  /* Collapsed cards show the device and composite only. */
  .row-main::after {
    content: '+';
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    font-family: var(--mono);
    font-size: 19px;
    line-height: 1;
    color: var(--ice);
    padding: 15px 16px 15px 4px;
  }
  .row.is-open .row-main::after { content: '−'; }

  .row:not(.is-open) .cell-score { display: none; }
  .cell-device {
    grid-column: 1;
    grid-row: 1;
    padding: 15px 16px;
  }
  .cell-total {
    grid-column: 2;
    grid-row: 1;
    padding: 15px 2px 15px 16px;
    border-left: none;
  }
  .cell-score {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px dashed var(--line-25);
    padding: 12px 16px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: baseline;
  }

  .cell-label {
    display: block;
    grid-column: 1;
    grid-row: 1;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    color: var(--ice);
  }
  .cell-score .value {
    grid-column: 2;
    grid-row: 1;
    font-size: 17px;
    margin-bottom: 0;
  }
  .cell-score .bar {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 9px;
  }
  .cell-score .note {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 6px;
  }

  /* The label would cost width the device name needs, and the column header
     already names it on desktop. */
  .cell-total .cell-label { display: none; }
  .cell-total .value { font-size: 24px; line-height: 1.1; }

  .cell-device { gap: 13px; }
  .device-photo,
  .device-photo-img { width: 54px; height: 58px; }
.device-name { font-size: 15.5px; }
  .device-meta { font-size: 10.5px; margin-top: 3px; }

  .teardown {
    padding: 0 16px 18px;
    border-top: 1px dashed var(--line-30);
  }
  .teardown > div { padding-top: 16px; }

  /* Reflowed to two columns — every child placed explicitly, never auto. */
  .os-layer { grid-template-columns: minmax(0, 1fr) auto; }
  .os-layer-name  { grid-column: 1; grid-row: 1; font-size: 11px; }
  .os-layer-pts   { grid-column: 2; grid-row: 1; text-align: right; }
  .os-layer-state { grid-column: 1 / -1; grid-row: 2; }
  .os-layer-note  { grid-column: 1 / -1; grid-row: 3; }
  .os-layer > div { padding: 8px 12px; font-size: 11.5px; }
  .os-breakdown .kicker { padding-top: 16px; }
}

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

.site-footer {
  max-width: 1240px;
  margin: 72px auto 0;
  padding: 26px 28px 0;
  border-top: 1px solid var(--line-30);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ice);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  /* Brand yields space so the toggle stays on the first row. */
  .site-header { gap: 14px; }
  .brand { flex: 1 1 0; min-width: 0; }
  .brand-text { min-width: 0; }

  .site-nav {
    display: none;
    order: 3;
    /* Span the header's full width, padding included, so the panel bleeds edge to edge. */
    flex-basis: calc(100% + var(--header-pad-x) * 2);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0 calc(-1 * var(--header-pad-x)) calc(-1 * var(--header-pad-y));
    border-top: 1px dashed var(--line-35);
  }
  .site-nav.is-open { display: flex; }

  .site-nav > a {
    border: none;
    border-bottom: 1px dashed var(--line-25);
    border-radius: 0;
    padding: 15px var(--header-pad-x);
    text-align: left;
  }
  .site-nav > a:last-child { border-bottom: none; }
  .site-nav > a:hover { background: var(--hover); }

  /* Current page: an accent rule rather than a boxed outline. */
  .site-nav > a.is-active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 3px 0 0 var(--text);
  }
}

@media (max-width: 900px) {
  .hero,
  .summary-section,
  .contact-section,
  .teardown {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero { align-items: start; gap: 28px; }
  .hero img { margin-left: 0; }
  .teardown { gap: 4px; }
  .contact-section { padding: 26px; }
}

@media (max-width: 640px) {
  :root { --header-pad-x: 18px; --header-pad-y: 16px; }
  .wrap, .wrap-narrow { padding: 0 18px; }
  .site-footer { padding: 26px 18px 0; }
  .brand-tag { font-size: 9.5px; letter-spacing: 0.12em; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
