/* Allo 1.0.3: the variable font (optical size, weight, roundness) and the nine obliques. SIL Open Font License 1.1. https://allo.joshpuckett.me */

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/AlloVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-ThinOblique.woff2") format("woff2");
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-ExtraLightOblique.woff2") format("woff2");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-LightOblique.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-Oblique.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-MediumOblique.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-SemiBoldOblique.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-BoldOblique.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-ExtraBoldOblique.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Allo";
  src: url("/_site/allo-1.0.3/Allo-BlackOblique.woff2") format("woff2");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/*
  The base every page shares (index.html, signin.html): the two themes' tokens, the icon stroke, the page.
  site/boot.js sets data-theme (and data-auth) on <html> before the first paint.
*/
/* Bencho's two themes, measured from bencho.dev: dark (the default) and light. Everything faint is the
   ink at a low alpha (--ink-rgb), so most of the page turns over with these few values; the rest are the
   surfaces that sit on pictures or float over the page */
:root {
  --bg: #0a0a0a;
  --bg-rgb: 10, 10, 10;
  --ink: #ffffff;
  --ink-rgb: 255, 255, 255;
  --ink-3: #989898;        /* nav links, icons */
  --ink-4: #898989;        /* search placeholder */
  --wash: 0.055;           /* search pill */
  --solid-hover: #ebebeb;  /* the solid (ink) buttons on hover */
  --thumb: rgba(255, 255, 255, 0.1);                 /* a toggle switch's thumb, and pills on a card */
  --glass: rgba(28, 28, 30, 0.72);                   /* the header's pills once the page has scrolled */
  --veil: rgba(20, 20, 22, 0.72);                    /* a pill or button over a picture */
  --veil-hover: rgba(36, 36, 38, 0.86);
  --menu: rgba(24, 24, 26, 0.94);                    /* menus and popovers */
  --edge-rgb: 255, 255, 255;                         /* a picture's hairline edge */
  --shadow-rgb: 0, 0, 0;
  --shadow-k: 1;                                     /* how strong shadows are */
  --scrim: rgba(0, 0, 0, 0.55);
  --danger: #ff6369;                                 /* a wrong code's edges, an error's icon */
  --glass-shadow: 0 0 0 1px rgba(var(--ink-rgb), 0.06), 0 2px 10px rgba(var(--shadow-rgb), calc(0.25 * var(--shadow-k)));
  color-scheme: dark;
}
/* light, after bencho.dev's: white, a near-black ink with warm greys under it, white thumbs and floating
   surfaces, and shadows at about a third of their dark strength (on white they read much stronger) */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --ink: #17181a;
  --ink-rgb: 23, 24, 26;
  --ink-3: #5c5b56;
  --ink-4: #6f6e68;
  --wash: 0.06;
  --solid-hover: #2e2f33;
  --thumb: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --veil: rgba(255, 255, 255, 0.8);
  --veil-hover: rgba(255, 255, 255, 0.94);
  --menu: rgba(255, 255, 255, 0.96);
  --edge-rgb: 0, 0, 0;
  --shadow-rgb: 23, 24, 26;
  --shadow-k: 0.35;
  --scrim: rgba(23, 24, 26, 0.28);
  --danger: #e5484d;
  color-scheme: light;
}
/* switching theme turns everything over at once: no colour transitions smearing across the page */
.theme-swap *, .theme-swap *::before, .theme-swap *::after { transition: none !important; }
* { box-sizing: border-box; }
/* One icon stroke across the platform: every line icon renders its stroke at 1.5px on screen, whatever
   size it's drawn at (bencho and marked.dev both render theirs at 1.5px; it sits with the 14px/500
   labels). non-scaling-stroke keeps the width in screen pixels. The two self-drawing checks (.t-check,
   .t-success-check) keep their own widths, as their draw-in is measured along the path */
svg[stroke] :is(path, line, circle, polyline, rect):not(:is(.t-check, .t-success-check) *) {
  vector-effect: non-scaling-stroke;
  stroke-width: 1.5px;
}
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.5 "Allo", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "ROND" 0;   /* Allo's roundness: 0 sharp, 50 its default "friendly", 100 round */
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }

:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }   /* the strong ease-out: entrances, presses */

/* a pill toggle (site/modules/toggle-switch.js): the options in the faint wash, the thumb behind the chosen one.
   The header's menu and Explore's sections have their own copies; this one serves the user menu's Theme */
.pill-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), var(--wash));
  outline: 1px solid transparent;           /* still draws an edge in forced-colours mode */
  outline-offset: -1px;
  user-select: none;
  touch-action: pan-y;
}
.pill-toggle__opt {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: 14px;                           /* (14, as every word you tap: DESIGN.md › Typography) */
  font-weight: 500;
  letter-spacing: -0.006em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 80ms;
}
.pill-toggle__opt[aria-pressed="true"] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .pill-toggle__opt:not([aria-pressed="true"]):hover { color: var(--ink); } }
.pill-toggle__opt:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(var(--ink-rgb), 0.35); }
.switch-thumb {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background: var(--thumb);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), calc(0.3 * var(--shadow-k)));
  pointer-events: none;
}

