/*
  Keystone's website. The colours are the app's: its accent blue
  (keystoneAccent: #2166d6 in light mode, #609cf5 in dark), the deep
  blue of the icon, and the orange of the keystone at the top of its arch.
  Light and dark follow the visitor's system setting.

  Author: Alexius Academia
  Date: 2026-10-25
*/

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f3f6fb;
  --card: #ffffff;
  --line: #dde4ef;
  --ink: #111a2c;
  --ink-soft: #4d5a70;
  --accent: #2166d6;
  --accent-soft: #e6eefc;
  --key: #f39a1e;
  --key-deep: #d97f08;
  --navy: #16357f;
  --code-bg: #0f1a33;
  --code-ink: #dce6f7;
  --shadow: 0 24px 60px rgba(17, 40, 96, 0.18);
  --radius: 14px;
  --wide: 1160px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #131922;
    --card: #171d27;
    --line: #273040;
    --ink: #e7ecf4;
    --ink-soft: #9ba7ba;
    --accent: #609cf5;
    --accent-soft: #1a2a45;
    --navy: #0f2257;
    --code-bg: #0a1224;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }

code, kbd { font-family: var(--mono); font-size: 0.88em; }
kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-soft);
  white-space: nowrap;
}
p code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  overflow-wrap: anywhere;
}

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 800px; }

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); font-weight: 760; }
h3 { font-size: 1.15rem; font-weight: 700; }

