/* ============================================
   ERA SWITCH — 2026 <-> 1998 (homepage only)
   The 1998 look reskins the same markup via body.era-1998,
   plus a few .retro-only extras. Transitions live at the bottom.
   ============================================ */
:root {
  --m: 1; /* transition speed multiplier: 1 = normal, 1.7 = dramatic */
}

/* ---------- Era-only elements ---------- */
.retro-only,
.to-2026 {
  display: none !important;
}

.era-1998 .retro-only {
  display: block !important;
}

.era-1998 .retro-only--inline {
  display: inline-block !important;
}

.era-1998 .to-1998 {
  display: none !important;
}

.era-1998 .to-2026 {
  display: inline-flex !important;
}

/* ---------- The time machine button (both eras) ---------- */
.time-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  background: #050806;
  color: #39FF88;
  border: 1px solid #1F6B3E;
  border-radius: 999px;
  font-family: 'VT323', ui-monospace, monospace;
  font-size: 24px;
  letter-spacing: 1px;
  cursor: pointer;
  animation: time-pulse 2.6s ease-out infinite;
  transition: box-shadow 0.2s, transform 0.2s;
}

.time-btn:hover {
  box-shadow: 0 0 0 4px rgba(57, 255, 136, 0.25), 0 0 28px rgba(57, 255, 136, 0.55);
  transform: translateY(-1px);
}

.time-btn:focus-visible {
  outline: 3px solid #39FF88;
  outline-offset: 3px;
}

.time-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(57, 255, 136, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: time-sheen 3.2s ease-in-out infinite;
}

.time-btn--sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 20px;
}

.time-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.to-2026 {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  min-height: 56px;
}

.blink {
  animation: blink 1s steps(2, start) infinite;
}

