/* totallossgame.com. Design system: Total Loss (4tpwio6z2xcbv9), version 1. Design: Website (hjdhkzxrez4ewb), version 47.
   The tokens, type styles and .tl-* classes are the design system's, under its names, cut down to what this page uses.
   Two layouts from the design's two artboards: Quiet (1440x900) from 1000px wide, and Quiet on a phone (390x844) below. */

@font-face {
  font-family: "Bowlby One";
  src: url("/fonts/bowlby_one/BowlbyOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo/Archivo-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/fonts/martian_mono/MartianMono-Variable.ttf") format("truetype");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --ink: #161a4f;
  --ink-soft: #4a4f85;
  --paper: #fffaf0;
  --dim: #b4b7e0;
  --rock: #ff3d8b;
  --stamp: #e4322b;
  --cash: #2fdb75;
  --brand: var(--rock);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 48px;
  --button-h: 56px;

  --radius-bezel: 12px;
  --radius-control: 8px;
  --radius-screen: 6px;
  --radius-dot: 999px;

  --stroke-hair: 2px;
  --stroke: 3px;
  --tilt-logo: -3deg;

  --motion-press: 90ms;
  --motion-quick: 160ms;
  --motion-slow: 420ms;
  --motion-breathe: 1.6s;
  --motion-sway: 7s;
  --motion-drift: 26s;
  --ease-out: cubic-bezier(.22, .8, .3, 1);
  --ease-in-out: cubic-bezier(.45, 0, .3, 1);

  --font-display: "Bowlby One", "Arial Black", sans-serif;
  --font-ui: "Archivo", "Arial Narrow", sans-serif;
  --font-mono: "Martian Mono", "Courier New", monospace;

  /* The design's own, which the design system has neither of: the wash over the blurred picture, and how long the
     background takes to follow the monitor. */
  --bg-wash: color-mix(in srgb, var(--ink) 72%, transparent);
  --bg-fade: calc(var(--motion-slow) * 3);
  /* The site's own: the page's side margin. 120px at the design's 1440, less on a narrower window, and more on a
     wider one, so the two blocks never drift more than 1440px apart. */
  --page-side: max(clamp(var(--space-6), 8.33vw, 120px), calc((100vw - 1440px) / 2));
}
:root, [data-mode] {
  --plate: 5px 6px 0 0 var(--brand);
  --plate-hover: 6px 8px 0 0 var(--brand);
  --plate-press: 2px 2px 0 0 var(--brand);
}

/* --- Base */

html { height: 100%; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--page-side);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
h1, p, ul { margin: 0; padding: 0; font-weight: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

/* --- Type */

.display-hold { font: 400 34px/1.1 var(--font-display); }
.ui-body { font: 600 18px/1.35 var(--font-ui); }
.mono-tag { font: 600 15px/1.3 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }

.link { white-space: nowrap; text-decoration: underline; text-decoration-thickness: var(--stroke-hair); text-underline-offset: 4px; }
.link:hover { text-decoration-thickness: var(--stroke); }
.link:focus-visible { outline: var(--stroke-hair) solid var(--paper); outline-offset: var(--space-1); border-radius: var(--radius-screen); }

/* --- Wordmark */

.tl-wordmark { display: inline-block; transform: rotate(var(--tilt-logo)); transform-origin: 0 50%; }
.tl-wordmark img { display: block; width: 100%; height: auto; }

/* --- Monitor */

.tl-bezel { position: relative; box-sizing: border-box; background: var(--ink-soft); border: var(--stroke) solid var(--ink); border-radius: var(--radius-bezel); display: flex; flex-direction: column; }
.tl-bezel--monitor { padding: var(--space-3) var(--space-3) 30px; }
.tl-screen { position: relative; flex-grow: 1; border: var(--stroke) solid var(--ink); border-radius: var(--radius-screen); overflow: hidden; background: var(--ink); }
.tl-screen > img.tl-feed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-glare { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255,250,240,.14), rgba(255,250,240,0) 40%); }
.tl-power { position: absolute; right: var(--space-4); bottom: 9px; width: 8px; height: 8px; box-sizing: border-box; border-radius: var(--radius-dot); background: var(--stamp); border: var(--stroke-hair) solid var(--ink); }
.tl-power.is-on { background: var(--cash); }

/* --- Button */

.tl-btn { height: var(--button-h); box-sizing: border-box; padding: 0 22px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-control); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 22px; font-weight: 800; font-stretch: 112%; white-space: nowrap; position: relative; }
.tl-btn--primary { background: var(--paper); color: var(--ink); box-shadow: var(--plate); }
/* Focus: four viewfinder corners, 9px outside the button */
.tl-btn:focus-visible::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none;
  background:
    linear-gradient(var(--paper), var(--paper)) left top / 14px 3px no-repeat,
    linear-gradient(var(--paper), var(--paper)) left top / 3px 14px no-repeat,
    linear-gradient(var(--paper), var(--paper)) right top / 14px 3px no-repeat,
    linear-gradient(var(--paper), var(--paper)) right top / 3px 14px no-repeat,
    linear-gradient(var(--paper), var(--paper)) left bottom / 14px 3px no-repeat,
    linear-gradient(var(--paper), var(--paper)) left bottom / 3px 14px no-repeat,
    linear-gradient(var(--paper), var(--paper)) right bottom / 14px 3px no-repeat,
    linear-gradient(var(--paper), var(--paper)) right bottom / 3px 14px no-repeat;
}
.tl-btn:focus { outline: none; }

