:root {
  --u: calc(100vw / 1920);
  --paper: #e9e9e6;
  --surface: #f5f5f2;
  --recess: #dfdfdb;
  --ink: #000000;
  --solid: #3a3a38;
  --muted: #6e6e6b;
  --royal: #0030f0;
  --cyan: #49d8ff;
  --chain: #00c805;
  --display: "Sora", sans-serif;
  --body: "Sora", sans-serif;
  --number: "JetBrains Mono", monospace;
  --label: "Spline Sans Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: #e9e9e6; color: #000; }
html { overflow-x: hidden; }
body { font-family: var(--body); }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

/* The desktop chrome below preserves the approved chrome/nav.html measurements. */
header[data-chrome="nav"] {
  width: 100%;
  height: calc(84 * var(--u));
  padding: 0 calc(44 * var(--u));
  display: grid;
  grid-template-columns: calc(300 * var(--u)) 1fr auto;
  align-items: center;
  gap: calc(30 * var(--u));
  border-bottom: 1.5px solid #000;
  background: #e9e9e6;
  font-family: var(--body);
}
header[data-chrome="nav"] .brand {
  display: inline-flex;
  align-items: center;
  gap: calc(14 * var(--u));
  min-width: 0;
}
header[data-chrome="nav"] .logo-box {
  position: relative;
  width: calc(42 * var(--u));
  height: calc(42 * var(--u));
  overflow: hidden;
  flex: 0 0 auto;
}
header[data-chrome="nav"] .logo-box img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(126 * var(--u));
  height: calc(126 * var(--u));
  transform: translate(-50%, -50%);
  object-fit: contain;
}
header[data-chrome="nav"] .wordmark {
  font-family: var(--display);
  font-size: calc(29 * var(--u));
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}
.routes {
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: calc(34 * var(--u));
  white-space: nowrap;
}
.routes a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #000;
  text-decoration: none;
  font-size: clamp(12px, calc(15 * var(--u)), 20px);
  font-weight: 500;
  line-height: 1;
}
.routes a.is-active { color: #0030f0; font-weight: 600; }
.routes a.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1.5px;
  left: 0;
  height: 3px;
  background: #0030f0;
}
header[data-chrome="nav"] .right {
  display: flex;
  align-items: center;
  gap: calc(25 * var(--u));
  white-space: nowrap;
}
header[data-chrome="nav"] .right > a {
  color: #000;
  text-decoration: none;
  font-size: clamp(12px, calc(15 * var(--u)), 20px);
  font-weight: 500;
}
header[data-chrome="nav"] .nav-ca {
  height: calc(45 * var(--u));
  padding: 0 calc(15 * var(--u));
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--u));
  border: 1px solid #000;
  font: 500 clamp(12px, calc(13 * var(--u)), 17px)/1 var(--label);
}
.ca-chip {
  display: inline-grid;
  place-items: center;
  min-width: calc(31 * var(--u));
  height: calc(25 * var(--u));
  padding: 0 calc(6 * var(--u));
  background: #00c805;
  color: #000;
  font-weight: 600;
}
.menu-toggle { display: none; }

main {
  min-height: calc(100vh - (180 * var(--u)));
  width: 100%;
  transition: opacity 120ms linear;
}
main.is-leaving { opacity: 0; }

