/*
  Styles for the era switcher (Boomer / Gen X / Millennial / Gen Z).
  The Millennial era is the normal site (layouts/partials/styles.html + static/css/home.css);
  this file only adds what the other eras and the switching need.

  Sections: which era is showing, morphing pieces, transition animations, dots, hint,
  Jeff Breaker overlay, then one section per era (BOOMER, GEN X, GEN Z).
*/
/* ---------- which era is showing ---------- */
.era { display: none; }
html[data-era="boomer"] #era-boomer,
html[data-era="genx"] #era-genx,
html[data-era="genz"] #era-genz { display: block; }
html[data-era]:not([data-era="millennial"]) #fixeed,
html[data-era]:not([data-era="millennial"]) .colorchange { display: none; }
html[data-era]:not([data-era="millennial"]) body { padding: 0; }
#era-root a { animation: none; }
#era-root, #era-root * { box-sizing: border-box; }
#era-root { overflow-x: clip; }
.gx-player { min-width: 0; }

/* ---------- shared pieces that morph between eras ----------
   Put one of these classes on the matching element in each era (the millennial ones are
   in content/_index.md and layouts/index.html). Only one element per name may be visible
   at a time; hidden eras aren't rendered, so that takes care of itself. */
.m-name  { view-transition-name: m-name; }
.m-photo { view-transition-name: m-photo; }
.m-bio   { view-transition-name: m-bio; }
.m-prior { view-transition-name: m-prior; }
#era-dial { view-transition-name: era-dial; }
.gz-rail { view-transition-name: gz-rail; }
.gz-tung { view-transition-name: gz-tung; }

