/* Ora's one design system (LA-1896). The tile, the room page and the owner's panel all
   load this file and keep nothing of their own but layout.

   The palette comes from the tile art (LA-1895, assets/tile-art/): charcoal, cream and
   purple. Purple marks Ora and real state only: the live
   mark, the main action, a link. Red is ink, and only ever a stamp on paper or a failure
   line. Cards are paper in every theme, since a card is a document Ora quoted.

   The tile is always dark: it sets data-theme="dark" on <html>. The room page and the
   panel follow the viewer's light or dark setting unless the page sets data-theme.

   Every text colour below passes WCAG AA (4.5:1) on the surface it is used on. The
   ratios were computed on 2026-10-08 and are in the LA-1896 entry of docs/DECISIONS.md.
   Change a colour, and check its ratio again. */

@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap");

:root {
  /* The tile art's colours. Use the role tokens below in pages, never these. */
  --ora-charcoal: #17181c;
  --ora-charcoal-2: #212327;
  --ora-charcoal-3: #2c2e33;
  --ora-cream: #f7f6f1;
  --ora-cream-2: #ebe8df;
  --ora-white: #ffffff;
  --ora-purple: #7c3aed;
  --ora-purple-light: #a78bfa;
  --ora-purple-deep: #6d28d9;
  --ora-red: #c53030;
  --ora-red-light: #f87171;

  /* Type. Figtree is the closest free match to TT Commons, the BLDG Labs face. If it
     fails to load, the system face takes over and nothing moves. */
  --font-sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --tracking-tight: -0.01em;
  --tracking-label: 0.12em;

  /* Spacing on a 4 px grid, and the corner radii. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-s: 6px;
  --radius-m: 8px;
  --radius-l: 12px;
  --radius-full: 9999px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.24), 0 1px 2px rgba(0, 0, 0, 0.18);

  /* Paper: a card in any theme. */
  --paper: var(--ora-cream);
  --paper-2: var(--ora-cream-2);
  --ink: var(--ora-charcoal);
  --ink-muted: rgba(23, 24, 28, 0.66); /* 5.55:1 on paper */
  --ink-dim: rgba(23, 24, 28, 0.6); /* 4.51:1 on paper */
  --stamp: var(--ora-red); /* 5.05:1 on paper */

  /* The accent fill is the same in both themes: cream on purple is 5.27:1. */
  --accent: var(--ora-purple);
  --on-accent: var(--ora-cream);
}

/* Dark: the tile always, and the other pages when the viewer prefers it. */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--ora-charcoal);
  --surface: var(--ora-charcoal-2);
  --surface-2: var(--ora-charcoal-3);
  --text: var(--ora-cream);
  --text-muted: rgba(247, 246, 241, 0.66); /* 7.08:1 on surface */
  --text-dim: rgba(247, 246, 241, 0.55); /* 5.38:1 on surface */
  --hairline: rgba(247, 246, 241, 0.12);
  --accent-text: var(--ora-purple-light); /* 5.78:1 on surface */
  --danger-text: var(--ora-red-light); /* 5.69:1 on surface */
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: var(--ora-cream);
    --surface: var(--ora-white);
    --surface-2: var(--ora-cream-2);
    --text: var(--ora-charcoal);
    --text-muted: rgba(23, 24, 28, 0.66); /* 5.55:1 on cream */
    --text-dim: rgba(23, 24, 28, 0.6); /* 4.51:1 on cream */
    --hairline: rgba(23, 24, 28, 0.12);
    --accent-text: var(--ora-purple-deep); /* 6.57:1 on cream */
    --danger-text: var(--ora-red); /* 5.05:1 on cream */
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: var(--ora-cream);
  --surface: var(--ora-white);
  --surface-2: var(--ora-cream-2);
  --text: var(--ora-charcoal);
  --text-muted: rgba(23, 24, 28, 0.66);
  --text-dim: rgba(23, 24, 28, 0.6);
  --hairline: rgba(23, 24, 28, 0.12);
  --accent-text: var(--ora-purple-deep);
  --danger-text: var(--ora-red);
}

/* The base every page shares. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

/* A label in mono capitals: section headings, timestamps, capability names. */
.readout {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-variant-numeric: tabular-nums;
}

/* Ora's live mark: a filled purple dot while it is in the meeting, an empty ring
   otherwise. */
.live-mark {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--text-dim);
  flex: none;
}
.live .live-mark,
.live-mark.on {
  background: var(--accent);
  border-color: var(--accent);
}

/* Cards are paper. Pages set their size and padding; colour and type live here. */
.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-l);
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.card .capability,
.card .label,
.card .picture-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-muted);
}
.card .credits {
  font-weight: var(--weight-bold);
}
.card .title,
.card .full,
.card .changes,
.card .source {
  color: var(--ink-muted);
}
.card .line {
  font-weight: 650;
}
.card .source {
  font-family: var(--font-mono);
}
.card .relation,
.card .chip {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  border: 2px solid var(--ink);
  border-radius: var(--radius-s);
  color: var(--ink);
}
.card .relation.stamp {
  color: var(--stamp);
  border-color: var(--stamp);
}

/* A sketch (LA-2009): rough ink boxes and arrows on the card's paper. No motion here: the
   tile loads this file and stays still. The panel adds its own draw-on (panel.html). */
.card .sketch-figure,
.card .map-figure {
  margin: 0;
  min-width: 0;
}
.card svg.sketch,
.card svg.map {
  display: block;
  max-width: 100%;
  height: auto;
}
.sketch .box,
.sketch .arrow,
.sketch .arrow-head,
.map .box,
.map .arrow,
.map .arrow-head {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sketch .box.second,
.map .box.second {
  stroke-width: 1.2;
  opacity: 0.55;
}
.sketch .box-fill,
.map .box-fill {
  fill: var(--paper-2);
  stroke: none;
}
.sketch .shape-label,
.map .shape-label {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: 17px;
}
.card .sketch-state,
.card .map-state {
  color: var(--ink-muted);
}
.card .sketch-state:empty,
.card .map-state:empty {
  display: none;
}

.card .map-gap {
  color: var(--ink-muted);
}
.map .exit-label,
.map .shape-owner {
  fill: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

/* A row in an action log, on the room page and the panel. */
.entry {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  overflow-wrap: anywhere;
}
.entry .skill {
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.entry .time,
.entry .where,
.entry .reason,
.entry .head {
  color: var(--text-muted);
}

/* Buttons and fields on the pages people use with a mouse or a finger. */
.button,
button {
  font: inherit;
  font-weight: var(--weight-semibold);
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: var(--radius-m);
  min-height: 44px;
  padding: 10px 14px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

input[type="email"],
input[type="password"],
input[type="url"],
input[type="text"],
select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
}
input[type="checkbox"] {
  accent-color: var(--accent);
}

.failure {
  color: var(--danger-text);
}
