/* The landing page's own styles, moved out of index.html's <style> so the
   page needs no 'unsafe-inline' (security review S1-EDG-2). */
/* Comic Sans MS ships with Windows and macOS but not with iOS, Android or
   most Linux boxes. The stack below used to end in the generic `cursive`,
   which is what those platforms actually got: on iOS Safari that resolves to
   Snell Roundhand, a formal copperplate script — the opposite of the joke.
   Comic Relief is a metrically equivalent libre clone of Comic Sans MS (SIL
   OFL, see fonts/OFL.txt), so it stands in without shifting a single line.

   Self-hosted rather than pulled from Google Fonts: this page asks nothing of
   anyone else, and Caddy serves fonts/ from the same directory as the page.
   It is listed *after* "Comic Sans MS" so a machine that has the genuine
   article uses it and never downloads these ~40 KB at all. */
@font-face {
  font-family: "Comic Relief";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/comic-relief-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Comic Relief";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/comic-relief-latin-700-normal.woff2") format("woff2");
}

/* Starfield + nebula, drawn entirely in CSS so this page never fetches an
   image, same as /mc-stats. Besides the site nav's nav.css and nav.js, the
   two woff2 files above are the only thing it ever requests, and only on
   platforms without Comic Sans MS. */
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes blink {
  0%, 49% { visibility: visible; }
  50%, 100% { visibility: hidden; }
}
@keyframes rainbow {
  0%   { color: #ff0000; }
  16%  { color: #ff9900; }
  33%  { color: #ffee00; }
  50%  { color: #33ff00; }
  66%  { color: #00ccff; }
  83%  { color: #cc00ff; }
  100% { color: #ff0000; }
}

html:not([data-theme="clean"]),
html:not([data-theme="clean"]) body {
  margin: 0;
  padding: 0;
  background-color: #000010;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 25% 65%, #fff, transparent),
    radial-gradient(2px 2px at 35% 15%, #fff, transparent),
    radial-gradient(1px 1px at 45% 80%, #fff, transparent),
    radial-gradient(1px 1px at 55% 35%, #fff, transparent),
    radial-gradient(2px 2px at 65% 55%, #fff, transparent),
    radial-gradient(1px 1px at 75% 10%, #fff, transparent),
    radial-gradient(1px 1px at 85% 75%, #fff, transparent),
    radial-gradient(2px 2px at 95% 40%, #fff, transparent),
    radial-gradient(1px 1px at 5% 90%, #fff, transparent),
    radial-gradient(1px 1px at 15% 45%, #fff, transparent),
    radial-gradient(1px 1px at 30% 95%, #fff, transparent),
    radial-gradient(2px 2px at 50% 5%, #fff, transparent),
    radial-gradient(1px 1px at 70% 85%, #fff, transparent),
    radial-gradient(1px 1px at 90% 20%, #fff, transparent),
    radial-gradient(1px 1px at 95% 60%, #fff, transparent),
    radial-gradient(120px 120px at 80% 25%, rgba(200,120,255,0.35), transparent 70%),
    radial-gradient(160px 160px at 15% 70%, rgba(80,160,255,0.30), transparent 70%),
    radial-gradient(60px 60px at 60% 65%, #ffcc66 0%, #ff9933 45%, transparent 70%);
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat,
    repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat,
    no-repeat, no-repeat, no-repeat;
  min-height: 100%;
}

html:not([data-theme="clean"]) body {
  /* At least the viewport, so body's opaque starfield covers the root's
     and no half nebula shows below a short page. */
  min-height: 100vh;
  font-family: "Comic Sans MS", "Comic Relief", "Comic Sans", sans-serif;
  color: #eaeaea;
}


/* The marquee under the bar (RLAND-1): the text starts past the right edge
   (padding-left: 100%) and slides until it has left on the left. The box
   clips it, so the page never scrolls sideways. */
@keyframes retro-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
html:not([data-theme="clean"]) .retro-marquee {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  border-top: 3px ridge #cc00ff;
  border-bottom: 3px ridge #cc00ff;
  padding: 4px 0;
  font-weight: bold;
  color: #ffee00;
  letter-spacing: 1px;
}
html:not([data-theme="clean"]) .retro-marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: retro-marquee 22s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-theme="clean"]) .retro-marquee { white-space: normal; text-align: center; }
  html:not([data-theme="clean"]) .retro-marquee span {
    display: block;
    padding: 0 8px;
    animation: none;
  }
}

html:not([data-theme="clean"]) .page-wrap {
  max-width: 720px;
  margin: 24px auto 60px;
  padding: 0 16px;
}

html:not([data-theme="clean"]) .titlebox {
  text-align: center;
  margin-bottom: 18px;
}
html:not([data-theme="clean"]) .titlebox h1 {
  font-size: 34px;
  margin: 10px 0 4px;
  text-shadow: 2px 2px 0 #cc00ff, -1px -1px 0 #00ccff;
  animation: rainbow 6s linear infinite;
}
html:not([data-theme="clean"]) .stars-line { letter-spacing: 6px; color: #ffee00; }


html:not([data-theme="clean"]) .content-box {
  background: rgba(0, 0, 20, 0.65);
  border: 4px double #00ccff;
  padding: 22px 26px;
  text-align: center;
}

html:not([data-theme="clean"]) .under-construction {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 14px;
  background: repeating-linear-gradient(
    45deg, #ffee00, #ffee00 12px, #000 12px, #000 24px
  );
  color: #000;
  font-weight: bold;
  font-size: 13px;
  border: 3px solid #000;
  /* Three blinks, then it stays (UX-landing-11). The keyframes end hidden
     and no fill is set, so after the last cycle the banner is back in its
     own, visible style; it never rests in the off frame. */
  animation: blink 1s steps(1) 3;
}
/* The text sits on a solid yellow strip inside the stripes, so no letter
   crosses a black band. */
html:not([data-theme="clean"]) .under-construction span {
  display: inline-block;
  padding: 2px 6px;
  background: #ffee00;
  color: #000;
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-theme="clean"]) .under-construction { animation: none; }
}

html:not([data-theme="clean"]) .main-msg {
  font-size: 20px;
  line-height: 1.5;
  color: #fffbe6;
  text-shadow: 1px 1px 2px #000;
  margin: 10px 0 6px;
}

html:not([data-theme="clean"]) hr.rainbow {
  height: 4px;
  border: 0;
  margin: 22px 0;
  background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet);
}

html:not([data-theme="clean"]) .badges {
  margin-top: 10px;
  font-size: 12px;
  color: #99ff99;
}
html:not([data-theme="clean"]) .badges span {
  display: inline-block;
  border: 1px solid #99ff99;
  padding: 2px 8px;
  margin: 2px;
  animation: twinkle 2.5s ease-in-out infinite;
}

html:not([data-theme="clean"]) footer {
  text-align: center;
  margin-top: 26px;
  font-size: 11px;
  color: #8888aa;
}
html:not([data-theme="clean"]) footer .counter {
  font-family: "Courier New", monospace;
  background: #000;
  color: #ff3333;
  border: 1px inset #666;
  padding: 2px 8px;
  letter-spacing: 2px;
}
#visitor-line[hidden] { display: none; }

/* ---- Both themes -------------------------------------------------------
   Content that belongs to one rendition carries retro-only or clean-only
   and is hidden in the other; nothing is written twice. */
html:not([data-theme="clean"]) .clean-only,
html[data-theme="clean"] .retro-only { display: none; }
.home-appearance { display: flex; justify-content: center; margin: 18px 0; }
.home-appearance .wp-appearance { width: 100%; text-align: left; }

/* ---- Clean ---------------------------------------------------------------
   Title, one sentence, a card per app (the same list as the site nav's
   static/site-nav/menu.json; tests/home.test.mjs keeps them agreeing), a
   row of the public demos, and the appearance control in the footer. The cards lift on hover;
   nothing else moves. */
html[data-theme="clean"],
html[data-theme="clean"] body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}
html[data-theme="clean"] body {
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.45;
}
html[data-theme="clean"] .page-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-4) var(--space-6);
}
html[data-theme="clean"] .titlebox { margin-bottom: var(--space-6); }
html[data-theme="clean"] .titlebox h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
html[data-theme="clean"] .lede {
  margin: 0;
  max-width: 38em;
  color: var(--text-muted);
  font-size: var(--text-lg);
}
html[data-theme="clean"] .apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
html[data-theme="clean"] .app-card {
  display: grid;
  gap: var(--space-1);
  height: 100%;
  box-sizing: border-box;
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
@media (hover: hover) {
  html[data-theme="clean"] .app-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
    border-color: var(--border-alt);
  }
}
html[data-theme="clean"] .app-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
html[data-theme="clean"] .app-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}
html[data-theme="clean"] .app-name::after {
  content: " \2192";
  color: var(--link);
}
html[data-theme="clean"] .app-desc { color: var(--text-muted); font-size: var(--text-sm); }
/* The "Try it without an account" row under the cards: the same cards, a
   heading of its own. */
html[data-theme="clean"] .demos h2 {
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}
html[data-theme="clean"] footer {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
html[data-theme="clean"] footer p { margin: var(--space-4) 0 0; }
html[data-theme="clean"] .home-appearance { justify-content: flex-start; margin: 0; }
