:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #dde1e6;
  --accent: #2f6fd6;
  --accent-text: #ffffff;
  --code-bg: #eef1f5;
  --warn-bg: #fff6e0;
  --warn-line: #f0d48a;
  --accent-soft: #e4edfc;
  --visited: #6b4fbb;
  --accent-strong: #2159b8;
  --bad: #d64545;
}
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --card: #1a1f25;
    --text: #e6e9ed;
    --muted: #9aa4b0;
    --line: #2c333b;
    --accent: #6a9cf0;
    --accent-text: #0d1117;
    --code-bg: #232a32;
    --warn-bg: #2e2716;
    --warn-line: #6b5a24;
    --accent-soft: #1d2a40;
    --visited: #b59cf5;
    --accent-strong: #6a9cf0;
    --bad: #f07070;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 40px 16px 64px; }
header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
header img { width: 36px; height: 36px; flex: none; }
header h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
a { color: var(--accent); }
a:visited { color: var(--visited); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
}
ol { padding-left: 1.3em; margin: 0 0 14px; }
li { margin-bottom: 10px; }
.qr { display: flex; justify-content: center; margin: 8px 0 18px; }
.qr svg {
  width: min(280px, 100%);
  height: auto;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
}
.cmd {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
code, .cmd pre {
  font: 13px/1.5 "Illinois Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  border-radius: 6px;
}
code { padding: 1px 5px; }
.cmd pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre;
}
button {
  font: inherit;
  font-size: 0.9rem;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmd pre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 500;
}
a.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.93rem;
}
.hidden { display: none; }
footer { margin-top: 28px; font-size: 0.85rem; color: var(--muted); }
footer a, footer button.link { color: inherit; }
/* Who makes it, and its licence (#129). */
footer p.made { margin: 8px 0 0; }
/* The flag keeps its colours, whatever the theme (#325). */
footer p.made img { vertical-align: -1px; border-radius: 1px; filter: none; forced-color-adjust: none; }
button.link {
  background: none;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}
dialog {
  max-width: min(560px, calc(100vw - 32px));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
}
dialog > div { padding: 22px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog h2 { margin-bottom: 14px; }
dialog h3 { font-size: 1rem; margin: 16px 0 6px; }
dialog p { font-size: 0.93rem; }
dialog .close { display: flex; justify-content: flex-end; margin-top: 8px; }
dialog .close button { padding: 8px 16px; }
#install-dialog { max-width: min(720px, calc(100vw - 32px)); }
#install-dialog .landing-section { margin-bottom: 0; }

/* The page without a link in it: what Iceblock is. */
body.landing main { max-width: 1040px; }
body.landing footer { text-align: center; }
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  margin: 8px 0 72px;
}
.hero h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin: 12px 0 18px;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
a.button.quiet {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.landing-section { margin-bottom: 80px; }
.landing-section > h2, .wide > div > h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.landing-section > .lede { margin-bottom: 32px; }
.wide > div > .lede { margin-bottom: 14px; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.steps .card { margin: 0; }
.steps h3, .features h3 { font-size: 1.05rem; margin: 14px 0 6px; }
.steps h3::before {
  counter-increment: step;
  content: counter(step) ". ";
  color: var(--accent);
}
.steps p, .features p { color: var(--muted); margin: 0; }
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.features .card { margin: 0; }
.features h3 { margin-top: 12px; }
.icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.icon svg { width: 22px; height: 22px; }
.wide { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; align-items: center; }
.platforms { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
button.platform {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 14px;
  font-size: 1rem;
  font-weight: 500;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
}
button.platform .logo { height: 30px; width: auto; }
button.platform svg.logo { height: 22px; }
button.platform[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Diagrams: drawn with the page's colours, so they follow dark mode. */
.diagram { width: 100%; height: auto; display: block; color: var(--text); }
.diagram .dev { color: var(--muted); }
.diagram .hub { fill: var(--accent-soft); }
.diagram .accent { color: var(--accent); }
.diagram .wire { stroke: var(--line); stroke-width: 2; fill: none; }
.diagram .flow {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 3 7;
  stroke-linecap: round;
  animation: flow 1.6s linear infinite;
}
.diagram .arrow { stroke: var(--muted); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.diagram .box { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.diagram .gone { opacity: 0.3; }
.diagram .cross { stroke: var(--bad); stroke-width: 3; stroke-linecap: round; }
.diagram .p1 { fill: #4c8df6; } .diagram .p2 { fill: #f2a33a; } .diagram .p3 { fill: #3fb68b; }
.diagram .p4 { fill: #e0607e; } .diagram .p5 { fill: #9b7bf0; } .diagram .p6 { fill: #33b3c9; }
.diagram .locked { fill: var(--muted); opacity: 0.55; }
@keyframes flow { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .diagram .flow { animation: none; } }

@media (max-width: 820px) {
  .hero, .wide { grid-template-columns: 1fr; }
  .steps, .features { grid-template-columns: 1fr; }
  .hero { margin-bottom: 56px; }
  .landing-section { margin-bottom: 56px; }
}
@media (min-width: 821px) and (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

/* The documentation (#306): its pages listed beside the one shown, or
   above it on a phone. */
body.docs main { max-width: 1040px; }
body.docs header a { color: inherit; text-decoration: none; display: flex; }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li { margin: 0 0 4px; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.docs-nav a:hover { background: var(--accent-soft); }
.docs-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.docs-content h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.docs-content li { margin: 4px 0; }
.docs-content code { font-family: "Illinois Mono", ui-monospace, monospace; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; overflow-wrap: anywhere; }
/* A block's lines keep their shape, and scroll instead. */
.docs-content pre code { overflow-wrap: normal; }
.docs-content pre { background: var(--code-bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.docs-content pre code { background: none; padding: 0; }
/* Tables, as the SDK's pages use them; wide ones scroll on a phone. */
.docs-content table { display: block; overflow-x: auto; border-collapse: collapse; margin: 12px 0; font-size: 0.95em; }
.docs-content th, .docs-content td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.docs-content th { font-weight: 600; }
/* What's built, planned, missing or still to decide (/sdk/). */
.status { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.82em; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); }
.status.built { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft); }
.status.planned { color: var(--muted); }
.status.gap { background: var(--warn-bg); border-color: var(--warn-line); }
.status.open { border-style: dashed; color: var(--visited); border-color: var(--visited); }
@media (max-width: 720px) {
  /* minmax(0, …): never wider than the screen, however long a line of
     code (#615). */
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
}
/* The licence's text (#713): as it's written, wrapped to the page. */
.licence-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: "Illinois Mono", ui-monospace, monospace; font-size: 0.85em; background: var(--code-bg); padding: 12px; border-radius: 8px; }
