/* ============================================================
   Design tokens
   Brand hue ≈ 192 (teal). Palette = black + white + 1 brand hue
   with ~5 HSB-derived variations. All contrast checked ≥ WCAG AA.
   Spacing scale: 4 · 8 · 12 · 16 · 24 · 32 · 40 · 48 · 64.
   ============================================================ */
:root {
  /* neutrals */
  --page:        #F4F6F7;   /* HSB ~197, 3, 97  */
  --surface:     #FFFFFF;
  --surface-alt: #ECF1F3;   /* HSB ~197, 4, 95  */
  --ink:         #17242B;   /* HSB ~200, 18, 17 : text-strong */
  --ink-2:       #46555C;   /* HSB ~197, 24, 36 : text-muted  */

  /* brand hue 192 + variations */
  --brand:        #12606F;  /* HSB ~192, 84, 44 : interactive */
  --brand-strong: #0E4C58;  /* HSB ~192, 84, 35 : hover/active */
  --brand-wash:   #E2EFF2;  /* HSB ~192, 8, 95  : soft fill   */

  /* structure */
  --stroke:        #C3D0D6; /* subtle, non-essential dividers only */
  --stroke-strong: #6E828B; /* form fields & meaningful borders ≥3:1 */

  /* status (reserved) */
  --error:   #B4231F;
  --success: #1F7A3D;
  --warning: #A8641A;

  /* type */
  --f-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --f-body:    "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* type scale — base 16, ratio ≈ 1.25 (rounded) */
  --t-tiny:  14px;
  --t-small: 16px;
  --t-body:  16px;
  --t-lead:  20px;
  --t-h4:    20px;
  --t-h3:    25px;
  --t-h2:    32px;
  --t-h1:    40px;
  --t-mega:  56px;

  /* spacing */
  --s4: 4px;  --s8: 8px;  --s12: 12px; --s16: 16px; --s24: 24px;
  --s32: 32px; --s40: 40px; --s48: 48px; --s64: 64px;

  --rail-w: 264px;
  --radius: 10px;
  --radius-sm: 6px;
}

/* ============================================================ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
button { font-family: inherit; }

/* visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--brand-strong);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute; left: -9999px; top: var(--s8);
  background: var(--ink); color: #fff; padding: var(--s8) var(--s16);
  border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: var(--s16); }

/* ============================================================ shell
   Non-standard nav: a persistent vertical index rail on the left
   acts as primary navigation + scroll-spy. Content flows to the right,
   opening with a typographic manifest + instrument strip (no photo hero).
*/
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
}

/* ---- rail ---- */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--stroke-strong);
  padding: var(--s32) var(--s24);
  display: flex;
  flex-direction: column;
  gap: var(--s32);
}
.brandmark { display: flex; align-items: baseline; gap: var(--s8); text-decoration: none; }
.brandmark:hover { text-decoration: none; }
.brandmark .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-wash);
  align-self: center;
}
.brandmark .name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-h4);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.rail-eyebrow {
  font-size: var(--t-tiny);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--s12);
}

.rail-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s4); }
.rail-index a {
  display: flex; align-items: center; gap: var(--s12);
  padding: var(--s12);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}
.rail-index a:hover { background: var(--brand-wash); text-decoration: none; }
.rail-index a.is-active { background: var(--brand-wash); color: var(--brand-strong); }
.rail-index .idx {
  font-variant-numeric: tabular-nums;
  font-size: var(--t-tiny);
  color: var(--ink-2);
  min-width: 20px;
}
.rail-index a.is-active .idx { color: var(--brand-strong); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s16); }
.rail-links { display: flex; flex-direction: column; gap: var(--s8); }
.rail-links a { color: var(--ink-2); font-size: var(--t-small); }
.rail-links a:hover { color: var(--brand-strong); }