/* a face we don't have: the initial, plain, on a disc a step lighter than what it sits on (the ink at 10%,
   so it works on any surface in either theme), the letter a bold light grey. No colour and no edge: it's a
   stand-in, and stays quiet beside the real faces. (The class twice: it outweighs the grey a placeholder's
   own rule gives it underneath). The tint sits on the surface it's drawn on, so the disc is solid: where
   faces overlap (a collection's makers), the one under it doesn't show through */
.av-fill.av-fill {
  background: linear-gradient(rgba(var(--ink-rgb), 0.1), rgba(var(--ink-rgb), 0.1)), var(--surface, var(--bg));
  color: rgba(var(--ink-rgb), 0.7);
  font-weight: 600;
  outline: 0;
  box-shadow: none;
}

/* ==========================================================================
   Sign in / sign up (signin.html, site/modules/signin.js): the Layout prototype's login dialog as a page, in our
   dress. The form alone, centred on the page, no visuals beside it.

   Layout's measures, kept: a 352px column (its 416px form panel less 32px each side), 24px between groups
   and 8px inside one, the 28px title over a 14px lede, a mark on top, 40px controls, 16px text in
   the field, six square code slots, toasts for every message.
   Ours, in place of Layout's: pills for the buttons and the field (the site's controls), the faint wash for
   the quiet ones and solid ink for the one that moves you on, Allo, the strong ease-out
   var(--ease-out), and the mascot on its own where Layout had its logo tile.
   ========================================================================== */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}


/* the page: the column centred, with room above and below for a phone's bars. No close or back button:
   it's a page, and the browser's Back does that */
.auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: calc(48px + env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom));
}
.auth-steps { display: grid; width: min(352px, 100%); }
.auth-step { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 24px; }
.auth-step[inert] { visibility: hidden; }                  /* keeps its size, leaves focus and the a11y tree */
.auth-step--center { justify-content: center; }
.auth-form { display: flex; flex-direction: column; gap: 24px; }   /* a field, then its buttons: the same gap as heading → field */
/* a step arrives out of a light blur and 4px below (240ms); reduced motion only fades */
.auth-step.is-entering { animation: auth-step-in 240ms var(--ease-out) both; }
@keyframes auth-step-in { from { opacity: 0; filter: blur(4px); transform: translateY(4px); } }
@keyframes auth-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .auth-step.is-entering { animation-name: auth-fade-in; } }

.auth-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
/* the mascot (mascot.js) on its own, no tile: the header logo's box (32 by 36) at twice its size, which
   draws the mascot about 40px across (the box has room round it for the spin). It sits close over the
   title; the box's own room gives it the air */
.auth-mark { position: relative; display: block; width: 64px; height: 72px; margin-bottom: 4px; }
.auth-mark .logo { position: absolute; inset: 0; display: block; }
.auth-mark canvas, .auth-mark svg { display: block; width: 100%; height: 100%; }
.auth-title {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.auth-title:focus-visible { outline: none; }               /* focused by script on a step change, not a control */
.auth-lede { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.55; text-wrap: balance; }   /* one line where it fits; an even break where it doesn't */
.auth-lede strong { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }

.auth-stack { display: flex; flex-direction: column; gap: 8px; }

/* ---- buttons: 40px pills. Primary is solid ink (one per step), secondary the faint wash ---- */
.auth-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;            /* still draws an edge in forced-colours mode */
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.006em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, scale 0.15s ease-out;
}
.auth-btn--primary { background: var(--ink); color: var(--bg); }
.auth-btn--secondary { background: rgba(var(--ink-rgb), var(--wash)); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .auth-btn--primary:enabled:hover { background: var(--solid-hover); }
  .auth-btn--secondary:enabled:hover { background: rgba(var(--ink-rgb), 0.1); }
}
.auth-btn:enabled:active { scale: 0.96; }
@media (prefers-reduced-motion: reduce) { .auth-btn:enabled:active { scale: 1; } }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(var(--ink-rgb), 0.5); }
.auth-btn:disabled { cursor: default; opacity: 0.5; }
.auth-brand { flex: none; width: 18px; height: 18px; }
/* busy: the button fills from the left under its label (site/modules/signin.js setBusy, settle): a layer in the
   label's tone at a low alpha, slid in by translateX so nothing relayouts; the label and icon stay */
.auth-btn { overflow: hidden; isolation: isolate; }
.auth-btn[aria-busy="true"] { opacity: 1; pointer-events: none; }
.auth-fill { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; }
.auth-fill__bar { position: absolute; inset: 0; background: rgba(var(--ink-rgb), 0.1); transform: translateX(-100%); }
.auth-btn--primary .auth-fill__bar { background: rgba(var(--bg-rgb), 0.18); }

