/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  position: relative;
  overflow-x: hidden;
}

/* ===== THEMES ===== */

body.theme-autumn {
  --bg: #0d0a00;
  --bg2: #1a0f00;
  --accent: #f97316;
  --accent2: #fb923c;
  --text: #fef3c7;
  --muted: #a16207;
  --card: rgba(249,115,22,0.06);
  --border: rgba(249,115,22,0.15);
  --particle-color: 249, 115, 22;
  --gradient: linear-gradient(135deg, #0d0a00 0%, #2d1400 100%);
}

body.theme-christmas {
  --bg: #020f09;
  --bg2: #041a0e;
  --accent: #22c55e;
  --accent2: #ef4444;
  --text: #ffffff;
  --muted: #9ca3af;
  --card: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.12);
  --particle-color: 34, 197, 94;
  --gradient: linear-gradient(160deg, #020f09 0%, #0a1f10 50%, #060a04 100%);
}

body.theme-newyear {
  --bg: #05050f;
  --bg2: #0a0a1f;
  --accent: #a78bfa;
  --accent2: #fbbf24;
  --text: #f8fafc;
  --muted: #64748b;
  --card: rgba(167,139,250,0.06);
  --border: rgba(167,139,250,0.15);
  --particle-color: 167, 139, 250;
  --gradient: linear-gradient(135deg, #05050f 0%, #1a0a30 100%);
}

body {
  background: var(--bg);
  background-image: var(--gradient);
  color: var(--text);
}

/* ===== PARTICLES ===== */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.theme-switcher {
  display: flex;
  gap: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
}
.theme-btn { border: none !important; border-radius: 100px !important; }
.theme-btn:hover { background: rgba(255,255,255,0.08) !important; color: var(--text) !important; }
.theme-btn.active { background: var(--accent) !important; color: #000 !important; border-color: var(--accent) !important; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s;
  user-select: none;
}

.tag:hover, .tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
}

.hero-content { max-width: 700px; width: 100%; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 48px;
  line-height: 1.6;
}

/* ===== COUNTDOWN ===== */
.next-milestone {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
}

.milestone-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.cd-num {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cd-unit {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 6px;
}

.cd-sep {
  font-size: 2.5rem;
  color: var(--border);
  margin-bottom: 20px;
  font-weight: 300;
}

.milestone-date {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===== PROGRESS ===== */
.progress-wrap { text-align: left; }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: 100px;
  transition: width 1s ease;
  width: 0%;
}

.progress-pct {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

/* ===== SECTIONS ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 80px 24px;
}

.section:nth-child(even) { background: rgba(0,0,0,0.2); }

.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 8px;
  color: var(--text);
}

.hint { font-size: 1.2rem; }

.section-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 32px;
  font-style: italic;
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--card);
}

th {
  padding: 14px 18px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover { background: var(--card); }

tbody tr.past td { color: var(--muted); }

tbody tr.current { background: rgba(var(--particle-color), 0.08); }
tbody tr.current td:first-child { border-left: 3px solid var(--accent); }

tbody tr.selected { background: rgba(var(--particle-color), 0.18) !important; }
tbody tr.selected td:first-child { border-left: 3px solid var(--accent2); }
tbody tr.selected td { color: var(--text); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-done { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-current { background: rgba(var(--particle-color), 0.2); color: var(--accent); }
.badge-upcoming { background: rgba(var(--particle-color), 0.08); color: var(--muted); }

/* ===== CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s, border-color 0.2s;
  cursor: default;
}

.event-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.event-card.past { opacity: 0.5; }

.card-emoji { font-size: 2rem; margin-bottom: 12px; }

.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text);
}

.card-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.card-time {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
}

.card-time.done { font-size: 1rem; color: var(--muted); }

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

footer p { font-size: 0.85rem; color: var(--muted); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.footer-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-tags .tag { cursor: default; }

/* ===== CHRISTMAS LIGHTS ===== */
.xmas-strip {
  position: fixed;
  z-index: 98;
  pointer-events: none;
  display: none;
  overflow: visible;
}

body.theme-christmas .xmas-strip { display: block; }

/* Top strip — hangs below header */
#xmas-top  { top: 64px; left: 0; width: 100%; height: 26px; border-top: 2px solid #1c2c1c; }
/* Left strip */
#xmas-left { top: 90px; left: 0; width: 26px; bottom: 0; border-right: 2px solid #1c2c1c; }
/* Right strip */
#xmas-right{ top: 90px; right: 0; width: 26px; bottom: 0; border-left: 2px solid #1c2c1c; }

/* Bulb base */
.xmas-bulb {
  position: absolute;
  width: 11px;
  height: 15px;
  border-radius: 50% 50% 55% 55% / 35% 35% 65% 65%;
  animation: xblink 2s ease-in-out infinite;
}

/* Socket (little cap on top of bulb) */
.xmas-bulb::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  background: #3a3a2a;
  border-radius: 2px 2px 0 0;
}

/* Horizontal bulb hangs down from wire */
.xmas-bulb.xh {
  top: 0px;
  transform: translateX(-50%);
}

/* Vertical-left bulb sticks right from wire */
.xmas-bulb.xvl {
  right: -1px;
  transform: translateY(-50%) rotate(90deg);
}

/* Vertical-right bulb sticks left from wire */
.xmas-bulb.xvr {
  left: -1px;
  transform: translateY(-50%) rotate(-90deg);
}

@keyframes xblink {
  0%,  42%, 58%, 100% { opacity: 1;    filter: brightness(1.2); }
  50%                  { opacity: 0.08; filter: brightness(0.05); }
}

/* ===== RESET BUTTON ===== */
.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== TABLE HINT ===== */
.table-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.table-hint::before { content: '👆'; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header-inner nav .tag:not(.active) { display: none; }
  .cd-block { min-width: 60px; }
  .cd-num { font-size: 2rem; }
  .cd-sep { font-size: 1.5rem; }
  .next-milestone { padding: 24px 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
