/* CodeKP design system.
 *
 * One stylesheet for every page. Two themes: "paper", a warm daylight cream, and
 * "lamp", a dark that is warmed with brown rather than the usual blue-black, so
 * the dark mode still feels like a room with a light on in it.
 *
 * The brand gradient is taken from the logo and left alone. Everything around it
 * is warm on purpose: cold greys next to that gradient read as corporate, which
 * is the opposite of the point.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  /* brand, constant across both themes */
  --blue: #2e7cf6;
  --indigo: #5b4be8;
  --violet: #9b34e8;
  --brand: linear-gradient(135deg, #2e7cf6 0%, #5b4be8 46%, #9b34e8 100%);

  /* the warm counterweight */
  --amber: #f0912f;
  --terracotta: #d9643f;
  --honey: #ffc86b;

  --ok: #2f8f5b;
  --wait: #b4741a;

  --font-display: 'Space Grotesk', ui-rounded, system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1120px;
  --radius: 18px;
  --radius-sm: 11px;

  /* a spring-ish curve, used for anything the pointer touches */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* paper: the default. Cream rather than white, ink rather than black. */
:root,
[data-theme='paper'] {
  --bg: #fbf6ef;
  --bg-tint: #f5ece0;
  --surface: #fffdfa;
  --surface-2: #f8f1e7;
  --ink: #241e1a;
  --ink-soft: #5d5349;
  --ink-faint: #8b8073;
  --line: rgba(60, 46, 34, 0.13);
  --line-strong: rgba(60, 46, 34, 0.24);
  --shadow: 0 1px 2px rgba(90, 66, 40, 0.05), 0 12px 28px -14px rgba(90, 66, 40, 0.28);
  --shadow-lift: 0 2px 4px rgba(90, 66, 40, 0.06), 0 26px 50px -20px rgba(90, 66, 40, 0.4);
  --grain: 0.035;
  --bloom-1: rgba(255, 200, 107, 0.5);
  --bloom-2: rgba(155, 52, 232, 0.16);
  --bloom-3: rgba(46, 124, 246, 0.14);
  --code-bg: rgba(60, 46, 34, 0.06);
  color-scheme: light;
}

/* lamp: warm dark. Browns in the neutrals, never slate. */
[data-theme='lamp'] {
  --bg: #17120f;
  --bg-tint: #1d1714;
  --surface: #221b17;
  --surface-2: #2a221d;
  --ink: #f4ece2;
  --ink-soft: #bdaf9f;
  --ink-faint: #8d8175;
  --line: rgba(255, 226, 194, 0.12);
  --line-strong: rgba(255, 226, 194, 0.26);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 28px 56px -22px rgba(0, 0, 0, 0.8);
  --grain: 0.05;
  --bloom-1: rgba(240, 145, 47, 0.24);
  --bloom-2: rgba(155, 52, 232, 0.26);
  --bloom-3: rgba(46, 124, 246, 0.22);
  --code-bg: rgba(255, 226, 194, 0.08);
  --ok: #6fd39b;
  --wait: #f0b45c;
  color-scheme: dark;
}

/* Before the theme script runs, follow the system so there is no flash. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #17120f;
    --bg-tint: #1d1714;
    --surface: #221b17;
    --surface-2: #2a221d;
    --ink: #f4ece2;
    --ink-soft: #bdaf9f;
    --ink-faint: #8d8175;
    --line: rgba(255, 226, 194, 0.12);
    --line-strong: rgba(255, 226, 194, 0.26);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 28px 56px -22px rgba(0, 0, 0, 0.8);
    --grain: 0.05;
    --bloom-1: rgba(240, 145, 47, 0.24);
    --bloom-2: rgba(155, 52, 232, 0.26);
    --bloom-3: rgba(46, 124, 246, 0.22);
    --code-bg: rgba(255, 226, 194, 0.08);
    --ok: #6fd39b;
    --wait: #f0b45c;
    color-scheme: dark;
  }
}

/* Cross-document transitions where the browser supports them. Pages on this
 * site share a nav and a footer, so a hard cut between them is jarring. */
@view-transition {
  navigation: auto;
}

/* -------------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(155, 52, 232, 0.22);
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- backdrop */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.bloom.one {
  width: 46vw;
  height: 46vw;
  min-width: 380px;
  min-height: 380px;
  background: radial-gradient(circle, var(--bloom-1), transparent 70%);
  top: -14%;
  left: -8%;
  animation: drift-a 26s ease-in-out infinite;
}

.bloom.two {
  width: 42vw;
  height: 42vw;
  min-width: 340px;
  min-height: 340px;
  background: radial-gradient(circle, var(--bloom-2), transparent 70%);
  top: 8%;
  right: -12%;
  animation: drift-b 32s ease-in-out infinite;
}

.bloom.three {
  width: 38vw;
  height: 38vw;
  min-width: 300px;
  min-height: 300px;
  background: radial-gradient(circle, var(--bloom-3), transparent 70%);
  bottom: -16%;
  left: 32%;
  animation: drift-c 38s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(70px, 50px, 0) scale(1.12); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-60px, 44px, 0) scale(1.08); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, -54px, 0) scale(1.14); }
}

