/*
  dindins.me: one look for every page. docs/site/SITE.md says what is here and why.

  The values are the app's `print` palette (docs/PALETTE.md, DESIGN.md "Colour"). The cloth
  is the app's weave (DESIGN.md "The weave, by day and by night"): lava warp, indigo weft,
  printed as dots on warm paper. The type is the app's: SF Rounded black for headings, SF for
  what you read. Everything is lower case, as in the app.
*/

:root {
  color-scheme: light dark;
  --paper: #FBF5EC;
  --ground: #FBF5EC;
  --ink: #1A1512;
  --mute: rgba(26, 21, 18, 0.64);
  --line: rgba(26, 21, 18, 0.10);
  --surface: rgba(255, 255, 255, 0.8);
  --sheet: #FFFCF7;
  --lava: #FF4A1C;
  --on-lava: #1A1512;
  --indigo: #2E3192;
  /* A step that is done: the app's tick, in indigo, the ink the upload toast draws it in. */
  --done: var(--indigo);
  --done-wash: color-mix(in srgb, var(--indigo) 14%, var(--sheet));
  --tongue: #FF6F9C;
  --focus: #2E3192;
  /* The table's own inks, from the rig's plan.json. */
  --tea: #BC7527;
  --rim: #3D5588;
  /* How much ink a thread takes: about 11% dots by day, 9% at night. */
  --warp-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cpattern id='d' width='2.6' height='2.6' patternUnits='userSpaceOnUse' patternTransform='rotate(15)'%3E%3Ccircle cx='1.3' cy='1.3' r='0.36' fill='%23FF4A1C'/%3E%3C/pattern%3E%3Crect width='100%25' height='100%25' fill='url(%23d)'/%3E%3C/svg%3E");
  --weft-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cpattern id='d' width='2.6' height='2.6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Ccircle cx='1.3' cy='1.3' r='0.36' fill='%232E3192'/%3E%3C/pattern%3E%3Crect width='100%25' height='100%25' fill='url(%23d)'/%3E%3C/svg%3E");
  --blend: multiply;
  --night: 0;
  --settle: linear(0, 0.072, 0.233, 0.423, 0.605, 0.757, 0.874, 0.955, 1.006, 1.034, 1.045, 1.045, 1.039, 1.031, 1.022, 1.014, 1.008, 1.004, 1.001, 0.999, 0.998, 0.998, 1);
  --arrive: linear(0, 0.095, 0.286, 0.486, 0.657, 0.786, 0.877, 0.936, 0.972, 0.992, 1.002, 1.006, 1.006, 1.006, 1.004, 1.003, 1.002, 1.001, 1.001, 1);
  --out: cubic-bezier(0.22, 1, 0.36, 1);
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141110;
    --ground: #221D1A;
    --ink: #F6EFE7;
    --mute: rgba(246, 239, 231, 0.74);
    --line: rgba(255, 255, 255, 0.12);
    --surface: #26201D;
    --sheet: #2A2421;
    --lava: #FF5A2B;
    --indigo: #B3B1E6;
    --tongue: #FF8DB4;
    --focus: #B3B1E6;
    --tea: #AC6A22;
    /* At night the inks are light: they add light to the stock. */
    --warp-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cpattern id='d' width='2.6' height='2.6' patternUnits='userSpaceOnUse' patternTransform='rotate(15)'%3E%3Ccircle cx='1.3' cy='1.3' r='0.32' fill='%23FF5A2B'/%3E%3C/pattern%3E%3Crect width='100%25' height='100%25' fill='url(%23d)'/%3E%3C/svg%3E");
    --weft-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cpattern id='d' width='2.6' height='2.6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Ccircle cx='1.3' cy='1.3' r='0.32' fill='%23B3B1E6'/%3E%3C/pattern%3E%3Crect width='100%25' height='100%25' fill='url(%23d)'/%3E%3C/svg%3E");
    --blend: screen;
    --night: 1;
  }
}

