/* Starchitect project site */

/* Colours are taken from the logo: the knotted star's gradient from magenta to
   plum. The site photos in the working models use the materials on site, brick,
   timber, blockwork and slate, and look the same in both themes. */

:root {
  --bg: #f8f5f9;
  --surface: #ffffff;
  --text: #22102b;
  --muted: #645670;
  --border: #e4dbe8;
  --accent: #a3007c;
  --accent-text: #ffffff;
  --accent-soft: #f8e7f3;
  --code-bg: #f1eaf3;
  --logo-from: #ff0093;
  --logo-to: #4a0068;
  --step-1: #ff0093;
  --step-2: #a5007e;
  --step-3: #4a0068;
  --hero-from: #8a006d;
  --hero-to: #2f0049;
  --hero-text: #ffffff;
  --hero-muted: #f3d9ec;
  --ok: #24764a;
  --ok-soft: #e2f1e8;
  --flag: #f5c842;
  --flag-text: #22102b;
  --side-bg: #2a1236;
  --side-fg: #d7c6df;
  --side-hi: #43204f;
  --side-text: #ffffff;
  --shadow: 0 1px 2px rgba(34, 16, 43, 0.06), 0 1rem 2.5rem -1rem rgba(34, 16, 43, 0.25);

  /* Site photos */
  --sky: #b7cbdb; --sky-2: #e3ebf1;
  --brick: #a4573d; --brick-2: #87432e; --mortar: #d8ccbe;
  --timber: #c89a62; --timber-2: #9c7243;
  --steel: #36414b; --block: #a2a8ac; --block-2: #7e858a;
  --slate: #4d5962; --slate-2: #3a444c; --pole: #8a939b;
  --scrim: rgba(10, 6, 14, 0.62); --on-scrim: #ffffff;

  /* The phone */
  --device: #0d0910; --device-2: #1d1622; --on-device: #f1ecf4; --on-device-2: #a497ad;

  --max: 64rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #140a1a;
    --surface: #1e1026;
    --text: #f1e9f4;
    --muted: #b3a2bd;
    --border: #3a2346;
    --accent: #ff5cbf;
    --accent-text: #22102b;
    --accent-soft: #3a1838;
    --code-bg: #26142f;
    --logo-from: #ff2ea6;
    --logo-to: #b04fd6;
    --step-1: #ff5cbf;
    --step-2: #d24fb4;
    --step-3: #9a4fd0;
    --hero-from: #5c0049;
    --hero-to: #1e0030;
    --hero-text: #f8f0f6;
    --hero-muted: #e3c6dc;
    --ok: #62c48d;
    --ok-soft: #173b2c;
    --side-bg: #0f0614;
    --side-fg: #bba8c6;
    --side-hi: #2d1638;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1.25rem 2.75rem -1rem rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #140a1a;
  --surface: #1e1026;
  --text: #f1e9f4;
  --muted: #b3a2bd;
  --border: #3a2346;
  --accent: #ff5cbf;
  --accent-text: #22102b;
  --accent-soft: #3a1838;
  --code-bg: #26142f;
  --logo-from: #ff2ea6;
  --logo-to: #b04fd6;
  --step-1: #ff5cbf;
  --step-2: #d24fb4;
  --step-3: #9a4fd0;
  --hero-from: #5c0049;
  --hero-to: #1e0030;
  --hero-text: #f8f0f6;
  --hero-muted: #e3c6dc;
  --ok: #62c48d;
  --ok-soft: #173b2c;
  --side-bg: #0f0614;
  --side-fg: #bba8c6;
  --side-hi: #2d1638;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1.25rem 2.75rem -1rem rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

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

code, pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }
pre .c { color: var(--muted); }
pre .s { color: var(--ok); }
pre .k { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }

/* The logo: a five-pointed star drawn as a Celtic knot. In the header it keeps
   its gradient; in the hero it's drawn in the hero's text colour. */
.logo { width: 1.6rem; height: 1.6rem; flex: none; }
.logo-from { stop-color: var(--logo-from); }
.logo-to { stop-color: var(--logo-to); }
.logo-mono { fill: currentColor; }

