/* Snap It - technical instrument panel: dark ground, fine grid, one accent
   ramp taken straight from the app icon. */

:root {
  --ink: #e8ecf4;
  --ink-dim: #8e97ab;
  --ink-faint: #59617450;
  --ground: #0b0d12;
  --panel: #12151d;
  --line: #1f2430;
  /* One hue per step, the spectrum the Sequences app uses. */
  --red: #ef4444;
  --orange: #f97316;
  --amber: #eab308;
  --green: #22c55e;
  --teal: #14b8a6;
  --cyan: #06b6d4;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --lime: #84cc16;
  --pink: #ec4899;

  --accent: var(--blue);
  --ok: var(--green);
  --rule: 1px solid var(--line);
  /* One light source, top left. Every coloured surface gets the same sheen
     and the same top edge highlight so the gloss reads as one material. */
  --gloss: linear-gradient(168deg,
    rgba(255, 255, 255, 0.28),
    rgba(255, 255, 255, 0.06) 42%,
    rgba(255, 255, 255, 0) 64%);
  --gloss-edge: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(760px 520px at 82% -8%, #16305e 0%, transparent 62%),
    radial-gradient(620px 460px at 4% 18%, #0d3b45 0%, transparent 58%),
    radial-gradient(700px 500px at 0% 100%, #2a1550 0%, transparent 55%),
    var(--ground);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* Blueprint grid behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ink-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-faint) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.5;
  z-index: 0;
}

main, footer { position: relative; z-index: 1; }

a { color: inherit; }

h1, h2, h3, .display {
  font-family: Archivo, "Archivo Expanded", ui-sans-serif, sans-serif;
  font-variation-settings: "wdth" 112;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: 0;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: var(--pad);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

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

/* The full spectrum as a hairline, so the palette reads before you scroll. */
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg,
    var(--red), var(--orange), var(--amber), var(--green),
    var(--teal), var(--cyan), var(--blue), var(--violet));
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: var(--rule);
  background: var(--ground);
}

/* Translucent only where the blur is real, so text can never show through. */
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  header {
    background: color-mix(in srgb, var(--ground) 82%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
}

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
}

.bar img { width: 28px; height: 28px; }

.bar .name {
  font-family: Archivo, sans-serif;
  font-variation-settings: "wdth" 125;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bar nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 22px;
  font-size: 13px;
  color: var(--ink-dim);
}

.bar nav a { text-decoration: none; transition: color 0.15s; }
.bar nav a:hover, .bar nav a:focus-visible { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(44px, 8vw, 92px);
}

.hero > * { min-width: 0; }

.hero h1 {
  font-size: clamp(36px, 4.6vw, 60px);
  font-variation-settings: "wdth" 125;
  text-transform: uppercase;
}

.hero h1 .split {
  display: block;
  white-space: nowrap;
  background: linear-gradient(96deg, var(--cyan), var(--blue) 42%, var(--violet) 78%, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--ink-dim);
  max-width: min(46ch, 100%);
  margin: 22px 0 30px;
}

.lede strong { color: var(--ink); font-weight: 500; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; min-width: 0; }

.copy {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: var(--rule);
  background-color: var(--panel);
  background-image: var(--gloss);
  box-shadow: var(--gloss-edge);
  border-radius: 8px;
  padding: 11px 13px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, transform 0.1s;
}

.copy:hover { border-color: #2f3950; }
.copy:active { transform: translateY(1px); }
.copy .k { color: var(--ink-dim); flex: none; }
.copy #cmd { min-width: 0; overflow-wrap: anywhere; }
.copy .tick { color: var(--ok); opacity: 0; transition: opacity 0.2s; }
.copy.done .tick { opacity: 1; }

.ghost {
  text-decoration: none;
  font-size: 13px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(96deg, var(--cyan), var(--violet)) border-box;
  border: 1px solid transparent;
  transition: filter 0.15s;
}

.ghost:hover { filter: brightness(1.35); }

/* ---------- grid demo ---------- */

.demo {
  border: var(--rule);
  border-radius: 14px;
  background: linear-gradient(#141821, #0e1117);
  padding: 16px;
  box-shadow: 0 30px 70px -40px #000;
}

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #090b10;
  border: var(--rule);
  overflow: hidden;
}

.cells {
  position: absolute;
  inset: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
}

.cells i {
  border-radius: 3px;
  background: #ffffff07;
}

.tile {
  position: absolute;
  border-radius: 6px;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--tile, var(--blue)) 92%, white),
    var(--tile, var(--blue)));
  background-image: var(--gloss),
    linear-gradient(140deg,
      color-mix(in srgb, var(--tile, var(--blue)) 92%, white),
      var(--tile, var(--blue)));
  box-shadow: var(--gloss-edge),
    0 10px 34px -10px var(--tile, var(--blue)),
    0 0 60px -20px var(--tile, var(--blue));
  transition: all 420ms cubic-bezier(0.22, 1, 0.36, 1), background 300ms linear;
  display: grid;
  place-items: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #fff;
  text-transform: uppercase;
}

