/* directivelabs.app: the Directive Labs Design System (decision log rows 63-65). One stylesheet for every page.
   Light and Dark follow the device (Match device). No Calm switch on the website: it would need a script (decided 2026-10-25).
   System fonts only. Nothing loads from another host. */

:root {
  color-scheme: light dark;
  /* Color roles, Light theme (Design System tokens.json) */
  --background: #f8f9fa;
  --card: #ffffff;
  --chip: #eef0f6;
  --border: #e0e0e0;
  --text: #1a1a2e;
  --text-muted: #5f6770;
  --primary: #6c5ce7;
  --on-primary: #ffffff;
  --accent-text: #6c5ce7;
  --gold: #8a560a;
  --control-border: #5f6770;   /* quiet buttons: text-muted, 5.4:1, so the control edge passes 3:1 */
  /* Brand colors (same in every theme), for the drawing */
  --brand-violet: #6c5ce7;
  --brand-lavender: #a29bfe;
  --brand-cyan: #00d2ff;
  --brand-navy: #1a1a2e;
  /* Type and spacing */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-button: 16px; --radius-button-lg: 18px; --radius-card: 20px; --radius-pill: 999px;
  /* Type scale (Design System): 1rem = body 17px; grows with the device's text size */
  --fs-caption: 0.8824rem;   /* 15px, the smallest text people read */
  --fs-body: 1rem;           /* 17px */
  --fs-key: 1.0588rem;       /* 18px, key reading text and row titles */
  --fs-button-lg: 1.1765rem; /* 20px */
  --fs-card-title: 1.2941rem;/* 22px */
  --fs-large-title: 2rem;    /* 34px */
  --target-min: 44px; --pill-height: 48px; --button-height: 56px; --button-height-lg: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #1a1a2e;
    --card: #16213e;
    --chip: #2a2a4a;
    --border: #2a2a4a;
    --text: #ffffff;
    --text-muted: #8a8a9a;
    --primary: #6c5ce7;
    --on-primary: #ffffff;
    --accent-text: #a29bfe;
    --gold: #fdcb6e;
    --control-border: #8a8a9a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 106.25%; }
/* On Apple devices, start from the system body size so text follows the iPhone's text size setting. */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  overflow-wrap: break-word;
}
/* Links: accent-text and bold, no underline (value 6 check 2); the underline comes back on hover and focus. */
a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }
strong { font-weight: 700; }

/* ---------- Homepage ---------- */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) 48px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.page > main { display: flex; flex-direction: column; gap: 48px; }
.hero { display: flex; flex-direction: column; gap: var(--space-2); }
.hero > * { margin: 0; }
.shape { display: none; }   /* the old decorative shapes: calm senses (value 6 check 9) */
.brand { order: -1; font-size: var(--fs-key); line-height: 1.333; font-weight: 600; color: var(--accent-text); }
.headline { font-size: var(--fs-large-title); line-height: 1.206; font-weight: 800; letter-spacing: -0.5px; }
.intro { font-size: var(--fs-key); line-height: 1.444; }

/* section only: the policy tables also carry the class "cards" (phone card layout) and must stay tables. */
section.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--space-3); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.card h2 { order: -1; margin: 0; font-size: var(--fs-card-title); line-height: 1.273; font-weight: 700; }
.card p { margin: 0; line-height: 1.5; }
.tag {
  align-self: flex-start;
  background: var(--chip);
  color: var(--text);
  font-size: var(--fs-caption);
  line-height: 1.333;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.values {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.values h2 { margin: 0; font-size: var(--fs-card-title); line-height: 1.273; font-weight: 700; }
.values ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: value;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-5) var(--space-6);
}
.values li { counter-increment: value; display: flex; gap: var(--space-3); }
/* The numbers are decoration: the list itself is numbered for screen readers. */
.values li::before {
  content: counter(value);
  content: counter(value) / "";
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--chip);
  color: var(--accent-text);
  font-size: var(--fs-body);
  font-weight: 800;
}
.values p { margin: 0; line-height: 1.5; }

.site-footer { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-caption); line-height: 1.4; color: var(--text-muted); }
.site-footer p { margin: 0; }

