/* One lattice for the wallpaper, navigation and both marketing pages. The
   origin sits at the top midpoint of the viewport on every screen size. */
body {
  --grid-step: 36px;
  --grid-bar-height: calc(2 * var(--grid-step));
  --grid-pair: calc(2 * var(--grid-step));
  --grid-edge: rgba(255,255,255,.24);
  --grid-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath d='M18 0v36M0 18h36' stroke='white' stroke-opacity='.12' fill='none'/%3E%3Cpath d='M18 15v6m-3-3h6' stroke='white' stroke-opacity='.35' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  --grid-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath d='M18 0v36M0 18h36' stroke='black' stroke-opacity='.12' fill='none'/%3E%3Cpath d='M18 15v6m-3-3h6' stroke='black' stroke-opacity='.4' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  --grid-paper: var(--grid-white), radial-gradient(rgba(255,255,255,.08) .45px, transparent .8px);
  --grid-size: var(--grid-step) var(--grid-step), 3px 3px;
  --grid-position: center calc(var(--grid-step) / -2), center top;
  background: #000;
  isolation: isolate;
}

@media (max-width: 1040px) {
  body { --grid-step: 28px; }
}

body::before, .mf-panel::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--grid-paper);
  background-size: var(--grid-size);
  background-position: var(--grid-position);
}

/* The clipped footer reveals the same lattice in dark ink, in the exact
   viewport coordinates used by the surrounding black paper. */
.mf-panel {
  isolation: isolate;
  clip-path: inset(0 round 0 0 28px 28px);
  --grid-paper: var(--grid-dark), radial-gradient(rgba(0,0,0,.08) .45px, transparent .8px);
}

.frame > section { background: transparent !important; }
.mf, .fl-win { background: transparent; }
.su-sticky::before { content: none; }

.nav {
  height: var(--grid-bar-height);
  border: 0;
  box-shadow: inset 0 -1px var(--grid-edge);
  background: rgba(5,5,6,.94);
}
.nav-in {
  height: 100%;
  width: 100%;
  width: round(down, 100%, var(--grid-pair));
  box-shadow: inset 1px 0 var(--grid-edge), inset -1px 0 var(--grid-edge);
}
.nav .logo, .mm-trig, .mm-link, .nav-right, .nav .menu-btn {
  border: 0;
  box-shadow: inset 1px 0 var(--grid-edge), inset -1px 0 var(--grid-edge);
}
.nav .logo {
  flex: 0 0 calc(4 * var(--grid-step));
  padding: 0;
  justify-content: center;
}
.nav .mm { display: flex; }
.nav .mm-trig, .nav .mm-link {
  justify-content: center;
  width: calc(3 * var(--grid-step));
  padding: 0;
}
.nav-right { display: flex; align-items: stretch; }
.nav-sign-cell {
  display: grid;
  place-items: center;
  width: calc(3 * var(--grid-step));
}
.nav .nav-cta { margin: 0; white-space: nowrap; }
.nav .menu-btn { display: none; }