@keyframes time-pulse {
  0% { box-shadow: 0 0 0 0 rgba(57, 255, 136, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(57, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 255, 136, 0); }
}

@keyframes time-sheen {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes blink {
  to { visibility: hidden; }
}

/* ============================================
   1998 THEME
   ============================================ */
.era-1998 {
  background-color: #000000;
  background-image:
    radial-gradient(#FFFFFF 1px, transparent 1.4px),
    radial-gradient(#9FD0FF 1px, transparent 1.4px);
  background-size: 48px 48px, 80px 80px;
  background-position: 0 0, 24px 40px;
  color: #FFFFFF;
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
  -webkit-font-smoothing: auto;
}

.era-1998::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

.era-1998 *:not(.time-btn) {
  border-radius: 0 !important;
}

.era-1998 a {
  color: #00FFFF;
}

.era-1998 a:hover {
  color: #FF66FF;
}

.era-1998 a:focus-visible,
.era-1998 button:focus-visible {
  outline: 3px dotted #FFFF00;
}

/* Bevelled grey "buttons" */
.era-1998 .nav-link,
.era-1998 .nav-cta,
.era-1998 .btn,
.era-1998 .tag,
.era-1998 .app-link {
  background: #C0C0C0;
  color: #000000 !important;
  border: 3px outset #E0E0E0;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  text-decoration: none;
  box-shadow: none;
  transform: none;
}

.era-1998 .nav-link,
.era-1998 .nav-cta {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.era-1998 .nav-link:active,
.era-1998 .btn:active,
.era-1998 .app-link:active {
  border-style: inset;
}

.era-1998 .tag {
  padding: 1px 6px;
  font-size: 12px;
  border-width: 2px;
}

/* Marquee + banners */
.retro-marquee {
  overflow: hidden;
  padding: 6px 0;
  background: #000000;
  border-bottom: 2px solid #FF00FF;
  color: #FFFF00;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
}

.retro-marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 24s linear infinite;
}

@keyframes marquee {
  to { transform: translateX(-100%); }
}

.uc-banner {
  margin-top: 22px;
  padding: 6px;
  background: repeating-linear-gradient(45deg, #000000 0 12px, #FFCC00 12px 24px);
  text-align: center;
}

.uc-banner span {
  padding: 2px 10px;
  background: #FFCC00;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 13px;
}

.new-badge {
  margin-left: 8px;
  padding: 1px 5px;
  background: #FF0000;
  color: #FFFF00;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 12px;
  vertical-align: middle;
  animation: blink 1s steps(2, start) infinite;
}

/* Header */
.era-1998 .site-header {
  position: static;
  background: #000080;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 3px solid #C0C0C0;
}

.era-1998 .brand,
.era-1998 .brand:hover {
  color: #FFFF00;
}

.era-1998 .brand__name {
  font-family: 'Comic Sans MS', 'Comic Sans', cursive;
  text-shadow: 2px 2px 0 #FF00FF;
}

.era-1998 .brand__moon {
  fill: #00FF00;
}

.era-1998 .site-nav {
  gap: 6px;
}

/* Hero */
.era-1998 .hero {
  justify-content: center;
  padding: 40px 0 24px;
  text-align: center;
}

.era-1998 .hero__pill {
  padding: 0;
  background: none;
  border: 0;
  color: #00FF00;
  font-size: 19px;
}

.era-1998 .hero__title {
  font-family: 'Comic Sans MS', 'Comic Sans', cursive;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0;
  color: #FFFF00;
  text-shadow: 3px 3px 0 #FF00FF;
}

.era-1998 .hero__sub {
  margin-left: auto;
  margin-right: auto;
  color: #FFFFFF;
  font-size: 20px;
}

.era-1998 .hero__actions {
  justify-content: center;
}

.era-1998 .btn {
  min-height: 42px;
  padding: 0 18px;
  font-size: 15px;
}

.era-1998 .status-card {
  max-width: 520px;
  background: #000033;
  border: 4px ridge #C0C0C0;
  color: #00FF00;
  font-family: 'Courier New', Courier, monospace;
  text-align: left;
}

.era-1998 .status-card__label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 17px;
  color: #FFFF00;
}

.era-1998 .status-card dt {
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  color: #FF66FF;
}

.era-1998 .status-card dd {
  color: #00FF00;
  font-size: 16px;
}

/* Section scaffolding */
.era-1998 .section {
  padding: 28px 0;
}

.era-1998 .section::before {
  content: "";
  display: block;
  height: 5px;
  margin-bottom: 28px;
  background: linear-gradient(90deg, #FF0000, #FF9900, #FFFF00, #00FF00, #00FFFF, #0066FF, #CC00FF);
}

.era-1998 .section__head {
  justify-content: center;
}

.era-1998 .section__title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 30px;
  letter-spacing: 0;
  color: #FF66FF;
  text-decoration: underline;
}

.era-1998 .section__num {
  display: none;
}

/* Identity */
.era-1998 .identity-band {
  padding: 28px;
  background: #000033;
  border: 4px ridge #C0C0C0;
  color: #FFFFFF;
}

.era-1998 .identity__label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  color: #00FF00;
}

.era-1998 .identity__statement {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0;
  color: #FFFF00;
}

.era-1998 .identity__detail {
  color: #FFFFFF;
}

.era-1998 .identity__detail strong {
  color: #00FFFF;
}

/* Cards */
.era-1998 .card,
.era-1998 .apps-teaser {
  background: #000033;
  border: 4px ridge #C0C0C0;
  color: #FFFFFF;
  box-shadow: none;
  transform: none;
}

.era-1998 .card__top {
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  color: #C8C8FF;
}

.era-1998 .card__kind {
  color: #00FF00;
}

.era-1998 .card__title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  color: #FFFF00;
}

.era-1998 .card__desc,
.era-1998 .lede {
  color: #FFFFFF;
}

.era-1998 .card__tags,
.era-1998 .card__links {
  border-top: 1px dashed #808080;
}

.era-1998 .card__status {
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  color: #00FF00;
}

.era-1998 .empty-note {
  border: 2px dashed #808080;
  color: #FFFFFF;
  font-family: 'Times New Roman', Times, serif;
}

.era-1998 .text-link {
  color: #00FFFF;
  font-family: 'Times New Roman', Times, serif;
  font-weight: bold;
  text-decoration: underline;
}

/* Blog */
.era-1998 .blog-list {
  padding-left: 26px;
  border-top: 0;
  list-style: square;
}

.era-1998 .blog-entry {
  display: list-item;
  padding: 6px 0;
  border-bottom: 0;
}

.era-1998 .blog-entry__date {
  display: inline;
  margin-right: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  color: #00FF00;
}

.era-1998 .blog-entry__title {
  color: #00FFFF;
  font-size: 19px;
  text-decoration: underline;
}

.era-1998 .blog-entry .tag {
  margin-left: 10px;
}

/* Apps */
.era-1998 .app-link__platforms {
  color: #222222;
}

.era-1998 .app-icon {
  background: #000080;
  color: #FFFF00;
}

/* Footer */
.era-1998 .site-footer {
  margin-top: 40px;
  background: none;
  text-align: center;
}

.era-1998 .site-footer__inner {
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 110px;
}

.era-1998 .footer__left {
  align-items: center;
}

.era-1998 .footer__wordmark {
  font-family: 'Comic Sans MS', 'Comic Sans', cursive;
  color: #FFFF00;
  text-shadow: 3px 3px 0 #FF00FF;
}

.era-1998 .footer__sub {
  color: #C8C8FF;
}

.era-1998 .footer__links {
  justify-content: center;
  gap: 6px;
}

.era-1998 .site-footer .nav-link:hover {
  color: #000000;
}

.retro-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #C8C8FF;
}

.era-1998 .retro-footer {
  display: flex !important;
}

.hit-counter {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  font-size: 18px;
  vertical-align: middle;
}

.hit-counter span {
  padding: 1px 5px;
  background: #1B1B1B;
  border: 1px solid #555555;
  color: #00FF00;
}

.webring {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px;
  background: #C0C0C0;
  border: 2px outset #E0E0E0;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.era-1998 .webring a {
  color: #000080;
}

/* ============================================
   TRANSITIONS
   ============================================ */
@keyframes era-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* --- 2026 -> 1998: VHS rewind --- */
.vhs-out {
  animation: vhs-warp calc(1.1s * var(--m)) steps(16, end) forwards;
}

.vhs-in {
  animation: vhs-settle calc(1.05s * var(--m)) steps(14, end) both;
}

.vhs-out *,
.vhs-in * {
  text-shadow: 2px 0 rgba(255, 0, 70, 0.75), -2px 0 rgba(0, 220, 255, 0.75) !important;
}

@keyframes vhs-warp {
  0% { transform: none; filter: none; }
  10% { transform: translateX(-6px) skewX(3deg); filter: saturate(1.6) contrast(1.2); }
  20% { transform: translate(8px, -18px); clip-path: inset(8% 0 40% 0); }
  30% { transform: translate(-4px, 24px) skewX(-4deg); clip-path: none; }
  45% { transform: translate(12px, -60px); filter: saturate(2) contrast(1.5) blur(1px); }
  60% { transform: translate(-10px, 90px) skewX(6deg); clip-path: inset(40% 0 10% 0); }
  75% { transform: translate(4px, -140px); clip-path: none; filter: saturate(2.4) contrast(1.8) blur(2px) brightness(1.3); }
  100% { transform: translate(0, -260px) scaleY(1.05); filter: saturate(0) contrast(2) blur(4px) brightness(1.8); }
}

@keyframes vhs-settle {
  0% { transform: translateY(-35vh); filter: saturate(2) contrast(1.6) blur(2px) brightness(1.4); }
  25% { transform: translateY(8vh) skewX(-3deg); }
  45% { transform: translateY(-3vh) translateX(6px); }
  65% { transform: translateX(-4px); filter: saturate(1.4) contrast(1.2) blur(0.6px); }
  100% { transform: none; filter: none; }
}

.vhs {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.vhs.out,
.vhs.blue,
.vhs.in {
  display: block;
}

.vhs__layer {
  position: absolute;
  inset: 0;
}

.vhs__noise {
  position: absolute;
  inset: -50%;
  background-image: url("images/fx/vhs-noise.png");
  background-size: 512px 512px;
  image-rendering: pixelated;
  opacity: 0;
}

.vhs.out .vhs__noise {
  animation: noise-jump 0.32s steps(1) infinite, noise-up calc(1.1s * var(--m)) ease-in forwards;
}

.vhs.in .vhs__noise {
  animation: noise-jump 0.32s steps(1) infinite, noise-down calc(0.9s * var(--m)) ease-out forwards;
}

@keyframes noise-jump {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-11%, 7%); }
  40% { transform: translate(9%, -13%); }
  60% { transform: translate(-6%, -4%); }
  80% { transform: translate(13%, 10%); }
}

