/* Shared look for the site and the app: colours, type, and the few pieces both use. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2-variations"), url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --sunk: #E7EBF2;
  --ink: #141C2B;
  --muted: #566275;
  --line: #D5DBE6;
  --line-strong: #7D889B; /* the edge of a control: 3:1 or better against the page and the cards */
  --accent: #2348D8;
  --accent-strong: #1A38B0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3E9FF;
  --timer: #8A4B00;
  --timer-soft: #FFEFCF;
  --timer-bar: #E39A1C;
  --timer-fill: #B87400; /* the life bar itself: dark enough to read on white */
  --keep: #0B6B4F;
  --keep-soft: #DDF3EA;
  --keep-bar: #1FA37A;
  --danger: #B3261E;
  --danger-soft: #FCE8E6;
  --hero: #2348D8;
  --hero-ink: #FFFFFF;
  --hero-muted: #C9D4FF;
  --hero-line: #5673E8;
  --hero-pop: #FFC857;
  --shadow: 0 1px 2px rgba(20, 28, 43, 0.06), 0 8px 24px rgba(20, 28, 43, 0.08);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: only light; /* "only" also tells browsers with an automatic dark theme to leave the page alone */
}
/* Light is the brand. Night never arrives on its own because the OS says so:
   it is an explicit choice, saved per device (see boot.js and the toggle buttons). */
html.night {
  color-scheme: dark;
    --bg: #0E131B;
    --surface: #171E29;
    --sunk: #111823;
    --ink: #E7ECF4;
    --muted: #95A2B5;
    --line: #2A3443;
    --line-strong: #66748A;
    --accent: #8AA4FF;
    --accent-strong: #A9BCFF;
    --accent-ink: #0E131B;
    --accent-soft: #1E2A52;
    --timer: #F3BD5B;
    --timer-soft: #3A2C10;
    --timer-bar: #E39A1C;
    --timer-fill: #E39A1C;
    --keep: #6FD3AE;
    --keep-soft: #12352A;
    --keep-bar: #1FA37A;
    --danger: #FF8A80;
    --danger-soft: #3B1512;
    --hero: #182A7A;
    --hero-ink: #F2F5FF;
    --hero-muted: #B4C2F5;
    --hero-line: #3550B8;
    --hero-pop: #FFC857;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* The stamp: small monospace capitals used for labels on both site and app. */
.stamp { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.quiet { background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.small { font-size: 14px; min-height: 36px; padding: 6px 12px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* Life pills and bars: amber while the clock runs, green when kept. */
.life { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--timer); background: var(--timer-soft); }
.life.keep { color: var(--keep); background: var(--keep-soft); }
.life.pending { color: var(--muted); background: var(--sunk); }
.life.once { color: var(--accent); background: var(--accent-soft); }
.lifebar { height: 3px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.lifebar i { display: block; height: 100%; width: 100%; background: var(--timer-fill); border-radius: 3px; }
.lifebar.keep i { background: var(--keep-bar); }

.field { font: inherit; width: 100%; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.field::placeholder { color: var(--muted); }
.field.mono { font-family: var(--mono); font-size: 13px; }

.qr { width: 200px; max-width: 100%; padding: 10px; background: #FFFFFF; border-radius: 10px; }
.qr svg { display: block; width: 100%; height: auto; }

.clip { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }

/* chips (lifetime pickers) */
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; min-width: 0; }
.chips legend { float: left; padding: 0; margin-right: 6px; font-size: 13px; color: var(--muted); }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; background: var(--surface); }
/* the chosen chip gets a heavier edge in its own colour, so the choice does not rest on the tint alone */
.chips input:checked + label { background: var(--timer-soft); border-color: var(--timer); box-shadow: inset 0 0 0 1px var(--timer); color: var(--timer); }
.chips input[value="keep"]:checked + label { background: var(--keep-soft); border-color: var(--keep); box-shadow: inset 0 0 0 1px var(--keep); color: var(--keep); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips input[value="once"]:checked + label { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }

/* the slip card, as the app draws it */
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.slip-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.slip-from { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-body { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.slip-body.mono { font-family: var(--mono); font-size: 13.5px; }
.addr .grp { display: inline-block; white-space: nowrap; margin-right: 0.42em; color: var(--muted); }
.addr .grp.end { color: var(--accent); font-weight: 500; background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
.slip-body.link .host { font-weight: 600; }
.slip-body.link .path { color: var(--muted); }
.slip-hint { font-size: 12px; color: var(--muted); }
.slip.arrive { animation: arrive 1.8s ease-out; }
@keyframes arrive {
  from { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-8px) scale(0.99); }
  to { background: var(--surface); border-color: var(--line); transform: none; }
}
@media (prefers-reduced-motion: reduce) { .slip.arrive { animation: none; } }
