/*
Theme Name: Experiment Zero
Theme URI: https://example.com
Author: You
Description: A dark, atmospheric "specimen containment" landing page for a domain that doesn't have content yet. Visitors introduce specimens into a glowing containment field; specimens merge, evolve, and clusters can stabilize into colonies that scale into the millions or billions. Includes Google AdSense support (auto ads + an optional manual ad unit).
Version: 2.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: experiment-zero
*/

:root {
  --bg: #0a0c12;
  --grid-line: #161b26;
  --vignette: rgba(0,0,0,0.6);
  --ink: #d9e2e8;
  --ink-soft: #7c8998;
  --dish: #0f131c;
  --dish-border: #3a4656;
  --ring: #4fc7d9;
  --gen1: #5ed0e0;
  --gen2: #8b7cf6;
  --gen3: #f0a346;
  --gen4: #ff4d6d;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(ellipse at center, transparent 0%, var(--vignette) 92%),
    repeating-linear-gradient(rgba(255,255,255,0.018) 0px, rgba(255,255,255,0.018) 1px, transparent 1px, transparent 3px),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(circle at 12% 15%, rgba(79,199,217,0.10), transparent 42%),
    radial-gradient(circle at 88% 85%, rgba(139,124,246,0.09), transparent 48%),
    var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 6vh 5vw 4vh;
  overflow-x: hidden;
  position: relative;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.4;
  animation: twinkle linear infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.8; }
}

.hud-readout {
  position: fixed;
  top: 14px;
  right: 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.6;
  opacity: 0.75;
  z-index: 5;
  pointer-events: none;
}
.hud-readout .hud-line { display: block; }
.hud-readout .hud-accent { color: var(--ring); }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
  text-align: center;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gen1);
  margin-right: 7px;
  vertical-align: middle;
  animation: pulse-dot 2.2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--gen1);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1.05;
  text-align: center;
  margin: 0 0 0.6rem;
  letter-spacing: 0.01em;
  text-shadow: 0 0 30px rgba(94, 208, 224, 0.22);
}

.sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--ink-soft);
  text-align: center;
  max-width: 46ch;
  line-height: 1.5;
  margin: 0 0 2.75rem;
}

.dish-wrap {
  --dish-size: min(80vmin, 620px);
  position: relative;
  width: var(--dish-size);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.bracket {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid var(--ring);
  opacity: 0.55;
  filter: drop-shadow(0 0 6px rgba(79,199,217,0.5));
}
.bracket-tl { top: -16px; left: -16px; border-right: none; border-bottom: none; }
.bracket-tr { top: -16px; right: -16px; border-left: none; border-bottom: none; }
.bracket-bl { bottom: -16px; left: -16px; border-right: none; border-top: none; }
.bracket-br { bottom: -16px; right: -16px; border-left: none; border-top: none; }

.dish {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--dish);
  border: 1px solid var(--dish-border);
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(79,199,217,0.12),
    0 0 70px rgba(79,199,217,0.08),
    inset 0 0 70px rgba(0,0,0,0.65);
  opacity: 0;
  transform: scale(0.92);
  animation: dish-in 0.7s cubic-bezier(.2,.9,.3,1.2) forwards;
}

.dish::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(79,199,217,0.16), transparent 22%);
  animation: sweep 7s linear infinite;
  pointer-events: none;
}

@keyframes dish-in {
  to { opacity: 1; transform: scale(1); }
}

@keyframes sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.organism {
  position: absolute;
  transform: translate(-50%, -50%) scale(0);
  animation: pop-in 0.5s cubic-bezier(.34,1.56,.64,1) forwards,
             pulse-glow 3.5s ease-in-out infinite;
  animation-delay: 0s, 0.5s;
  pointer-events: none;
}

.organism-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: drift ease-in-out infinite;
}

/* Every specimen gets a static, dotted measurement ring — reads as an
   instrument's field-of-view marker rather than decoration. Intensifies
   with generation, as if better-resolved with each analysis pass. The
   ring stays circular (a scan boundary) even though the specimen inside
   it is an irregular, one-of-a-kind signature shape. */
.organism::before {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  border: 1px dotted var(--c, var(--gen1));
  opacity: 0.35;
}
.organism--gen-2::before { opacity: 0.45; }
.organism--gen-3::before { opacity: 0.55; }
.organism--gen-4::before { opacity: 0.65; }

@keyframes pop-in {
  0% { transform: translate(-50%, -50%) scale(0); }
  60% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  8% { opacity: 0.68; }
  16% { opacity: 1; }
  24% { opacity: 0.82; }
  34% { opacity: 1; }
  70% { opacity: 1; }
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(1.5%, -1%); }
  50% { transform: translate(-1%, 1.5%); }
  75% { transform: translate(-1.5%, -1%); }
}

/* Higher tiers additionally get an active rotating scan ring, as if being
   tracked in real time. */
