/* ============================================================
   FloofenKompfen — Logo Studio (self-contained dark showroom)
   ============================================================ */
/* studio-specific names mapped onto the shared theme tokens from styles.css */
:root {
  --stage: var(--bg);
  --stage-2: var(--bg-elev);
  --panel: var(--nav-glass);
  --panel-solid: var(--bg-elev);
  --line-strong: var(--line);
  --muted: var(--text-muted);
  --accent-2: var(--accent-strong);
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  background: var(--stage);
  color: var(--text);
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: "Unbounded", sans-serif; margin: 0; line-height: 1.1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }

.studio-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 90% at 50% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    radial-gradient(90% 70% at 50% 100%, color-mix(in srgb, var(--accent-strong) 10%, transparent), transparent 60%),
    linear-gradient(180deg, var(--stage-2), var(--stage) 60%);
  pointer-events: none;
}

/* ---------- Nav ---------- */
.studio-nav {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.1rem, 4vw, 2.4rem);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); }
.brand-chip {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: #16151e; border: 1px solid var(--line);
  overflow: hidden;
}
.brand-chip img { width: 30px; height: 30px; object-fit: contain; }
.brand-name { font-family: "Unbounded", sans-serif; font-weight: 800; font-size: 0.92rem; }
.brand-name em { font-style: normal; color: var(--accent); }
.nav-back {
  text-decoration: none; color: var(--muted);
  font-weight: 600; font-size: 0.86rem;
  padding: 0.5em 0.9em; border: 1px solid var(--line); border-radius: 999px;
  transition: color .15s, border-color .15s;
}
.nav-back:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Layout ---------- */
.studio {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 25rem;
  gap: 1.5rem;
  align-items: stretch;
  max-width: 90rem;
  margin: 0 auto;
  padding: 6rem clamp(1.1rem, 4vw, 2.4rem) 3rem;
  min-height: 100vh;
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% 30%, rgba(255,255,255,0.03), transparent 70%),
    linear-gradient(180deg, #0b0b12, #050507);
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh;
  isolation: isolate;
}
.stage-inner {
  position: relative;
  width: min(92%, 40rem);
  aspect-ratio: 1 / 1;
  margin-top: 1.5rem;
  display: grid; place-items: center;
}

/* uplight cones */
.light-cone {
  position: absolute;
  bottom: 12%;
  left: 50%;
  width: 60%;
  height: 78%;
  transform-origin: bottom center;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 42%, transparent), rgba(255,255,255,0.05) 55%, transparent 85%);
  clip-path: polygon(46% 100%, 54% 100%, 96% 0%, 4% 0%);
  filter: blur(14px);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.8;
}
.light-cone.c1 { transform: translateX(-50%) rotate(-9deg); animation: sway1 6s ease-in-out infinite; }
.light-cone.c2 { transform: translateX(-50%) rotate(0deg); width: 42%; background: linear-gradient(to top, rgba(255,255,255,0.28), transparent 80%); animation: flick 5s ease-in-out infinite; }
.light-cone.c3 { transform: translateX(-50%) rotate(9deg); animation: sway2 7s ease-in-out infinite; }
@keyframes sway1 { 0%,100%{ transform: translateX(-50%) rotate(-9deg);} 50%{ transform: translateX(-50%) rotate(-6deg);} }
@keyframes sway2 { 0%,100%{ transform: translateX(-50%) rotate(9deg);} 50%{ transform: translateX(-50%) rotate(6deg);} }
@keyframes flick { 0%,100%{opacity:.85;} 45%{opacity:.65;} 70%{opacity:.95;} }

/* the logo */
.logo-canvas {
  position: relative;
  z-index: 3;
  width: 90%;
  height: 90%;
  object-fit: contain;
  margin-bottom: 20%;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.55));
  animation: bob 6s ease-in-out infinite;
  touch-action: none;
}
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-10px);} }

/* pedestal */
.pedestal {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 62%;
  pointer-events: none;
}
.pedestal-glow {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  width: 92%; height: 46px; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  filter: blur(6px);
}
.pedestal-top {
  position: relative;
  width: 100%; height: 0; padding-bottom: 26%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 38%, #33323c, #1a1a22 62%, #101017);
  box-shadow: inset 0 3px 10px rgba(255,255,255,0.14), inset 0 -6px 14px rgba(0,0,0,0.6);
}
.pedestal-body {
  width: 78%; height: 0; padding-bottom: 12%;
  margin: -6% auto 0;
  background: linear-gradient(180deg, #1b1b23, #0b0b10);
  clip-path: polygon(6% 0, 94% 0, 82% 100%, 18% 100%);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}
.stage-caption {
  position: relative; z-index: 4;
  margin: 0 0 1.4rem;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Panel ---------- */
.panel {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.2rem;
  align-self: start;
}
.panel-head h1 { font-size: 1.5rem; font-weight: 800; }
.panel-head h1 em { font-style: normal; color: var(--accent); }
.panel-head p { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.86rem; }

.section-label {
  font-family: "Space Mono", monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* layer tabs */
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.layer {
  height: 52px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.layer:hover { transform: translateY(-2px); }
.layer.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.layer .chip {
  display: block;
  width: 100%; height: 100%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
}

/* color picker */
.picker { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.wheel-wrap { position: relative; width: 210px; height: 210px; }
#wheel {
  width: 210px; height: 210px; border-radius: 50%;
  cursor: crosshair; touch-action: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 0 0 1px var(--line);
}
.wheel-marker {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%); pointer-events: none;
}
.val-row { width: 100%; display: flex; align-items: center; gap: 0.7rem; }
.val-row span { font-family: "Space Mono", monospace; font-size: 0.66rem; color: var(--muted); }
.val-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, #000, #fff);
  outline: none; cursor: pointer;
}
.val-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid #111; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
}
.val-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid #111; box-shadow: 0 2px 6px rgba(0,0,0,0.5); cursor: pointer;
}

/* inputs */
.inputs { display: flex; gap: 0.6rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field.hex { flex: 1.4; }
.field.rgb { flex: 1; }
.field label {
  font-family: "Space Mono", monospace; font-size: 0.6rem; letter-spacing: 0.1em;
  color: var(--muted); text-transform: uppercase;
}
.field input {
  width: 100%;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55em 0.6em;
  color: var(--text);
  font-family: "Space Mono", monospace; font-size: 0.85rem;
  text-align: center;
}
.field input:focus { border-color: var(--accent); }
.rgb-group { display: flex; gap: 0.4rem; }
.rgb-group .field { flex: 1; }

/* swatches */
.swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.4rem; }
.swatch {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line);
  cursor: pointer; padding: 0;
  transition: transform .12s, box-shadow .12s;
}
.swatch:hover { transform: scale(1.12); box-shadow: 0 0 0 2px var(--accent); z-index: 1; }

/* actions */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; padding: 0.75em 1em;
  font-family: "Unbounded", sans-serif; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: none; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { grid-column: 1 / -1; background: var(--accent); color: #1a1206; }
.btn.primary:hover { background: #ffc63a; }

.download-note {
  font-family: "Space Mono", monospace; font-size: 0.66rem; color: var(--muted);
  text-align: center; margin: 0;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 30px);
  background: var(--panel-solid); border: 1px solid var(--accent);
  color: var(--text); border-radius: 12px; padding: 0.8rem 1.1rem;
  font-size: 0.85rem; opacity: 0; visibility: hidden; z-index: 50;
  transition: transform .3s, opacity .3s, visibility .3s; box-shadow: var(--shadow);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .stage { min-height: 46vh; }
  .panel { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-canvas, .light-cone { animation: none !important; }
}
