/* groundboard's home page. Tokens follow DESIGN.md: cool slate neutrals, colour spent on
   grounding (checked, spec only, unresolved), monospace for anything quoted from code. The
   indigo accent is provisional, so the page leads with ink rather than building on it. */

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --panel: #ffffff;
  --on-ink: #f8fafc;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --open: #b54708;
  --open-soft: #fffaeb;
  --grid: rgb(15 23 42 / 0.05);
  --focus: #4f46e5;
  --sans:
    Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono:
    ui-monospace, "Cascadia Code", "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e2e8f0;
    --ink-soft: #cbd5e1;
    --muted: #94a3b8;
    --line: #1e293b;
    --line-strong: #334155;
    --surface: #0b1120;
    --surface-2: #0f172a;
    --panel: #111827;
    --on-ink: #0b1120;
    --ok: #4ade80;
    --ok-soft: rgb(74 222 128 / 0.12);
    --open: #fbbf24;
    --open-soft: rgb(251 191 36 / 0.12);
    --grid: rgb(226 232 240 / 0.05);
    --focus: #818cf8;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem / 1.55 var(--sans);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.25em;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.button:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.button.secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.secondary:hover {
  background: var(--surface-2);
}

/* Header and footer */

.top,
.bottom,
main > section {
  width: min(72rem, 100% - 2rem);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}

.brand svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.top nav a:not(.button) {
  text-decoration: none;
  color: var(--ink-soft);
}

.top nav a:not(.button):hover {
  color: var(--ink);
  text-decoration: underline;
}

.bottom {
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.bottom a {
  margin-left: 0.5rem;
}

/* Sections */

main > section {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem);
}

main > section + section {
  border-top: 1px solid var(--line);
}

/* How a board is made: a real sequence, so its steps are numbered. */

.sequence {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
}

.sequence li {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}

.sequence li::before {
  content: counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.sequence p {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Hero: the text, and a board of the example shop app on blueprint paper. */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.lede {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 34em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.fine {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 34em;
}

.board {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 1.25rem;
}

.board figcaption {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 1rem;
}

.board-title {
  font-weight: 700;
}

.board-question {
  color: var(--muted);
  font-size: 0.9rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

/* The arrow between two steps. */
.steps li + li {
  position: relative;
}

.steps li + li::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: -1.1rem;
  height: 1.1rem;
  border-left: 1.5px solid var(--line-strong);
}

.steps button {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
}

.steps button:hover {
  border-color: var(--muted);
}

.steps button[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.step-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.cite {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.cite.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.cite.open {
  background: var(--open-soft);
  color: var(--open);
}

.source {
  margin-top: 1.25rem;
  border-top: 1px dashed var(--line-strong);
  padding-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.source-path {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.source pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.source-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: none;
}

.dot.ok {
  background: var(--ok);
}

.dot.open {
  background: var(--open);
}

/* Screen atlas */

.atlas {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  align-items: start;
}

.atlas p {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 36em;
}

.terminal,
.way pre {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  line-height: 1.7;
}

/* Get started */

.ways {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.way {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.way p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.way pre {
  font-size: 0.8rem;
}

/* Privacy */

.private p {
  margin-top: 1rem;
  max-width: 40em;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

@media (max-width: 960px) {
  .hero,
  .atlas {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

@media (max-width: 560px) {
  .top nav a:not(.button) {
    display: none;
  }

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