/*
 * The Wassaaa brand on the web (Package 13; review D11; design/DESIGN_LANGUAGE.md
 * §2 colour, §3 type, §5 "The web"). The one small stylesheet the guest pages
 * (/v, /t, /j) and the public site wear, so the page a code opens looks like
 * the app it leads to:
 *
 * - the fonts, served by Wassaaa from /fonts (never fetched from Google, so a
 *   visitor's address is not sent to a third party), shown at once in the
 *   phone's own font and swapped in when they arrive;
 * - the colours as roles with the spec's names, daylight by default and night
 *   when the browser asks for it;
 * - the parts: the logo tile (one drawing, /brand/logo.svg) and the
 *   wordmark, buttons, card, chip, the live pill, field, link, a focus ring
 *   that can be seen, the skip link, and stillness for reduced motion.
 *
 * Page layout lives on top: site.css (the public site), door.css (the door
 * pages). The portals keep console.css (their redesign is Package 16); its
 * sign-in screens mirror these colours, and functions/test/webBrand.test.js
 * fails if the two drift. Contrast is measured in
 * functions/test/portalContrast.test.js: every pair of colours the parts below
 * put together, in daylight and at night (Package 22e). Change a part's
 * colours, add its pair there.
 */

@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/BricolageGrotesque-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/BricolageGrotesque-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/InstrumentSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/InstrumentSans-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/InstrumentSans-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* Daylight. */
:root {
  color-scheme: light dark;
  --canvas: #EFEAE1;
  --surface: #FAF7F2;
  --raised: #FFFFFF;
  --sunken: #E4DFD5;
  --ink: #15201D;
  --ink2: #55625C;
  --ink3: #57615C;
  --line: #DDD9CF;
  --line2: #C9C4B8;
  --strong-line: #87857D;
  --accent: #D03915;
  --on-accent: #FFFFFF;
  --accent-soft: #FFE6DE;
  --accent-ink: #B82F0F;
  --signal: #367026;
  --on-signal: #FFFFFF;
  --danger: #B3261E;
  --success: #256C45;
  --focus: #B82F0F;
  --glass: rgba(250, 247, 242, 0.82);
  --shadow: rgba(21, 32, 29, 0.10);
}

/* Night. */
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0B1512;
    --surface: #141F1B;
    --raised: #1D2A25;
    --sunken: #080F0D;
    --ink: #F1F4F0;
    --ink2: #A9B5AF;
    --ink3: #8C9892;
    --line: #27332E;
    --line2: #3A4741;
    --strong-line: #67736E;
    --accent: #FF6A45;
    --on-accent: #2A0A02;
    --accent-soft: #3A1D14;
    --accent-ink: #FF8A6B;
    --signal: #D7FF72;
    --on-signal: #16210A;
    --danger: #FF6B6B;
    --success: #6FD79B;
    --focus: #FF8A6B;
    --glass: rgba(13, 24, 21, 0.74);
    --shadow: rgba(0, 0, 0, 0.40);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
/* Focus that can be seen, on everything you can reach with a keyboard. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; padding: 10px 14px; background: var(--raised); color: var(--ink); border-radius: 12px; z-index: 10; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

/* ---- type ---- */
h1, h2, h3, .display { font-family: 'Bricolage Grotesque', system-ui, sans-serif; margin: 0; }
h1, .display { font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; font-size: clamp(36px, 8vw, 56px); }
h2 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-size: clamp(24px, 4.5vw, 30px); }
h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-size: 19px; }
p { margin: 0; }
.lead { font-size: 18px; color: var(--ink2); max-width: 40em; }
.small { font-size: 13px; }
.muted { color: var(--ink2); }
.eyebrow { font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 11px; font-weight: 700; line-height: 1.35; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 28px; }
ul.plain { margin: 0; padding-inline-start: 1.2em; }
ul.plain li + li { margin-top: 6px; }