.organism--gen-3::after {
  content: "";
  position: absolute;
  inset: -28%;
  border-radius: 50%;
  border: 1px dashed var(--c, var(--gen3));
  opacity: 0.5;
  animation: spin-slow 14s linear infinite;
}

.organism--gen-4::after {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  border: 1px dashed var(--c, var(--gen4));
  opacity: 0.55;
  animation: spin-slow 6s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 15%;
  font-size: 0.78rem;
  color: var(--ink-soft);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.stats {
  margin-top: 2rem;
  text-align: center;
}

.count {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ring);
  letter-spacing: 0.02em;
}

.log {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.add-btn {
  margin-top: 1.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ring);
  border: 1px solid var(--ring);
  padding: 0.65rem 1.4rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.add-btn:hover { background: rgba(79,199,217,0.12); box-shadow: 0 0 18px rgba(79,199,217,0.3); }
.add-btn:active { transform: scale(0.97); }
.add-btn:focus-visible {
  outline: 2px solid var(--gen3);
  outline-offset: 3px;
}

.ez-ad-slot {
  margin-top: 2.5rem;
  width: min(90vw, 728px);
}

.settlement {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: pop-in 0.5s cubic-bezier(.34,1.56,.64,1) forwards;
}

.settlement-icon {
  display: block;
  margin: 0 auto;
  animation: settle-pulse 3s ease-in-out infinite;
}

.settlement-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.settlement-satellites {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.settlement-scanring {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: spin-slow 20s linear infinite reverse;
}

.settlement-roads {
  animation: dash-flow 1.2s linear infinite;
}

@keyframes dash-flow {
  to { stroke-dashoffset: -8; }
}

.settlement--level-6 .settlement-icon,
.settlement--level-7 .settlement-icon {
  animation-duration: 2s;
}
.settlement--level-7 .settlement-icon {
  animation-duration: 1.4s;
}

.settlement-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: rgba(10,12,18,0.8);
  border: 1px solid rgba(79,199,217,0.3);
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
}
.settlement-label-name {
  padding: 2px 6px;
}
.settlement-label-pop {
  padding: 2px 6px;
  border-top: 1px solid rgba(79,199,217,0.25);
  color: var(--ring);
  width: 100%;
  text-align: center;
}

@keyframes settle-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  border: 1px solid var(--ring);
  opacity: 0.8;
  pointer-events: none;
  animation: ripple-out 0.7s ease-out forwards;
}

@keyframes ripple-out {
  to {
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
    opacity: 0;
  }
}

.event-log {
  margin-top: 2.25rem;
  width: 100%;
  max-width: 460px;
  border: 1px solid rgba(79,199,217,0.22);
  border-radius: 4px;
  background: rgba(10,12,18,0.72);
}

.event-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(79,199,217,0.15);
  border-radius: 4px 4px 0 0;
}
.event-log-count {
  color: var(--ring);
  font-weight: 600;
}

.event-log-body {
  min-height: 44px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
  border-radius: 0 0 4px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(79,199,217,0.4) transparent;
}
.event-log-body::-webkit-scrollbar { width: 6px; }
.event-log-body::-webkit-scrollbar-track { background: transparent; }
.event-log-body::-webkit-scrollbar-thumb {
  background: rgba(79,199,217,0.4);
  border-radius: 3px;
}

.event-log-empty {
  padding: 16px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.6;
  text-align: center;
}

.event-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 5px 12px;
  border-left: 2px solid var(--evt-color, var(--ring));
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.4;
  animation: row-in 0.3s ease;
}
.event-time {
  color: var(--ink-soft);
  flex-shrink: 0;
}
.event-msg {
  color: var(--ink);
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: break-word;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

footer.ez-footer {
  margin-top: auto;
  padding-top: 3rem;
  font-size: 0.68rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 42ch;
  line-height: 1.6;
}

@media (orientation: landscape) and (max-height: 560px) {
  body { padding: 3vh 5vw 3vh; }
  .eyebrow { margin-bottom: 0.5rem; }
  h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); margin-bottom: 0.4rem; }
  .sub { margin-bottom: 1.25rem; font-size: 0.8rem; }
  .dish-wrap {
    --dish-size: min(50vmin, 60vh);
    width: var(--dish-size);
  }
  .stats { margin-top: 1.1rem; }
  .add-btn { margin-top: 1rem; }
  .event-log { margin-top: 1.25rem; max-width: 100%; }
  .event-log-body { max-height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .dish, .dish::after, .organism, .organism-svg, .organism--gen-3::after,
  .organism--gen-4::after, .settlement-icon, .settlement-satellites,
  .settlement-scanring, .settlement-roads, .ripple, .eyebrow::before, .star {
    animation: none !important;
    opacity: 1 !important;
  }
  .organism {
    transform: translate(-50%, -50%) scale(1) !important;
  }
  .dish { transform: none !important; }
  .ripple { display: none !important; }
  .star { opacity: 0.35 !important; }
}