@media (max-width: 1040px) {
  .nav .logo { flex-basis: calc(5 * var(--grid-step)); }
  .nav-sign-cell { width: calc(4 * var(--grid-step)); }
}
@media (max-width: 760px) {
  .nav .mm { display: none; }
  .nav .menu-btn {
    display: inline-grid;
    place-items: center;
    width: var(--grid-pair);
    height: 100%;
    color: var(--text);
  }
  .nav .menu-btn svg { width: 18px; height: 18px; }
  .nav .mm.open {
    display: block;
    position: absolute;
    inset: 100% 0 auto;
    margin: 0 auto;
    width: 100%;
    width: round(down, 100%, var(--grid-pair));
    height: auto;
    max-height: calc(100dvh - var(--grid-bar-height));
    overflow: auto;
    overscroll-behavior: contain;
    background: #101013;
    border: 1px solid var(--grid-edge);
  }
  .nav .mm-wrap { height: auto; }
  .nav .mm-trig, .nav .mm-link {
    width: 100%;
    height: var(--grid-bar-height);
    justify-content: space-between;
    padding: 0 var(--grid-step);
    box-shadow: inset 0 -1px var(--grid-edge);
  }
  .mm-panel { display: none; }
  .mm-wrap.open .mm-panel {
    display: grid; position: static; width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px; transform: none; border: 0; border-radius: 0;
    box-shadow: inset 0 -1px var(--grid-edge); background: #181819;
  }
  .mm-wrap.open .mm-panel::before { content: none; }
  .mm-col, .mm-col + .mm-col { padding: 4px; border: 0; }
  .mm-item { grid-template-columns: 24px 1fr; gap: 10px; padding: 8px; }
  .mm-ic { width: 24px; height: 24px; border: 0; background: none; box-shadow: none; }
  .mm-ic svg { width: 20px; height: 20px; }
  .mm-item b { font-size: 15px; }
  .mm-item small { font-size: 12px; }
}
@media (max-width: 500px) {
  .mm-wrap.open .mm-panel { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 359px) {
  .nav .logo { flex-basis: calc(4 * var(--grid-step)); gap: 5px; }
  .nav .logo .logo-mark { width: 21px; height: 21px; }
  .nav .logo-word { font-size: 26px; }
  .nav-sign-cell { width: calc(4 * var(--grid-step)); }
}

/* Even cell counts keep the panel, its columns and action boundaries on
   the same vertical lines as the black surround. */
.mf {
  --footer-unit: calc(6 * var(--grid-step));
  padding: 0 0 var(--grid-step);
}
.mf-panel {
  width: calc(100% - var(--grid-step));
  width: round(down, calc(100% - var(--grid-step)), var(--grid-pair));
  max-width: calc(40 * var(--grid-step));
  padding: var(--grid-step) 0 0;
}
.mf-top, .mf-cols {
  width: calc(100% - var(--grid-pair));
  width: round(down, calc(100% - var(--grid-pair)), var(--footer-unit));
  margin-inline: auto;
}
.mf-top { gap: var(--grid-step) !important; }
.mf-links {
  min-height: var(--grid-step);
  gap: 0;
  justify-content: center;
}
.mf-links a {
  width: var(--grid-pair);
  min-height: var(--grid-step);
  display: grid;
  place-items: center;
}
@media (min-width: 610px) {
  .mf-links a { width: calc(3 * var(--grid-step)); }
}
.mf-links a:last-child { width: calc(4 * var(--grid-step)); }
.mf-right, .mf-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 0 !important;
}
.mf-right { width: 100%; }
.mf-right .mf-btn {
  justify-self: stretch;
  justify-content: center;
  height: var(--grid-bar-height);
  padding: 0 4px;
  border-radius: 0;
  box-shadow: inset -1px 0 #444;
}
.mf-cols { margin-top: var(--grid-bar-height); }
.mf-cols > div { align-items: stretch; gap: 0; }
.mf-cols h6, .mf-cols a {
  min-height: var(--grid-step);
  margin: 0;
  display: grid;
  place-items: center;
}
.mf-cols h6 { color: #652307; }
.mf-cols a:hover { background: rgba(0,0,0,.04); }
@media (max-width: 539px) {
  .mf-top, .mf-cols { width: calc(100% - var(--grid-pair)); }
  .mf-right, .mf-cols { grid-template-columns: 1fr !important; }
  .mf-cols > div + div { margin-top: var(--grid-step); }
  .mf-btn + .mf-btn { box-shadow: inset 0 1px #444; }
}
/* The hero uses the same centered lattice as the header, without extra
   side padding or the old fixed-width frame rails crossing its grid. */
.frame:has(> .mh) { border-inline: 0; }
.mh-content {
  width: 100%;
  width: round(down, 100%, var(--grid-pair));
  margin-inline: auto;
  padding-top: var(--grid-bar-height) !important;
  padding-inline: 0 !important;
}
/* One wallpaper row tall; opening a label only redistributes columns. */
.mh .modes {
  --open-mode-width: calc(4 * var(--grid-step));
  display: flex;
  justify-content: center;
  gap: 0 !important;
  margin: 0 0 var(--grid-step);
  height: var(--grid-step);
  align-items: stretch;
}
.mh .mode {
  flex: 0 0 auto;
  width: var(--grid-pair);
  justify-content: center;
  height: var(--grid-step) !important;
  padding: 0 !important;
  gap: 0 !important;
  border: 0;
  border-radius: 0;
  color: #c4c3bf;
  background: rgba(8,8,8,.88);
  box-shadow: inset 1px 0 var(--grid-edge), inset 0 1px var(--grid-edge), inset 0 -1px var(--grid-edge);
  transition: width .3s, color .18s, background .18s !important;
}
.mh .mode:last-child { border-right: 1px solid var(--grid-edge); }
.mh .mode[aria-pressed="true"], .mh .modes:not(:has([aria-pressed="true"])) .mode:first-child {
  width: var(--open-mode-width);
}
.mh .mode[aria-pressed="true"] {
  color: #fff;
  background: #281712;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.mh .mode:is(:hover,:focus-visible) .mode-lbl { max-width: 0; opacity: 0; margin: 0; }
.mh .mode[aria-pressed="true"] .mode-lbl,
.mh .modes:not(:has([aria-pressed="true"])) .mode:first-child .mode-lbl {
  max-width: 80px;
  opacity: 1;
  margin-left: 8px;
}
@media (max-width: 359px) {
  .mh .modes { --open-mode-width: var(--grid-pair); }
  .mh .mode { flex-direction: row; font-size: 11px; }
  .mh .mode svg { width: 14px; height: 14px; flex-basis: 14px; }
  .mh .mode:not([aria-pressed="true"]) .mode-lbl { height: 0; }
  .mh .mode[aria-pressed="true"] .mode-lbl,
  .mh .modes:not(:has([aria-pressed="true"])) .mode:first-child .mode-lbl {
    height: auto;
    margin: 0 0 0 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mh .mode, .mh .mode .mode-lbl { transition: none !important; }
}