@media (prefers-contrast: more) {
  :root { --mute: rgba(26, 21, 18, 0.78); --line: rgba(26, 21, 18, 0.22); --surface: #FFFFFF; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --mute: rgba(246, 239, 231, 0.86); --line: rgba(255, 255, 255, 0.26); --surface: #332B27; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  /* No background here: the cloth sits under the page, and the root holds the ground. */
  font: 17px/1.47 var(--text);
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The cloth: the ground on every page, pinned to the window, so it never swims. */
.cloth {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--ground);
  /* Tonight's cloth: table.js sets these from the weekday, as the app does. Sunday's gingham
     is the fallback. */
  --pitch: 40px;
  --thread: 20px;
  --cross: 20px;
  --phase: 0px;
}
.cloth i { position: absolute; inset: 0; mix-blend-mode: var(--blend); }
/* One ink, one layer: a screen of hard dots at the ink's own angle, cut to the threads. The
   dots are 2.6 px apart, as in the app. The warp runs down the cloth, in lava at 15 degrees. */
.cloth .warp {
  -webkit-mask: var(--warp-mask, repeating-linear-gradient(90deg, #000 0 var(--thread), transparent var(--thread) var(--pitch)));
  mask: var(--warp-mask, repeating-linear-gradient(90deg, #000 0 var(--thread), transparent var(--thread) var(--pitch)));
}
/* The weft runs across it, in indigo at 45 degrees. */
.cloth .weft {
  -webkit-mask: var(--weft-mask, repeating-linear-gradient(180deg, transparent 0 var(--phase), #000 var(--phase) calc(var(--phase) + var(--cross)), transparent calc(var(--phase) + var(--cross)) calc(var(--phase) + var(--pitch))));
  mask: var(--weft-mask, repeating-linear-gradient(180deg, transparent 0 var(--phase), #000 var(--phase) calc(var(--phase) + var(--cross)), transparent calc(var(--phase) + var(--cross)) calc(var(--phase) + var(--pitch))));
}
/* The dots are drawn at their angle inside a layer the size of the window, so nothing
   bigger than the window is ever turned or kept in memory. */
.cloth .warp { background: var(--warp-dots) 0 0 / 100% 100%; }
.cloth .weft { background: var(--weft-dots) 0 0 / 100% 100%; }
/* The paper's clouds and fibres, very lightly. */
.cloth .grain {
  position: absolute;
  inset: 0;
  opacity: calc(0.5 - var(--night) * 0.25);
  mix-blend-mode: var(--blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .35 0 0 0 -1.6 .9'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The page. One column on a phone; the table beside the words on a wide screen. */
.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.top { display: flex; justify-content: center; padding: 4px 0 8px; }
.wordmark { display: block; width: 112px; height: auto; }
.wordmark .ink { fill: var(--ink); }
.wordmark .tongue { fill: var(--tongue); }
.wordmark-link { border-radius: 12px; }

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 8px;
}
.words { width: 100%; max-width: 440px; text-align: center; }
/* The words sit on a sheet of paper laid on the cloth: the cloth never sits behind text. */
.sheet {
  background: var(--sheet);
  border-radius: 32px;
  padding: 28px 22px 22px;
  box-shadow: 0 1px 1px rgba(26, 21, 18, 0.05), 0 2px 6px rgba(26, 21, 18, 0.05), 0 22px 44px -22px rgba(26, 21, 18, 0.38);
}
@media (min-width: 860px) { .sheet { padding: 40px 36px 32px; } }
/* Inside the sheet, a card is a section of it: a hairline, not a second sheet. */
.sheet .card, .sheet .next {
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 16px 0 0;
  margin-top: 4px;
}

@media (min-width: 860px) {
  .page { padding-top: 32px; padding-bottom: 32px; }
  .top { justify-content: flex-start; padding-left: 8px; }
  .stage {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 48px;
  }
  .words { text-align: left; justify-self: start; }
  .words .steps-lines, .words .next { margin-left: 0; margin-right: 0; }
}

h1, h2, .button, .lines {
  font-family: var(--rounded);
  font-weight: 900;
}
h1 {
  font-size: clamp(34px, 9.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  text-wrap: balance;
}
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 800; }
p { margin: 0; }
.lede { color: var(--mute); margin: 0 auto 22px; max-width: 34ch; text-wrap: pretty; }
@media (min-width: 860px) { .lede { margin-left: 0; font-size: 19px; } }

/* The how-to page's three lines. The one the table is showing is in ink. */
.lines {
  list-style: none;
  margin: 0 auto 24px;
  padding: 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.lines li { color: var(--ink); text-wrap: balance; transition: opacity 0.25s var(--out); }
.lines li + li { margin-top: 4px; }
/* A faint line keeps 3:1 on the sheet, light and dark: it is large text. */
.playing .lines li { opacity: 0.5; }
.playing .lines li.now { opacity: 1; }

.next {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px 20px;
  text-align: left;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 8px 24px -12px rgba(26, 21, 18, 0.18);
}
.next svg { width: 36px; height: 36px; }
.next p { color: var(--mute); font-size: 15px; }
.next strong { display: block; color: var(--ink); font: 800 17px/1.3 var(--rounded); letter-spacing: -0.01em; margin-bottom: 2px; }

.note { color: var(--mute); font-size: 14px; margin-top: 16px; }

/* Cards and steps: the invite page. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 8px 20px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 10px 30px -14px rgba(26, 21, 18, 0.22);
}
.steps { list-style: none; margin: 0; padding: 0; }
.steps > li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 16px 0; }
.steps > li + li { border-top: 1px solid var(--line); }
.n {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font: 800 15px/1 var(--rounded);
}
.step h2 { margin-top: 4px; }
/* The first two steps, TestFlight and dindins, are where people get stuck: bigger, one button
   each. */
.steps > li.first { grid-template-columns: 40px 1fr; }
.steps > li.first .n { width: 40px; height: 40px; font-size: 18px; }
.steps > li.first h2 { font-size: 22px; margin-top: 7px; }
/* The step now is in lava, as its button is. A step that is done goes quiet, in indigo, and
   its button shows the tick (steps.js). */
.steps > li.now .n { background: var(--lava); color: var(--on-lava); }
.steps > li.done .n { background: var(--done-wash); color: var(--done); }
.button.finished { background: var(--done-wash); color: var(--done); box-shadow: none; }
.button .tick {
  width: 20px; height: 20px; margin-right: 8px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 4.48; stroke-linecap: round; stroke-linejoin: round;
}
/* Words for a screen reader only. */
.hush { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A phone at 200% zoom is under 300 px wide. The number goes over its step, so the words
   and the buttons keep the width of the sheet. */
@media (max-width: 299px) {
  .sheet { padding-left: 14px; padding-right: 14px; }
  .steps > li, .steps > li.first { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .button { text-align: center; }
}
.step p { color: var(--mute); font-size: 15px; }
.step p.aside { font-size: 14px; margin-top: 10px; }
.copied { color: var(--mute); font-size: 14px; margin-top: 8px; min-height: 1.4em; }

.button {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; margin-top: 14px; padding: 0 24px;
  border-radius: 999px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--out), box-shadow 0.15s var(--out);
}
/* The press: in at once, out over 0.15s, to 0.95. DESIGN.md, "Motion". */
.button:active { transform: scale(0.95); transition-duration: 0s; }
/* Lava is the one action on a page, with dark ink on it. Never white. */
.lava { background: var(--lava); color: var(--on-lava); box-shadow: 0 6px 16px -8px rgba(255, 74, 28, 0.7); }
.quiet { background: var(--ink); color: var(--paper); }
@media (hover: hover) {
  .lava:hover { box-shadow: 0 10px 22px -10px rgba(255, 74, 28, 0.9); }
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.button:focus-visible { outline-offset: 4px; }

.foot { color: var(--mute); font-size: 14px; text-align: center; padding-top: 28px; min-height: 48px; }
.foot a { color: var(--mute); text-decoration-thickness: 1px; text-underline-offset: 3px; }

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The table from above ----------
   The how-to table (docs/HOWTO.md), printed by the app's own press on the print rig:
   scripts/print-rig/site.swift. Every layer is the whole table, 402 by 490, so each part
   moves round its own middle with no measuring. The numbers are the rig's plan.json. */
.table {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 402 / 490;
  margin: 0 auto;
  contain: layout paint;
}
.table > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.table img { display: block; user-select: none; -webkit-user-drag: none; }
.table picture img { width: 100%; height: 100%; }
/* The dinners and the tea print onto the paper under them, as the press does. */
.table .theirs, .table .yours, .table .tea { mix-blend-mode: multiply; }
.table .yours { transform-origin: 50% 84.08%; }        /* your plate: 201, 412 */
.table .tea { transform-origin: 69.9% 73.06%; }        /* your cup: 281, 358 */
.table .pot { transform-origin: 52.49% 45.71%; }       /* the pot: 211, 224 */
.table .marks { overflow: visible; }
.table .corners { transform-origin: 201px 412px; transform-box: view-box; opacity: 0; }
.table .stream {
  opacity: 0;
  fill: none;
  stroke: var(--tea);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.table .corners { fill: none; stroke: var(--rim); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 860px) { .table { width: min(100%, 560px); } }
/* On the invite and the lost page, the words carry the page, so the table is smaller. */
.invite .table, .lost .table { width: min(66%, 300px); }
@media (min-width: 860px) { .invite .table, .lost .table { width: min(100%, 460px); } }
.lost .home { max-width: 280px; margin: 8px auto 0; }
@media (min-width: 860px) { .lost .home { margin-left: 0; } }

/* At rest, as each page lays it. */
.table[data-rest="told"] .theirs { opacity: 1; }
.table[data-rest="seat"] .yours,
.table[data-rest="seat"] .tea,
.table[data-rest="empty"] .theirs,
.table[data-rest="empty"] .yours,
.table[data-rest="empty"] .tea { opacity: 0; }
.table[data-rest="seat"] .corners { opacity: 1; }

/* The story plays once, as the page opens, then the table holds still. A screen at rest
   costs nothing. table.js adds `play` once every layer has decoded, so no part pops in late. */
.js .table:not(.play) { opacity: 0; }
.table.play { animation: in 0.4s var(--out) both; }
@keyframes in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

/* The home page: snap your dinner, dig in, come back later and spill the tea. */
.table.play[data-story="home"] .corners { animation: aim 1.7s var(--out) 0.45s both; }
.table.play[data-story="home"] .yours { animation: land 0.56s var(--settle) 1.75s both, fade-in 0.2s ease-out 1.75s both; }
.table.play[data-story="home"] .theirs { animation: clear 0.7s var(--out) 2.45s both; }
.table.play[data-story="home"] .pot { animation: pour 2.2s ease-in-out 3.5s both; }
.table.play[data-story="home"] .stream { animation: run 1.05s linear 3.95s both; }
.table.play[data-story="home"] .tea { animation: grow 0.45s var(--out) 4.35s both; }
/* Before the story: a line in the head marks the page `js`, so with no script the table
   shows the story told. */
.js .table[data-story="home"]:not(.play) .theirs { filter: blur(6px); opacity: 0.55; }
.js .table[data-story="home"]:not(.play) .yours,
.js .table[data-story="home"]:not(.play) .tea { opacity: 0; }

/* The invite: a seat for you. Your friends have eaten, and the camera finds your plate. */
.table.play[data-story="invite"] .corners { animation: find 0.7s var(--out) 0.5s both; }

@keyframes aim {
  0% { opacity: 0; transform: scale(1.3); }
  35% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  /* The shutter: the corners blink shut on the shot. */
  78% { opacity: 1; transform: scale(0.94); }
  100% { opacity: 0; transform: scale(0.94); }
}
@keyframes find {
  from { opacity: 0; transform: scale(1.3); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes land { from { transform: scale(1.16); } to { transform: scale(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes clear {
  from { filter: blur(6px); opacity: 0.55; }
  to { filter: blur(0); opacity: 1; }
}
/* The pot lifts toward your cup, a little bigger round its own middle, holds while it pours,
   and goes back. It never turns. The lift is the rig's: 23.15, 44.32 of 402 by 490. */
@keyframes pour {
  0% { transform: none; }
  22%, 72% { transform: translate(5.76%, 9.04%) scale(1.07); }
  100% { transform: none; }
}
/* The tea from the spout's mouth to the middle of the cup, then its tail follows it in. */
@keyframes run {
  0% { opacity: 1; stroke-dashoffset: 1; }
  40% { stroke-dashoffset: 0; }
  62% { stroke-dashoffset: 0; }
  99% { opacity: 1; stroke-dashoffset: -1; }
  100% { opacity: 0; stroke-dashoffset: -1; }
}
@keyframes grow { from { transform: scale(0); } to { transform: scale(1); } }

/* Reduce Motion: the story is already told. Nothing moves, and nothing waits. */
@media (prefers-reduced-motion: reduce) {
  .js .table:not(.play) { opacity: 1; }
  .table *, .table { animation: none !important; transition: none !important; }
  .table[data-story="home"] .theirs { filter: none !important; opacity: 1 !important; }
  .table[data-story="home"] .yours, .table[data-story="home"] .tea { opacity: 1 !important; }
  .table[data-story="home"] .corners, .table .stream { opacity: 0 !important; }
  .table[data-story="invite"] .corners { opacity: 1 !important; }
  .playing .lines li { opacity: 1; }
  .button, .lines li { transition: none; }
  .button:active { transform: none; }
}

/* ---------- The reading pages: privacy and terms ----------
   One sheet of paper on the cloth, a column you can read, and each part under a hairline. */
.doc {
  width: 100%;
  max-width: 640px;
  margin: 8px auto 0;
  text-align: left;
}
.doc h1 { text-align: center; }
.doc .lede { text-align: center; margin-bottom: 6px; }
.doc .updated { color: var(--mute); font-size: 14px; text-align: center; margin: 0 0 20px; }
.doc .card { padding-top: 20px; margin-top: 20px; }
.doc .card h2 { margin: 0 0 8px; }
.doc .card p { color: var(--ink); }
.doc .card p + p, .doc .card p + ul, .doc .card ul + p { margin-top: 10px; }
/* A bullet is a small ink dot, like the list on the app's delete-account screen. */
.doc ul.dots { list-style: none; margin: 0; padding: 0; }
.doc ul.dots li { position: relative; padding: 4px 0 4px 18px; }
.doc ul.dots li::before {
  content: ""; position: absolute; left: 2px; top: calc(4px + 0.62em);
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: 0.4;
}
.doc a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (min-width: 860px) {
  .reading .top { justify-content: center; padding-left: 0; }
  .doc .card { font-size: 17px; }
}

/* ---------- A seat at a table: the table's link, /t/<code> ----------
   A table is a smaller group, with its own cloth (docs/tables/TABLES.md, 3.1). A cloth prints in
   one ink, but the floral, which prints two, and every table's cloth runs on the bias, at 45
   degrees: a square cloth is all friends, a diagonal cloth is a table. The inks are the app's
   tokens of the same names (`ginghamInk`, `tickingInk`, `plaidInk`, `paneInk`, `floralInk` and
   `floralLeaf` in Palette.swift), with their primitives' values. t/index.html lays the cloth:
   these say only which ink. */
:root {
  --gingham-ink: #3D5588;   /* blue */
  --ticking-ink: #2B9956;   /* basil */
  --plaid-ink: #914E72;     /* wine */
  --pane-ink: #8A7440;      /* strawNight */
  --floral-ink: #C0225F;    /* crimson: the petals */
  --floral-leaf: #3FB26B;   /* jade: the leaves, the stem and the heart */
  /* A person with no face: their initial on one of these, the app's `Palette.tints`. */
  --tint-0: #F2C9A6; --tint-1: #E0AEB6; --tint-2: #BDD1C2; /* apricot, rose, sage */
  --tint-3: #C5C9E2; --tint-4: #F2DBA6; --tint-5: #D0BEDD; /* periwinkle, straw, lilac */
  /* The table's top, under its cloth: the sheet's paper. */
  --table-top: #FFFCF7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gingham-ink: #C5C9E2; /* periwinkle */
    --ticking-ink: #49CC7C; /* basilNight */
    --plaid-ink: #E0AEB6;   /* rose */
    --pane-ink: #F2DBA6;    /* straw */
    --floral-ink: #FF8DB4;  /* pinkNight */
    --floral-leaf: #55C27F; /* jadeNight */
    --tint-0: #8A5A3A; --tint-1: #7D4B55; --tint-2: #4C6A55;
    --tint-3: #505879; --tint-4: #8A7440; --tint-5: #5F4E72;
    /* At night a shadow does not show on the ground, so the top is a step lighter. */
    --table-top: #3A312C;
  }
}
@media (prefers-contrast: more) {
  :root {
    --gingham-ink: #2F4677; --ticking-ink: #288D4F; --plaid-ink: #7E3F62; --pane-ink: #6B6350;
    --floral-ink: #951648; --floral-leaf: #2E9A58;
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --gingham-ink: #CFCDFA; --ticking-ink: #5AD68A; --plaid-ink: #FFA6C6; --pane-ink: #F2DBA6;
    --floral-ink: #FFA6C6; --floral-leaf: #6AD090;
  }
}

/* The table's cloth over tonight's. It waits, clear, until the page knows the table, then comes
   in once. Pinned to the window, as every cloth. */
.cloth.bias { opacity: 0; transition: opacity 0.3s var(--out); }
.cloth.bias.on { opacity: 1; }

/* The table from above, as the app draws it (`SeatPlan`, TABLES.md 3.13): the cloth on the bias,
   the first emoji of the name in the middle, the host at the top centre. A link shows only the
   people you may see, so signed out the host sits alone: a square, one face, no empty seat. The
   count is in words under it. A face is 64 px; a pitch is 1.3 faces; the square is two. */
.seat-at {
  --face: 64px;
  --side: calc(var(--face) * 2.6);
  position: relative;
  /* With no script, or no code, there is no table to show. */
  display: none;
  width: var(--side);
  height: var(--side);
  margin: calc(var(--face) / 2 + 12px) auto 20px;
}
.table-link .seat-at { display: block; }
.seat-at .top-of-table {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: calc(var(--side) * 0.12);
  background: var(--table-top);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 1px rgba(26, 21, 18, 0.06), 0 3px 8px rgba(26, 21, 18, 0.06), 0 24px 40px -24px rgba(26, 21, 18, 0.45);
}
.seat-at .top-of-table i { position: absolute; inset: 0; mix-blend-mode: var(--blend); }
.seat-at .centre {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--face) * 0.66);
  line-height: 1;
  /* The emoji sits on the cloth like a thing on a table: a soft shadow under it. */
  filter: drop-shadow(0 3px 4px rgba(26, 21, 18, 0.22));
}
.seat-at .host {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--face);
  height: var(--face);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  /* The seat before anybody is in it: the table's own paper, with a fine rim. */
  background: var(--table-top);
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px var(--sheet), 0 6px 14px -6px rgba(26, 21, 18, 0.45);
}
/* Who sits there: their face, or their initial on their colour, as in the app (`Face`). */
.who { position: absolute; inset: 0; display: grid; place-items: center; }
.who.initial {
  background: var(--tint);
  color: var(--ink);
  font: 800 calc(var(--face) * 0.42)/1 var(--rounded);
  text-transform: none;
}
.who img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* An invite's friend, at the head of the table (/j/): in the clear space between the top two
   cups, your empty plate at the foot. Inside the picture, which clips what is outside it. */
.friend { display: none; }
.invite-link .table > .friend {
  --face: 52px;
  display: block;
  inset: auto;
  left: 50%;
  top: 4%;
  width: var(--face);
  height: var(--face);
  transform: translateX(-50%);
  border-radius: 50%;
  overflow: hidden;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px var(--sheet), 0 6px 14px -6px rgba(26, 21, 18, 0.45);
  transition: opacity 0.45s var(--out);
}
@media (min-width: 860px) { .invite-link .table > .friend { --face: 76px; } }
.invite-link .friend .who { opacity: 0; transition: opacity 0.45s var(--out); }
.invite-link.laid .friend .who { opacity: 1; }
.invite-link.empty .table > .friend { opacity: 0; }

/* A table's link loads once, calmly. From the first frame the table holds its place as an empty
   table, and the words hold theirs, unseen: two lines for the title, two for the name, and one
   for the count. An invite's page (/j/, `invite-link`) holds its title and its friend's seat
   the same way. The stage is laid from the top, not centred, so a shorter page (a dead link
   has no steps) leaves the table where it was. When the table and its host's face are ready,
   they and the words fade in together, and nothing moves (t/index.html). */
.table-link .stage, .invite-link .stage { align-content: start; align-items: start; }
/* The ground is plain paper until the table comes: tonight's cloth never shows first. The
   table's own cloth fades in with the table (#ground, `on`). */
.table-link .cloth:not(.bias) .warp, .table-link .cloth:not(.bias) .weft { display: none; }
.table-link .words > *, .invite-link .words > * { opacity: 0; transition: opacity 0.45s var(--out); }
.table-link.told .words > *, .invite-link.told .words > * { opacity: 1; }
:is(.table-link, .invite-link):not(.settled) #title, :is(.table-link, .invite-link).late #title { min-height: 2lh; }
.table-link:not(.settled) :is(#name, #count):empty,
.table-link.late :is(#name, #count):empty { display: block; }
.table-link #name, .table-link #count { min-height: 1lh; }
/* A name can take two lines. Before the answer, and after a late one, it holds room for two. */
.table-link:not(.settled) #name, .table-link.late #name { min-height: 2lh; }
.seat-at .top-of-table i, .seat-at .centre, .seat-at .who { opacity: 0; transition: opacity 0.45s var(--out); }
.laid .seat-at .top-of-table i, .laid .seat-at .centre, .laid .seat-at .who { opacity: 1; }
/* No table to show (a dead link, or no answer): the empty seat goes, the empty table stays. */
.seat-at .host { transition: opacity 0.45s var(--out); }
.empty .seat-at .host { opacity: 0; }
.seat-name {
  font: 900 26px/1.15 var(--rounded);
  letter-spacing: -0.02em;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.seat-count { color: var(--mute); font-size: 15px; margin: 0 0 18px; }
/* A table's name and count show only once the page knows them. */
.seat-name:empty, .seat-count:empty { display: none; }
.seat .lede { margin-bottom: 18px; }
@media (min-width: 860px) {
  .seat-at { --face: 80px; }
  .seat-name { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .cloth.bias, .table-link .words > *, .invite-link .words > *, .seat-at .top-of-table i, .seat-at .centre, .who, .seat-at .host,
  .invite-link .table > .friend { transition: none; }
}