.sub { color: var(--ink-soft); margin: 12px 0 0; max-width: 64ch; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* The bar at the top */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(19, 46, 112, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@media (prefers-color-scheme: dark) {
  .top { background: rgba(11, 20, 44, 0.92); }
}

.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 8px; }

nav { display: flex; align-items: center; gap: 22px; }
nav a { color: rgba(255, 255, 255, 0.78); text-decoration: none; font-size: 0.95rem; }
nav a:hover { color: #fff; }
nav .pill { color: var(--navy); background: #fff; padding: 6px 16px; border-radius: 999px; font-weight: 650; }
nav .pill:hover { color: var(--navy); background: #e8effc; }

/* The hero: the icon's blue, ruled like a timescale */

.hero {
  color: #fff;
  text-align: center;
  padding: 76px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 72px),
    radial-gradient(ellipse at 50% 0%, rgba(120, 170, 255, 0.35), transparent 60%),
    linear-gradient(170deg, #2a67d9 0%, #1d47a8 55%, #16357f 100%);
}
@media (prefers-color-scheme: dark) {
  .hero {
    background:
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 72px),
      radial-gradient(ellipse at 50% 0%, rgba(96, 156, 245, 0.25), transparent 60%),
      linear-gradient(170deg, #173a86 0%, #10275e 55%, #0b1a40 100%);
  }
}

.hero-icon { margin: 0 auto 24px; filter: drop-shadow(0 16px 28px rgba(5, 15, 50, 0.45)); }
.hero .eyebrow { color: #ffd38a; }
.hero h1 { max-width: 22ch; margin: 0 auto; text-wrap: balance; }
.hero kbd { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.lead { max-width: 64ch; margin: 22px auto 0; font-size: 1.15rem; color: rgba(255, 255, 255, 0.84); }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

.button {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, background 0.15s ease;
}
.button:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.16); }
.button.primary { background: var(--key); border-color: var(--key); color: #1b1203; }
.button.primary:hover { background: #ffad3a; }

.hero-shot {
  margin: 56px auto -170px;
  max-width: 1080px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 40px 90px rgba(5, 15, 50, 0.45);
  background: var(--card);
  position: relative;
}
.hero-shot img { width: 100%; }

/* Sections */

section { padding: 88px 0; }
.hero + section { padding-top: 250px; }
.band { background: var(--bg-soft); }

.heads { text-align: center; }
.heads .sub { margin-left: auto; margin-right: auto; }

/* The headline features: words beside a picture, alternating */

.step {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2.2fr);
  gap: 48px;
  align-items: center;
  margin-top: 80px;
}
.step.flip { grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
.step.flip .words { order: 2; }
.step .words { min-width: 0; }
.step .figure, .step .shot { min-width: 0; }
.step .words p { color: var(--ink-soft); margin: 12px 0 0; }

.shot {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
}
.shot img { width: 100%; }
a.shot { display: block; transition: transform 0.15s ease; }
a.shot:hover { transform: translateY(-2px); }
figcaption, .caption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 10px; }
.figure { margin: 0; min-width: 0; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1b1203;
  background: var(--key);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: 3px;
  margin-left: 6px;
}

.mark {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.outline {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-ink);
  font: 0.78rem/1.6 var(--mono);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.outline .k { color: #8fb8ff; }
.outline .n { color: #ffcf7a; }
.outline .r { color: #7fe0c8; }

/* The S-Curve: two pictures side by side */

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 32px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.points li { padding-left: 18px; position: relative; color: var(--ink-soft); }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.points strong { color: var(--ink); }

/* Everything else */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.grid article::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  width: 44px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}
.grid article p { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.97rem; }

/* Views gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 40px;
}
.gallery .wide { grid-column: 1 / -1; }

/* Formats */

.table-scroll { overflow-x: auto; margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius); }
.formats { width: 100%; border-collapse: collapse; background: var(--card); font-size: 0.96rem; }
.formats th, .formats td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.formats th { background: var(--bg-soft); font-weight: 650; white-space: nowrap; }
.formats tr:last-child td { border-bottom: 0; }
.io td:nth-child(2), .io td:nth-child(3),
.io th:nth-child(2), .io th:nth-child(3) { text-align: center; white-space: nowrap; }
.formats td small { display: block; color: var(--ink-soft); }
.yes { color: var(--accent); font-weight: 700; }
.no { color: var(--ink-soft); }

/* Speed */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.stat b {
  display: block;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.stat span { display: block; margin-top: 6px; color: var(--ink-soft); }

/* Limits */

.limits ul { margin: 28px 0 0; padding: 0; list-style: none; }
.limits li {
  padding: 13px 0 13px 30px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.limits li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 25px;
  width: 12px;
  height: 2px;
  background: var(--key);
}
.note {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
}

/* Downloads */

.downloads { text-align: center; }
.downloads .sub { margin-left: auto; margin-right: auto; }
.cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }

.card {
  flex: 1 1 240px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(17, 40, 96, 0.3); }
.card strong { font-size: 1.2rem; }
.card span { color: rgba(255, 255, 255, 0.75); font-size: 0.92rem; }
.card.pending { background: var(--card); color: var(--ink); border: 1.5px dashed var(--line); }
.card.pending span { color: var(--ink-soft); }
.card.pending strong::after {
  content: "Coming soon";
  margin-left: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
  vertical-align: 3px;
}

/* The privacy page */

.privacy { padding-top: 60px; }
.privacy h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); }
.privacy h2 { font-size: 1.4rem; margin-top: 40px; }
.privacy p, .privacy ul { margin: 14px 0 0; }
.privacy li { margin-top: 6px; }
.privacy code { overflow-wrap: anywhere; }

/* The foot */

footer { background: var(--navy); color: rgba(255, 255, 255, 0.72); padding: 28px 0; font-size: 0.92rem; }
@media (prefers-color-scheme: dark) { footer { background: #0a1430; } }
footer a { color: #fff; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Narrow screens */

@media (max-width: 900px) {
  .step, .step.flip { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 56px; }
  .step.flip .words { order: 0; }
  .pair, .gallery { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  nav a:not(.pill) { display: none; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 48px; }
  .hero-shot { margin: 40px auto -70px; }
  .hero + section { padding-top: 130px; }
  section { padding: 60px 0; }
  .grid { grid-template-columns: 1fr; }
  .lead { font-size: 1.05rem; }
}

@media (max-width: 600px) {
  .io thead { display: none; }
  .io tr {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 6px 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  .io tr:last-child { border-bottom: 0; }
  .formats.io td { border: 0; padding: 0; text-align: left; }
  .io td:first-child, .io td:last-child { grid-column: 1 / -1; }
  .io td:nth-child(2)::before { content: "Read "; }
  .io td:nth-child(3)::before { content: "Write "; }
  .io td:nth-child(2)::before, .io td:nth-child(3)::before { color: var(--ink-soft); font-weight: 400; }
  .io td:last-child { color: var(--ink-soft); font-size: 0.93rem; }
}

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