html {
  scroll-behavior: smooth;
}

/* Theme variables */
:root {
  --background-color: #f7f6f4;
  --primary-text-color: #141523;
  --muted: rgba(20, 21, 35, 0.6);
  --muted-strong: rgba(20, 21, 35, 0.85);
  --accent-color: #ffb703;
  --accent-strong: #f25f4c;
  --accent-highlight: #ffd166;
  --accent-purple: #8a7cff;
  --border: rgba(20, 21, 35, 0.12);
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --shadow: 0 35px 70px rgba(20, 21, 35, 0.12);
  --header-background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 243, 255, 0.9));
  --background-accent: linear-gradient(180deg, rgba(255, 183, 0, 0.2), rgba(242, 95, 76, 0.08));
  --glass: rgba(255, 255, 255, 0.85);
  --spotlight: rgba(255, 255, 255, 0.4);
  --navbar-background: rgba(255, 255, 255, 0.9);
}

.dark-mode {
  --background-color: #03050f;
  --primary-text-color: #f7f7f7;
  --muted: rgba(247, 247, 247, 0.65);
  --muted-strong: rgba(247, 247, 247, 0.85);
  --accent-color: #f25f4c;
  --accent-strong: #ffb703;
  --accent-highlight: #ffe39a;
  --border: rgba(255, 255, 255, 0.14);
  --panel: rgba(13, 16, 27, 0.92);
  --panel-strong: rgba(26, 30, 48, 0.95);
  --shadow: 0 35px 70px rgba(0, 0, 0, 0.55);
  --header-background: radial-gradient(circle at 10% 20%, rgba(255, 96, 96, 0.35), transparent 50%), linear-gradient(135deg, #030510 20%, #0f1228 60%, #15192f 100%);
  --background-accent: linear-gradient(160deg, rgba(242, 95, 76, 0.2), rgba(15, 20, 40, 0.6));
  --glass: rgba(255, 255, 255, 0.08);
  --spotlight: rgba(255, 255, 255, 0.15);
  --navbar-background: rgba(3, 5, 15, 0.6);
}

/* Reset */
body, h1, h2, p, ul {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', 'Segoe UI', Verdana, sans-serif;
  background: var(--background-color);
  color: var(--primary-text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--background-accent);
  opacity: 0.5;
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

.hero {
  background: var(--header-background);
  min-height: 70vh;
  padding: clamp(48px, 4vw, 80px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(242, 95, 76, 0.15), transparent 40%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 360px);
  gap: clamp(28px, 3vw, 48px);
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 5vw, 3.8rem);
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--muted-strong);
  max-width: 520px;
  margin-bottom: 24px;
}

.hero-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hero-tags span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-text-color);
}

.hero-panel {
  background: var(--panel);
  border-radius: 24px;
  padding: 28px 30px;
  box-shadow: 0 30px 60px rgba(20, 21, 35, 0.2);
  border: 1px solid var(--border);
}

.hero-panel .panel-label {
  font-size: 0.85rem;
  letter-spacing: 0.4px;
  color: var(--muted-strong);
  text-transform: uppercase;
}

.panel-rating {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0;
}

.panel-rating span {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.hero-panel-stars {
  display: flex;
  gap: 2px;
  font-size: 1.1rem;
  color: var(--accent-strong);
}

.panel-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.panel-accent {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 183, 0, 0.8), rgba(242, 95, 76, 0.9));
}

/* Audio Controls */
.audio-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  background: var(--accent-color);
  padding: 8px 15px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 999;
}

#audioToggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-text-color);
  cursor: pointer;
  outline: none;
}

.slider-wrapper {
  overflow: hidden;
  width: 0;
  opacity: 0;
  transition: width 0.4s ease, opacity 0.4s ease, margin-left 0.4s ease;
  margin-left: 0;
}

.audio-controls:hover .slider-wrapper {
  width: 120px;
  opacity: 1;
  margin-left: 15px;
}

#volumeSlider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

#volumeSlider:hover { background: #bbb; }

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary-text-color);
  border: 2px solid var(--background-color);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

#volumeSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary-text-color);
  border: 2px solid var(--background-color);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-background);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primary-text-color);
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  margin: 0;
  padding: 0;
}

.nav-links li { margin: 0 15px; }

.nav-links a {
  text-decoration: none;
  font-weight: bold;
  color: var(--primary-text-color);
  font-size: 1rem;
  transition: color 0.3s ease;
}

.nav-links a:hover { color: #777; }

#darkModeToggle {
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.5s ease, color 0.5s ease;
  margin-right: 10px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav-links {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: absolute;
    top: 50px;
    left: 10px;
    width: 85vw;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 99;
  }

  .nav-links.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-links li { margin: 10px 0; text-align: left; }
  .nav-links a { font-size: 1.1rem; font-weight: 600; color: var(--primary-text-color); }
  #hamburger { display: block; }
}

/* Ripple Effect */
#ripple {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--accent-color);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0.5;
  pointer-events: none;
  z-index: 5;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* Flashlight */
#flashlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  z-index: 50;
}

/* ===== Reviews Page ===== */

/* Wider, responsive reviews section */
/* Header */
.page-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.page-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--primary-text-color);
}

.badge {
font-size: 14px;
padding: 4px 10px;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--panel);
backdrop-filter: blur(12px);
color: var(--primary-text-color);
}

.sub { color: var(--muted); margin: 8px 0 20px; }

main > section.reviews-section {
  inline-size: min(95vw, 1040px);
  margin-inline: auto;
  padding: clamp(28px, 3vw, 48px);
  border-radius: 32px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

main > section.reviews-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 45%),
    radial-gradient(circle at 20% 60%, rgba(255, 183, 0, 0.25), transparent 50%);
  opacity: 0.6;
  pointer-events: none;
}

main > section.reviews-section > * {
  position: relative;
  z-index: 1;
}

.review-controls {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-label {
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  font-size: 0.9rem;
  color: var(--primary-text-color);
}

.filter-pill.active {
  background: linear-gradient(120deg, var(--accent-color), var(--accent-strong));
  color: #0a0a0a;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(20, 21, 35, 0.2);
}

.filter-feedback {
  font-size: 0.95rem;
  color: var(--muted-strong);
}

/* Cards */
.card {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 16px;
box-shadow: var(--shadow);
transition: background 0.5s ease, border-color 0.5s ease;
}

/* Summary (clean flex, mobile-friendly) */
.summary {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: clamp(24px, 4vw, 60px);
width: 100%;
margin-bottom: 30px;
}

.summary-left .avg-big {
font-weight: 800;
font-size: 44px;
line-height: 1;
margin-bottom: 6px;
color: var(--primary-text-color);
}

.stars-row {
letter-spacing: 4px;
font-size: 1.25rem;
background: linear-gradient(120deg, var(--accent-color), var(--accent-strong));
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

.muted { color: var(--muted-strong); font-size: 14px; margin-top: 6px; }

.summary-bars {
display: grid;
gap: 5px;
align-content: start;
flex: 1;
}

.dist-row {
display: flex;
align-items: center;
gap: 12px;
flex: 1 1 auto;
}

.dist-label {
width: 28px;
text-align: right;
font-weight: 600;
color: var(--primary-text-color);
}

.dist-track {
flex: 1 1 auto;
height: 14px;
background: var(--border);
border-radius: 999px;
overflow: hidden;
}

.dist-fill {
height: 100%;
width: 0%;
background: linear-gradient(120deg, var(--accent-color), var(--accent-strong));
border-radius: 999px;
transition: width .45s ease;
}

.dist-count {
width: auto;
min-width: 70px;
text-align: left;
color: var(--muted);
font-size: 13px;
}

/* Reviews grid */
#reviews {
list-style: none;
padding: 0;
display: grid;
gap: 18px;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Review card */
.review {
  padding: 18px 20px 16px;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  position: relative;
  color: var(--primary-text-color);
}

.review:hover {
  transform: translateY(-2px);
  background: var(--panel-strong);
  border-color: var(--border);
}

.review::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.15), rgba(255, 219, 153, 0.15));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.review:hover::before {
opacity: 1;
}

.row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 8px;
}

.identity { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: .2px;
  background: var(--accent-color);
  border: 1px solid var(--border);
  color: var(--primary-text-color);
}

.name { font-weight: 600; color: var(--primary-text-color); }
.small-muted { color: var(--muted); font-size: 12.5px; }
.stars { color: var(--accent-purple); letter-spacing: 2px; font-variant-numeric: tabular-nums; }

.comment { opacity: .95; line-height: 1.55; color: var(--primary-text-color); }

/* States */
.loading, .err, .empty {
  color: var(--muted);
  margin: 6px 2px 14px;
  text-align: center;
  padding: 40px;
}

/* Footer link */
.actions { margin-top: 22px; text-align: center; }

.actions a {
  color: var(--accent-purple);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.actions a:hover { border-color: var(--accent-purple); }

/* Animations */
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

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

/* Staggered animation delays */
.review:nth-child(1) { animation-delay: 0.1s; }
.review:nth-child(2) { animation-delay: 0.2s; }
.review:nth-child(3) { animation-delay: 0.3s; }
.review:nth-child(4) { animation-delay: 0.4s; }
.review:nth-child(5) { animation-delay: 0.5s; }
.review:nth-child(6) { animation-delay: 0.6s; }
.review:nth-child(7) { animation-delay: 0.7s; }
.review:nth-child(8) { animation-delay: 0.8s; }
.review:nth-child(9) { animation-delay: 0.9s; }
.review:nth-child(10) { animation-delay: 1.0s; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .summary { flex-direction: column; gap: 20px; }
  main > section.reviews-section {
    inline-size: 100%;
    padding-inline: 15px;
  }
}

/* Prevent horizontal scroll; contain hero canvas overflow */
html, body { overflow-x: clip; }
.hero { position: relative; overflow: clip; }
#particles { display: block; width: 100%; height: 100%; }
