*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Inter', 'Poppins', sans-serif;
  cursor: none;
  user-select: none;
}

/* ─── Slideshow ─────────────────────────────────────── */

#slideshow {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.slide {
  position: absolute;
  inset: -140px;           /* generous bleed so Ken Burns never exposes edges */
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.slide.active {
  opacity: 1;
}

/* Ken Burns — each slide picks one of these at random via JS */
@keyframes kb-right {
  0%   { transform: scale(1.06) translate(60px, 15px); }
  100% { transform: scale(1.12) translate(-60px, -15px); }
}
@keyframes kb-left {
  0%   { transform: scale(1.06) translate(-60px, -15px); }
  100% { transform: scale(1.12) translate(60px, 15px); }
}
@keyframes kb-up {
  0%   { transform: scale(1.06) translate(-20px, 50px); }
  100% { transform: scale(1.12) translate(20px, -50px); }
}
@keyframes kb-down {
  0%   { transform: scale(1.06) translate(20px, -50px); }
  100% { transform: scale(1.12) translate(-20px, 50px); }
}

.slide.kb-right  { animation: kb-right  36s ease-in-out forwards; }
.slide.kb-left   { animation: kb-left   36s ease-in-out forwards; }
.slide.kb-up     { animation: kb-up     36s ease-in-out forwards; }
.slide.kb-down   { animation: kb-down   36s ease-in-out forwards; }

/* ─── Gradient mask ─────────────────────────────────── */

.gradient-mask {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* heavy sweep from bottom-left corner */
    radial-gradient(ellipse 140% 120% at -10% 110%, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.7) 30%, transparent 65%),
    /* subtle bottom edge */
    linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 40%),
    /* subtle left edge */
    linear-gradient(to right, rgba(0,0,0,0.45) 0%, transparent 35%),
    /* very light overall vignette */
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.3) 100%);
}

/* ─── Top bar ───────────────────────────────────────── */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
}

.logo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  opacity: 0.8;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  text-decoration: none;
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 1;
}

.brand-terra {
  color: #ffffff;
}

.brand-volt {
  color: #f59e0b;
}

.clock {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

/* ─── Data overlay (bottom-left) ────────────────────── */

.data-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 48px 44px;
  max-width: 520px;
}

.fuel-label {
  font-family: 'Poppins', sans-serif;
  font-size: 2.2rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.6s ease, transform 1.6s ease;
}

.fuel-label.visible {
  opacity: 1;
  transform: translateY(0);
}

.fuel-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.6s ease 0.1s, transform 1.6s ease 0.1s;
}

.fuel-subtitle.visible {
  opacity: 1;
  transform: translateY(0);
}

.fuel-output {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.6s ease 0.2s, transform 1.6s ease 0.2s;
}

.fuel-output.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Sparkline ─────────────────────────────────────── */

.sparkline-wrap {
  margin-top: 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.6s ease 0.4s, transform 1.6s ease 0.4s;
}

.sparkline-wrap.visible {
  opacity: 1;
  transform: translateY(0);
}

.sparkline-canvas {
  display: block;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,0.4));
}

/* ─── Progress dots ─────────────────────────────────── */

.progress-dots {
  position: fixed;
  bottom: 28px;
  right: 36px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.6s ease, transform 0.6s ease;
}

.dot.active {
  background: rgba(255,255,255,0.85);
  transform: scale(1.35);
}

/* ─── Cursor auto-hide ─────────────────────────────── */

body.cursor-visible {
  cursor: default;
}

body.cursor-visible .intro-screen,
body.cursor-visible .popup-overlay {
  cursor: default;
}

/* ─── Intro splash screen ──────────────────────────── */

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: opacity 1.2s ease;
}

.intro-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-content {
  text-align: center;
}

.intro-logo {
  font-family: 'Poppins', sans-serif;
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 1.1;
}

.intro-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  letter-spacing: 6px;
  margin-top: 16px;
}