@keyframes noise-up {
  from { opacity: 0; }
  to { opacity: 0.92; }
}

@keyframes noise-down {
  from { opacity: 0.6; }
  to { opacity: 0; }
}

.vhs__band {
  position: absolute;
  left: 0;
  right: 0;
  top: -20vh;
  height: 14vh;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.5) 45%, rgba(255, 255, 255, 0.15) 60%, transparent);
  mix-blend-mode: screen;
  animation: vhs-band calc(0.7s * var(--m)) linear infinite;
}

.vhs__band--thin {
  height: 6vh;
  opacity: 0.7;
  animation-duration: calc(0.45s * var(--m));
  animation-delay: 0.2s;
}

@keyframes vhs-band {
  from { top: -20vh; }
  to { top: 110vh; }
}

.vhs__lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
}

.vhs__blue {
  display: none;
  position: absolute;
  inset: 0;
  background: #0B1FD1;
}

.vhs.blue .vhs__blue {
  display: block;
}

.vhs.in .vhs__layer {
  animation: era-fade-out calc(0.9s * var(--m)) ease-in calc(0.25s * var(--m)) both;
}

.osd {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'VT323', ui-monospace, monospace;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 3px;
  color: #FFFFFF;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
}

.osd[hidden] {
  display: none;
}