/* currency toggle — segmented control */
.cur-toggle {
  display: inline-flex;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  padding: var(--s4);
  gap: var(--s4);
  background: var(--surface);
  width: max-content;
}
.cur-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--t-tiny);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: var(--s12) var(--s16);
  min-height: 44px;
  min-width: 64px;
  border-radius: 999px;
  cursor: pointer;
}
.cur-toggle button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}
.cur-toggle button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* ---- main ---- */
.main { min-width: 0; }
.wrap { max-width: 1120px; padding: 0 var(--s40); margin: 0 auto; }

/* ============================================================ manifest
   The hero is a thesis, not a stock photo: a typographic statement
   plus a live "home instrument" strip — the page's signature element.
*/
.manifest { padding: var(--s64) 0 var(--s40); }
.manifest .kicker {
  font-size: var(--t-tiny);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-strong);
  margin: 0 0 var(--s16);
}
.manifest h1 {
  font-size: var(--t-mega);
  max-width: 16ch;
  margin: 0 0 var(--s24);
}
.manifest .lede {
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 58ch;
}

/* instrument strip (signature) */
.instrument {
  margin-top: var(--s40);
  border-top: 1px solid var(--stroke-strong);
  border-bottom: 1px solid var(--stroke-strong);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.instrument .cell {
  padding: var(--s24);
  border-left: 1px solid var(--stroke);
}
.instrument .cell:first-child { border-left: 0; padding-left: 0; }
.instrument .val {
  font-family: var(--f-display);
  font-size: var(--t-h3);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  display: flex; align-items: center; gap: var(--s8);
}
.instrument .val .live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.instrument .lbl {
  font-size: var(--t-tiny);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: var(--s4);
}

/* ============================================================ category sections */
.cat { padding: var(--s48) 0; border-bottom: 1px solid var(--stroke); scroll-margin-top: var(--s24); }
.cat:last-of-type { border-bottom: 0; }
.cat-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s24);
  margin-bottom: var(--s32);
}
.cat-head .num {
  font-family: var(--f-display);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-tiny);
  color: var(--brand-strong);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--s8);
}
.cat-head h2 { font-size: var(--t-h2); }
.cat-head .blurb { color: var(--ink-2); max-width: 46ch; font-size: var(--t-small); }
.cat-count {
  font-size: var(--t-tiny);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 12-column grid; cards span 4 (3-up), 6 (2-up), 12 (1-up) */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s24);
}
.card { grid-column: span 4; }

/* ---- product card = device tile ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s16);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover {
  border-color: var(--brand);
  box-shadow: 0 12px 28px -18px rgba(18, 96, 111, 0.55);
  transform: translateY(-2px);
}
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--brand-wash);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.thumb .ph { position: absolute; inset: 0; }
.pill {
  position: absolute; top: var(--s8); left: var(--s8);
  background: rgba(23, 36, 43, 0.86);
  color: #fff;
  font-size: var(--t-tiny);
  letter-spacing: 0.03em;
  padding: var(--s4) var(--s8);
  border-radius: 999px;
}
.card h3 { font-size: var(--t-h4); letter-spacing: -0.01em; }
.card .desc { color: var(--ink-2); font-size: var(--t-small); line-height: 1.55; }
.card .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s16);
  padding-top: var(--s8);
}
.price {
  font-variant-numeric: tabular-nums;
  font-size: var(--t-h4);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s8);
  min-height: 48px;
  padding: 0 var(--s24);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--t-small);
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--brand-strong); border-color: var(--stroke-strong); }
.btn-secondary:hover { background: var(--brand-wash); text-decoration: none; }
.card .btn { min-height: 48px; padding: 0 var(--s16); }

/* ============================================================ policy pages */
.doc { padding: var(--s64) 0 var(--s48); max-width: 760px; }
.doc .kicker {
  font-size: var(--t-tiny); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand-strong); margin: 0 0 var(--s16);
}
.doc h1 { font-size: var(--t-h1); margin-bottom: var(--s12); }
.doc .updated { color: var(--ink-2); font-size: var(--t-small); margin-bottom: var(--s40); }
.doc h2 {
  font-size: var(--t-h3); margin: var(--s48) 0 var(--s16);
  padding-top: var(--s24); border-top: 1px solid var(--stroke);
}
.doc h3 { font-size: var(--t-h4); margin: var(--s32) 0 var(--s8); }
.doc p, .doc li { font-size: var(--t-body); line-height: 1.7; color: var(--ink); }
.doc p + p { margin-top: var(--s16); }
.doc ul, .doc ol { margin: var(--s16) 0; padding-left: var(--s24); }
.doc li { margin-bottom: var(--s8); }
.doc .callout {
  background: var(--brand-wash);
  border-radius: var(--radius);
  padding: var(--s24);
  margin: var(--s24) 0;
  font-size: var(--t-small);
}
.doc table { width: 100%; border-collapse: collapse; margin: var(--s24) 0; font-size: var(--t-small); }
.doc th, .doc td {
  text-align: left; padding: var(--s12) var(--s16);
  border-bottom: 1px solid var(--stroke); vertical-align: top;
}
.doc th { font-family: var(--f-display); color: var(--ink); background: var(--surface-alt); }
.doc strong { font-weight: 700; }

