.landing {
  overflow-x: hidden;
}

.era {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--content-padding);
  position: relative;
  scroll-snap-align: start;
}

.era-content {
  max-width: var(--content-width);
  width: 100%;
}

@supports (animation-timeline: view()) {
  .era-content {
    animation: fade-in-up linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 60%;
  }
}

/* Era 1: 1991 */
.era-1991 {
  background: #c0c0c0;
  color: #000;
  font-size: 16px;
  line-height: 1.4;
}

.era-1991 h1 {
  font-size: 24px;
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

.era-1991 .label {
  text-transform: none;
  letter-spacing: normal;
  font-weight: bold;
  font-size: 14px;
  color: #000;
}

.era-1991 a { color: #0000ee; text-decoration: underline; }
.era-1991 a:visited { color: #551a8b; }

.era-1991 hr {
  border: none;
  border-top: 1px solid #000;
  margin: 1em 0;
}

.era-1991 p {
  margin-bottom: 1em;
  max-width: 60ch;
}

.era-1991 address {
  font-style: italic;
  margin-top: 2em;
  font-size: 14px;
}

/* Era 2: 1996 */
.era-1996 {
  background: #000033;
  color: #00ff00;
  font-size: 14px;
}

.era-1996 h2 {
  font-size: 28px;
  color: #ff00ff;
  text-align: center;
  letter-spacing: normal;
  font-weight: bold;
  margin-bottom: var(--space-md);
  text-shadow: 2px 2px #000;
}

.era-1996 .label {
  text-align: center;
  display: block;
  color: #ffff00;
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
}

.era-1996-table {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  border-collapse: collapse;
}

.sidebar-cell {
  width: 150px;
  vertical-align: top;
  padding: 0;
}

.sidebar-nav {
  background: #000066;
  border: 2px solid #3333ff;
  padding: var(--space-sm);
}

.sidebar-nav .sidebar-title {
  color: #ffff00;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #3333ff;
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.sidebar-nav a {
  display: block;
  color: #00ffff;
  padding: 2px 0;
  text-decoration: underline;
  font-size: 13px;
}

.main-cell {
  vertical-align: top;
  padding: var(--space-md);
}

.geocities-content .welcome-text {
  font-size: 20px;
  color: #ff6600;
  text-align: center;
  margin-bottom: var(--space-md);
}

.geocities-content p { margin-bottom: var(--space-sm); }
.geocities-content code { color: #ffff00; }

.visitor-counter {
  text-align: center;
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: #000;
  border: 1px inset #666;
  color: #00ff00;
}

.counter-num { color: #ff0000; font-weight: bold; }

.construction {
  text-align: center;
  font-size: 18px;
  margin-top: var(--space-md);
  animation: pulse 1.5s ease-in-out infinite;
}
/* Era 3: 2010 */
.era-2010 {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  color: #eee;
}

.era-2010 h2 {
  background: linear-gradient(135deg, #e94560, #f5a623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.era-2010 .label { color: #e94560; }
.era-2010 .subtitle { color: #aaa; margin-bottom: var(--space-xl); }

.css3-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-lg);
}

.css3-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.css3-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 8px 25px rgba(233,69,96,0.2),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.css3-card-icon { font-size: 2rem; margin-bottom: var(--space-sm); color: #e94560; }
.css3-card h3 { font-size: 1.1rem; margin-bottom: var(--space-xs); color: #fff; }
.css3-card p { font-size: 0.9rem; color: #aaa; line-height: 1.5; }
.css3-card code { color: #f5a623; font-size: 0.85rem; }
/* Era 4: 2020 */
.era-2020 {
  background: #111;
  color: #e0e0e0;
}

.era-2020 h2 { color: #fff; margin-bottom: var(--space-sm); }
.era-2020 .label { color: #888; }
.era-2020 .subtitle { color: #888; margin-bottom: var(--space-xl); }

.modern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1px;
  background: #333;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.modern-feature { background: #1a1a1a; padding: var(--space-lg); }

.modern-feature code {
  display: block;
  font-size: 1rem;
  color: #646cff;
  margin-bottom: var(--space-sm);
}

.modern-feature p { font-size: 0.9rem; color: #888; line-height: 1.5; }
/* Era 5: 2026 */
.era-2026 {
  background: var(--color-base);
  color: var(--color-text);
  font-family: var(--font-heading);
}

.era-2026 h2 {
  font-size: var(--text-3xl);
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--color-gradient-start),
    var(--color-gradient-mid),
    var(--color-gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.era-2026 .label { color: var(--color-primary); }
.era-2026 .subtitle { margin-bottom: var(--space-xl); }

.platform-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.platform-chip {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 2rem;
  font-family: var(--font-code);
  font-size: var(--text-sm);
  color: var(--color-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.platform-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: oklch(0.62 0.2 270 / 0.1);
}

.portal-cta { text-align: center; margin-top: var(--space-xl); }
.portal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(
    135deg,
    var(--color-gradient-start),
    var(--color-gradient-mid)
  );
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  border-radius: 4rem;
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.portal-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--color-gradient-mid),
    var(--color-gradient-end)
  );
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.portal-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px oklch(0.62 0.2 270 / 0.4);
}

.portal-link:hover::before { opacity: 1; }

.portal-text,
.portal-arrow {
  position: relative;
  z-index: 1;
}

.portal-arrow {
  font-size: 1.5em;
  transition: transform var(--duration-fast) var(--ease-out);
}

.portal-link:hover .portal-arrow {
  transform: translateX(4px);
}

@supports (scroll-snap-type: y mandatory) {
  .landing {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100dvh;
  }
}

@media (max-width: 768px) {
  .era { padding: var(--space-xl) var(--content-padding); }
  .sidebar-cell { display: none; }
  .css3-showcase { grid-template-columns: 1fr; }
}

/* ── Guestbook Dialog ──────────────────────────────────────────────────────── */
#guestbook-dialog {
  background: #000066;
  color: #00ff00;
  font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif;
  border: 4px ridge #9999ff;
  border-radius: 0;
  padding: 0;
  max-width: min(600px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
}

#guestbook-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.gb-inner {
  padding: 1rem;
}

.gb-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.gb-title {
  font-size: 1.4rem;
  color: #ff00ff;
  text-shadow: 1px 1px #000;
  text-align: center;
  margin: 0;
  font-weight: bold;
  font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif;
}

.gb-close {
  display: block;
  margin: 0.5rem auto;
  background: #c0c0c0;
  color: #000;
  border: 2px outset #fff;
  font-family: "Arial", sans-serif;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  min-height: 44px;
  cursor: pointer;
}

.gb-close:active {
  border-style: inset;
}

.gb-divider {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.5rem 0;
}

.gb-entries {
  margin: 0.5rem 0;
}

.gb-entry {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.gb-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.gb-entry-text {
  font-size: 0.85rem;
  line-height: 1.5;
}

.gb-date {
  color: #aaffaa;
  font-size: 0.78rem;
}

.gb-form {
  margin-top: 0.5rem;
}

.gb-form-title {
  color: #ffff00;
  font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.gb-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.gb-field label {
  font-size: 0.85rem;
  color: #00ffff;
}

.gb-field input,
.gb-field textarea {
  background: #000033;
  border: 1px inset #3333ff;
  color: #00ff00;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  padding: 4px 6px;
  resize: vertical;
}

.gb-submit {
  background: #c0c0c0;
  color: #000;
  border: 2px outset #fff;
  font-family: "Arial", sans-serif;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  min-height: 44px;
  cursor: pointer;
  margin-top: 0.25rem;
}

.gb-submit:active {
  border-style: inset;
}

.gb-thanks {
  text-align: center;
  color: #ffff00;
  font-size: 1rem;
  padding: 1rem 0;
  line-height: 2;
}

.gb-footer-rose {
  display: block;
  margin: 0.75rem auto 0;
  max-width: 80px;
}

/* ── Marquee 1996 ──────────────────────────────────────────────────────────── */
.marquee-96 {
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  color: #ff6600;
  font-size: 13px;
  border-top: 2px solid #3333ff;
  border-bottom: 2px solid #3333ff;
  margin-top: 0.75rem;
  padding: 4px 0;
}

.marquee-96 span {
  display: inline-block;
  animation: marquee-scroll 18s linear infinite;
}

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

/* ── Card Flip (2010 era) ───────────────────────────────────────────────────── */
.card-flip-root {
  perspective: 800px;
  cursor: pointer;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card-flip-root.flipped .card-flip-inner {
  transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg, 1.25rem);
}

.card-flip-front {
  position: relative;
  background: transparent;
}

.card-flip-back {
  position: absolute;
  inset: 0;
}

.card-flip-back {
  background: linear-gradient(145deg, rgba(233,69,96,0.15), rgba(245,166,35,0.1));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  transform: rotateY(180deg);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-flip-back code {
  font-size: 1.1rem;
  color: #f5a623;
  font-family: var(--font-code, monospace);
  word-break: break-word;
}

/* ── Hampster Dance Bounce ──────────────────────────────────────────────────── */
@keyframes hampster-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20%       { transform: translateY(-12px) rotate(-3deg); }
  40%       { transform: translateY(0) rotate(3deg); }
  60%       { transform: translateY(-8px) rotate(-2deg); }
  80%       { transform: translateY(0) rotate(1deg); }
}

.hampster-bounce {
  animation: hampster-bounce 0.5s ease-in-out infinite !important;
  display: inline-block;
}

/* ── Centering Popover ─────────────────────────────────────────────────────── */
#centering-popover {
  background: var(--color-surface, #1a1a1a);
  color: var(--color-text, #e0e0e0);
  border: 1px solid var(--color-border, #333);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: min(480px, 90vw);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#centering-popover h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: #646cff;
}

#centering-popover ul {
  list-style: disc;
  padding-left: 1.25rem;
  line-height: 2;
  font-size: 0.9rem;
}

#centering-popover code {
  color: #646cff;
  font-size: 0.85rem;
}

.popover-close-hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.75rem;
  text-align: right;
}

/* ── Platform chip link styling ─────────────────────────────────────────────── */
a.platform-chip {
  text-decoration: none;
  display: inline-block;
}

/* === Chiptune Player Button === */
.chiptune-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #000066;
  color: #00ffff;
  border: 2px outset #3333ff;
  padding: 0.65rem 0.9rem;
  min-height: 44px;
  font-family: 'Comic Sans MS', cursive;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.chiptune-btn:hover {
  background: #000099;
  color: #ffff00;
}

.chiptune-btn:active {
  border-style: inset;
}

.chiptune-btn.playing {
  animation: btn-pulse 1s ease-in-out infinite;
  color: #ffff00;
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 4px #3333ff; }
  50% { box-shadow: 0 0 12px #3333ff, 0 0 20px #00ffff; }
}

/* ── Parallax (Layer 1 / Task 2) ────────── */
.era .bg-layer,
.era .fg-layer {
  position: relative;
  will-change: transform;
}

/* Decorative bg-layers (eras 2010/2020/2026) — purely visual, sit behind content */
.era > .bg-layer[class*="bg-decorative-"] {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.era > .era-content { position: relative; z-index: 1; }

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .era .bg-layer {
      animation: parallax-slow linear;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    .era .fg-layer {
      animation: parallax-fast linear;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }
}

@keyframes parallax-slow { from { transform: translateY(-30px); } to { transform: translateY(30px); } }
@keyframes parallax-fast { from { transform: translateY(60px); } to { transform: translateY(-60px); } }

/* Era 4 (2010) decorative — soft red/orange orbs evoking skeuomorphic web */
.bg-decorative-2010::before,
.bg-decorative-2010::after {
  content: ""; position: absolute; width: 36vw; height: 36vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(233,69,96,0.18), transparent 70%);
  filter: blur(60px);
}
.bg-decorative-2010::before { top: -8%; left: -8%; }
.bg-decorative-2010::after  { bottom: -10%; right: -10%; background: radial-gradient(circle, rgba(245,166,35,0.14), transparent 70%); }

/* Era 5 (2020) decorative — minimalist grid wash */
.bg-decorative-2020 {
  background:
    linear-gradient(rgba(100,108,255,0.04) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(100,108,255,0.04) 1px, transparent 1px) 0 0 / 64px 64px;
}
.bg-decorative-2020::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(100,108,255,0.10), transparent 60%);
}

/* Era 6 (2026) decorative — purple/cyan platform aurora */
.bg-decorative-2026::before,
.bg-decorative-2026::after {
  content: ""; position: absolute; width: 42vw; height: 42vw; border-radius: 50%;
  filter: blur(70px);
}
.bg-decorative-2026::before { top: -10%; left: -8%; background: radial-gradient(circle, oklch(0.65 0.22 290 / 0.22), transparent 70%); }
.bg-decorative-2026::after  { bottom: -12%; right: -10%; background: radial-gradient(circle, oklch(0.7 0.18 200 / 0.20), transparent 70%); }

/* ── Ambient Orbs (Layer 1 / Task 5) ─────────────────── */
.ambient-bg--orbs::before, .ambient-bg--orbs::after {
  content: ""; position: absolute; width: 48vw; height: 48vw; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.65 0.22 290 / 0.35), transparent 70%);
  filter: blur(40px); animation: ambient-drift 24s ease-in-out infinite;
}
.ambient-bg--orbs::before { top: -10%; left: -10%; }
.ambient-bg--orbs::after { bottom: -10%; right: -10%; background: radial-gradient(circle, oklch(0.65 0.18 200 / 0.35), transparent 70%); animation-direction: reverse; animation-duration: 30s; }

/* Scroll-snap for landing eras (Layer 1 / Task 23) */
@media (min-width: 641px) and (prefers-reduced-motion: no-preference) {
  body[data-page="landing"] { scroll-snap-type: y mandatory; }
  .era { scroll-snap-align: start; min-height: 100svh; }
}
