/* 0xAF-Re project page.
 *
 * Single dark theme on purpose: the subject is a terminal deck, and its palette
 * (internal/ui/theme.go, "deck") is what the page is built from. A light
 * repaint would describe a tool nobody runs on a white screen.
 *
 * No webfonts, no external requests of any kind — the page is as self-contained
 * as the binary it documents. */

:root {
  --ground: #0b0f14;
  --panel: #0f151d;
  --panel-lift: #141c26;
  --rule: #22303f;
  --rule-soft: #1a232e;
  --ink: #e2e8f0;
  --muted: #8296ad;
  --faint: #5b6b80;
  --accent: #22d3ee;
  --accent-dim: #0e7490;
  --violet: #a78bfa;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;

  --step--1: 0.78rem;
  --step-0: 0.94rem;
  --step-1: 1.06rem;
  --step-2: 1.35rem;
  --step-3: 1.85rem;
  --step-4: 2.6rem;

  --gap: 1.1rem;
  --shell: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  /* A faint scanline wash, fixed so it reads as the surface and not as content. */
  background-image: linear-gradient(
    180deg,
    rgba(34, 211, 238, 0.045) 0%,
    rgba(11, 15, 20, 0) 42%
  );
  background-repeat: no-repeat;
  background-size: 100% 900px;
}

a {
  color: var(--accent);
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--accent);
}

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

code,
kbd,
pre,
.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

/* --- shell -------------------------------------------------------------- */

.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 20, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0.6rem 0;
  font-family: var(--mono);
  font-size: var(--step--1);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand b {
  color: var(--ground);
  background: var(--accent);
  padding: 0.05em 0.45ch;
}

.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 1.2ch;
  flex-wrap: wrap;
  color: var(--faint);
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
  color: var(--accent);
}

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

.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 2rem;
  display: grid;
  gap: 1.6rem;
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--faint);
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 700;
  text-wrap: balance;
}

.hero h1 span {
  color: var(--accent);
}

.hero__lede {
  margin: 0;
  max-width: 66ch;
  font-size: var(--step-1);
  color: #cfd8e5;
}

.hero__lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.pill {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.25rem 0.85ch;
  white-space: nowrap;
}

.pill b {
  color: var(--ink);
  font-weight: 600;
}

/* --- command line ------------------------------------------------------- */

.cmd {
  display: flex;
  align-items: center;
  gap: 1ch;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.7rem 1ch;
  font-family: var(--mono);
  font-size: var(--step-0);
  overflow-x: auto;
}

.cmd__prompt {
  color: var(--accent);
  user-select: none;
}

.cmd code {
  white-space: pre;
}

.caret {
  width: 0.6ch;
  height: 1.1em;
  background: var(--accent);
  animation: blink 1.15s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.copy {
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.2rem 0.8ch;
  cursor: pointer;
}

.copy:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

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

section {
  padding: 2.6rem 0;
  border-top: 1px solid var(--rule-soft);
}

.label {
  display: flex;
  align-items: center;
  gap: 1ch;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.7rem;
}

.label::before {
  content: "▏";
  color: var(--accent-dim);
}

h2 {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: var(--step-3);
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 700;
  text-wrap: balance;
}

h3 {
  margin: 1.8rem 0 0.4rem;
  font-family: var(--mono);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--ink);
}

p {
  max-width: 72ch;
  margin: 0 0 1rem;
}

p.wide {
  max-width: none;
}

.muted {
  color: var(--muted);
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  max-width: none;
  margin-top: 1.2rem;
}

.download {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.22rem 0.9ch;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-decoration: none;
  white-space: nowrap;
}

.download:hover,
.download:focus-visible {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.community-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 10rem);
  gap: 1rem;
  align-items: center;
  max-width: 56rem;
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
}

.community-invite h3 {
  margin-top: 0;
}

.community-invite p:last-child {
  margin-bottom: 0;
}

.qr-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.qr-link img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin-top: 1.3rem;
}

.promo-tile {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
}

.promo-tile:hover,
.promo-tile:focus-visible {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.promo-tile img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--ground);
}

.promo-tile span {
  min-height: 1.6rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.35;
}

.promo-tile--wide {
  grid-column: 1 / -1;
}

.promo-tile--qr img {
  aspect-ratio: 1;
  object-fit: cover;
  background: #f8fafc;
}

@media (max-width: 620px) {
  .community-invite {
    grid-template-columns: 1fr;
  }

  .qr-link {
    max-width: 12rem;
  }

  .promo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .promo-tile {
    padding: 0.5rem;
  }

  .promo-tile--wide {
    grid-column: 1 / -1;
  }
}

/* --- captures ----------------------------------------------------------- */

figure.capture {
  margin: 1.4rem 0 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

figure.capture > .capture__bar {
  display: flex;
  align-items: center;
  gap: 1ch;
  padding: 0.45rem 1ch;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--faint);
  background: var(--panel-lift);
}

.capture__bar span.dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--rule);
  flex: none;
}

figure.capture > .capture__scroll {
  overflow-x: auto;
  padding: 0.6rem;
}

figure.capture img {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

figcaption {
  padding: 0.6rem 1ch 0.8rem;
  border-top: 1px solid var(--rule-soft);
  font-size: var(--step--1);
  color: var(--muted);
  max-width: 84ch;
}

/* --- grids -------------------------------------------------------------- */

.cols {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  margin-top: 1.4rem;
}

.card {
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  background: var(--panel);
  padding: 1rem 1.1rem;
}

.card h4 {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: var(--step-0);
  color: var(--accent);
  font-weight: 700;
}

.card p {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
  max-width: none;
  line-height: 1.6;
}

.card p + p {
  margin-top: 0.5rem;
}

/* --- data --------------------------------------------------------------- */

.tablewrap {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 0.5rem 1ch;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

thead th {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  background: var(--panel);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code,
td .mono {
  color: var(--ink);
}

pre.block {
  margin: 1.1rem 0;
  padding: 0.9rem 1ch;
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  border-left: 2px solid var(--accent-dim);
  border-radius: 6px;
  overflow-x: auto;
  font-size: var(--step--1);
  line-height: 1.62;
  color: #cfd8e5;
}

pre.block .c {
  color: var(--faint);
}

pre.block .k {
  color: var(--accent);
}

pre.block .v {
  color: var(--violet);
}

code.inline {
  background: var(--panel-lift);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: 0.05em 0.45ch;
  font-size: 0.92em;
  color: #d5deea;
}

ul.tight,
ol.tight {
  max-width: 72ch;
  padding-left: 2.2ch;
  margin: 0 0 1rem;
}

ul.tight li,
ol.tight li {
  margin-bottom: 0.4rem;
}

ul.marks {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-width: 72ch;
}

ul.marks li {
  padding-left: 2.4ch;
  position: relative;
  margin-bottom: 0.45rem;
}

ul.marks li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
  font-family: var(--mono);
}

.tier {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.05em 0.6ch;
  border-radius: 3px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.tier--read {
  color: var(--ok);
}

.tier--write {
  color: var(--warn);
}

.tier--exec {
  color: var(--violet);
}

.tier--ask {
  color: var(--err);
}

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

footer {
  border-top: 1px solid var(--rule-soft);
  padding: 2.4rem 0 3.4rem;
  color: var(--muted);
  font-size: var(--step--1);
}

footer .scope {
  font-family: var(--mono);
  color: var(--faint);
  max-width: 78ch;
}

footer a {
  color: var(--muted);
}

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

@media (max-width: 620px) {
  :root {
    --step-4: 2rem;
    --step-3: 1.5rem;
  }
  .topbar nav {
    display: none;
  }
}
