@font-face {
  font-family: 'TAN Meringue';
  src: url('TAN-Meringue-Font/TAN MERINGUE.woff2') format('woff2'),
       url('TAN-Meringue-Font/TAN MERINGUE.otf')   format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body { background: #f1f1f1; overflow-y: auto; overflow-x: hidden; }
canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: block;
  z-index: 0;
  touch-action: none;
}

/* ── Hero section ── */
#hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

@keyframes brand-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#brand {
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  animation: brand-fade 1.5s ease-in 0.4s both;
}

#brand-pre {
  font-family: 'Space Mono', monospace;
  font-size: var(--pre-size, 1rem);
  font-weight: 700;
  color: var(--pre-color, #30223d);
  margin-bottom: var(--pre-btm, 4px);
  margin-left: var(--pre-left, 13px);
}
@media (max-width: 480px) {
  #brand-pre {
    font-size: 1.25rem;
    margin-left: -40px;
  }
}

#wordmark-wrap {
  position: relative;
}

#brand-wordmark {
  font-family: 'TAN Meringue', Georgia, serif;
  font-size: clamp(4rem, calc(var(--wm-size, 7.5) * 1vw), var(--wm-max, 130px));
  font-weight: normal;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--wm-fill, #ffffff);
  -webkit-text-stroke: 0.5px var(--wm-glow, #ea21a1);
  text-shadow:
    0 0 3px  var(--wm-glow, #ea21a1),
    0 0 14px var(--wm-glow, #ea21a1),
    0 0 35px var(--wm-glow, #ea21a1),
    0 0 80px var(--wm-glow, #ea21a1);
  margin: 0;
}

#brand-flare {
  position: absolute;
  width: var(--fl-w, 276px);
  opacity: var(--fl-opacity, 1);
  pointer-events: none;
}

#brand-post {
  font-family: 'Space Mono', monospace;
  font-size: var(--post-size, 1rem);
  font-weight: 700;
  color: var(--post-color, #30223d);
  text-align: right;
  margin-top: var(--post-top, 4px);
  margin-right: var(--post-right, 47px);
}

@media (max-width: 480px) {
  #brand-post {
    font-size: 1.25rem;
    margin-right: -20px;
  }
}

/* ── Next section ── */
#next-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(48, 34, 61, 0.08);
  transition: background 0.4s, border-color 0.4s;
}
[data-theme-mode="night"] #next-section {
  background: rgba(14, 6, 55, 0.88);
  border-top-color: rgba(255, 255, 255, 0.08);
}
#next-section .section-inner {
  max-width: 680px;
  padding: 100px 40px;
}
#next-section .hey {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  color: rgb(90, 170, 255);
  margin-bottom: 1.4rem;
  line-height: 1.2;
}
[data-theme-mode="night"] #next-section .hey {
  color: var(--col2, #42f5e9);
}
#next-section p {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.8;
  color: #30223d;
  margin-bottom: 1.2em;
}
[data-theme-mode="night"] #next-section p {
  color: rgba(255, 255, 255, 0.82);
}
#next-section p:last-child { margin-bottom: 0; }

/* ── CTA links ── */
#next-section .cta-book,
#next-section .cta-contact {
  margin-top: 2.4em;
}
#next-section .cta-contact {
  margin-top: 0.6em;
}
#next-section .cta-book a,
#next-section .cta-contact a {
  color: rgb(90, 170, 255);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
  opacity: 0.7;
  transition: opacity 0.15s;
}
[data-theme-mode="night"] #next-section .cta-book a,
[data-theme-mode="night"] #next-section .cta-contact a {
  color: var(--col2, #42f5e9);
}
#next-section .cta-book a:hover,
#next-section .cta-contact a:hover {
  opacity: 1;
}

#panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 320px;
  background: rgba(18, 16, 20, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: #c8c0d0;
  user-select: none;
  z-index: 100;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1),
              border-radius 0.22s cubic-bezier(0.4,0,0.2,1);
}
#panel.minimized {
  width: 36px;
  border-radius: 18px;
  overflow: hidden;
}

#panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: grab;
  transition: padding 0.22s, border-color 0.22s;
}
#panel.minimized #panel-header {
  padding: 0;
  border-color: transparent;
  cursor: default;
}
#panel-header:active { cursor: grabbing; }
#panel.minimized #panel-header:active { cursor: default; }

#panel-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s;
}
#panel.minimized #panel-title { opacity: 0; width: 0; }

#toggle-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
#toggle-btn:hover { color: rgba(255,255,255,0.75); }

#panel-body { padding: 10px 14px 14px; }

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.tab-btn {
  flex: 1;
  padding: 6px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  color: rgba(255,255,255,0.28);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.07); }
.tab-btn.active {
  background: rgba(200, 127, 221, 0.15);
  border-color: rgba(200, 127, 221, 0.42);
  color: #c87fdd;
}

/* ── Duration row ── */
.dur-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dur-row label {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
}
.dur-row input[type=range] {
  flex: 1;
  height: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.dur-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(200, 127, 221, 0.5);
  cursor: pointer;
}
.dur-row .val {
  flex: 0 0 32px;
  text-align: right;
  color: rgba(200, 127, 221, 0.55);
  font-size: 10px;
}

/* ── Param rows ── */
.section-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  margin: 10px 0 5px;
}
.section-label:first-child { margin-top: 2px; }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.row label {
  flex: 0 0 108px;
  color: rgba(255,255,255,0.5);
  font-size: 10.5px;
}
.row input[type=range] {
  flex: 1;
  height: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #c87fdd;
  cursor: pointer;
  transition: background 0.15s;
}
.row input[type=range]::-webkit-slider-thumb:hover { background: #e096f5; }
.row .val {
  flex: 0 0 38px;
  text-align: right;
  color: #c87fdd;
  font-size: 10.5px;
}

/* ── Color inputs ── */
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.color-row label {
  flex: 1;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.05em;
}
.color-row input[type=color] {
  width: 44px;
  height: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  cursor: pointer;
  padding: 1px;
  background: none;
}
.color-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type=color]::-webkit-color-swatch { border: none; border-radius: 3px; }

/* ── Buttons ── */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 10px 0 8px;
}

.btn-row {
  display: flex;
  gap: 5px;
  margin-bottom: 0;
}

.btn {
  flex: 1;
  padding: 6px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  color: rgba(255,255,255,0.32);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }

.btn.accent {
  background: rgba(200, 127, 221, 0.12);
  border-color: rgba(200, 127, 221, 0.28);
  color: #c87fdd;
}
.btn.accent:hover { background: rgba(200, 127, 221, 0.22); }

#seq-btn {
  margin-top: 6px;
  width: 100%;
  padding: 7px 0;
  background: rgba(200, 127, 221, 0.06);
  border: 1px solid rgba(200, 127, 221, 0.18);
  border-radius: 6px;
  color: rgba(200, 127, 221, 0.5);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
#seq-btn:hover {
  background: rgba(200, 127, 221, 0.16);
  color: #c87fdd;
  border-color: rgba(200, 127, 221, 0.38);
}
#seq-btn.running {
  color: rgba(200, 127, 221, 0.85);
  border-color: rgba(200, 127, 221, 0.5);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Theme select / input ── */
.theme-select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #c8c0d0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  padding: 6px 24px 6px 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='none' stroke='rgba(200,192,208,0.5)' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  margin-bottom: 8px;
}
.theme-select option { background: #1e1a24; color: #c8c0d0; }
.theme-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: #c8c0d0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  margin-bottom: 8px;
}
.theme-input::placeholder { color: rgba(255,255,255,0.2); }
.theme-input:focus { border-color: rgba(200,127,221,0.4); }
textarea.theme-input { resize: vertical; min-height: 72px; line-height: 1.5; }
