/* Agoramores — "lava-lamp" theme overrides. Loaded after main.css.
   Every selector here is scoped to body[data-theme-id="lava-lamp"]. */

/* Lava Lamp — the original August blob theme, kept as a standalone (non-month) theme.
   Restored verbatim except the heading gradient, whose stops were lifted out of the
   700-900 range so they read as a gradient instead of flat black on the bright ground. */
body[data-theme-id="lava-lamp"] {
  --tt-bg: #ffd36b;
  /* Link-hover paired to THIS block's ground (standing rule 2026-08-14).
     #ffd36b is light: #FF465A only measures 2.36:1 here, so this lighting
     takes the same-hue dark variant, #BD0014 — 4.66:1. */
  --link-hover: #BC0900;
  --tt-bg-alt: #ff7a59;
  --tt-cyan: #000;
  --tt-cyan-soft: #000;
  --tt-yellow: #000;
  --tt-orange: #000;
  --tt-green: #000;
  --tt-chartreuse: #000;
  --tt-pink: #000;
  --tt-purple: #000;
  --tt-blue: #000;
  --tt-teal: #000;
  --tt-gray: #000;
  --tt-gold: #000;
  --tt-red: #c01b19;
  --tt-breadcrumb-text: #000;
  --tt-breadcrumb-glow: transparent;
  /* Hover/focus halo for the zodiac glyphs. This month's breadcrumb glow is
     too faint to trace a character, so the chips get their own value; the
     rule that uses it lives once in main.css. Never a border. */
  --zodiac-glow: rgba(0, 0, 0, 0.45);
  --tt-heading-rainbow: none;
  --tt-heading-rainbow-vertical: none;
  --tt-heading-text-rainbow: linear-gradient(
    90deg,
    #c01b19,
    #c94a0d,
    #8a6410,
    #347830,
    #697247,
    #6b411b,
    #963b27,
    #cb2f2d,
    #c01b19
  );
  --bg: #ffd36b;
  --surface: transparent;
  --text: #000;
  --text-soft: #000;
  --muted: #000;
  --border: transparent;
  --border-dim: transparent;
  --border-teal: rgba(0, 0, 0, 0.72);
  /* The :root default cuts the card with black below the stroke, which is what
     an engraving looks like on a dark face. This one is sunlit — the lit lip of
     a cut on a bright ground is white — so the shadow has to change sign or the
     numeral reads as drop-shadowed type instead of struck lettering. */
  --tt-engrave: 0 1px 0 rgba(242, 230, 210, 0.75);
  background: #ffd36b;
  color: #000;
  color-scheme: light;
}

body[data-theme-id="lava-lamp"] .breadcrumb-nav {
  background: rgba(242, 230, 210, 0.18);
  box-shadow: none;
}

body[data-theme-id="lava-lamp"]::before,
body[data-theme-id="lava-lamp"] .breadcrumb-nav::before {
  display: none;
  animation: none;
}