/* Sections */

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

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 0.25rem 0 1rem; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.5rem; color: var(--muted); }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 44rem; }

/* Hero: the logo's gradient, deepened so white text reads on it */

.hero {
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  border-bottom: none;
}
.hero .eyebrow,
.hero .lede { color: var(--hero-muted); }
.hero h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(2.4rem, 8vw, 3.75rem);
  margin: 0.5rem 0 0.75rem;
}
.hero h1 .logo { width: 1.1em; height: 1.1em; }
.hero .button { background: var(--hero-text); color: var(--hero-to); }
.hero .button.secondary {
  background: transparent;
  color: var(--hero-text);
  border-color: var(--hero-text);
}
.hero .screenshot figcaption { color: var(--hero-muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.75rem; }
.button {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}
.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.status { margin: 0 0 1.5rem; color: var(--hero-muted); font-size: 0.95rem; }
.status::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--flag);
  vertical-align: 0.05em;
}

/* Cards */

.cards {
  list-style: none;
  counter-reset: card;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}
.cards li {
  counter-increment: card;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--step-1);
  border-radius: 8px;
  padding: 1rem;
}
/* Top borders step through the logo's gradient, from site to client */
.cards li:nth-child(2) { border-top-color: var(--step-2); }
.cards li:nth-child(3) { border-top-color: var(--step-3); }
.cards li strong { display: block; margin-bottom: 0.25rem; }
.cards li strong::before { content: counter(card) ". "; color: var(--muted); }

/* Key facts */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
}
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }

@media (max-width: 30rem) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 0.5rem; }
}

/* Tables */

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border: 1px solid var(--border); vertical-align: top; }
th { background: var(--code-bg); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Screenshots and working models */

.screenshot { margin: 1.5rem 0; }
.screenshot figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }

/* Text and a portrait figure side by side on wide screens */
.media-layout { display: grid; gap: 0 2.5rem; align-items: start; }
.media-layout > * { min-width: 0; }
@media (min-width: 52rem) {
  .media-layout { grid-template-columns: minmax(0, 1fr) 17rem; }
}

/* Diagrams: inline SVG, coloured from the theme tokens */

.diagram { margin: 1.5rem 0; }
.diagram-scroll { overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 720px; height: auto; }
.diagram figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }

.diagram text { fill: var(--text); font-size: 13px; }
.diagram .d-head { font-size: 14px; font-weight: 600; }
.diagram .d-small { font-size: 12px; }
.diagram .d-muted { fill: var(--muted); font-weight: 400; }
.diagram .d-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

.diagram .d-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.diagram .d-box-accent { stroke: var(--accent); }
.diagram .d-flow { stroke: var(--accent); stroke-width: 2; fill: none; }
.diagram .d-arrowhead { fill: var(--accent); }

/* The bounced email */

.mail {
  max-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.95rem;
}
.mail-head { display: grid; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); background: var(--code-bg); }
.mail-head span:last-child { color: var(--muted); }
.mail-body { display: grid; gap: 0.75rem; padding: 1rem; }
.mail-body p { margin: 0; }
.mail .facts { font-variant-numeric: tabular-nums; }
.mail .over { color: var(--brick); font-weight: 600; }
.meter { position: relative; height: 0.6rem; border-radius: 0.3rem; overflow: hidden; border: 1px solid var(--border); }
.meter i { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, var(--brick) 0 6px, var(--brick-2) 6px 12px); }
/* 20 MB of 186 MB */
.meter b { position: absolute; top: 0; bottom: 0; left: 10.75%; width: 2px; background: var(--text); }
.meter-key { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.attach { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }

/* ---------- Working models ---------- */

/* Browser window around the dashboard and the client report */
.window {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 0.95rem;
}
.window :where(h3, h4, h5, p, ul, ol, dl, dd, figure) { margin: 0; }
.window :where(ul, ol) { padding: 0; list-style: none; }
.window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--code-bg);
}
.window-bar .dots { display: flex; gap: 0.35rem; flex: none; }
.window-bar .dots i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--border); }
.window-bar .url {
  min-width: 0;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font: 0.75rem ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }

/* Dashboard */

.app { display: grid; grid-template-columns: 12rem minmax(0, 1fr); }
.side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0.6rem;
  background: var(--side-bg);
  color: var(--side-fg);
  font-size: 0.875rem;
}
@media (max-width: 52rem) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
}
.side-brand { display: flex; align-items: center; gap: 0.45rem; padding: 0 0.5rem; color: var(--side-text); font-weight: 700; }
.side-brand .logo { width: 1.25rem; height: 1.25rem; }
.side-nav, .side-projects { display: grid; gap: 2px; }
.side-nav span, .side-projects span { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 6px; }
.side-nav span.on, .side-projects span.on { background: var(--side-hi); color: var(--side-text); }
.side-nav svg { width: 1.1rem; height: 1.1rem; flex: none; }
.side-projects span { justify-content: space-between; }
.side-projects em { font-style: normal; font-size: 0.75rem; opacity: 0.75; white-space: nowrap; }
.side-label { padding: 0 0.5rem 0.35rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }

.app-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; padding: 1.25rem; }
.proj-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.proj-head h3 { font-size: 1.35rem; line-height: 1.2; }
.proj-meta { color: var(--muted); font-size: 0.875rem; }

.rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
@media (min-width: 30rem) { .rail { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stage {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  width: 100%;
  height: 100%;
  padding: 0.55rem 0.6rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.stage:hover { border-color: var(--muted); }
.stage[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.stage.is-current { background: var(--accent-soft); }
.stage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.25rem; }
.stage-n { font-size: 1.35rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stage-state { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stage.is-done .stage-state { color: var(--ok); }
.stage.is-current .stage-state { color: var(--accent); }
.stage-t { min-height: 2.5em; font-size: 0.75rem; line-height: 1.25; color: var(--muted); }
.stage-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.stage-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.3s ease; }
.stage.is-done .stage-bar i { background: var(--ok); }

.app-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 60rem) { .app-cols { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 1rem; min-width: 0; }
.panel { display: grid; gap: 0.75rem; align-content: start; min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.panel-head h4 { color: var(--text); font-size: 0.95rem; }
.panel-head .sub { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.stage-desc { color: var(--muted); font-size: 0.875rem; }
.tasks li + li { border-top: 1px solid var(--border); }
.tasks label { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.5rem 0.1rem; font-size: 0.875rem; line-height: 1.45; cursor: pointer; }
.tasks input { flex: none; width: 1rem; height: 1rem; margin: 0.15rem 0 0; accent-color: var(--accent); cursor: pointer; }
.tasks input:checked + span { color: var(--muted); }
.tasks small { display: block; color: var(--muted); font-size: 0.75rem; }
.report-rows { display: grid; gap: 0.4rem; font-size: 0.875rem; }
.report-rows div { display: flex; justify-content: space-between; gap: 0.75rem; }
.report-rows dt { color: var(--muted); }
.report-rows dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

/* Site photos, drawn from the materials on site */

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.ph { position: relative; max-width: 100%; aspect-ratio: 4 / 3; margin: 0; border-radius: 4px; overflow: hidden; background-color: var(--sky); }
.ph[data-k="brick"] {
  background-image:
    linear-gradient(to bottom, var(--sky) 0 28%, transparent 28%),
    repeating-linear-gradient(0deg, var(--mortar) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(90deg, var(--mortar) 0 2px, transparent 2px 24px),
    linear-gradient(var(--brick), var(--brick-2));
}
.ph[data-k="joists"] {
  background-image:
    linear-gradient(to bottom, transparent 0 78%, var(--timber-2) 78%),
    repeating-linear-gradient(90deg, var(--timber) 0 9px, var(--timber-2) 9px 11px, transparent 11px 26px),
    linear-gradient(var(--sky-2), var(--sky));
}
.ph[data-k="steel"] {
  background-image:
    linear-gradient(to bottom, transparent 0 34%, var(--steel) 34% 45%, transparent 45%),
    linear-gradient(90deg, transparent 0 14%, var(--block-2) 14% 20%, transparent 20% 80%, var(--block-2) 80% 86%, transparent 86%),
    linear-gradient(to bottom, var(--sky) 0 34%, var(--brick) 34%);
}
.ph[data-k="block"] {
  background-image:
    repeating-linear-gradient(0deg, var(--block-2) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(90deg, var(--block-2) 0 2px, transparent 2px 34px),
    linear-gradient(var(--block), var(--block));
}
.ph[data-k="roof"] {
  background-image:
    linear-gradient(162deg, var(--sky) 0 38%, transparent 38%),
    repeating-linear-gradient(0deg, var(--slate) 0 8px, var(--slate-2) 8px 10px);
}
.ph[data-k="scaffold"] {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 30px, var(--pole) 30px 33px),
    repeating-linear-gradient(0deg, transparent 0 26px, var(--pole) 26px 29px),
    linear-gradient(to bottom, var(--sky) 0 52%, var(--brick) 52%);
}
.ph figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.9rem 0.5rem 0.35rem;
  background: linear-gradient(transparent, var(--scrim));
  color: var(--on-scrim);
  font: 0.65rem/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph.is-new { box-shadow: 0 0 0 3px var(--flag); }
.ph.is-new::after {
  content: "New";
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 3px;
  background: var(--flag);
  color: var(--flag-text);
  font-size: 0.65rem;
  font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) {
  .ph.is-new { animation: arrive 0.6s ease-out; }
  @keyframes arrive { from { transform: scale(0.85); opacity: 0.2; } to { transform: none; opacity: 1; } }
}

/* Client report */

.doc { display: grid; gap: 1.75rem; max-width: 46rem; margin: 0 auto; padding: 1.75rem 1.25rem 2rem; }
@media (min-width: 40rem) { .doc { padding: 2.25rem 2.5rem 2.5rem; } }
.doc-brand { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.practice { display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; font-weight: 600; }
.monogram { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; background: var(--text); color: var(--surface); font-size: 0.8rem; font-weight: 700; }
.doc-title h3 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; }
.doc-title p { color: var(--muted); }
.doc h4 { margin-bottom: 0.6rem; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.where-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-bottom: 0.75rem; }
.where-now b { font-size: 1.5rem; }
.where-now span { color: var(--muted); font-size: 0.875rem; }
.segs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.seg { display: grid; gap: 0.35rem; min-width: 0; }
.seg i { position: relative; height: 0.45rem; border-radius: 2px; background: var(--border); overflow: hidden; }
.seg.done i { background: var(--accent); }
.seg.now i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 30%); background: var(--accent); transition: width 0.3s ease; }
.seg span { color: var(--muted); font-size: 0.7rem; line-height: 1.25; }
.seg.now span { color: var(--text); font-weight: 600; }
@media (max-width: 40rem) {
  .seg span { display: none; }
  .seg.now span { display: block; white-space: nowrap; }
}
.note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem; }
.avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; font-weight: 700; }
.note-who { color: var(--muted); font-size: 0.875rem; }
.note-who b { color: var(--text); }
.note p + p { margin-top: 0.5rem; }
.decision { display: grid; gap: 0.6rem; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.decision-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.8rem; }
.flag { padding: 0.05rem 0.45rem; border-radius: 3px; background: var(--flag); color: var(--flag-text); font-size: 0.75rem; font-weight: 600; }
.decision h5 { font-size: 1.05rem; }
.decision p { color: var(--muted); font-size: 0.875rem; }
.choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.decision .decision-status { min-height: 1.4em; color: var(--ok); }
.dated li { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; padding: 0.55rem 0; font-size: 0.9rem; }
.dated.ruled li { border-top: 1px solid var(--border); }
.dated time { color: var(--muted); font-size: 0.8rem; padding-top: 0.1rem; font-variant-numeric: tabular-nums; }
.dated em { display: block; color: var(--accent); font-size: 0.75rem; font-style: normal; font-weight: 600; }
.doc-foot { padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; }

/* Site app: a phone, as in the Luno site */

.phone { max-width: 17rem; margin: 1.5rem auto; }
.media-layout .phone { margin-top: 0; }
.phone figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.9rem; }
.phone-frame {
  padding: 0.45rem;
  border-radius: 2.4rem;
  background: var(--device);
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
}
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 9 / 19;
  border-radius: 1.95rem;
  background: var(--device);
  color: var(--on-device);
  overflow: hidden;
  font-size: 0.8rem;
}
.status-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1.3rem 0.2rem; font-weight: 600; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.status-bar .notch { width: 5rem; height: 1.3rem; border-radius: 0.7rem; background: var(--device-2); }
.status-bar .bars { display: flex; align-items: flex-end; gap: 2px; height: 0.7rem; }
.status-bar .bars i { width: 3px; border-radius: 1px; background: var(--on-device); }
.proj-pick { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin: 0.5rem 0.7rem 0.6rem; padding: 0.45rem 0.7rem; border-radius: 0.7rem; background: var(--device-2); }
.proj-pick small { display: block; color: var(--on-device-2); font-size: 0.68rem; }
.viewfinder { position: relative; flex: 1; margin: 0 0.7rem; border-radius: 0.8rem; aspect-ratio: auto; }
/* Rule-of-thirds grid */
.viewfinder::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.35) 0 calc(33.33% + 0.5px), transparent 0 calc(66.66% - 0.5px), rgba(255, 255, 255, 0.35) 0 calc(66.66% + 0.5px), transparent 0),
    linear-gradient(transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.35) 0 calc(33.33% + 0.5px), transparent 0 calc(66.66% - 0.5px), rgba(255, 255, 255, 0.35) 0 calc(66.66% + 0.5px), transparent 0);
}
.vf-tags { position: absolute; top: 0.5rem; left: 0.5rem; right: 0.5rem; display: flex; justify-content: space-between; gap: 0.35rem; }
.vf-tags span { padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--scrim); color: var(--on-scrim); font-size: 0.65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flash { position: absolute; inset: 0; background: #ffffff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 0.35s ease-out; }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flash.go { animation: none; } }
.queue { display: grid; gap: 0.45rem; padding: 0.6rem 0.7rem 0.2rem; }
.queue-status { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--on-device-2); font-size: 0.7rem; }
.queue-status b { color: var(--on-device); font-weight: 600; }
.queue-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; min-height: 2.4rem; }
.qitem { position: relative; }
.qbar { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 3px; border-radius: 2px; background: var(--scrim); overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--on-scrim); }
.qitem.done .qbar { display: none; }
.qitem.done::after { content: "✓"; position: absolute; right: 2px; bottom: 2px; padding: 1px 3px; border-radius: 3px; background: var(--scrim); color: var(--on-scrim); font-size: 0.6rem; line-height: 1; }
.shutter-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0.6rem 1.4rem 1.2rem; color: var(--on-device-2); font-size: 0.68rem; }
.shutter-row span:last-child { text-align: right; }
.shutter {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  border: 4px solid var(--device);
  background: var(--on-device);
  box-shadow: 0 0 0 3px var(--on-device);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.shutter:active { transform: scale(0.92); }
.shutter:focus-visible { outline: 3px solid var(--flag); outline-offset: 5px; border-radius: 50%; }

.log { margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.log-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); background: var(--code-bg); font-size: 0.9rem; }
.log-head span { color: var(--muted); font-size: 0.8rem; }
.log ol { max-height: 15rem; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.log li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.55rem 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.log li:first-child { border-top: 0; }
.log li.fresh { background: var(--accent-soft); }
.log time { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.log .ok { display: block; color: var(--ok); font-size: 0.8rem; }

/* Footer */

.site-footer { padding: 2rem 0; color: var(--muted); font-size: 0.9rem; }