/* Paper grain. An SVG turbulence tile beats a PNG here: no request, and it
 * scales cleanly on any display density. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- typography */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.wrap-narrow {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.022em;
  line-height: 1.14;
  font-weight: 700;
}

.grad {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-transform: lowercase;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

/* A hand-drawn underline that draws itself in when scrolled to. Warmth that
 * a straight rule cannot give you. */
.sketch {
  position: relative;
  white-space: nowrap;
}

.sketch::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.24em;
  height: 0.34em;
  background: no-repeat center/100% 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9.5C38 4.2 92 3.1 129 5.4c21 1.3 44 3.4 68 1.2' fill='none' stroke='%23f0912f' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.75s var(--ease) 0.15s;
}

.in .sketch::after,
.sketch.in::after {
  transform: scaleX(1);
}

section.block {
  padding: clamp(56px, 8vh, 96px) 0;
  position: relative;
}

.sec-head {
  max-width: 620px;
  margin-bottom: 2.4rem;
}

.sec-head h2 {
  font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  margin-top: 0.7rem;
}

.sec-head p {
  color: var(--ink-soft);
  margin-top: 0.85rem;
}

/* --------------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}

.nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 70px;
}

/* Sized so the wordmark reads at the same height as the K and the P in the mark.
 * At this weight the visible height of "CodeKP" is about 0.78 of its font size,
 * and the mark's letters are about 0.82 of the mark's box, so 28px of mark wants
 * roughly 1.8rem of text. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

/* The mark is inlined rather than loaded as an image so the brace can take the
 * page's ink colour and survive the theme toggle. An <img> only ever sees the
 * system theme, which is the wrong answer once someone flips the switch. */
.brand .logo {
  height: 28px;
  width: auto;
  flex: none;
  /* The brace overhangs further above the letters than below, so centring the
   * box leaves the letters sitting low against the text. This lifts them back. */
  margin-bottom: 2.6px;
  transition: transform 0.4s var(--spring);
}

.brand:hover .logo {
  transform: rotate(-4deg) scale(1.06);
}

/* Inside an app, the header carries the app's name next to the wordmark. Filled
 * in by render.js from data/apps.js, so it is never typed into a page. */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.crumb-sep {
  color: var(--ink-faint);
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1;
}

.crumb-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

a.crumb-name {
  color: var(--ink-soft);
  transition: color 0.2s;
}

a.crumb-name:hover {
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.5rem 0.8rem;
  border-radius: 9px;
  transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-links a[aria-current='page'] {
  color: var(--ink);
}

/* theme toggle */
.theme-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  margin-left: 0.35rem;
  transition: transform 0.4s var(--spring), color 0.2s, border-color 0.2s;
}

.theme-btn:hover {
  color: var(--amber);
  border-color: var(--line-strong);
  transform: rotate(18deg) scale(1.08);
}

.theme-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme='lamp'] .theme-btn .sun,
:root:not([data-theme]) .theme-btn .sun { display: block; }
[data-theme='lamp'] .theme-btn .moon,
:root:not([data-theme]) .theme-btn .moon { display: none; }
[data-theme='paper'] .theme-btn .sun { display: none; }
[data-theme='paper'] .theme-btn .moon { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-btn .sun { display: none; }
  :root:not([data-theme]) .theme-btn .moon { display: block; }
}