.demo figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-dim);
}

.demo figcaption b { color: var(--ink); font-weight: 500; }
.demo figcaption span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- stats ---------- */

/* Held to the same measure as the rest of the page: full bleed leaves the
   four figures marooned on a wide display. The inset lives on the wrapper so
   the four columns stay equal width. */
.stats-wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: var(--rule);
  border-bottom: var(--rule);
}

.stats > div {
  padding: 26px 20px;
  border-left: var(--rule);
}

.stats > div:first-child { border-left: 0; }

.stats > div:nth-child(1) .n { color: var(--red); }
.stats > div:nth-child(2) .n { color: var(--amber); }
.stats > div:nth-child(3) .n { color: var(--green); }
.stats > div:nth-child(4) .n { color: var(--cyan); }

.stats .n {
  text-shadow: 0 0 26px color-mix(in srgb, currentColor 45%, transparent);
  font-family: Archivo, sans-serif;
  font-variation-settings: "wdth" 125;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 6px;
}

.stats .l { font-size: 12px; color: var(--ink-dim); }

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

#keys { --accent: var(--amber); }
#install { --accent: var(--green); }
#config { --accent: var(--teal); }
#why { --accent: var(--cyan); }

section {
  padding-block: clamp(46px, 8vw, 86px);
  scroll-margin-top: 76px;
}

section h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-variation-settings: "wdth" 118;
  margin-bottom: 8px;
}

section h2::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 12px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

section > .wrap > p.sub {
  color: var(--ink-dim);
  margin: 0 0 30px;
  max-width: 62ch;
}

/* keys table */

.keys { width: 100%; border-collapse: collapse; font-size: 13px; }


.keys th {
  text-align: left;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0 14px 10px;
  border-bottom: var(--rule);
}

.keys td { padding: 11px 14px; border-bottom: var(--rule); }

.keys tbody { counter-reset: step; }

.keys tbody tr { cursor: pointer; transition: background 0.14s; }

/* Ten layouts, ten steps around the wheel, so no two rows share a colour.
   Cycle length matches the number of shipped layouts. */
.keys tbody tr:nth-child(10n + 1) { --row: var(--red); }
.keys tbody tr:nth-child(10n + 2) { --row: var(--orange); }
.keys tbody tr:nth-child(10n + 3) { --row: var(--amber); }
.keys tbody tr:nth-child(10n + 4) { --row: var(--lime); }
.keys tbody tr:nth-child(10n + 5) { --row: var(--green); }
.keys tbody tr:nth-child(10n + 6) { --row: var(--teal); }
.keys tbody tr:nth-child(10n + 7) { --row: var(--cyan); }
.keys tbody tr:nth-child(10n + 8) { --row: var(--blue); }
.keys tbody tr:nth-child(10n + 9) { --row: var(--violet); }
.keys tbody tr:nth-child(10n + 10) { --row: var(--pink); }

