/* 1920x1080, dark, read from across a room (CLAUDE.md, Layout).
   One font, served from this site (no third-party assets; CSP default-src
   'self'): the Pi and every phone's preview measure the same glyphs, so the
   editor's preview fits and wraps exactly as the wall does (#19). DejaVu Sans,
   subset to Latin + Latin Extended-A; license in fonts/LICENSE-DejaVu.txt.
   "swap", not "block": the clock must never be blank, so it draws in the
   fallback first and render.js refits once the font is in. */
@font-face { font-family: "Memory Aid Sans"; src: url("fonts/DejaVuSans.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Memory Aid Sans"; src: url("fonts/DejaVuSans-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap; }
/* Emoji: whatever a phone keyboard sends draws from one font, the same on the
   Pi and in Chrome previews. Noto Color Emoji (SIL OFL 1.1, license in
   fonts/LICENSE-NotoColorEmoji.txt). unicode-range keeps the 9.6 MB file from
   loading until an emoji is actually on screen. tech(color-CBDT): a browser
   that can't draw it (Safari, Firefox) skips it and uses its own emoji. */
@font-face { font-family: "Memory Aid Emoji"; font-display: swap;
  src: url("fonts/NotoColorEmoji.woff2") format("woff2") tech(color-CBDT);
  unicode-range: U+200D, U+20E3, U+2122, U+2139, U+2194-2199, U+21A9-21AA, U+231A-231B, U+2328, U+23CF, U+23E9-23F3,
    U+23F8-23FA, U+24C2, U+25AA-25AB, U+25B6, U+25C0, U+25FB-25FE, U+2600-27BF, U+2934-2935, U+2B05-2B07,
    U+2B1B-2B1C, U+2B50, U+2B55, U+3030, U+303D, U+3297, U+3299, U+FE0F, U+1F000-1FAFF, U+E0020-E007F; }

/* Palette. Every text colour clears WCAG AAA (7:1) against the darkest and
   the lightest point of the page's background and of the note card; the
   ratios are in the PR that set them (the beautification pass, 2026-11-23).
   Decoration (rules, item bars, card fills) carries no meaning on its own. */
:root {
  --bg: #0b0e13;
  --bg-top: #121a26;      /* the background's one gradient: lighter at the top */
  --fg: #f6f2ea;          /* warm white */
  --soft: #d9d3c7;        /* date line, Coming up text */
  --muted: #b7b0a3;       /* headings, seconds */
  --accent: #ffd27a;      /* times */
  --rule: #263040;
  --bar-today: #e8b85c;
  --bar-coming: #4a5568;
  --card: #1a1710;        /* the note's warm card */
  --card-edge: #3a3222;
  --font: "Memory Aid Sans", "Memory Aid Emoji", "DejaVu Sans", "Noto Sans", "Liberation Sans", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  cursor: none;
}
/* One static gradient, painted once: no animation, nothing for the Pi to
   redraw but the seconds. */
body { background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 560px) var(--bg); }

#board {
  position: relative;
  width: 1920px;
  height: 1080px;
  padding: 52px 80px 44px;
  display: grid;
  grid-template-columns: 1040px 1fr;
  grid-template-rows: auto auto minmax(0, 1fr); /* the note takes what the plan leaves */
  column-gap: 80px;
  row-gap: 28px;
}

/* ---- Clock band: the floor of the whole screen ---- */
#clock {
  grid-column: 1 / span 2;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  column-gap: 48px;
  padding-bottom: 22px;
  /* A rule that glows warm in the middle and fades at the ends. */
  background: linear-gradient(90deg, transparent, #4b4231 30%, #4b4231 70%, transparent) bottom / 100% 2px no-repeat;
}
/* --k shrinks the whole band when a long day (Wednesday) and the time
   don't fit side by side; render.js sets it. Never clip, never wrap. */
#weekday { font-size: calc(150px * var(--k, 1)); font-weight: 700; line-height: 1.0; letter-spacing: -0.01em; }
#date    { font-size: calc(72px * var(--k, 1));  line-height: 1.2; margin-top: 12px; white-space: nowrap; color: var(--soft); }
.hour    { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
#time    { font-size: calc(170px * var(--k, 1)); font-weight: 700; line-height: 1.0; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }
/* Seconds tick, small and quiet beside the hour (Chris, 2026-11-22). */
#ss      { font-size: calc(72px * var(--k, 1)); font-weight: 400; color: var(--muted); letter-spacing: 0; }
#ampm    { font-size: 0.62em; letter-spacing: 0; }

/* "It is Monday morning", in a pill tinted for the time of day, with a small
   sun or moon drawn in CSS (no image, no emoji font). render.js sets
   data-part; the words, not the colour, carry the meaning. */
#daypart {
  font-size: calc(54px * var(--k, 1));
  white-space: nowrap;
  line-height: 1.2;
  margin-top: 14px;
  padding: 0.12em 0.6em 0.14em 0.5em;
  border-radius: 999px;
  color: var(--dp-fg, #ffe1a3);
  background: var(--dp-bg, #2a2417);
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
}
#daypart::before {
  content: "";
  flex: none;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: var(--dp-fg, #ffe1a3);
}
#daypart[data-part="morning"]   { --dp-fg: #ffe1a3; --dp-bg: #2b2517; }
#daypart[data-part="afternoon"] { --dp-fg: #ffd0a1; --dp-bg: #2d2219; }
#daypart[data-part="evening"]   { --dp-fg: #ffc4b4; --dp-bg: #2e1f22; }
#daypart[data-part="night"]     { --dp-fg: #cdd6ff; --dp-bg: #1c2136; }
/* Evening: the sun is half down. Night: a crescent moon. */
#daypart[data-part="evening"]::before {
  border-radius: 0.31em 0.31em 0 0;
  height: 0.31em;
  margin-top: 0.15em;
}
#daypart[data-part="night"]::before {
  background: transparent;
  box-shadow: inset 0.16em -0.06em 0 0 var(--dp-fg);
}

/* When the device clock can't be trusted the band hides; the plan stays. */
body.no-clock #clock { display: none; }

/* ---- Lists ---- */
#today  { grid-column: 1; grid-row: 2; min-width: 0; overflow: hidden; }
#coming { grid-column: 2; grid-row: 2; min-width: 0; overflow: hidden; }

h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

ul { list-style: none; }
/* Each item hangs off a short bar: gold for today, slate for later. */
li {
  margin-bottom: 14px;
  min-width: 0;
  padding-left: 26px;
  border-left: 6px solid var(--bar-today);
  border-radius: 3px;
}
#coming li { border-left-color: var(--bar-coming); padding-left: 22px; }
li:last-child { margin-bottom: 0; } /* the space goes to the note */

.when {
  display: block;
  font-size: 34px;
  line-height: 1.15;
  color: var(--accent);
}
.what {
  display: block;
  font-size: 54px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#coming .when { font-size: 30px; }
#coming .what { font-size: 40px; color: var(--soft); }

/* ---- Note: a warm card, like a note on the fridge ---- */
#note {
  grid-column: 1 / span 2;
  grid-row: 3;
  align-self: end;
  max-height: 100%;
  font-size: 50px;   /* render.js shrinks it to fit, never below 32 px */
  line-height: 1.15;
  background: var(--card);
  border: 2px solid var(--card-edge);
  border-left: 8px solid var(--bar-today);
  border-radius: 20px;
  padding: 12px 32px 14px 30px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* Hidden copy of the note's text box at the floor size: the editor asks it
   whether a note fits before saving (render.js noteFits). */
#note-probe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1688px; /* the note's text width: 1920 - 2 x 80 board padding - 8 and 2 borders - 30 and 32 padding */
  line-height: 1.15;
  overflow-wrap: anywhere;
  visibility: hidden;
  pointer-events: none;
}

/* Only the family notices: content is older than 36 h. It sits in the
   board's right margin, clear of the note card. */
#stale-dot {
  position: absolute;
  right: 30px;
  bottom: 24px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #5b5f66;
}

[hidden] { display: none !important; }