/* ----------------------------------------------------------------- buttons */

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.97rem;
  padding: 0.82rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  transition: transform 0.35s var(--spring), box-shadow 0.3s var(--ease),
    background-color 0.25s, border-color 0.25s, color 0.25s;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(91, 75, 232, 0.8);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -14px rgba(91, 75, 232, 0.9);
  filter: brightness(1.06);
}

.btn.warm {
  background: linear-gradient(135deg, var(--honey), var(--amber) 55%, var(--terracotta));
  color: #2b1a09;
  box-shadow: 0 10px 26px -12px rgba(217, 100, 63, 0.7);
}

.btn.warm:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -14px rgba(217, 100, 63, 0.8);
  filter: brightness(1.04);
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.btn.ghost:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.btn[disabled],
.btn.is-pending {
  cursor: default;
  background: var(--surface-2);
  color: var(--ink-faint);
  border-color: var(--line);
  box-shadow: none;
}

.btn[disabled]:hover,
.btn.is-pending:hover {
  transform: none;
  filter: none;
}

.btn.sm {
  font-size: 0.86rem;
  padding: 0.5rem 1.05rem;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------------- pills */

.pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.pill.brand {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}

.pill.live {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 38%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}

.pill.waiting {
  color: var(--wait);
  border-color: color-mix(in srgb, var(--wait) 38%, transparent);
  background: color-mix(in srgb, var(--wait) 10%, transparent);
}

/* a slow pulse, so "waiting" reads as alive rather than stalled */
.pill.waiting .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* ------------------------------------------------------------------- cards */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.3s;
  transform-style: preserve-3d;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.card .sheen {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bloom-1), transparent 70%);
  filter: blur(30px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  top: -70px;
  right: -70px;
}

.card:hover .sheen {
  opacity: 0.85;
}

/* app cards on the home grid */
/* auto-fit rather than auto-fill: with only a couple of tools in the workshop,
 * auto-fill would leave an empty column sitting there looking like a mistake. */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
}

.app-card {
  display: flex;
  flex-direction: column;
}

.app-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.app-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  flex: none;
  transition: transform 0.5s var(--spring);
}

.app-card:hover .icon {
  transform: scale(1.07) rotate(-4deg);
}

.app-card .icon img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.app-card h3 {
  font-size: 1.24rem;
  margin-bottom: 0.45rem;
}

.app-card p {
  color: var(--ink-soft);
  font-size: 0.93rem;
  margin-bottom: 1.1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.18rem 0.48rem;
}

.card-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

.card-link .arrow {
  color: var(--violet);
  transition: transform 0.3s var(--spring);
}

.app-card:hover .card-link .arrow {
  transform: translateX(5px);
}

.card-link.muted {
  color: var(--ink-faint);
  pointer-events: none;
}

/* a card that is only a placeholder for a future app */
.card.dashed {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

/* -------------------------------------------------------------- feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 1.05rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.45rem;
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.3s;
}

.feature:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.feature .fi {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(46, 124, 246, 0.14), rgba(155, 52, 232, 0.14));
  border: 1px solid var(--line);
  margin-bottom: 0.95rem;
}

.feature .fi svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: url(#brandGrad);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.feature p {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ------------------------------------------------------------------ panels */

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1.7rem, 4.5vw, 3rem);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel > .glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 88% 0%, var(--bloom-1), transparent 58%);
  opacity: 0.55;
}

.panel > * {
  position: relative;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.4rem;
  align-items: center;
}

/* --------------------------------------------------------------- data table */

.rows {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.row {
  display: grid;
  grid-template-columns: 1.3fr auto 3fr;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.row:hover {
  background: var(--surface-2);
}

.row.head {
  background: var(--surface-2);
}

.row.head span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.row .name {
  font-family: var(--font-display);
  font-weight: 600;
}

.row .desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.key {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--blue);
  background: rgba(46, 124, 246, 0.08);
  min-width: 2.2ch;
  text-align: center;
}

/* two-column definition list, used by the specs sheet */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.spec {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

.spec dd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

/* permissions */
.perms {
  display: grid;
  gap: 0.8rem;
}

.perm {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
}

.perm code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--violet);
  word-break: break-word;
}

.perm .detail {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-left: 0.4rem;
}

.perm p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 0.4rem;
}

/* ---------------------------------------------------------------- timeline */

.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage {
  flex: 1 1 140px;
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--line);
  position: relative;
}