/* The footer preserves the approved chrome/footer.html measurements. */
footer[data-chrome="footer"] {
  width: 100%;
  height: calc(96 * var(--u));
  padding: 0 calc(44 * var(--u));
  border-top: 1.5px solid #000;
  background: #e9e9e6;
  font-family: var(--label);
  font-size: clamp(12px, calc(13 * var(--u)), 18px);
  line-height: 1.25;
}
footer[data-chrome="footer"] .row-one {
  height: calc(55 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(19 * var(--u));
  border-bottom: 1px solid #000;
  white-space: nowrap;
}
footer[data-chrome="footer"] .brand {
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--u));
  margin-right: calc(7 * var(--u));
}
footer[data-chrome="footer"] .logo-box {
  position: relative;
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
  overflow: hidden;
  flex: 0 0 auto;
}
footer[data-chrome="footer"] .logo-box img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(102 * var(--u));
  height: calc(102 * var(--u));
  transform: translate(-50%, -50%);
  object-fit: contain;
}
footer[data-chrome="footer"] .wordmark {
  font-family: var(--display);
  font-size: calc(22 * var(--u));
  font-weight: 700;
  line-height: 1;
}
footer[data-chrome="footer"] a { color: #000; text-decoration: none; }
footer[data-chrome="footer"] .ca {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
}
footer[data-chrome="footer"] .ca-chip {
  min-width: calc(29 * var(--u));
  height: calc(25 * var(--u));
  padding: 0 calc(5 * var(--u));
}
footer[data-chrome="footer"] .copy,
footer[data-chrome="footer"] .buy { font-weight: 600; }
footer[data-chrome="footer"] .sources {
  min-width: 0;
  margin-left: auto;
  color: #3a3a38;
  font-size: clamp(12px, calc(12 * var(--u)), 16px);
  text-align: right;
}
footer[data-chrome="footer"] .row-two {
  height: calc(39 * var(--u));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(32 * var(--u));
  color: #3a3a38;
  white-space: nowrap;
}

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

@media (max-width: 1279px) and (min-width: 1024px) {
  header[data-chrome="nav"] {
    grid-template-columns: calc(230 * var(--u)) 1fr auto;
  }
  .routes { gap: calc(22 * var(--u)); }
  header[data-chrome="nav"] .right { gap: calc(16 * var(--u)); }
}

@media (max-width: 1023px) {
  :root { --u: 1px; }
  header[data-chrome="nav"] {
    position: relative;
    height: 72px;
    padding: 0 20px;
    grid-template-columns: 1fr auto;
    gap: 16px;
  }
  header[data-chrome="nav"] .brand { gap: 10px; }
  header[data-chrome="nav"] .logo-box { width: 36px; height: 36px; }
  header[data-chrome="nav"] .logo-box img { width: 108px; height: 108px; }
  header[data-chrome="nav"] .wordmark { font-size: 24px; }
  .menu-toggle {
    display: inline-flex;
    height: 42px;
    padding: 0 12px;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #000;
    border-radius: 0;
    background: transparent;
    color: #000;
    font: 600 13px/1 "Spline Sans Mono", monospace;
    text-transform: uppercase;
  }
  .menu-glyph,
  .menu-glyph::before,
  .menu-glyph::after {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #000;
  }
  .menu-glyph { position: relative; }
  .menu-glyph::before,
  .menu-glyph::after { content: ""; position: absolute; left: 0; }
  .menu-glyph::before { top: -6px; }
  .menu-glyph::after { top: 6px; }
  .routes {
    position: absolute;
    z-index: 20;
    top: 72px;
    right: 0;
    left: 0;
    height: auto;
    padding: 10px 20px 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1.5px solid #000;
    background: var(--paper);
  }
  header[data-chrome="nav"].is-open .routes { display: flex; }
  .routes a {
    min-height: 46px;
    border-bottom: 1px solid #000;
    font-size: 15px;
  }
  .routes a.is-active::after { right: auto; top: 0; bottom: 0; left: -20px; width: 4px; height: auto; }
  header[data-chrome="nav"] .right { display: none; }
  main { min-height: calc(100vh - 72px); }
  footer[data-chrome="footer"] {
    height: auto;
    padding: 0 20px;
    font-size: 12px;
  }
  footer[data-chrome="footer"] .row-one {
    height: auto;
    padding: 18px 0;
    flex-wrap: wrap;
    gap: 14px 16px;
    white-space: normal;
  }
  footer[data-chrome="footer"] .brand { flex-basis: 100%; }
  footer[data-chrome="footer"] .logo-box { width: 30px; height: 30px; }
  footer[data-chrome="footer"] .logo-box img { width: 90px; height: 90px; }
  footer[data-chrome="footer"] .wordmark { font-size: 20px; }
  footer[data-chrome="footer"] .sources {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
    line-height: 1.5;
  }
  footer[data-chrome="footer"] .row-two {
    height: auto;
    padding: 14px 0 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    white-space: normal;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  main { transition: none; }
}