.keys tbody td:first-child::before {
  content: counter(step);
  counter-increment: step;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 12px;
  border-radius: 50%;
  background-color: var(--row);
  background-image: var(--gloss);
  box-shadow: var(--gloss-edge), 0 0 12px -5px var(--row);
  color: #08090d;
  font-size: 11px;
  font-weight: 500;
  vertical-align: -4px;
}

.keys tbody tr td:nth-child(2) kbd {
  border-color: color-mix(in srgb, var(--row) 55%, transparent);
  background-color: color-mix(in srgb, var(--row) 12%, var(--panel));
  background-image: var(--gloss);
  box-shadow: var(--gloss-edge);
  color: var(--ink);
}

/* A 6 x 6 miniature of the hero grid, one per row, so "Center Two Thirds"
   reads as a shape and not just a name. Two nodes per row rather than 36
   cells: the grid is painted, only the region is an element. */
.gap-above { margin-top: 1.4rem; }

.mini {
  position: relative;
  display: block;
  width: 48px;
  height: 30px;
  border: var(--rule);
  border-radius: 4px;
  background:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 5px);
  background-color: #0b0d13;
}

.mini i {
  position: absolute;
  left: calc(var(--mx) * 100%);
  top: calc(var(--my) * 100%);
  width: calc(var(--mw) * 100%);
  height: calc(var(--mh) * 100%);
  border-radius: 2px;
  /* Translucent colour so the grid reads through, with the sheen painted on
     top at full strength rather than faded with it. */
  background-color: color-mix(in srgb, var(--row, var(--cyan)) 46%, transparent);
  background-image: var(--gloss);
  box-shadow: var(--gloss-edge);
  transition: background-color 0.16s, box-shadow 0.16s;
}

.keys tbody tr:hover .mini i,
.keys tbody tr[aria-current="true"] .mini i {
  background-color: color-mix(in srgb, var(--row) 82%, transparent);
  box-shadow: var(--gloss-edge), 0 0 14px -3px var(--row);
}

.keys tbody tr:hover, .keys tbody tr:focus-visible { background: #ffffff08; outline: none; }
.keys tbody tr[aria-current="true"] {
  background: color-mix(in srgb, var(--row) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--row);
}

kbd {
  font: inherit;
  font-size: 12px;
  border: var(--rule);
  background: var(--panel);
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
}

/* cards + code */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.card {
  position: relative;
  overflow: hidden;
  border: var(--rule);
  border-radius: 12px;
  padding: 22px;
  background: linear-gradient(#12161f, #0d1016);
  box-shadow: var(--gloss-edge);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
}

.cards .card:nth-child(1) { --card-accent: var(--teal); }
.cards .card:nth-child(2) { --card-accent: var(--cyan); }
.cards .card:nth-child(3) { --card-accent: var(--violet); }

.card h3 span.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--card-accent, var(--accent));
}

.card h3 { font-size: 16px; font-variation-settings: "wdth" 112; margin-bottom: 8px; }
.card p { color: var(--ink-dim); margin: 0; font-size: 13.5px; }

pre {
  border: var(--rule);
  border-radius: 12px;
  background: #0a0d13;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.75;
  margin: 0;
}

code { color: #cdd6e6; }
.c-key { color: #7fb4ff; }
.c-str { color: #b592ff; }
.c-num { color: var(--ok); }
.c-com { color: #5b6479; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

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

footer {
  border-top: var(--rule);
  padding-block: 34px;
  font-size: 12.5px;
  color: var(--ink-dim);
}

footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

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

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: var(--rule); }
  .cards, .two { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .bar nav { gap: 16px; }
  .bar nav a:nth-child(1), .bar nav a:nth-child(3) { display: none; }
  .keys th:nth-child(4), .keys td:nth-child(4) { display: none; }
  .copy { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  html { scroll-behavior: auto; }
}