.stage:last-child {
  border-right: 0;
}

.stage .n {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.3rem;
}

.stage .t {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stage.done .t {
  color: var(--ink);
}

.stage.done .n::after {
  content: ' done';
  color: var(--ok);
}

.stage.current {
  background: linear-gradient(180deg, color-mix(in srgb, var(--wait) 12%, transparent), transparent);
}

.stage.current .t {
  color: var(--wait);
}

.stage.current .n::after {
  content: ' now';
  color: var(--wait);
}

/* ---------------------------------------------------------------- releases */

.releases {
  display: grid;
  gap: 1rem;
}

.release {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow);
}

.release header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.release h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.release time,
.release .state {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.release ul {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.release li {
  color: var(--ink-soft);
  font-size: 0.93rem;
  padding-left: 1.35rem;
  position: relative;
}

.release li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

/* notes on the updates page */
.note-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  box-shadow: var(--shadow);
}

.note-card h3 {
  font-size: 1.15rem;
  margin: 0.35rem 0 0.6rem;
}

.note-card p {
  color: var(--ink-soft);
}

.note-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------- steps */

.steps {
  display: grid;
  gap: 0.8rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  box-shadow: var(--shadow);
}

.step .num {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 0.9rem;
}

.step p {
  padding-top: 0.2rem;
  font-size: 0.95rem;
}

.step p .quiet {
  color: var(--ink-soft);
}

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
}

kbd {
  border: 1px solid var(--line);
  font-weight: 600;
}

/* -------------------------------------------------------------------- list */

.ticks {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.ticks li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.ticks li svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 0.28em;
  fill: none;
  stroke: url(#brandGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticks li b {
  color: var(--ink);
  font-weight: 600;
}

.dashes {
  columns: 2;
  column-gap: 2.4rem;
  list-style: none;
}

.dashes li {
  break-inside: avoid;
  margin-bottom: 0.85rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding-left: 1.2rem;
  position: relative;
}

.dashes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
}

/* folded builder notes: closed by default, one click each */
.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fold-item {
  border-top: 1px solid var(--line);
}

.fold-item:first-child {
  border-top: 0;
}

.fold-item > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  user-select: none;
}

.fold-item > summary::-webkit-details-marker {
  display: none;
}

.fold-item > summary::after {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.15rem;
  border-right: 2px solid var(--amber);
  border-bottom: 2px solid var(--amber);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.fold-item[open] > summary::after {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

.fold-item > summary:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--amber) 6%, transparent);
}

.fold-body {
  padding: 0 1.3rem 1.3rem;
}

.fold-lede {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.fold-body .specs,
.fold-body .perms,
.fold-body .releases,
.fold-body .dashes {
  margin: 0;
}

/* ---------------------------------------------------------------- callout */

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
  margin: 1.6rem 0;
}

.callout strong {
  font-weight: 700;
}

.callout p {
  color: var(--ink-soft);
}

.callout p b,
.callout strong {
  color: var(--ink);
}

/* ------------------------------------------------------------------ footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 1rem 0 0.95rem;
  margin-top: 2rem;
}

/* Stacked down the centre. Pushed to opposite ends of the full width the brand
 * and the links left a wide dead gap between them. */
.foot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}

.foot-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}

.foot-tag {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.foot-tag .chev {
  color: var(--amber);
  font-weight: 700;
}

.foot-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.foot-links a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.foot-links a:hover {
  color: var(--ink);
}

.copyright {
  color: var(--ink-faint);
  font-size: 0.8rem;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  text-align: center;
}

/* ------------------------------------------------------------------ reveal */

/* Only hidden once the script that reveals them is known to be running, so a
 * failed observer or a blocked script can never strand the page blank. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------------ prose */

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.7rem);
  margin-bottom: 0.4rem;
}

.prose h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.5rem 0 0.7rem;
}