/* ---- the email field: a 40px pill in the wash, 16px text so iOS never zooms ---- */
.auth-input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--ink-rgb), var(--wash));
  outline: 1px solid transparent;
  outline-offset: -1px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input::placeholder { color: var(--ink-4); }
@media (hover: hover) and (pointer: fine) { .auth-input:hover { background: rgba(var(--ink-rgb), 0.1); } }
.auth-input:focus-visible { background: rgba(var(--ink-rgb), 0.09); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.2); }
.auth-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--danger); }

/* ---- "or": a hairline either side of the word ---- */
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12px; line-height: 16px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(var(--ink-rgb), 0.1); }

/* ---- the small print ---- */
.auth-foot { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 16px; text-align: center; text-wrap: balance; }
.auth-foot :is(a, button) { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: from-font; }
.auth-foot a { color: inherit; }
.auth-foot button { padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.auth-foot button:focus-visible { outline: 2px solid rgba(var(--ink-rgb), 0.5); outline-offset: 2px; }
.auth-foot button:disabled { cursor: default; color: var(--ink-3); font-weight: inherit; text-decoration: none; }
.auth-foot [data-resend-wait] { font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .auth-foot :is(a, button:enabled):hover { color: var(--ink); } }

/* ==========================================================================
   The code field (site/modules/otp.js): one real <input> lies invisibly over six square slots and does the work
   (typing, paste, autofill from the email, screen readers); the slots draw its value.
   States (data-state): "" typing · verifying (digits dim) · invalid (red edges, a short shake; typing
   replaces the whole code) · success (the slots fill with ink, left to right, 40ms apart)
   ========================================================================== */
.otp { display: flex; flex-direction: column; }
.otp__field { position: relative; }
.otp__input {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent;
  font: inherit; font-size: 16px; letter-spacing: -0.5em; cursor: text;
}
.otp__input:focus { outline: none; }
.otp__input::selection { background: transparent; }
.otp__slots { display: flex; justify-content: center; gap: 8px; }
.otp__slot {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 1 48px;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 14px;
  background: rgba(var(--ink-rgb), var(--wash));
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
/* the slot being typed into: clear, with an ink edge (the checkboxes' 1.5px) */
.otp__slot.is-active { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(var(--ink-rgb), 0.6); }
/* a digit arrives out of a short blur (each digit is a fresh <span>, so @starting-style runs) */
.otp__slot > span { transition: opacity 0.15s var(--ease-out), filter 0.15s var(--ease-out), translate 0.15s var(--ease-out); }
@starting-style { .otp__slot > span { opacity: 0; filter: blur(2px); translate: 0 2px; } }
/* the caret in the empty slot being typed into */
.otp__slot.has-caret::after { content: ""; width: 1.5px; height: 1em; border-radius: 999px; background: var(--ink); animation: otp-caret 1s step-end infinite; }
@keyframes otp-caret { 50% { opacity: 0; } }
.otp[data-state="verifying"] .otp__slot { color: var(--ink-3); }
.otp[data-state="invalid"] .otp__slot { background: rgba(var(--ink-rgb), var(--wash)); box-shadow: inset 0 0 0 1px var(--danger); }
.otp[data-state="invalid"] .otp__slots { animation: otp-shake 320ms var(--ease-out); }
@keyframes otp-shake { 20% { translate: -6px; } 40% { translate: 4.8px; } 60% { translate: -3px; } 80% { translate: 1.5px; } }
.otp[data-state="success"] .otp__slot { background: var(--ink); box-shadow: none; color: var(--bg); transition-delay: calc(var(--i, 0) * 40ms); }
@media (prefers-reduced-motion: reduce) {
  .otp__slot.has-caret::after { animation: none; }
  .otp[data-state="invalid"] .otp__slots { animation: none; }
}

/* the toast (site/modules/toast.js): a 44px pill on the menus' surface and shadow, bottom centre, 24px up */
.toaster {
  position: fixed;
  inset: auto 0 calc(24px + env(safe-area-inset-bottom));
  z-index: 100;
  display: grid;
  justify-items: center;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 1px solid transparent;            /* still draws an edge in forced-colours mode */
  border-radius: 999px;
  background: var(--menu);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 0 0 1px rgba(var(--edge-rgb), 0.06), 0 8px 24px rgba(var(--shadow-rgb), calc(0.4 * var(--shadow-k)));
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.006em;
  pointer-events: auto;
  transition: opacity 200ms var(--ease-out), translate 200ms var(--ease-out);
}
.toast:not([class*="--"]) { padding-left: 18px; }
.toast > svg { flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.toast--error > svg { color: var(--danger); }
@starting-style { .toast { opacity: 0; translate: 0 8px; } }
.toast.is-leaving { opacity: 0; translate: 0 4px; transition-duration: 150ms; transition-timing-function: ease-out; }
@media (prefers-reduced-motion: reduce) {
  .toast { transition-property: opacity; }
  @starting-style { .toast { translate: none; } }
  .toast.is-leaving { translate: none; }
}