/* ---------- Legal pages and 404 ---------- */
body:not(.home-page) { max-width: 680px; margin: 0 auto; padding: var(--space-6) var(--space-5) 64px; }
.home { font-size: var(--fs-body); }
body:not(.home-page) h1 { font-size: var(--fs-large-title); line-height: 1.206; letter-spacing: -0.5px; font-weight: 800; margin: var(--space-5) 0 var(--space-2); }
.updated { color: var(--text-muted); font-size: var(--fs-caption); line-height: 1.4; margin-top: 0; }
body:not(.home-page) h2 { font-size: var(--fs-card-title); line-height: 1.273; font-weight: 700; margin: 40px 0 var(--space-2); }
body:not(.home-page) h3 { font-size: var(--fs-key); line-height: 1.333; font-weight: 600; margin: var(--space-6) 0 var(--space-1); }
body:not(.home-page) p, body:not(.home-page) li { line-height: 1.55; }
body:not(.home-page) ul, body:not(.home-page) ol { padding-left: 22px; }
body:not(.home-page) li { margin-bottom: 6px; }
table { border-collapse: collapse; width: 100%; margin: var(--space-2) 0; font-size: var(--fs-caption); line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: var(--space-2) 10px; border-bottom: 1px solid var(--border); }
th { background: var(--chip); }
/* A product link alone in a table's first column is a stand-alone link: 44 px tap target (core value 6). */
table.cards td:first-child a { display: inline-flex; align-items: center; min-height: 44px; }
body:not(.home-page) hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }
/* Policy tables: on phones, each row becomes a card with its column names as labels (no sideways scrolling). */
@media (max-width: 640px) {
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
  }
  table.cards td { border: 0; padding: var(--space-1) 0; }
  table.cards td::before { content: attr(data-label); display: block; font-weight: 700; color: var(--text-muted); }
}
body:not(.home-page) > footer {
  margin-top: 56px;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

/* ---------- Tap targets: every stand-alone link is at least 44px tall (value 6; preferred 48px) ---------- */
.site-footer a,
body:not(.home-page) > footer a,
.home { display: inline-flex; align-items: center; min-height: 48px; }

/* ---------- 404 page (content: 2026-10-29_404_Content_v2.md) ---------- */
.not-found .art { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto var(--space-2); color: var(--text); }
.not-found .joke { font-size: var(--fs-key); line-height: 1.444; color: var(--text); margin: 0 0 var(--space-6); }
.button {
  display: flex;
  align-items: center;
  min-height: var(--button-height);
  padding: var(--space-3) var(--space-5);
  border: 2px solid var(--control-border);
  border-radius: var(--radius-button);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.294;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--chip); text-decoration: none; }
.button-main {
  justify-content: center;
  min-height: var(--button-height-lg);
  border: 0;
  border-radius: var(--radius-button-lg);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-button-lg);
  line-height: 1.2;
  font-weight: 800;
}
.button-main:hover { background: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
body:not(.home-page) .directory { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
body:not(.home-page) .directory li { margin: 0; }
.not-found .lost { margin-top: var(--space-8); }

/* ---------- How we design page (content: 2026-10-25_How_We_Design_Content_v1.md) ---------- */
.design-page .intro { font-size: var(--fs-key); line-height: 1.444; }
.design-page .checks li { margin-bottom: var(--space-3); }
body:not(.home-page) .sources { list-style: none; padding: 0; }
body:not(.home-page) .sources li { margin: 0; }
.sources a { display: inline-flex; align-items: center; min-height: 48px; }
.design-page .lost { margin-top: var(--space-8); }

/* The 404 drawing: brand colors in both themes; stars follow the text color. */
.art .stars { fill: currentColor; }
.art .line { stroke: var(--brand-navy); }
.art .suit { fill: #ffffff; }
.art .moon { fill: var(--brand-lavender); }
.art .crater { fill: #8c83f5; }
.art .visor { fill: var(--brand-cyan); }
.art .pack { fill: var(--brand-violet); }
.art .dark { fill: var(--brand-navy); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