.prose p {
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.prose ul {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  margin: 0.4rem 0 1.1rem;
}

.prose li {
  color: var(--ink-soft);
  padding-left: 1.4rem;
  position: relative;
}

.prose li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.prose b,
.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.updated {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 0.84rem;
  margin-bottom: 2rem;
}

/* ---------------------------------------------------------------------- kp
 *
 * The curious one. Eyes follow the pointer, blinks on a loose timer, leans in
 * when you hover, giggles when poked and dozes off when left alone. Every mood
 * is a class on .kp, and the whole face he needs is already in the SVG.
 */

.kp {
  position: relative;
  width: clamp(120px, 20vw, 168px);
  flex: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kp svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The rig holds everything that moves as one body, so a mood can squash or
 * spin him without disturbing the shadow he is standing on. */
.kp .rig {
  transform-box: view-box;
  transform-origin: 100px 176px;
  animation: kp-bob 5.5s ease-in-out infinite;
  transition: transform 0.5s var(--spring);
}

@keyframes kp-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.kp:hover .rig {
  transform: rotate(-5deg) scale(1.04);
}

.kp .shade {
  fill: rgba(0, 0, 0, 0.16);
  animation: kp-shade 5.5s ease-in-out infinite;
  transform-box: view-box;
  transform-origin: 100px 198px;
}

@keyframes kp-shade {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.88); opacity: 0.72; }
}

.kp .body-fill { fill: url(#brandGradFill); }
.kp .belly { fill: var(--surface); opacity: 0.95; }
.kp .eye-white { fill: #fff; }
.kp .pupil { fill: #241e1a; transition: transform 0.12s linear; }
.kp .shine { fill: #fff; opacity: 0.9; pointer-events: none; }
.kp .cheek { fill: var(--terracotta); opacity: 0.34; transition: opacity 0.3s var(--ease); }
.kp .stroke { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: 0.85; }
.kp .antenna-tip { fill: var(--honey); animation: kp-glow 3s ease-in-out infinite; }

@keyframes kp-glow {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* Arms swing from the shoulder rather than the middle of the stub. */
.kp .arm {
  transform-box: view-box;
  transition: transform 0.4s var(--spring);
}
.kp .arm-l { transform-origin: 26px 112px; }
.kp .arm-r { transform-origin: 174px 112px; }

.kp:hover .arm-l { transform: rotate(-16deg); }
.kp:hover .arm-r { transform: rotate(16deg); }
.kp:hover .cheek { opacity: 0.55; }

/* the lids sit over the eyes and drop for a blink */
.kp .lid {
  fill: url(#brandGradFill);
  transform-box: fill-box;
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.09s ease;
}

.kp.blinking .lid {
  transform: scaleY(1);
}

/* Two faces live in the SVG at once. The happy one is only uncovered when he
 * is actually pleased about something. These are drawn straight onto the belly
 * rather than onto the white of an eye, so they take the theme's ink and stay
 * legible on the dark belly under lamplight. */
.kp .eye-arc,
.kp .eye-shut {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4.5;
  stroke-linecap: round;
  opacity: 0;
}

.kp .mouth-laugh {
  fill: var(--ink);
  opacity: 0;
}

.kp.giggling .eye-arc,
.kp.dizzy .eye-arc,
.kp.giggling .mouth-laugh,
.kp.dizzy .mouth-laugh {
  opacity: 0.85;
}

.kp.giggling .eye-white,
.kp.giggling .pupil,
.kp.giggling .shine,
.kp.giggling .mouth-smile,
.kp.dizzy .eye-white,
.kp.dizzy .pupil,
.kp.dizzy .shine,
.kp.dizzy .mouth-smile {
  opacity: 0;
}

.kp.giggling .cheek,
.kp.dizzy .cheek {
  opacity: 0.7;
}

/* A giggle is mostly squash and stretch, with a shiver on top. */
.kp.giggling .rig {
  animation: kp-giggle 1s var(--ease);
}

@keyframes kp-giggle {
  0% { transform: scale(1, 1) rotate(0deg); }
  15% { transform: scale(1.1, 0.9) rotate(-4deg); }
  32% { transform: scale(0.94, 1.08) rotate(3deg); }
  50% { transform: scale(1.07, 0.94) rotate(-3deg); }
  68% { transform: scale(0.97, 1.04) rotate(2deg); }
  84% { transform: scale(1.03, 0.98) rotate(-1deg); }
  100% { transform: scale(1, 1) rotate(0deg); }
}

.kp.dizzy .rig {
  animation: kp-dizzy 1.5s var(--ease);
}

@keyframes kp-dizzy {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(14deg) scale(1.05); }
  50% { transform: rotate(-14deg) scale(0.96); }
  75% { transform: rotate(9deg) scale(1.03); }
  100% { transform: rotate(0deg) scale(1); }
}

.kp.waving .arm-r {
  animation: kp-wave 1.6s var(--ease);
}

@keyframes kp-wave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-42deg); }
  35% { transform: rotate(-14deg); }
  55% { transform: rotate(-42deg); }
  75% { transform: rotate(-16deg); }
}

/* Dozing: eyes drawn shut, breathing slowed right out, a few z's drifting off.
 * The blink lid is a filled disc, which reads fine for a tenth of a second but
 * looks like a wide open eye when held, so sleep gets its own drawn lid. */
.kp.dozing .eye-white,
.kp.dozing .pupil,
.kp.dozing .shine {
  opacity: 0;
}

.kp.dozing .eye-shut { opacity: 0.85; }
.kp.dozing .rig { animation: kp-breathe 4.2s ease-in-out infinite; }
.kp.dozing .antenna-tip { animation: none; opacity: 0.4; }

@keyframes kp-breathe {
  0%, 100% { transform: scale(1, 1) translateY(0); }
  50% { transform: scale(1.02, 0.98) translateY(3px); }
}

.kp .zzz text {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  fill: var(--ink-faint);
  opacity: 0;
}

.kp.dozing .zzz text {
  animation: kp-zzz 2.8s ease-in-out infinite;
}

.kp.dozing .zzz text:nth-child(2) { animation-delay: 0.55s; }
.kp.dozing .zzz text:nth-child(3) { animation-delay: 1.1s; }

@keyframes kp-zzz {
  0% { opacity: 0; transform: translate(0, 6px) scale(0.7); }
  30% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(7px, -14px) scale(1.15); }
}

.kp .spark {
  fill: var(--honey);
  transform-box: view-box;
  animation: kp-spark 0.85s var(--ease) forwards;
  pointer-events: none;
}

.kp .spark:nth-child(even) { fill: var(--violet); }
.kp .spark:nth-child(3n) { fill: var(--terracotta); }

@keyframes kp-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1); }
}