/* ============================================================ footer */
.footer {
  background: var(--ink);
  color: #C9D3D8;
}
.footer .wrap { padding-top: var(--s48); padding-bottom: var(--s40); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s40);
  padding-bottom: var(--s32);
  border-bottom: 1px solid #33454C;
}
.footer h4 { color: #fff; font-size: var(--t-small); margin-bottom: var(--s16); font-family: var(--f-display); }
.footer .name { color: #fff; font-family: var(--f-display); font-size: var(--t-h4); margin-bottom: var(--s12); }
.footer p, .footer li, .footer a { font-size: var(--t-small); line-height: 1.6; }
.footer a { color: #C9D3D8; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s8); }
.footer .legal { color: #9FB0B6; }
.footer-bottom {
  padding-top: var(--s24);
  display: flex; flex-wrap: wrap; gap: var(--s16);
  justify-content: space-between;
  font-size: var(--t-tiny); color: #9FB0B6;
}

/* ============================================================ mobile top nav (hidden on desktop) */
.topbar { display: none; }

/* ============================================================ responsive */
@media (max-width: 1040px) {
  .card { grid-column: span 6; }
  .instrument { grid-template-columns: repeat(2, 1fr); }
  .instrument .cell:nth-child(3) { border-left: 0; padding-left: 0; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center;
    justify-content: space-between; gap: var(--s16);
    padding: var(--s16) var(--s16);
    border-right: 0; border-bottom: 1px solid var(--stroke-strong);
    flex-wrap: wrap;
  }
  .rail-eyebrow, .rail-index, .rail-links { display: none; }
  .rail-foot { margin-top: 0; flex-direction: row; align-items: center; }

  /* mobile category strip */
  .topbar {
    display: block;
    position: sticky; top: 0; z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--stroke-strong);
    overflow-x: auto;
  }
  .topbar ul {
    display: flex; gap: var(--s8); list-style: none; margin: 0;
    padding: var(--s12) var(--s16); white-space: nowrap;
  }
  .topbar a {
    color: var(--ink); font-size: var(--t-small); font-weight: 500;
    padding: var(--s8) var(--s12); border-radius: 999px; background: var(--surface-alt);
  }
  .topbar a:hover, .topbar a.is-active { background: var(--brand-wash); color: var(--brand-strong); text-decoration: none; }

  .wrap { padding: 0 var(--s24); }
  .manifest { padding: var(--s40) 0 var(--s32); }
  .manifest h1 { font-size: var(--t-h1); }
  .cat-head { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s32); }
}

@media (max-width: 560px) {
  .card { grid-column: span 12; }
  .instrument { grid-template-columns: 1fr 1fr; }
  .manifest h1 { font-size: var(--t-h2); }
  .manifest .lede { font-size: var(--t-body); }
}

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