@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
  --bg-primary: #ececec;
  --bg-secondary: #f4f4f4;
  --text-primary: #111111;
  --text-secondary: #4b5563;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  --dialog-bg: rgba(255, 255, 255, 0.98);
  --dialog-text: var(--text-primary);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --dialog-bg: rgba(24, 24, 24, 0.98);
    --dialog-text: var(--text-primary);
  }
  :root {
    --bg-primary: #181818;
    --bg-secondary: #111111;
    --text-primary: #ececec;
    --text-secondary: #b8b8b8;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  }
}

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lexend', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Layout & Components
   ========================================================================== */

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  text-align: center;
  background-color: var(--bg-primary);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.carousel {
  position: relative;
  height: 500px;
  margin-bottom: 24px;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.carousel-links-secondary {
  display: flex;
  gap: 12px;
}

.carousel-link {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}

.carousel-link:hover {
  opacity: 0.8;
}

.carousel-link-small {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1.5px solid var(--text-secondary);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  transition: opacity 0.2s, border-color 0.2s;
}

.carousel-link-small:hover {
  opacity: 0.8;
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s;
}

.buy-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}

.buy-dialog.visible {
  opacity: 1;
  pointer-events: auto;
}

.buy-dialog-panel {
  background: var(--dialog-bg);
  color: var(--dialog-text);
  padding: 22px 26px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: min(90%, 380px);
  width: 100%;
}

.buy-dialog-panel p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.indicator.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
}


.halo-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(150px, 45%, 280px);
}

.halo-fallback.image-container {
  display: none;
  flex-direction: column;
}

.halo-fallback.image-container.active {
  display: flex;
}

.halo-fallback.active + .halo-graphic,
.halo-graphic:has(~ .halo-fallback.active) {
  display: none;
}

#canvas-container {
  width: 100%;
  aspect-ratio: 1;
}

#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  border-radius: 8px;
}

.halo-caption {
  display: flex;
  justify-content: center;
  gap: clamp(0.15em, 1.5vw, 0.55em);
  width: 100%;
  max-width: 100%;
  margin-top: 1.2em;
  line-height: 1;
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.halo-caption span {
  text-align: center;
}

.image-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-container img {
  max-width: 100%;
  height: auto;
  max-height: 370px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

h1 {
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 0;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Extra small screens */
@media (max-width: 480px) {
  body {
    padding: 6px;
  }

  .container {
    padding: 12px;
    border-radius: 10px;
  }

  .carousel {
    height: 340px;
  }

  .halo-graphic {
    width: clamp(150px, 55%, 260px);
  }

  .image-container {
    margin: 0 0 12px 0;
  }

  .image-container img {
    max-height: 220px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 2px;
  }

  .container {
    padding: 8px;
    border-radius: 6px;
    border: none;
    box-shadow: none;
  }

  .halo-graphic {
    width: 65%;
  }

  .carousel {
    height: 320px;
  }

  .image-container img {
    max-height: 240px;
  }

  .carousel-link {
    padding: 6px 16px;
    font-size: 0.8rem;
  }

  .carousel-link-small {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .carousel-links {
    gap: 6px;
    margin-top: 10px;
  }

  .carousel-indicators {
    margin-bottom: 4px;
  }

  h1 {
    font-size: 1.8rem;
  }
}

/* Small screens */
@media (min-width: 481px) and (max-width: 767px) {
  .carousel {
    height: 340px;
  }

  .image-container img {
    max-height: 230px;
  }
}

/* Medium screens and up */
@media (min-width: 768px) {
  .carousel {
    height: 560px;
  }

  h1 {
    font-size: 3.5rem;
  }

  .image-container img {
    max-height: 420px;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .container {
    max-width: 1100px;
    padding: 60px;
  }

  .carousel {
    height: 680px;
  }

  .halo-graphic {
    width: clamp(200px, 45%, 360px);
  }

  .halo-caption {
    font-size: 2.8rem;
  }

  .image-container img {
    max-height: 520px;
  }

  .carousel-link {
    padding: 12px 32px;
    font-size: 1.05rem;
  }

  .carousel-link-small {
    padding: 8px 18px;
    font-size: 0.9rem;
  }
}

/* Landscape on short viewports */
@media (orientation: landscape) and (max-height: 500px) {
  .container {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .carousel {
    height: 260px;
    margin-bottom: 0;
    flex: 1;
  }

  .carousel-indicators {
    flex-direction: column;
    margin-bottom: 0;
  }

  .halo-graphic {
    width: clamp(120px, 40%, 200px);
  }

  .carousel-slide:nth-child(2) {
    flex-direction: row;
    gap: 24px;
  }

  .carousel-slide:nth-child(2) .image-container img {
    max-height: 200px;
  }

  .carousel-slide:nth-child(2) .carousel-links {
    justify-content: center;
    margin-top: 0;
  }

  .image-container img {
    max-height: 230px;
  }
}

p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 400;
}