.kp-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  translate: -50% 0;
  width: max-content;
  max-width: 240px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translateY(6px) scale(0.94);
  transform-origin: bottom center;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--spring);
  pointer-events: none;
}

.kp-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% -1px;
  border: 7px solid transparent;
  border-top-color: var(--surface);
  filter: drop-shadow(0 1px 0 var(--line));
}

.kp-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: kp-pop 0.5s var(--spring);
}

@keyframes kp-pop {
  0% { transform: translateY(6px) scale(0.9); }
  55% { transform: translateY(-2px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .kp-bubble { max-width: 190px; font-size: 0.8rem; }
}

/* -------------------------------------------------------------- the sandbox */

.demo-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.demo-bar .lights {
  display: flex;
  gap: 0.35rem;
}

.demo-bar .lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.demo-bar .title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
}

.demo-stage {
  position: relative;
  min-height: 320px;
  background: var(--bg-tint);
  transition: box-shadow 0.2s var(--ease);
}

/* Shown while a file is being dragged over the page, so it is obvious where it
 * is going to land rather than the drop silently doing nothing. */
.demo-stage.drop-ready {
  box-shadow: inset 0 0 0 3px var(--amber);
}

.demo-stage.drop-ready::after {
  content: 'Drop the PDF anywhere';
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.55rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #2b1a09;
  background: var(--amber);
  z-index: 2;
  pointer-events: none;
}

.demo-stage iframe {
  display: block;
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: 0;
  background: #fff;
}

.demo-invite {
  display: grid;
  place-items: center;
  gap: 1rem;
  text-align: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
}

.demo-invite h3 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.demo-invite p {
  color: var(--ink-soft);
  max-width: 44ch;
  font-size: 0.95rem;
}

.demo-invite .weight {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.demo-loading {
  display: grid;
  place-items: center;
  padding: 4rem 1.5rem;
  gap: 0.9rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--violet);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { rotate: 360deg; }
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 880px) {
  .split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .dashes {
    columns: 1;
  }
  .nav-links a.tuck {
    display: none;
  }
}

@media (max-width: 560px) {
  .wrap,
  .wrap-narrow {
    padding: 0 20px;
  }
  /* The app name matters more than the wordmark here, so the mark keeps its
   * place and the text beside it gives way. */
  .brand {
    font-size: 1.3rem;
  }
  .crumb-name {
    font-size: 0.95rem;
    max-width: 34vw;
  }
  .row {
    grid-template-columns: 1fr auto;
  }
  .row .desc {
    grid-column: 1 / -1;
  }
  .spec {
    border-right: 0;
  }
}

/* --------------------------------------------------------------- printing */

@media print {
  .backdrop,
  .grain,
  .nav,
  .theme-btn,
  .kp,
  .demo-shell {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .prose a {
    color: #000;
  }
  .prose a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    color: #555;
  }
  .panel,
  .card,
  .callout {
    box-shadow: none;
    border-color: #ccc;
  }
}

/* ----------------------------------------------------------------- consent */

/* The notice that asks before anything is counted. It sits in the corner
 * rather than across the whole screen, because it is a question, not a
 * toll gate: every page works the same whichever button is pressed. */

.consent {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.4rem);
  bottom: clamp(0.75rem, 2vw, 1.4rem);
  z-index: 60;
  width: min(20rem, calc(100vw - 1.5rem));
  padding: 0.85rem 0.95rem 0.8rem;
  /* The same amber edge the callouts wear, so this reads as a note from the
   * site rather than a cookie bar somebody bolted on. */
  background: color-mix(in srgb, var(--amber) 6%, var(--surface));
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 15px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--spring);
}