.osd--tl { left: 6vw; top: 5vh; font-size: clamp(36px, 5vw, 52px); }
.osd--tr { right: 6vw; top: 5vh; }
.osd--bl { left: 6vw; bottom: 5vh; color: #FFCF6B; }
.osd--br { right: 6vw; bottom: 5vh; }

/* --- 1998 -> 2026: AI generation --- */
.ai-out {
  animation: ai-dissolve calc(1s * var(--m)) cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.ai-in {
  animation: ai-denoise calc(1.4s * var(--m)) steps(12, end) both;
}

@keyframes ai-dissolve {
  0% { filter: none; transform: none; opacity: 1; }
  100% { filter: blur(18px) saturate(0) brightness(1.3); transform: scale(0.97); opacity: 0.35; }
}

@keyframes ai-denoise {
  0% { filter: blur(26px) saturate(1.8) brightness(1.1); opacity: 0.5; transform: scale(1.015); }
  100% { filter: none; opacity: 1; transform: none; }
}

.ai {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.ai.out,
.ai.in {
  display: block;
}

.ai__noise {
  position: absolute;
  inset: 0;
  background-image: url("images/fx/latent-noise.png");
  background-size: 192px 192px;
  filter: blur(1.5px) saturate(1.3);
  opacity: 0;
}

.ai.out .ai__noise {
  animation: latent-in calc(1s * var(--m)) ease-in forwards;
}

.ai.in .ai__noise {
  animation: latent-out calc(1.4s * var(--m)) steps(12, end) forwards;
}

@keyframes latent-in {
  from { opacity: 0; }
  to { opacity: 0.95; }
}

@keyframes latent-out {
  0% { opacity: 0.95; filter: blur(1.5px); }
  100% { opacity: 0; filter: blur(14px); }
}

.ai__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1.5px);
  background-size: 22px 22px;
  mix-blend-mode: overlay;
}

.ai.in .ai__grid {
  animation: era-fade-out calc(1.2s * var(--m)) ease-out both;
}

.ai__sweep {
  position: absolute;
  left: 0;
  right: 0;
  top: -30vh;
  height: 30vh;
  background: linear-gradient(180deg, transparent, rgba(130, 160, 255, 0.35) 40%, rgba(120, 255, 200, 0.45) 55%, transparent);
  mix-blend-mode: screen;
}

.ai.in .ai__sweep {
  animation: ai-sweep calc(1.3s * var(--m)) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ai-sweep {
  from { top: -30vh; }
  to { top: 110vh; }
}

.ai__card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100% - 40px));
  padding: 22px 24px;
  transform: translate(-50%, -50%);
  background: rgba(10, 12, 14, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  color: #F2F4F2;
  font-family: 'Inter', system-ui, sans-serif;
}

.ai.out .ai__card {
  animation: ai-card-in calc(0.4s * var(--m)) ease-out both;
}

.ai.in .ai__card {
  animation: era-fade-out calc(0.5s * var(--m)) ease-in calc(1s * var(--m)) both;
}

@keyframes ai-card-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.ai__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #A9B2AD;
}

.ai__prompt {
  min-height: 56px;
  margin: 10px 0 18px;
  font-size: 19px;
  line-height: 1.45;
}

.ai__caret {
  color: #39FF88;
}

.ai__meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #A9B2AD;
}

.ai__track {
  height: 4px;
  margin-top: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ai__bar {
  width: 0;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #39FF88, #7AA8FF);
}

@media (prefers-reduced-motion: reduce) {
  .time-btn,
  .time-btn::after,
  .blink,
  .new-badge,
  .retro-marquee span {
    animation: none !important;
  }

  .retro-marquee span {
    padding-left: 16px;
  }
}