/* ---- the logo tile and the wordmark ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo { display: block; width: 36px; height: 36px; border-radius: 11px; flex: none; }
.wordmark { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 0.09em; line-height: 1.2; }
.wordmark span { color: var(--accent-ink); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; border: 0; }
/* The one coral button on a screen, with the coral glow under it. */
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 26px -12px var(--accent); }
.btn-quiet { background: var(--raised); color: var(--ink); border: 1px solid var(--line2); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { background: var(--sunken); color: var(--ink3); box-shadow: none; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--canvas); border-color: transparent; }
.btn:active:not([disabled]) { transform: scale(0.97); }
/* A link that looks like one, 44 high. */
.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 700; color: var(--accent-ink); }

/* ---- card ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.card + .card { margin-top: 16px; }
@media (prefers-color-scheme: light) { .card { box-shadow: 0 4px 12px var(--shadow); } }

/* ---- chip and pills ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink2); }
/*
 * The live pill: lime means someone is here now, and nothing else. Only the
 * presence words wear it ("Warming up", "Buzzin’", "Busy", "Packed", each
 * with its flames drawn after it, and "Here now"); a quiet place is a plain
 * pill.
 */
.pill-live { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--signal); color: var(--on-signal); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-live .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ---- field ---- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field label, .field legend { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field .hint { font-size: 13px; color: var(--ink2); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; background: var(--sunken);
  border: 1px solid var(--strong-line); color: var(--ink); font: inherit; font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink3); }

/* ---- skeletons: the shape of what is coming ---- */
.skeleton { display: inline-block; border-radius: 999px; background: linear-gradient(90deg, var(--sunken), var(--raised), var(--sunken)); background-size: 200% 100%; animation: sheen 1.2s linear infinite; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Somebody who asked their device to stop animating gets stillness. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:active:not([disabled]) { transform: none; }
}

/* ---- Arabic, right to left (Package 95 Part 4; the board, design/renderings/arabic-2026-11/README.md) ----
 * words.js gives <html> dir="rtl" for an Arabic reader, and the pages lay out
 * by the start and the end of a line, so most of this follows by itself.
 * These are the board's exceptions and its "decided by deduction":
 * - No letter spacing on Arabic letters: spacing them apart breaks Arabic's
 *   joined writing. The Latin wordmark keeps its own.
 * - The lockup stays at the left where it heads a page (AR6 B, by deduction
 *   from Home's bar: the brand sits as on every English phone), and reads
 *   "Wassaaa" left to right. The page's links beside it read from the right.
 * - What never mirrors: a map, a QR code, a price, a phone number, a code to
 *   type, and the drawing of a phone on the door page (a picture).
 * - What a person or a place typed reads by its own first letter
 *   (`unicode-bidi: plaintext`, as `.typed` and a message's bubble), where it
 *   sits following the page.
 * - An arrow that points turns round: "back" points right, "opens elsewhere"
 *   up and to the left. */
[dir="rtl"] *:not(.wordmark):not(.wordmark *):not(.cs-code):not(.door-code) { letter-spacing: normal !important; }
[dir="rtl"] .brand { direction: ltr; }
[dir="rtl"] .site-header .wrap, [dir="rtl"] .door-top { direction: ltr; }
[dir="rtl"] .site-header .wrap > :not(.brand), [dir="rtl"] .door-top > :not(.brand) { direction: rtl; }
[dir="rtl"] a[href^="tel:"], [dir="rtl"] .phone-number, [dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] a[href^="mailto:"] { unicode-bidi: plaintext; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="url"], [dir="rtl"] input[inputmode="numeric"] { unicode-bidi: plaintext; text-align: right; }
[dir="rtl"] .typed { unicode-bidi: plaintext; }
[dir="rtl"] p.typed, [dir="rtl"] div.typed, [dir="rtl"] li.typed, [dir="rtl"] h1.typed, [dir="rtl"] h2.typed, [dir="rtl"] h3.typed { text-align: right; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