.consent.in {
  opacity: 1;
  transform: none;
}

.consent-copy {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.58;
  color: var(--ink-soft);
}

.consent-copy b {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.consent-copy a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line-strong);
}

.consent-copy a:hover {
  color: var(--ink);
}

.consent-acts {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

/* A notch under .btn.sm, since the whole card is scaled down from the page. */
.consent .btn {
  font-size: 0.8rem;
  padding: 0.42rem 0.9rem;
  border-radius: 9px;
}

.consent-state {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

@media (max-width: 560px) {
  .consent {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }

  .consent-acts .btn {
    flex: 1;
    justify-content: center;
  }
}

/* ------------------------------------------------ workshop + writing home */

.workshop {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 2.4rem;
  align-items: start;
}

.workshop-col .sec-head {
  margin-bottom: 1.4rem;
}

.workshop-apps .app-grid {
  grid-template-columns: 1fr;
}

.workshop-writing .post-grid,
.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.post-card .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.post-card .post-app {
  color: var(--amber);
}

.post-card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

.post-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-bottom: 0.95rem;
}

/* --------------------------------------------------------- journal stories */

.journal-story {
  padding: 1.55rem 0 1.7rem;
  border-top: 1px solid var(--line);
}

.journal-story:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.journal-story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.journal-story-about a {
  color: var(--amber);
}

.journal-story h2 {
  font-size: clamp(1.28rem, 2.6vw, 1.55rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.55rem;
}

.journal-story h2 a {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.journal-story h2 a:hover {
  filter: brightness(1.12);
  opacity: 0.92;
}

.journal-story p {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 38ch;
  margin-bottom: 0.85rem;
}

.journal-story-more {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
}

.journal-story-more:hover {
  color: var(--blue);
}

.empty-line {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.section-more {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ----------------------------------------------------------------- trust */

.trust-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.trust-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.trust-k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trust-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.trust-v.good {
  color: #1f8f5f;
}

.trust-v.bad {
  color: var(--wait);
}

.trust-summary {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

/* --------------------------------------------------------------- updates */

.update-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.update-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.update-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45rem;
}

.update-card h3 a {
  color: inherit;
}

.update-card p,
.update-state {
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.update-card ul {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.update-card li + li {
  margin-top: 0.25rem;
}

/* ----------------------------------------------------------------- 404 */

.lost {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1.25rem;
}

.lost .kp {
  margin: 0 auto 1.5rem;
  width: min(160px, 42vw);
}

.lost h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.7rem;
}

.lost p {
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 auto 1.6rem;
}

/* --------------------------------------------------------------- article */

.article-head {
  margin-bottom: 2rem;
}

.article-head .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.article-body {
  max-width: 68ch;
}

.article-body p + p {
  margin-top: 1rem;
}

.article-body h2 {
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  font-size: 1.35rem;
}

@media (max-width: 960px) {
  .workshop {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .js .reveal {
    opacity: 1;
    transform: none;
  }
  .sketch::after {
    transform: scaleX(1);
  }
}
