:root {
  --color-primary: #ffffff;
  --color-secondary: #fff9e0;
  --color-accent: #fabe0b;
  --color-text-dark: #0c0c0c;
  --color-text-light: #f8fafc;
  --slider-pos: 50%;
  --alpha-multiplier: 0.66;
}

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

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-primary);
  color: var(--color-text-dark);
  padding: 2rem 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', serif;
  font-weight: 400;
  color: var(--color-text-dark);
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--color-text-dark);
}

.container {
  max-width: 684px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Campaign Picker Section */
.campaign-picker-section {
  width: 100%;
}

.campaign-picker-section h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: #64748b;
}

.campaign-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

/* Campaign Card */
.campaign-card {
  flex: 0 0 180px;
  background: var(--color-secondary);
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.campaign-card:hover {
  transform: translateY(-2px);
}

.campaign-card.active {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.campaign-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.campaign-card-info {
  padding: 0.5rem 0.75rem;
}

.campaign-card-title {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-dark);
  display: block;
}

.campaign-card-meta {
  font-size: 0.7rem;
  color: #64748b;
}

/* Stage & Comparison Slider */
.stage {
  background: var(--color-secondary);
  padding: 1.5rem;
}

.stage h2 {
  font-size: 1.25rem;
  margin-top: 1rem;
}

.stage h2 .meta-info {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  font-family: Inter, sans-serif;
  margin-top: 0.25rem;
  font-weight: 400;
}

.comparison-slider {
  position: relative;
  width: 100%;
  max-height: 900px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  user-select: none;
  background-color: #000;
}

.comparison-slider img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Before image overlay using CSS clip-path */
.img-before {
  clip-path: inset(0 calc(100% - var(--slider-pos)) 0 0);
  z-index: 2;
}

/* Divider line & handle */
.slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos);
  width: 2px;
  background-color: #fff;
  z-index: 3;
  pointer-events: none;
  transform: translateX(-50%);
}

.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-button::before {
  content: '◄ ►';
  font-size: 10px;
  color: #333;
}

/* Invisible range slider overlay */
.slider-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 4;
  cursor: ew-resize;
}

/* Gallery Grid */
.gallery-section {
  width: 100%;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.slider-controls {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: var(--color-secondary);
  color: var(--color-text-dark);
  border: 1px solid var(--color-text-dark);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.nav-btn:hover {
  background: #334155;
  color: var(--color-accent);
}

/* Outer wrapper with hidden overflow */
.gallery-slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0.5rem 0;
  cursor: grab;
}

.gallery-slider-wrapper:active {
  cursor: grabbing;
}

/* Moving inner track */
.gallery-track {
  display: flex;
  gap: 1rem;
  will-change: transform;
  user-select: none;
}

/* Thumbnail Cards */
.gallery-card {
  flex: 0 0 160px; /* Fixed width per thumbnail */
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
  background: var(--color-secondary);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gallery-card.active {
  border-color: var(--color-accent);
  transform: scale(1.03) translate(3px, 0px);
}

.gallery-card p {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgb(from var(--color-primary) r g b / var(--alpha-multiplier));
  font-size: 0.75rem;
  padding: 0.4rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Style Book Floating Toggle Button */
.style-book-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--color-accent);
  color: var(--color-text-light);
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 1000;
  transition: transform 0.2s, background-color 0.2s;
}

.style-book-toggle:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Style Book Modal Overlay */
.style-book-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, var(--alpha-multiplier));
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.style-book-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Style Book Card */
.style-book-content {
  background: #000;
  color: #fff;
  width: 90%;
  max-width: 550px;
  max-height: 80vh;
  border-radius: 12px;
  padding: 1.5rem;
  overflow-y: auto;
  border: 1px solid #334155;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.style-book-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.style-book-section h2 {
  color: var(--color-secondary);
}

.close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
}

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

.style-book-section {
  margin-bottom: 1.5rem;
}

.style-book-section h3 {
  font-size: 1rem;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

/* Color Pickers Grid */
.color-swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.swatch-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #334155;
}

.swatch-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.swatch-input-container input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.swatch-input-container input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.swatch-input-container input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.swatch-info code {
  color: #94a3b8;
  font-size: 0.7rem;
}

/* Font Pickers Grid */
.font-pickers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.font-picker-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.font-picker-card label {
  font-size: 0.8rem;
  color: #94a3b8;
}

.style-select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.style-select:focus {
  outline: none;
  border-color: var(--color-secondary);
}

/* Reset Button */
.reset-btn {
  width: 100%;
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.reset-btn:hover {
  opacity: 0.9;
}