@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Syne:wght@600;700;800&display=swap');

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

:root {
  --bg: #040508;
  --s: #0A0D14;
  --s2: #12161F;
  --bd: rgba(255,255,255,0.06);
  --bd2: rgba(255,255,255,0.13);
  --fg: #E8EDF3;
  --fg2: #9AA8BC;
  --mu: #556070;
  --acc: #00E5FF;
  --success: #4ADE80;
  --warning: #FBBF24;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 4px; border: 2px solid var(--s); }
::-webkit-scrollbar-thumb:hover { background: var(--mu); }

/* Buttons */
.btn {
  background: var(--acc);
  color: #040508;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px; /* Mobile accessible tap target */
}
.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
}
.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--mu);
  border: 1px solid var(--bd);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.04em;
  min-height: 44px; /* Mobile accessible tap target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-ghost:hover {
  border-color: var(--bd2);
  color: var(--fg);
  background: rgba(255,255,255,0.02);
}

/* Form Controls & Sliders */
.section-lbl {
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
  margin-top: 32px;
  font-weight: 600;
}
.section-lbl:first-child { margin-top: 0; }

.slider-row { margin-bottom: 20px; }
.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.slider-name { font-size: 12px; color: var(--fg2); font-weight: 500; }
.slider-val { font-size: 12px; color: var(--acc); font-weight: 600; min-width: 50px; text-align: right; }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--s2);
  border-radius: 3px;
  outline: none;
  border: 1px solid var(--bd);
  margin: 10px 0; /* Padding for mobile tap */
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--acc);
  cursor: pointer;
  border: 3px solid var(--s);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
input[type=range]:active::-webkit-slider-thumb {
  transform: scale(0.9);
}
input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--acc);
  cursor: pointer;
  border: 3px solid var(--s);
}

/* Toggles */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 44px; /* Accessible tap target */
}
.toggle-label { font-size: 12px; color: var(--fg2); font-weight: 500; }
.toggle {
  width: 44px;
  height: 24px;
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle.on {
  background: var(--acc);
  border-color: var(--acc);
}
.toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after {
  transform: translateX(20px);
}

/* Colors & Swatches */
.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--bd2);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  transition: transform 0.15s;
}
.color-swatch:hover {
  transform: scale(1.05);
  border-color: var(--acc);
}
.color-swatch input[type=color] {
  position: absolute;
  inset: -8px;
  opacity: 0;
  cursor: pointer;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
}
.color-label { font-size: 12px; color: var(--fg2); flex: 1; font-weight: 500; margin-bottom: 2px; }
.color-hex { font-size: 11px; color: var(--mu); text-transform: uppercase; letter-spacing: 0.05em; }

/* Code Blocks */
.code-block {
  background: var(--s);
  border: 1px solid var(--bd);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--bd);
  background: rgba(255,255,255,0.01);
}
.code-label {
  font-size: 11px;
  color: var(--mu);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
pre {
  font-size: 12px;
  line-height: 1.6;
  color: var(--fg2);
  overflow-x: auto;
  white-space: pre;
  padding: 20px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 60px);
  background: var(--acc);
  color: #040508;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 14px 28px;
  border-radius: 100px;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Split Layout (Sidebar + Preview) */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
  overflow: hidden;
}
.layout .panel {
  background: var(--s);
  border-right: 1px solid var(--bd);
  padding: 32px;
  overflow-y: auto;
  height: 100%;
}
.layout .preview-area {
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg);
}

/* Centered Layout */
.layout-centered {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px;
}
.layout-centered .panel {
  background: var(--s);
  border: 1px solid var(--bd);
  border-radius: 16px;
  padding: 40px;
}

/* Mobile Responsiveness */
@media (max-width: 800px) {
  .layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }
  .layout .preview-area {
    height: 45vh;
    flex-shrink: 0;
    border-bottom: 1px solid var(--bd);
    z-index: 10;
  }
  .layout .panel {
    height: 55vh;
    border-right: none;
    padding: 24px 20px;
  }
  
  .layout-centered {
    padding: 20px 16px;
  }
  .layout-centered .panel {
    padding: 24px 20px;
    border-radius: 12px;
  }
  
  .toast {
    bottom: 20px;
    width: 90%;
    text-align: center;
  }
}