/* --- Focus on what isn't a button: the focus box, 3px paper then 3px ink. Here, the monitor. */

#monitor:focus { outline: none; }
#monitor:focus-visible::after {
  content: ""; position: absolute; inset: -6px; pointer-events: none;
  border: var(--stroke) solid var(--paper); border-radius: var(--radius-bezel); box-shadow: 0 0 0 3px var(--ink);
}

/* --- The page: Quiet */

/* The background: the monitor's picture, blurred beforehand (images/blur/), under a wash of ink. It stays put if a
   short window makes the page scroll. */
.bg { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; overflow: hidden; }
.bg-blur { position: absolute; inset: 0; }
.bg img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity var(--bg-fade) var(--ease-in-out); }
.bg::after { content: ""; position: absolute; inset: 0; background: var(--bg-wash); }

main, footer { position: relative; }
main { flex: 1; display: grid; grid-template-columns: minmax(440px, 1fr) minmax(300px, 560px); gap: clamp(var(--space-6), 6.67vw, 96px); align-items: center; padding: var(--space-5) 0; }
.words { display: flex; flex-direction: column; align-items: flex-start; }
.tl-wordmark { width: 240px; }
h1 { margin-top: var(--space-6); max-width: 520px; }
.words > p { margin-top: var(--space-4); max-width: 500px; }
.act { display: flex; align-items: center; gap: var(--space-5); margin-top: var(--space-6); }

/* The monitor: the pictures one over another, the one that's on fading in over the last. */
.tl-bezel { aspect-ratio: 560 / 372; cursor: pointer; }
.tl-screen > img.tl-feed { opacity: 0; transition: opacity var(--motion-slow) var(--ease-out); }
.bg img.is-on, .tl-screen > img.tl-feed.is-on { opacity: 1; }

footer { display: flex; justify-content: space-between; gap: var(--space-2) var(--space-5); flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; }
.facts li + li::before { content: " · "; white-space: pre; }
footer .legal { color: var(--dim); }

/* --- Quiet on a phone: one column */

@media (max-width: 999px) {
  body { padding: var(--space-5); }
  main, footer { width: 100%; max-width: 560px; margin: 0 auto; }
  main { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .words { display: contents; }
  .tl-wordmark { width: 150px; align-self: flex-start; order: 1; }
  .tl-bezel { order: 2; width: 100%; aspect-ratio: 342 / 200; margin-top: var(--space-5); flex-shrink: 0; }
  h1 { order: 3; margin-top: var(--space-5); max-width: none; }
  h1.display-hold { font: 400 30px/1.02 var(--font-display); } /* The design system's display-card. */
  .words > p { order: 4; margin-top: var(--space-3); max-width: none; }
  .act { order: 5; flex-direction: column; gap: var(--space-4); margin-top: var(--space-5); }
  .act .tl-btn { align-self: stretch; }

  footer { flex: none; flex-direction: column; flex-wrap: nowrap; gap: var(--space-2); padding-top: var(--space-6); } /* The design has space-5; Bea asked for more, 2026-11-10. */
  .facts { flex-direction: column; gap: var(--space-2); }
  .facts li + li::before { content: none; }
  footer .legal { margin-top: var(--space-3); }
}

/* --- Motion: the design system's, for what's on this page. Reduced motion keeps the fades and nothing else. */

@keyframes tl-corners-in { from { opacity: 0; inset: -18px; } }
@keyframes tl-corners-breathe { to { inset: -12px; } }
@keyframes tl-led-glow { to { box-shadow: 0 0 7px 1px color-mix(in srgb, var(--cash) 60%, transparent); } }
@keyframes tl-drift { from { scale: 1.04; translate: 0 0; } to { scale: 1.08; translate: -1.5% -1%; } }
@keyframes tl-roll { from { translate: 0 -100%; } to { translate: 0 400%; } }
@keyframes tl-sway { to { rotate: .7deg; } }

@media (prefers-reduced-motion: no-preference) {
  .tl-btn { transition: translate var(--motion-quick) var(--ease-out), box-shadow var(--motion-quick) var(--ease-out), opacity var(--motion-quick) var(--ease-out); }
  .tl-btn--primary:hover { box-shadow: var(--plate-hover); translate: -1px -2px; }
  .tl-btn:active { box-shadow: var(--plate-press); translate: 3px 4px; transition-duration: var(--motion-press); }
  .tl-btn:focus-visible::after { animation: tl-corners-in var(--motion-quick) var(--ease-out) both, tl-corners-breathe var(--motion-breathe) var(--ease-in-out) var(--motion-quick) infinite alternate; }
  .tl-power.is-on { animation: tl-led-glow var(--motion-breathe) var(--ease-in-out) infinite alternate; }
  .tl-wordmark { animation: tl-sway var(--motion-sway) var(--ease-in-out) infinite alternate; }
  .tl-screen > img.tl-feed { animation: tl-drift var(--motion-drift) var(--ease-in-out) infinite alternate; }
  .tl-screen:has(> .tl-feed)::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22%; pointer-events: none; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--paper) 6%, transparent), transparent); animation: tl-roll 9s linear infinite; }
}