/* let clicks reach the page while an era change is still animating */
::view-transition { pointer-events: none; }
::view-transition-group(*) { animation-duration: .8s; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
::view-transition-old(*), ::view-transition-new(*) { animation-duration: .55s; }
/* paragraphs glide at their real size instead of being squashed into the new box */
::view-transition-old(m-bio), ::view-transition-new(m-bio),
::view-transition-old(m-prior), ::view-transition-new(m-prior) { height: auto; width: auto; object-fit: none; object-position: left top; }
::view-transition-group(m-bio), ::view-transition-group(m-prior) { overflow: clip; }
::view-transition-old(root) { animation: .45s ease-in both era-out; }
::view-transition-new(root) { animation: .6s .15s ease-out both era-in; }
html[data-dir="back"]::view-transition-old(root) { animation-name: era-out-back; }
html[data-dir="back"]::view-transition-new(root) { animation-name: era-in-back; }
::view-transition-group(era-dial) { animation: none; }
::view-transition-new(gz-rail) { animation: .7s cubic-bezier(.2, .8, .2, 1) both slide-in-right; }
::view-transition-old(gz-rail) { animation: .5s ease-in both slide-out-right; }
::view-transition-new(gz-tung) { animation: .7s .25s cubic-bezier(.3, 1.6, .5, 1) both pop-in; }
::view-transition-old(gz-tung) { animation: .3s ease-in both pop-out; }
@keyframes era-out { to { opacity: 0; transform: translateX(-40px); filter: blur(4px); } }
@keyframes era-in { from { opacity: 0; transform: translateX(40px); filter: blur(4px); } }
@keyframes era-out-back { to { opacity: 0; transform: translateX(40px); filter: blur(4px); } }
@keyframes era-in-back { from { opacity: 0; transform: translateX(-40px); filter: blur(4px); } }
@keyframes slide-in-right { from { transform: translateX(100%); } }
@keyframes slide-out-right { to { transform: translateX(100%); } }
@keyframes pop-in { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
@keyframes pop-out { to { transform: scale(0); opacity: 0; } }

/* ---------- era dots (a range input under the hood) ----------
   No CSS transitions or animations in here: they stall Chrome's view transitions
   (see "Chrome quirks" in static/js/eras.js). The fade is set from JS. */
#era-dial {
  opacity: .2; /* until eras.js takes over */
  position: fixed; z-index: 60; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: 96px; height: 24px;
}
.era-dots { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.era-dots i { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.era-dots i::after {
  content: ""; width: 7px; height: 7px; border-radius: 999px;
  background: rgba(30, 30, 30, .3);
  /* no CSS transitions here: a transition running inside the dial while an era change is
     being captured stalls Chrome's view transition. The dial crossfades as part of it anyway. */
}
.era-dots i.on::after { width: 16px; background: rgba(30, 30, 30, .8); }
/* light dots on the dark Gen Z background */
html[data-era="genz"] .era-dots i::after { background: rgba(255, 255, 255, .45); }
html[data-era="genz"] .era-dots i.on::after { background: #fff; }
#era-dial:has(#era-slider:focus-visible) { opacity: 1 !important; }
#era-dial:has(#era-slider:focus-visible) .era-dots i.on::after { outline: 2px solid #ff5ce1; outline-offset: 2px; }
#era-slider {
  -webkit-appearance: none; appearance: none; position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; background: transparent;
}
#era-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 24px; }
#era-slider::-moz-range-thumb { width: 16px; height: 24px; border: 0; }
#fixeed { padding-bottom: 72px; }
/* DVD logo -> Jeff Breaker */
html.over-dvd, html.over-dvd body { cursor: url(/cursors/millennial-link.svg) 3 3, pointer !important; }
html.over-dvd #era-hint { opacity: 0; }
html.breaker-on, html.breaker-on body { overflow: hidden; }
html.breaker-on #era-hint, html.breaker-on #era-dial { display: none; }
#breaker { position: fixed; inset: 0; z-index: 90; background: #ffed91; touch-action: none; }
#breaker canvas { display: block; cursor: none; }
.breaker-close {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
  font: 20px/1 system-ui, sans-serif; color: blue; background: rgba(255, 255, 255, .6);
  border: 2px solid blue; cursor: pointer;
}
.breaker-close:hover { background: #fff; }
#era-hint {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .01em;
  color: #fff; background: rgba(20, 20, 20, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0; transition: opacity .2s;
  view-transition-name: era-hint;
}
#era-hint.show { opacity: 1; }
#era-hint .for-touch { display: none; }
#era-hint.touch { left: 50%; top: auto; bottom: 46px; transform: translateX(-50%) !important; }
#era-hint.touch .for-mouse { display: none; }
#era-hint.touch .for-touch { display: inline; }
html.era-dragging #era-hint { opacity: 0; }
::view-transition-group(era-hint) { animation: none; }
/* ---------- cursors: one set per era ----------
   Images are in static/cursors/ (made by tools/cursors/make.py). The two numbers after
   each url are the hotspot: the pixel that actually clicks. Phones don't show cursors. */
@media (pointer: fine) {
  html[data-era="boomer"] body { cursor: url(/cursors/boomer.svg) 1 1, default; }
  html[data-era="boomer"] :is(a, button, label, #era-slider) { cursor: url(/cursors/boomer-link.svg) 14 1, pointer; }

  html[data-era="genx"] body { cursor: url(/cursors/genx.svg) 3 3, default; }
  html[data-era="genx"] :is(a, button, label, #era-slider) { cursor: url(/cursors/genx-link.svg) 16 16, pointer; }

  html[data-era="millennial"] body { cursor: url(/cursors/millennial.svg) 3 3, default; }
  html[data-era="millennial"] :is(a, button, label, #era-slider) { cursor: url(/cursors/millennial-link.svg) 3 3, pointer; }

  html[data-era="genz"] body {
    cursor: url(/cursors/genz.png) 13 2, default;
    cursor: image-set(url(/cursors/genz.png) 1x, url(/cursors/genz@2x.png) 2x) 13 2, default;
  }
  html[data-era="genz"] :is(a, button, label, #era-slider) {
    cursor: url(/cursors/genz-link.png) 16 16, pointer;
    cursor: image-set(url(/cursors/genz-link.png) 1x, url(/cursors/genz-link@2x.png) 2x) 16 16, pointer;
  }
}
/* Gen X sparkle trail (spawned by eras.js) */
.gx-sparkle {
  position: fixed; z-index: 80; pointer-events: none; font-size: 16px; line-height: 1;
  text-shadow: 0 0 2px #fff, 0 0 1px rgba(0, 0, 0, .5);
  transform: translate(-50%, -50%); animation: gx-sparkle .8s ease-out forwards;
}
@keyframes gx-sparkle { to { opacity: 0; transform: translate(-50%, 30%) scale(.3) rotate(90deg); } }
html.era-dragging, html.era-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; }

/* ---------- BOOMER: browser defaults, nothing else ---------- */
html[data-era="boomer"] body { background: #fff; color: #000; font: 16px/normal "Times New Roman", Times, serif; }
#era-boomer { padding: 8px 8px 80px; }
#era-boomer h1 { font-size: 2em; margin: .67em 0; font-weight: bold; }
#era-boomer h2 { font-size: 1.5em; margin: .83em 0; font-weight: bold; }
#era-boomer p { margin: 1em 0; }
#era-boomer ul { margin: 1em 0; padding-left: 40px; list-style: disc; }
#era-boomer hr { border: 1px inset #eee; margin: .5em 0; }
#era-boomer a { color: #0000ee; text-decoration: underline; }
#era-boomer a:visited { color: #551a8b; }

/* ---------- GEN X: jeffspace ---------- */
html[data-era="genx"] body {
  color: #000; font: 11px/1.4 Verdana, Arial, Helvetica, sans-serif;
  background-color: #0b0420;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 70px 80px, #ff9cf5, transparent),
    radial-gradient(2px 2px at 120px 20px, #9cf4ff, transparent),
    radial-gradient(1px 1px at 160px 110px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40px 140px, #fff59c, transparent),
    linear-gradient(135deg, #2a0845 0%, #6441a5 50%, #2a0845 100%);
  background-size: 180px 160px, 180px 160px, 180px 160px, 180px 160px, 180px 160px, 100% 100%;
  background-attachment: fixed;
}
#era-genx a { color: #003399; text-decoration: underline; }
#era-genx a:hover { color: #ff6600; }
.gx-topbar { background: #003399; color: #fff; padding: 6px 12px; font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.gx-topbar b { font-family: "Arial Black", Arial, sans-serif; font-size: 20px; letter-spacing: -1px; font-style: italic; }
#era-genx .gx-topbar a, #era-genx .gx-subbar a { color: #fff; }
.gx-subbar { background: #6698cb; color: #fff; padding: 4px 12px; }
.gx-page { width: 800px; max-width: 100%; margin: 12px auto 90px; background: #fff; padding: 10px; display: flex; gap: 10px; align-items: flex-start; }
.gx-left { width: 300px; flex: 0 0 300px; }
.gx-right { flex: 1; min-width: 0; }
.gx-name { font-size: 22px; font-weight: bold; margin: 2px 0 6px; width: fit-content; }
.gx-glitter { background: linear-gradient(90deg, #ff00cc, #ffcc00, #00ffcc, #cc00ff, #ff00cc); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gx-glit 2s linear infinite; }
@keyframes gx-glit { to { background-position: 200% 0; } }
.gx-profile { display: flex; gap: 8px; }
.gx-profile img { width: 140px; height: 140px; object-fit: cover; border: 1px solid #999; }
.gx-online { color: #33cc33; font-weight: bold; animation: gx-blink 1s steps(2) infinite; }
@keyframes gx-blink { 50% { opacity: .2; } }
.gx-mood { margin: 6px 0; } .gx-view { margin: 4px 0 10px; }
.gx-box { border: 1px solid #6698cb; margin-bottom: 10px; }
.gx-box h3 { margin: 0; background: #6698cb; color: #fff; font-size: 11px; padding: 3px 6px; }
.gx-box.gx-orange h3 { background: #ffcc99; color: #cc3300; }
.gx-in { padding: 6px; }
.gx-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#era-genx .gx-contact a { text-decoration: none; }
.gx-details { width: 100%; border-collapse: collapse; }
.gx-details td { padding: 3px 4px; vertical-align: top; }
.gx-details td:first-child { background: #b1d0f0; color: #336699; font-weight: bold; width: 40%; }
.gx-details td:last-child { background: #d5e8fb; }
.gx-url { border: 1px solid #6698cb; padding: 6px; margin-bottom: 10px; }
.gx-network { border: 1px solid #6698cb; padding: 10px; font-size: 16px; font-weight: bold; margin-bottom: 10px; }
.gx-h { color: #ff6600; font-weight: bold; font-size: 12px; margin: 10px 0 4px; }
.gx-blurb p { margin: 0 0 8px; line-height: 1.5; }
.gx-player { background: #000; color: #0f0; font-family: "Courier New", monospace; padding: 6px; display: flex; gap: 8px; align-items: center; }
.gx-player button { font: inherit; font-size: 11px; background: #333; color: #0f0; border: 1px outset #666; cursor: pointer; padding: 2px 8px; }
.gx-bars { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.gx-bars i { width: 3px; background: #0f0; height: 3px; }
.gx-player.playing .gx-bars i { animation: gx-eq .4s ease-in-out infinite alternate; }
.gx-player.playing .gx-bars i:nth-child(2) { animation-delay: .1s; } .gx-player.playing .gx-bars i:nth-child(3) { animation-delay: .2s; }
.gx-player.playing .gx-bars i:nth-child(4) { animation-delay: .05s; } .gx-player.playing .gx-bars i:nth-child(5) { animation-delay: .15s; }
@keyframes gx-eq { from { height: 2px; } to { height: 14px; } }
.gx-marquee { overflow: hidden; white-space: nowrap; flex: 1; }
.gx-marquee span { display: inline-block; padding-left: 100%; animation: gx-scroll 9s linear infinite; }
@keyframes gx-scroll { to { transform: translateX(-100%); } }
.gx-count { margin-bottom: 8px; }
.gx-top8 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
#era-genx .gx-top8 a { text-decoration: none; display: block; }
.gx-top8 span { display: flex; height: 70px; align-items: center; justify-content: center; font-size: 34px; border: 1px solid #ccc; margin-bottom: 3px; }
.gx-comments { width: 100%; border-collapse: collapse; }
.gx-comments td { padding: 6px; vertical-align: top; border-bottom: 1px solid #ddd; }
.gx-comments td.who { width: 90px; text-align: center; background: #ffcc99; }
.gx-comments td.who span { display: block; font-size: 28px; }
.gx-comments td.msg { background: #fff3e6; }
@media (max-width: 720px) {
  .gx-page { flex-direction: column; align-items: stretch; margin: 0 0 90px; }
  .gx-left, .gx-right { width: 100%; flex: none; }
  .gx-topbar { gap: 8px 12px; }
  .gx-profile img { width: 120px; height: 120px; }
  .gx-top8 span { height: 56px; font-size: 28px; }
  .gx-top8 a { font-size: 10px; overflow-wrap: anywhere; }
}

/* ---------- GEN Z ---------- */
html[data-era="genz"] body { background: #1a0033; color: #fff; font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; line-height: 1.2; }
.gz-wrap { display: grid; grid-template-columns: minmax(0, 1fr) min(36vw, 420px); min-height: 100vh; }
.gz-feed {
  padding: 40px clamp(18px, 4vw, 56px) 120px;
  background:
    radial-gradient(circle at 20% 10%, #ff2bd6 0, transparent 40%),
    radial-gradient(circle at 90% 30%, #00e5ff 0, transparent 35%),
    radial-gradient(circle at 30% 90%, #7cff00 0, transparent 35%),
    #1a0033;
}
.gz-rail { position: sticky; top: 0; height: 100vh; background: #000; overflow: hidden; }
.gz-rail iframe { position: absolute; top: 50%; left: 50%; height: 100%; width: calc(100vh * 16 / 9); min-width: 100%; transform: translate(-50%, -50%); border: 0; pointer-events: none; }
.gz-tung {
  position: fixed; z-index: 20; right: calc(min(36vw, 420px) + 18px); bottom: 56px;
  width: 220px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden;
  border: 4px solid #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); background: #000;
  animation: gz-bop .6s ease-in-out infinite alternate;
}
.gz-tung iframe { position: absolute; top: 50%; left: 50%; height: 100%; width: calc(220px * 16 / 9 * 16 / 9); transform: translate(-50%, -50%); border: 0; pointer-events: none; }
.gz-tung span { position: absolute; z-index: 2; left: 8px; bottom: 8px; font-size: 12px; background: rgba(0, 0, 0, .6); padding: 3px 8px; border-radius: 999px; }
@keyframes gz-bop { from { transform: rotate(-2deg); } to { transform: rotate(2deg) translateY(-6px); } }
.gz-title {
  font-size: clamp(56px, 11vw, 120px); line-height: .9; margin: 0 0 8px; letter-spacing: -0.03em; width: fit-content;
  background: linear-gradient(90deg, #fff, #ffe600, #ff2bd6, #00e5ff, #fff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gz-shimmer 4s linear infinite;
  filter: drop-shadow(0 5px 0 #000) drop-shadow(0 0 18px rgba(0, 0, 0, .35));
}
@keyframes gz-shimmer { to { background-position: 300% 0; } }
.gz-handle { font-size: 18px; opacity: .9; margin-bottom: 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gz-pfp { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #ffe600; object-fit: cover; }
.gz-cap {
  width: fit-content; max-width: 640px; font-size: clamp(22px, 3.2vw, 34px); line-height: 1.15; margin: 0 0 22px; color: #fff;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 4px 0 #000;
}
.gz-cap .hl { color: #ffe600; } .gz-cap .pink { color: #ff5ce1; }
#era-genz .gz-cap a { color: #7cff00; text-decoration: underline; }
.gz-aura { display: inline-flex; gap: 10px; align-items: center; margin: 10px 0 30px; background: #000; border: 3px solid #ffe600; border-radius: 999px; padding: 8px 18px; font-size: 20px; }
.gz-aura b { color: #ffe600; font-variant-numeric: tabular-nums; }
.gz-aura button { font: inherit; font-size: 16px; background: #ffe600; color: #000; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.gz-aura button:active { transform: scale(.94); }
.gz-tags { font-size: 16px; color: #00e5ff; margin-top: 30px; font-weight: 600; }
.gz-floaty { position: fixed; pointer-events: none; z-index: 70; font-size: 28px; animation: gz-up 1.4s ease-out forwards; }
@keyframes gz-up { to { transform: translateY(-120px) scale(1.4); opacity: 0; } }
@media (max-width: 760px) {
  .gz-wrap { display: block; }
  .gz-feed { padding: 24px 18px 52vh; }
  .gz-rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 44vh; z-index: 10; border-top: 4px solid #fff; }
  .gz-rail iframe { width: calc(44vh * 16 / 9); }
  .gz-tung { right: 12px; bottom: calc(44vh + 12px); width: 110px; border-width: 3px; border-radius: 12px; }
  .gz-tung iframe { width: calc(110px * 16 / 9 * 16 / 9); }
}
@media (prefers-reduced-motion: reduce) {
  .gx-glitter, .gx-online, .gx-marquee span, .gz-title, .gz-tung { animation: none; }
}