.intro-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
}

.intro-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: rgba(255,255,255,0.6);
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-btn:hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
}

.intro-gauge-wrap {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.intro-gauge-bar {
  height: 100%;
  width: 0%;
  background: #f59e0b;
  border-radius: 3px;
  transition: width 0.1s linear;
}

.intro-skip {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.5px;
}

/* ─── Popup overlays (settings + credits) ──────────── */

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  cursor: default;
}

.popup-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.popup-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 380px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.popup-card-wide {
  width: 520px;
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.popup-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.popup-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.popup-close:hover {
  color: #fff;
}

.popup-body {
  padding: 20px 24px 24px;
}

.popup-body-scroll {
  max-height: 60vh;
  overflow-y: auto;
}

.popup-body-scroll::-webkit-scrollbar {
  width: 6px;
}

.popup-body-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.popup-body-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* ─── About popup body ─────────────────────────────── */

.about-para {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 14px;
}

.about-para strong {
  color: #fff;
}

.about-credits-link {
  margin-top: 4px;
  margin-bottom: 0;
}

.about-credits-link a {
  color: #f59e0b;
  text-decoration: none;
  font-weight: 500;
}

.about-credits-link a:hover {
  text-decoration: underline;
}

/* ─── Settings form elements ───────────────────────── */

.setting-group {
  margin-bottom: 20px;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.setting-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option,
.toggle-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.radio-option:hover,
.toggle-option:hover {
  background: rgba(255,255,255,0.05);
}

.radio-option input,
.toggle-option input {
  accent-color: #f59e0b;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-view-credits {
  width: 100%;
  padding: 10px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-view-credits:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ─── Credits list ─────────────────────────────────── */

.credits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.credit-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.credit-item:last-child {
  border-bottom: none;
}

.credit-thumb {
  width: 56px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}

.credit-info {
  flex: 1;
  min-width: 0;
}

.credit-image-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.credit-author {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

.credit-author a {
  color: #f59e0b;
  text-decoration: none;
}

.credit-author a:hover {
  text-decoration: underline;
}

.credits-source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
}

.credits-source a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
}

.credits-source a:hover {
  color: rgba(255,255,255,0.6);
}

/* ─── Debug Mode ─────────────────────────────────────── */

.debug-nav {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.6rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

.debug-nav:hover {
  background: rgba(255,255,255,0.15);
}

.debug-nav-prev { left: 18px; }
.debug-nav-next { right: 18px; }

body.debug-mode .debug-nav {
  display: flex;
  align-items: center;
  justify-content: center;
}

.debug-panel {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 240px;
  max-height: 380px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,200,0,0.35);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  font-family: 'Inter', monospace, sans-serif;
}

body.debug-mode .debug-panel {
  display: flex;
  flex-direction: column;
}

.debug-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255,200,0,0.2);
  flex-shrink: 0;
}

.debug-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f59e0b;
  background: rgba(245,158,11,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.debug-slide-info {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debug-paused {
  display: none;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f59e0b;
  text-align: center;
  padding: 4px 12px;
  background: rgba(245,158,11,0.1);
  border-bottom: 1px solid rgba(255,200,0,0.15);
  flex-shrink: 0;
}

.debug-paused.visible {
  display: block;
}

.debug-table-wrap {
  overflow-y: auto;
  flex: 1;
}

.debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.debug-table thead th {
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.8);
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  text-align: left;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.05em;
  font-size: 0.62rem;
}

.debug-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.debug-table tbody tr.debug-row-current {
  background: rgba(245,158,11,0.12);
}

.debug-table tbody td {
  padding: 3px 10px;
  color: rgba(255,255,255,0.75);
  font-variant-numeric: tabular-nums;
}

.debug-table tbody td:first-child {
  color: rgba(255,255,255,0.3);
  font-size: 0.6rem;
}

.debug-table tbody td:last-child {
  color: #fff;
  font-weight: 500;
}
