/* USELESS APP EVENT — deliberately chaotic stylesheet.
   Every rule below does its job. The job is nothing. */

:root {
  --yellow: #ffff00;
  --lime: #00ff41;
  --magenta: #ff00a8;
  --blue: #0000ee;
  --red: #ff0000;
  --ink: #111111;
  --paper: #ffffff;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

::selection { background: var(--yellow); color: var(--ink); }

h1, h2, h3 {
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

h1 { font-size: clamp(2.6rem, 8vw, 5.5rem); text-transform: uppercase; margin: 0.5rem 0 1rem; }
h2 { font-size: clamp(2rem, 5vw, 3rem); text-transform: uppercase; margin: 0 0 0.75rem; text-decoration: underline wavy var(--magenta) 3px; }
h3 { font-size: 1.5rem; margin: 0 0 0.5rem; }

a { color: var(--blue); text-decoration: underline; }
a:visited { color: #551a8b; }
a:hover { color: var(--red); }

:focus-visible { outline: 4px dotted var(--red); outline-offset: 3px; }
button, select, input { cursor: help; font: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--yellow);
  padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Ticker */
.ticker {
  overflow: hidden; background: var(--ink); color: var(--lime);
  font-family: "Courier New", monospace; font-weight: bold;
  padding: 0.4rem 0; border-bottom: 4px solid var(--lime);
}
.ticker-track {
  display: inline-block; white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { margin-right: 3rem; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 2rem; padding: 1rem 1.5rem;
  background: var(--yellow); border-bottom: 6px double var(--ink);
}
.brand {
  margin: 0; font-family: Impact, sans-serif; font-size: 1.9rem;
  color: var(--magenta); text-shadow: 2px 2px 0 var(--ink);
}
.brand-sub { margin: 0; font-size: 0.8rem; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-header nav a { font-weight: bold; }
.visitor { margin: 0; font-family: "Courier New", monospace; font-size: 0.85rem; }
.visitor-note { color: #555; font-style: italic; font-size: 0.8rem; }

/* Hero */
.hero {
  padding: 3rem 1.5rem 2.5rem; text-align: center;
  background: repeating-linear-gradient(45deg, #fff 0 40px, #ffffcc 40px 80px);
  border-bottom: 4px solid var(--ink);
}
.hero-kicker {
  display: inline-block; margin: 0 0 1rem; padding: 0.25rem 0.75rem;
  background: var(--ink); color: var(--yellow);
  font-family: "Courier New", monospace; font-weight: bold;
}
.hero-nothing { color: var(--magenta); }
.hero-lede { max-width: 42rem; margin: 0 auto 1.75rem; font-size: 1.15rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.btn {
  display: inline-block; padding: 0.7rem 1.3rem; font-weight: bold;
  border: 3px outset #999; background: #eee; color: var(--ink);
  text-decoration: none; border-radius: 0;
}
.btn:active { border-style: inset; }
.btn-red { background: var(--red); color: #fff; border-color: #7a0000; font-size: 1.1rem; }
.btn-blue { background: var(--blue); color: #fff; border-color: #00005a; }
.btn-green { background: var(--lime); color: var(--ink); border-color: #00661a; }
.btn-plain { background: #fff; }

/* Link buttons keep their own colours in every state. The global
   a:visited (0,1,1) and a:hover rules outrank a plain .btn-blue (0,1,0),
   which turned this button dark purple on dark blue after its first
   click — roughly 1.2:1. These selectors win and hold the contrast. */
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active { text-decoration: none; }
a.btn-red:link,
a.btn-red:visited,
a.btn-red:hover,
a.btn-red:active { color: #fff; }
a.btn-blue:link,
a.btn-blue:visited,
a.btn-blue:hover,
a.btn-blue:active { color: #fff; }
a.btn-green:link,
a.btn-green:visited,
a.btn-green:hover,
a.btn-green:active { color: var(--ink); }
a.btn-plain:link,
a.btn-plain:visited,
a.btn-plain:hover,
a.btn-plain:active { color: var(--ink); }
a.demo-btn:link,
a.demo-btn:visited,
a.demo-btn:hover,
a.demo-btn:active { color: var(--ink); background: var(--lavender); }

/* Hover darkens the fill instead of recolouring the text. */
a.btn-blue:hover { background: #0000a8; }
a.btn-plain:hover { background: var(--yellow); }
a.btn-red:hover { background: #cc0000; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: line-through; }
.press-count { font-family: "Courier New", monospace; }

/* Uselessness meter: fills to 97%, then panics */
.meter-wrap { max-width: 34rem; margin: 2rem auto 0; text-align: left; }
.meter-labels { display: flex; justify-content: space-between; font-family: "Courier New", monospace; font-weight: bold; }
.meter { height: 1.6rem; border: 3px solid var(--ink); background: #fff; }
.meter-fill {
  height: 100%; width: 97%;
  background: repeating-linear-gradient(-45deg, var(--lime) 0 12px, var(--yellow) 12px 24px);
}
.meter-note { font-size: 0.85rem; color: #444; margin: 0.25rem 0 0; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center;
  list-style: none; margin: 2rem 0 0; padding: 0;
}
.hero-stats li { border: 3px solid var(--ink); padding: 0.75rem 1rem; background: #fff; min-width: 9rem; }
.hero-stats strong { display: block; font-family: Impact, sans-serif; font-size: 2.2rem; line-height: 1; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 2rem; }
.badge {
  padding: 0.4rem 0.8rem; border: 2px dashed var(--ink);
  font-family: "Comic Sans MS", "Comic Neue", cursive; font-size: 0.9rem;
  background: #fff;
}
.badge-spin, .badge-wobble { display: inline-block; }

/* Test pattern divider: broadcast calibration stripes */
.test-pattern {
  height: 1.25rem;
  background: repeating-linear-gradient(90deg, #fff 0 40px, var(--yellow) 40px 80px, #00ffff 80px 120px, var(--lime) 120px 160px, var(--magenta) 160px 200px, var(--red) 200px 240px, var(--blue) 240px 280px, var(--ink) 280px 320px);
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
}

/* Sections */
.section { padding: 2.5rem 1.5rem; border-bottom: 4px solid var(--ink); }
.section-intro { max-width: 44rem; font-size: 1.1rem; }
.demos { background: #e8f8ff; }
.why { background: #fff8e1; }
.testimonials { background: #ffe8f5; }
.rules { background: #eaffea; }
.faq { background: #f3e8ff; }

/* Demo cards: each button sabotaged differently (see useless.js) */
.demo-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem; list-style: none; margin: 1.5rem 0; padding: 0;
}
.demo-card {
  position: relative; padding: 1.25rem; background: #fff;
  border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.demo-1 { transform: rotate(-0.6deg); }
.demo-2 { transform: rotate(0.5deg); }
.demo-3 { transform: rotate(-0.4deg); }
.demo-4 { transform: rotate(0.6deg); }
.demo-tag { margin: 0 0 0.5rem; font-family: "Courier New", monospace; font-size: 0.8rem; font-weight: bold; }
.demo-card h3 { font-family: "Comic Sans MS", "Comic Neue", cursive; }
.demo-status { font-size: 0.9rem; color: #444; }
.demo-outcome { font-family: "Courier New", monospace; font-size: 0.9rem; min-height: 1.4em; margin: 0.5rem 0 0; }
.demo-btn { position: relative; }

.download-box {
  border: 4px dashed var(--magenta); padding: 1.25rem; background: #fff; max-width: 44rem;
}
.download-box code { font-family: "Courier New", monospace; background: var(--yellow); padding: 0 0.3em; }

/* Why widgets */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.why-grid article { border-left: 8px solid var(--magenta); padding-left: 1rem; }
.why-grid h3 { font-family: Georgia, "Times New Roman", serif; }

.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; margin-top: 2rem; }
.widget { border: 3px solid var(--ink); background: #fff; padding: 1.25rem; }
.widget h3 { font-family: "Courier New", monospace; font-weight: bold; font-size: 1.1rem; text-transform: uppercase; }
.widget label { display: block; font-weight: bold; margin-bottom: 0.25rem; }
.widget input[type="email"], .widget input[type="search"], .widget select {
  width: 100%; padding: 0.5rem; margin-bottom: 0.75rem;
  border: 3px inset #999; background: #fff;
}
.weather { font-size: 1.4rem; margin: 0.5rem 0; }
.weather-detail { color: #444; }
.greeting { font-family: "Comic Sans MS", cursive; }

/* Testimonials */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.testimonial-grid blockquote {
  margin: 0; padding: 1.25rem; background: #fff; border: 3px solid var(--ink);
  font-family: Georgia, serif; font-style: italic;
}
.testimonial-grid blockquote:nth-child(odd) { transform: rotate(-0.8deg); }
.testimonial-grid blockquote:nth-child(even) { transform: rotate(0.7deg); }
.testimonial-grid footer { margin-top: 0.75rem; font-style: normal; font-family: "Courier New", monospace; font-size: 0.85rem; }

/* Rules (generated from content/rules.md) */
.rules-body { max-width: 46rem; }
.rules-body h2 { font-size: 1.8rem; text-decoration: none; }
.rules-body h3 { font-size: 1.3rem; }
.rules-body blockquote {
  margin: 1rem 0; padding: 0.75rem 1.25rem;
  border-left: 10px solid var(--yellow); background: #fff;
  font-family: "Comic Sans MS", cursive;
}
.rules-body code { background: var(--yellow); padding: 0 0.3em; font-family: "Courier New", monospace; }
.agree-box { border: 4px double var(--ink); padding: 1rem 1.25rem; background: #fff; max-width: 46rem; margin-top: 1.5rem; }
.agree-box label { font-weight: bold; font-size: 1.1rem; }
.agree-box input { width: 1.5rem; height: 1.5rem; vertical-align: middle; }

/* FAQ */
.faq details { border: 3px solid var(--ink); background: #fff; margin-bottom: 0.75rem; padding: 0.75rem 1rem; max-width: 46rem; }
.faq summary { font-weight: bold; cursor: help; }

/* Footer */
.site-footer {
  padding: 2rem 1.5rem 7rem; background: var(--ink); color: #fff;
  font-family: "Courier New", monospace; font-size: 0.9rem;
}
.site-footer a { color: var(--lime); }
.site-footer strong { color: var(--yellow); }
.print-hint { margin-top: 1rem; }

/* Cookie banner: bottom-left, clear of the chat bubble (bottom-right)
   and the toasts (top-right). On narrow screens it sits above the
   chat toggle instead of colliding with it. */
.cookie-banner {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 60; max-width: 22rem;
  background: var(--yellow); border: 4px solid var(--ink); padding: 1rem;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}
@media (max-width: 44rem) {
  .cookie-banner { left: 4vw; right: 4vw; max-width: none; bottom: 5.25rem; }
}
.cookie-banner p { margin: 0 0 0.75rem; }
.cookie-banner .btn { margin-right: 0.5rem; }

/* Notifications: top-right corner, stacked, self-dismissing */
.toasts {
  position: fixed; top: 1rem; right: 1rem; z-index: 80;
  display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--lime); font-family: "Courier New", monospace;
  padding: 0.6rem 0.9rem; border: 2px solid var(--lime); max-width: 20rem;
}

/* The most useful feature on the site: printing produces a blank page */
@media print {
  body * { visibility: hidden; }
  body::after {
    content: "This page intentionally left blank.";
    visibility: visible; position: absolute; top: 2rem; left: 2rem;
    font-family: "Courier New", monospace; font-size: 1.5rem;
  }
}

/* Motion: the one sensible thing we kept */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track {
    animation: none !important;
  }
}
