/* ───────────────────────────────────────────────────────────
   Variables (light/dark mode)
   ─────────────────────────────────────────────────────────── */
:root {
  --bg-color: #111;
  --text-color: #f5f5f559;
}

body.light-mode {
  --bg-color: #ffffff !important;
  --text-color: #2a2a2a !important;
  --hover-bg: #f5f5f5;
  --hover-color: #000000;
  --gold-color: #b58c3b;
  --gold-shadow: rgba(181, 140, 59, 0.3);
}

/* ───────────────────────────────────────────────────────────
   Reset & Base
   ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ───────────────────────────────────────────────────────────
   Keyframes
   ─────────────────────────────────────────────────────────── */
@keyframes pulseBorder {
  0%   { border-bottom-color: rgba(0, 0, 0, 0.2); }
  50%  { border-bottom-color: rgba(0, 0, 0, 0.6); }
  100% { border-bottom-color: rgba(0, 0, 0, 0.2); }
}

@keyframes grain-static {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-1%, 1%); }
}

@keyframes grain-static-2 {
  0%   { transform: translate(1%, -1%); }
  100% { transform: translate(-1%, 1%); }
}

@keyframes zoomFloat {
  0%   { transform: scale(1) translateY(-2%); }
  50%  { transform: scale(1.025) translateY(2%); }
  100% { transform: scale(1.05) translateY(-2%); }
}

@keyframes driftX {
  0%   { transform: translateX(-2%); }
  100% { transform: translateX(2%); }
}

/* ───────────────────────────────────────────────────────────
   Body & Typography
   ─────────────────────────────────────────────────────────── */
body {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Helvetica Neue', sans-serif;
  transition: background 0.3s, color 0.3s;
}

body.light-mode {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

body.light-mode h1 {
  color: var(--gold-color) !important;
  text-shadow: 
    2px 2px 6px rgba(0, 0, 0, 0.2),
    0 0 10px var(--gold-shadow),
    0 0 6px var(--gold-shadow) !important;
}

body.light-mode #signal-archive {
  color: var(--text-color) !important;
}

body.light-mode #signal-archive:hover {
  background: var(--hover-bg) !important;
  color: var(--hover-color) !important;
}

body.light-mode #toolbar a {
  color: var(--text-color) !important;
}

body.light-mode #toolbar a:hover svg {
  fill: var(--gold-color) !important;
  stroke: var(--gold-color) !important;
}

h1 {
  font-size: 3rem;
  letter-spacing: 0.1em;
  color: #b58c3b;
  text-shadow:
    2px 2px 6px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(255, 180, 0, 0.5),
    0 0 6px rgba(255, 180, 0, 0.6);
  background: linear-gradient(
    145deg,
    rgba(255, 180, 0, 0.4),
    rgba(185, 130, 40, 0.5)
  );
  background-clip: text;
  -webkit-background-clip: text;
  animation: zoomFloat 12s ease-in-out infinite alternate;
}

p {
  font-size: 1.1rem;
  color: #aaa;
  margin-top: 0.5rem;
  animation: zoomFloat 12s ease-in-out infinite alternate;
}

/* ───────────────────────────────────────────────────────────
   Grain Overlay
   ─────────────────────────────────────────────────────────── */
body::before,
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://grainy-gradients.vercel.app/static.svg');
  background-repeat: repeat;
  pointer-events: none;
}

body::before {
  background-size: 80px 80px;
  opacity: 0.035;
  mix-blend-mode: multiply;
  filter: hue-rotate(-1deg) contrast(1.1);
  animation: grain-static-2 0.8s steps(6) infinite reverse;
  z-index: 0;
}

body::after {
  background-size: 100px 100px;
  opacity: 0.045;
  mix-blend-mode: screen;
  filter: hue-rotate(1deg) contrast(1.05);
  animation: grain-static 0.5s steps(8) infinite;
  z-index: 1;
}

body.light-mode::before {
  opacity: 0.02;
  mix-blend-mode: multiply;
}

body.light-mode::after {
  opacity: 0.03;
  mix-blend-mode: screen;
}

/* ───────────────────────────────────────────────────────────
   Moon Widget & Theme Toggle
   ─────────────────────────────────────────────────────────── */
#moon-calendar {
  position: fixed;
  top: 0;
  left: 0;
  padding: 1rem;
  z-index: 3;
}

#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 4;
  cursor: pointer;
}

#theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: var(--text-color);
  transition: fill 0.3s;
}

/* ───────────────────────────────────────────────────────────
   Centered Content
   ─────────────────────────────────────────────────────────── */
.centered {
  text-align: center;
  opacity: 0.95;
  z-index: 2;
}

/* ───────────────────────────────────────────────────────────
   Signal Archive Button (stacked words, custom font, spacing)
   ─────────────────────────────────────────────────────────── */
#signal-archive {
  font-family: 'Exo 2', sans-serif;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  line-height: 1.2;
  font-weight: 700;
  font-size: 1rem;
  background: none;
  color: var(--text-color);
  border-radius: 999px;
  border: 2px solid transparent;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

#signal-archive:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* ───────────────────────────────────────────────────────────
   Archive Container & Toolbar
   ─────────────────────────────────────────────────────────── */
.archive-container {
  position: relative;
  display: inline-block;
  text-align: center;
}

.archive-container button#signal-archive {
  display: inline-block;
}

#toolbar {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

#toolbar.show {
  display: flex;
}

#toolbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-color);
}

/* All SVG paths in toolbar links inherit text color */
#toolbar a svg,
#toolbar a svg path {
  fill: var(--text-color) !important;
  stroke: var(--text-color) !important;
}

#toolbar a svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2;
  fill: none;
}