body[data-theme-id="lava-lamp"] .night-sky {
  background:
    radial-gradient(ellipse at 16% 18%, rgba(255, 248, 138, 0.95) 0 8%, rgba(255, 205, 74, 0.58) 20%, transparent 44%),
    radial-gradient(ellipse at 84% 14%, rgba(255, 68, 67, 0.82) 0 9%, rgba(255, 124, 124, 0.48) 24%, transparent 46%),
    radial-gradient(ellipse at 34% 92%, rgba(255, 127, 42, 0.88) 0 11%, rgba(255, 209, 102, 0.5) 28%, transparent 52%),
    radial-gradient(ellipse at 86% 86%, rgba(194, 114, 73, 0.44) 0 10%, rgba(202, 202, 139, 0.24) 28%, transparent 54%),
    linear-gradient(135deg, #fff06d 0%, #ffb13d 28%, #ff6867 58%, #d07f60 100%);
  background-repeat: no-repeat;
}

body[data-theme-id="lava-lamp"] .night-sky::before {
  inset: -18vmax;
  opacity: 1;
  background-image:
    radial-gradient(ellipse at 18% 30%, rgba(255, 255, 172, 0.82) 0 8%, rgba(255, 203, 80, 0.56) 18%, transparent 40%),
    radial-gradient(ellipse at 74% 24%, rgba(255, 60, 59, 0.74) 0 10%, rgba(255, 96, 91, 0.48) 22%, transparent 43%),
    radial-gradient(ellipse at 46% 72%, rgba(255, 134, 44, 0.78) 0 12%, rgba(255, 198, 80, 0.44) 26%, transparent 48%),
    radial-gradient(ellipse at 82% 76%, rgba(194, 114, 73, 0.52) 0 9%, rgba(255, 124, 124, 0.36) 24%, transparent 46%);
  background-repeat: no-repeat;
  background-size: 82vmax 72vmax, 68vmax 60vmax, 88vmax 76vmax, 66vmax 58vmax;
  background-position: -18vmax -12vmax, 46vmax -6vmax, -4vmax 34vmax, 48vmax 32vmax;
  background-blend-mode: screen;
  animation: lavaLampDrift 36s ease-in-out infinite alternate;
}

body[data-theme-id="lava-lamp"] .night-sky__stars--far,
body[data-theme-id="lava-lamp"] .night-sky__stars--near {
  inset: -16vmax;
  opacity: 0.9;
  background-image:
    radial-gradient(ellipse at 34% 28%, rgba(242, 230, 210, 0.3) 0 7%, transparent 26%),
    radial-gradient(ellipse at 72% 62%, rgba(255, 231, 114, 0.38) 0 9%, transparent 29%),
    radial-gradient(ellipse at 16% 74%, rgba(255, 98, 97, 0.3) 0 8%, transparent 27%);
  background-repeat: no-repeat;
  background-size: 74vmax 58vmax, 62vmax 68vmax, 58vmax 52vmax;
  background-position: 12vmax -6vmax, 42vmax 26vmax, -12vmax 34vmax;
  background-blend-mode: soft-light;
  animation: lavaLampDriftSoft 52s ease-in-out infinite alternate;
}

body[data-theme-id="lava-lamp"] .heading-section::before,
body[data-theme-id="lava-lamp"] .page-toc::before {
  display: none;
}

body[data-theme-id="lava-lamp"] .night-sky__aurora {
  display: block;
  z-index: 2;
  inset: -12vmax;
  height: auto;
  clip-path: none;
  background:
    radial-gradient(ellipse at 20% 64%, rgba(255, 249, 168, 0.32) 0 9%, transparent 31%),
    radial-gradient(ellipse at 62% 36%, rgba(255, 62, 61, 0.34) 0 11%, transparent 34%),
    radial-gradient(ellipse at 78% 78%, rgba(184, 101, 49, 0.24) 0 10%, transparent 32%);
  background-repeat: no-repeat;
  background-size: 74vmax 54vmax, 68vmax 58vmax, 62vmax 46vmax;
  background-position: -8vmax 28vmax, 26vmax -4vmax, 44vmax 34vmax;
  animation: lavaLampDriftAurora 64s ease-in-out infinite alternate;
}

body[data-theme-id="lava-lamp"],
body[data-theme-id="lava-lamp"] p,
body[data-theme-id="lava-lamp"] li,
body[data-theme-id="lava-lamp"] strong,
body[data-theme-id="lava-lamp"] b,
body[data-theme-id="lava-lamp"] em,
body[data-theme-id="lava-lamp"] i,
body[data-theme-id="lava-lamp"] a,
body[data-theme-id="lava-lamp"] label,
body[data-theme-id="lava-lamp"] td,
body[data-theme-id="lava-lamp"] .brand a {
  background: none;
  color: #000;
  -webkit-text-fill-color: #000;
  text-shadow: none;
  animation: none;
}

body[data-theme-id="lava-lamp"] *:not(.breadcrumb-nav):not(.breadcrumb-nav *),
body[data-theme-id="lava-lamp"] *:not(.breadcrumb-nav):not(.breadcrumb-nav *)::before,
body[data-theme-id="lava-lamp"] *:not(.breadcrumb-nav):not(.breadcrumb-nav *)::after {
  border-color: transparent !important;
  border-image: none !important;
  box-shadow: none !important;
}

/* The celestial tooltip floats on <body> (outside the breadcrumb bar), so the
   border stripper above hits it; give it back a readable frame on the sun. */
body[data-theme-id="lava-lamp"] .celestial-tooltip.celestial-tooltip {
  border-color: rgba(0, 0, 0, 0.72) !important;
  border-image: none !important;
  background: #ffd36b;
}

body[data-theme-id="lava-lamp"] input,
body[data-theme-id="lava-lamp"] textarea,
body[data-theme-id="lava-lamp"] select,
body[data-theme-id="lava-lamp"] code,
body[data-theme-id="lava-lamp"] pre,
body[data-theme-id="lava-lamp"] th {
  background: rgba(242, 230, 210, 0.18);
  color: #000;
}

/* Fireworks are Independence Day furniture: July theme only. The JS also refuses to
   spawn them off-July, so this is belt-and-braces for any burst already on screen. */
body[data-theme-id="lava-lamp"] .night-sky__fireworks {
  display: none;
}

@media (prefers-reduced-data: reduce) {
  /* Month themes set ambient motion on higher-specificity selectors; stop those too. */
  body[data-theme-id="lava-lamp"] .night-sky::before,
  body[data-theme-id="lava-lamp"] .night-sky__stars,
  body[data-theme-id="lava-lamp"] .night-sky__aurora {
    animation: none;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   LAVA LAMP AT NIGHT.

   The same lamp with the room lights off. A lava lamp by day is a bright object
   on a bright desk and you read it as colour; at night it is the only thing
   lit in the room, and you read it as a light source. So the sun-yellow ground
   drops to the deep warm dark a lamp actually sits in, the blobs keep their
   hues and their positions — same lamp, same wax, nothing rearranged — and the
   ink flips to a warm off-white rather than a clinical one, because everything
   in that room is being lit by the lamp.

   The blobs are pulled DOWN in absolute value even though they are now the
   brightest thing in frame. That is not a contradiction: what makes something
   read as a light source is its ratio to the dark around it, not its own
   number, and these sit twenty-odd times the ground's luminance while staying
   under the ceiling that keeps off-white body copy at 4.5:1 where a blob core
   passes behind a paragraph. Painting them at their daylight values would glow
   convincingly and make the page unreadable in four places.

   No animation is added or removed here. Every rule below restates
   `background-image` only, so the base block's sizes, positions, blend modes
   and drift keyframes carry through untouched — which is also what keeps the
   `prefers-reduced-data` block above authoritative: it cancels `animation` on
   selectors this block never declares `animation` on.
   --------------------------------------------------------------------------- */
body[data-theme-id="lava-lamp"][data-mode="night"] {
  --tt-bg: #1b0e05;
  /* Link-hover re-paired to THIS block's ground (standing rule 2026-08-14).
     #1b0e05 is dark: #FF465A clears 5.65:1 here. */
  --link-hover: #FF4947;
  /* The daylight alt is hot coral; at night that same coral is an ember. */
  --tt-bg-alt: #33150a;
  --tt-cyan: #f3e5d2;
  --tt-cyan-soft: #f3e5d2;
  --tt-yellow: #f3e5d2;
  --tt-orange: #f3e5d2;
  --tt-green: #f3e5d2;
  --tt-chartreuse: #f3e5d2;
  --tt-pink: #f3e5d2;
  --tt-purple: #f3e5d2;
  --tt-blue: #f3e5d2;
  --tt-teal: #f3e5d2;
  --tt-gray: #f3e5d2;
  --tt-gold: #f3e5d2;
  /* Red is the anchor in both lightings, but #c01732 only clears 3.1:1 on this
     ground — it was chosen against a sun-yellow one. Same crimson, lifted to
     4.8:1, so it still leads the heading gradient and still frames the card. */
  --tt-red: #f03935;
  --tt-breadcrumb-text: #f3e5d2;
  /* Breadcrumb glow stays transparent as it is by day, so the chips need their
     own value — and it has to invert: a black halo was right on the sun, and is
     nothing at all here. Warm, because the only light in the room is the lamp. */
  --zodiac-glow: rgba(255, 214, 150, 0.72);
  /* The daylight stops were dropped out of the 700-900 range to be legible on
     the bright ground; here the same eight hues go the other way, lifted into
     the mid-to-high band so they stay separated against the dark instead of
     collapsing into one smudge. Red leads and closes the cycle. */
  --tt-heading-text-rainbow: linear-gradient(
    90deg,
    #f03935,
    #ff8a3d,
    #f2cf5a,
    #81d27f,
    #b4cb91,
    #c5926a,
    #e3856e,
    #ff8484,
    #f03935
  );
  --bg: #1b0e05;
  --text: #f3e5d2;
  --text-soft: #f3e5d2;
  --muted: #f3e5d2;
  --border-teal: rgba(243, 229, 210, 0.72);
  /* Back to the :root direction — this face is dark again, so the cut is black
     below the stroke. Stated rather than inherited, because the base block now
     sets the pale-ground value and would otherwise win. */
  --tt-engrave: 0 1px 0 rgba(0, 0, 0, 0.55);
  background: #1b0e05;
  color: #f3e5d2;
  color-scheme: dark;
}

/* By day the bar is a sheet of white laid over the sun; at night it is the same
   sheet catching what little the lamp throws, so the lift goes warm and drops
   to a fifth of its strength — anything more and the card floats off the dark
   instead of sitting in it. */
body[data-theme-id="lava-lamp"][data-mode="night"] .breadcrumb-nav {
  background: rgba(247, 228, 206, 0.07);
}

body[data-theme-id="lava-lamp"][data-mode="night"] .night-sky {
  background-image:
    radial-gradient(ellipse at 16% 18%, rgba(140, 88, 10, 0.95) 0 8%, rgba(96, 58, 8, 0.6) 20%, transparent 44%),
    radial-gradient(ellipse at 84% 14%, rgba(192, 33, 33, 0.85) 0 9%, rgba(123, 24, 23, 0.5) 24%, transparent 46%),
    radial-gradient(ellipse at 34% 92%, rgba(168, 74, 12, 0.9) 0 11%, rgba(110, 52, 10, 0.5) 28%, transparent 52%),
    radial-gradient(ellipse at 86% 86%, rgba(121, 63, 30, 0.5) 0 10%, rgba(90, 85, 55, 0.28) 28%, transparent 54%),
    linear-gradient(135deg, #2b1608 0%, #1f1006 30%, #24110c 62%, #180c0b 100%);
}

/* The drifting layer blends with `screen`, which brightens wherever two blobs
   overlap — harmless on the sun, but here an overlap is what would push a core
   past the readability ceiling. So this set runs roughly half the value of the
   one above, and the screened overlaps land where the single blobs do rather
   than above them. */
body[data-theme-id="lava-lamp"][data-mode="night"] .night-sky::before {
  background-image:
    radial-gradient(ellipse at 18% 30%, rgba(112, 68, 8, 0.8) 0 8%, rgba(74, 44, 6, 0.56) 18%, transparent 40%),
    radial-gradient(ellipse at 74% 24%, rgba(141, 24, 21, 0.74) 0 10%, rgba(104, 30, 20, 0.48) 22%, transparent 43%),
    radial-gradient(ellipse at 46% 72%, rgba(126, 54, 10, 0.78) 0 12%, rgba(84, 42, 8, 0.44) 26%, transparent 48%),
    radial-gradient(ellipse at 82% 76%, rgba(92, 47, 21, 0.52) 0 9%, rgba(100, 28, 26, 0.36) 24%, transparent 46%);
}

/* These two carry wax, not stars, so they are re-lit rather than hidden. They
   blend with `soft-light`, which lightens whatever is under it, and the room is
   dim — the layer opacity comes down with the values so the wash reads as the
   lamp's spill on the dark instead of a grey film over it. */
body[data-theme-id="lava-lamp"][data-mode="night"] .night-sky__stars--far,
body[data-theme-id="lava-lamp"][data-mode="night"] .night-sky__stars--near {
  opacity: 0.55;
  background-image:
    radial-gradient(ellipse at 34% 28%, rgba(255, 208, 140, 0.16) 0 7%, transparent 26%),
    radial-gradient(ellipse at 72% 62%, rgba(255, 168, 62, 0.2) 0 9%, transparent 29%),
    radial-gradient(ellipse at 16% 74%, rgba(240, 57, 53, 0.16) 0 8%, transparent 27%);
}

/* Not a horizon here: this sheet borrows the aurora element as a third, slowest
   wax layer, so it is re-lit with the rest and never becomes scenery. */
body[data-theme-id="lava-lamp"][data-mode="night"] .night-sky__aurora {
  background-image:
    radial-gradient(ellipse at 20% 64%, rgba(150, 100, 20, 0.24) 0 9%, transparent 31%),
    radial-gradient(ellipse at 62% 36%, rgba(177, 31, 30, 0.26) 0 11%, transparent 34%),
    radial-gradient(ellipse at 78% 78%, rgba(109, 58, 29, 0.2) 0 10%, transparent 32%);
}

/* The chips are excluded on purpose. The base list above reaches them and then
   loses to .celestial-chip's doubled-class rule in main.css, which is what
   stops this sheet's -webkit-text-fill-color from blanking the glyphs; adding
   [data-mode] would raise the same selector past that rule and undo the
   anchor-proofing for one mode only. Cutting them out keeps both modes
   identical, and keeps that fill-colour pattern from spreading anywhere new. */
body[data-theme-id="lava-lamp"][data-mode="night"],
body[data-theme-id="lava-lamp"][data-mode="night"] p,
body[data-theme-id="lava-lamp"][data-mode="night"] li,
body[data-theme-id="lava-lamp"][data-mode="night"] strong,
body[data-theme-id="lava-lamp"][data-mode="night"] b,
body[data-theme-id="lava-lamp"][data-mode="night"] em,
body[data-theme-id="lava-lamp"][data-mode="night"] i,
body[data-theme-id="lava-lamp"][data-mode="night"] a:not(.celestial-chip),
body[data-theme-id="lava-lamp"][data-mode="night"] label,
body[data-theme-id="lava-lamp"][data-mode="night"] td,
body[data-theme-id="lava-lamp"][data-mode="night"] .brand a {
  color: #f3e5d2;
  -webkit-text-fill-color: #f3e5d2;
}

/* The daylight carve-out hard-codes the sun as the tooltip's fill so the border
   stripper cannot leave it frameless; at night that fill is a lit rectangle in
   a dark room with cream type on it. Same shape of rule, one lighting up —
   `!important` is not decoration here, it is the only way past the stripper. */
body[data-theme-id="lava-lamp"][data-mode="night"] .celestial-tooltip.celestial-tooltip {
  border-color: rgba(243, 229, 210, 0.6) !important;
  background: #1b0e05;
}

body[data-theme-id="lava-lamp"][data-mode="night"] input,
body[data-theme-id="lava-lamp"][data-mode="night"] textarea,
body[data-theme-id="lava-lamp"][data-mode="night"] select,
body[data-theme-id="lava-lamp"][data-mode="night"] code,
body[data-theme-id="lava-lamp"][data-mode="night"] pre,
body[data-theme-id="lava-lamp"][data-mode="night"] th {
  background: rgba(247, 228, 206, 0.09);
  color: #f3e5d2;
}

/* Lava Lamp ambient drift, preserved from the original August theme. */
@keyframes lavaLampDrift {
  0% {
    background-position: -18vmax -12vmax, 46vmax -6vmax, -4vmax 34vmax, 48vmax 32vmax;
    transform: scale(1) rotate(-1deg);
  }
  50% {
    background-position: -2vmax 4vmax, 30vmax 10vmax, 12vmax 22vmax, 34vmax 16vmax;
    transform: scale(1.06) rotate(1.2deg);
  }
  100% {
    background-position: 12vmax -8vmax, 8vmax 22vmax, 28vmax 36vmax, 2vmax 8vmax;
    transform: scale(1.03) rotate(-1.8deg);
  }
}

@keyframes lavaLampDriftSoft {
  0% {
    background-position: 12vmax -6vmax, 42vmax 26vmax, -12vmax 34vmax;
    transform: scale(1.05) rotate(2deg);
  }
  50% {
    background-position: -4vmax 16vmax, 24vmax -2vmax, 12vmax 16vmax;
    transform: scale(1.12) rotate(-1.4deg);
  }
  100% {
    background-position: 28vmax 10vmax, 2vmax 30vmax, 36vmax 2vmax;
    transform: scale(1.07) rotate(1.8deg);
  }
}

@keyframes lavaLampDriftAurora {
  0% { background-position: -8vmax 28vmax, 26vmax -4vmax, 44vmax 34vmax; transform: scale(1.02); }
  50% { background-position: 10vmax 16vmax, 14vmax 14vmax, 26vmax 20vmax; transform: scale(1.1); }
  100% { background-position: 28vmax 32vmax, -6vmax 26vmax, 8vmax 4vmax; transform: scale(1.05); }
}
