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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f4efe4;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#art {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* ---- Control panel ---- */
#panel {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 270px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;          /* scroll inside the panel on small screens */
  padding: 18px 20px;
  background: rgba(15, 26, 51, 0.88);
  color: #f4efe4;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

#panel h1 {
  font-size: 22px;
  letter-spacing: 6px;
  margin-bottom: 16px;
  color: #7fd0e3;
}

.section-title {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #7fd0e3;
  opacity: 0.9;
  margin: 18px 0 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(244, 239, 228, 0.15);
}

#panel h1 + .section-title {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.control {
  margin-bottom: 14px;
}

.control label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 6px;
}

.control label span {
  color: #7fd0e3;
  font-variant-numeric: tabular-nums;
}

.control select {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: #f4efe4;
  color: #0f1a33;
  font-size: 14px;
  cursor: pointer;
}

.control input[type="range"] {
  width: 100%;
  accent-color: #7fd0e3;
  cursor: pointer;
}

/* checkbox row: box and label side by side */
.control.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.control.checkbox label {
  margin-bottom: 0;
  cursor: pointer;
}

.control.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #7fd0e3;
  cursor: pointer;
}

/* ---- Palette swatches ---- */
#palettes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(244, 239, 228, 0.25);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.active {
  border-color: #7fd0e3;
  transform: scale(1.15);
}

/* ---- Buttons ---- */
.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.buttons button {
  padding: 9px 0;
  border: 1px solid rgba(244, 239, 228, 0.3);
  border-radius: 8px;
  background: transparent;
  color: #f4efe4;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.buttons button:hover {
  background: rgba(244, 239, 228, 0.12);
}

/* Breathe button while the animation is running */
.buttons button.active {
  background: #7fd0e3;
  border-color: #7fd0e3;
  color: #0f1a33;
}

/* Export: the main action, full width */
.buttons button.primary {
  grid-column: 1 / -1;
  background: #7fd0e3;
  border-color: #7fd0e3;
  color: #0f1a33;
  font-weight: 600;
}

.buttons button.primary:hover {
  background: #a3e0ee;
}

/* ---- Keyboard hint ---- */
.hint {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.9;
  opacity: 0.6;
  text-align: center;
}

kbd {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid rgba(244, 239, 228, 0.35);
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
}

/* ---- H key: slide the panel away for clean screenshots and videos ---- */
#panel {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#panel.hidden {
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}

/* =====================================================
   Step 6 additions: About button and overlay
   ===================================================== */

/* About button: full width, outlined */
.buttons button.wide {
  grid-column: 1 / -1;
}

/* The dark see-through layer that covers the whole screen */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 14, 30, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10;
}

/* the `hidden` attribute must win over display: flex */
.overlay[hidden] {
  display: none;
}

.about-card {
  position: relative;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px 34px;
  background: #f4efe4;
  color: #1a2540;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  line-height: 1.6;
  font-size: 15px;
}

.about-card h2 {
  font-size: 28px;
  letter-spacing: 8px;
  color: #1b3f8b;
}

.about-card .tagline {
  margin-bottom: 18px;
  color: #2e9cc0;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.about-card h3 {
  margin: 18px 0 6px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #1b3f8b;
}

.about-card ol {
  margin: 8px 0 8px 22px;
}

.about-card li {
  margin-bottom: 4px;
}

.about-card kbd {
  border-color: rgba(26, 37, 64, 0.4);
}

.about-card .credit {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(26, 37, 64, 0.15);
  font-size: 13px;
  opacity: 0.7;
}

.about-card .close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: #1a2540;
  cursor: pointer;
  opacity: 0.6;
}

.about-card .close:hover {
  opacity: 1;
}