/* The app pages, wearing the same clothes as the rest of the site: the
   palette from globals.css, Space Grotesk and JetBrains Mono, square
   corners, ember accent. Plain CSS so a new app page needs no build. */

:root {
  --background: #FAF8F5;
  --foreground: #010203;
  --card: #F3F2EE;
  --secondary: #ECEBE7;
  --muted: #E6E4E1;
  --muted-foreground: #52555B;
  --accent: #B94739;
  --border: #D9D7D4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000102;
    --foreground: #F1EEE7;
    --card: #020306;
    --secondary: #090B0F;
    --muted: #13161B;
    --muted-foreground: #7D8086;
    --accent: #FFB685;
    --border: #1F2227;
  }
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(70ch, 100% - 2.5rem); margin-inline: auto; }

/* ---------- masthead ---------- */

.top {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
}

.top a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-decoration: none;
}

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

header { padding: 3.4rem 0 2rem; border-bottom: 1px solid var(--border); }

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.1rem, 5.4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.03;
  text-wrap: balance;
  margin: 0 0 1rem;
}

.standfirst {
  font-size: 1.12rem;
  color: var(--muted-foreground);
  margin: 0;
  max-width: 58ch;
  line-height: 1.6;
}

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

section { padding: 2.6rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: 0; }

h2 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.9rem 0 0.55rem;
}

p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }

ul { margin: 0 0 1.05rem; padding-left: 1.1rem; }
li { margin-bottom: 0.55rem; }
li:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 3px; }

strong { font-weight: 600; }

/* ---------- callouts, square and left-ruled like the site ---------- */

.plain, .caution {
  background: var(--card);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.2rem;
  font-size: 1.02rem;
}

.plain { border-left: 2px solid var(--foreground); }
.caution { border-left: 2px solid var(--accent); }

/* ---------- tables ---------- */

.scroll { overflow-x: auto; margin: 0 0 1.05rem; }

table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 0 1rem 0.6rem 0;
  border-bottom: 1px solid var(--foreground);
  white-space: nowrap;
}

td {
  padding: 0.62rem 1rem 0.62rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* ---------- question list ---------- */

dl { margin: 0; }

dt {
  font-weight: 600;
  font-size: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

dd {
  margin: 0.35rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.98rem;
}

/* ---------- the app list on the hub ---------- */

.apps { display: flex; flex-direction: column; }

.app {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 0 1.2rem;
  align-items: center;
  padding: 1.4rem 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.app:last-child { border-bottom: 1px solid var(--border); }

.app:hover { background: var(--card); }

.app img { width: 76px; height: 76px; display: block; }

.app strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.15rem;
}

.app span { color: var(--muted-foreground); font-size: 0.95rem; }

.app em {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

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

footer {
  padding: 2.4rem 0 4rem;
  color: var(--muted-foreground);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer a { color: var(--muted-foreground); text-decoration: none; }
footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  header { padding-top: 2.4rem; }
  .app { grid-template-columns: 56px 1fr; }
  .app img { width: 56px; height: 56px; }
  .app em { display: none; }
  footer { font-size: 0.68rem; }
}
