:root {
  --bg-1: #130019;
  --bg-2: #050817;
  --bg-3: #0f1e13;
  --ink: #f8fbff;
  --muted: #d9e5ff;
  --line: rgba(255, 255, 255, 0.24);
  --accent-pink: #ff2ea6;
  --accent-yellow: #ffe74f;
  --accent-cyan: #2df7ff;
  --accent-lime: #8eff5a;
  --accent-orange: #ff8a1f;
  --accent-purple: #9350ff;
  --danger: #ff5f8b;
  --ok: #7affba;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.93rem + 0.35vw, 1.14rem);
  line-height: 1.62;
  min-height: 100vh;
  background:
    radial-gradient(circle at 6% 7%, rgba(255, 46, 166, 0.32), transparent 24%),
    radial-gradient(circle at 95% 10%, rgba(255, 231, 79, 0.23), transparent 30%),
    radial-gradient(circle at 83% 80%, rgba(45, 247, 255, 0.24), transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(142, 255, 90, 0.21), transparent 36%),
    linear-gradient(120deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.03) 75%, transparent 75%, transparent),
    linear-gradient(-25deg, rgba(255, 46, 166, 0.06), transparent 40%);
  background-size: 22px 22px, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.65;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 231, 79, 0.12), transparent 12%),
    radial-gradient(circle at 70% 60%, rgba(255, 46, 166, 0.12), transparent 14%),
    radial-gradient(circle at 50% 85%, rgba(45, 247, 255, 0.1), transparent 16%);
  animation: driftGlow 22s linear infinite;
  z-index: -1;
}

@keyframes driftGlow {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-1.4%, 1.1%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes floatBob {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulseSpin {
  0% {
    filter: saturate(1);
    transform: rotate(0deg);
  }
  50% {
    filter: saturate(1.2);
    transform: rotate(180deg);
  }
  100% {
    filter: saturate(1);
    transform: rotate(360deg);
  }
}

a {
  color: var(--accent-cyan);
}

.shell {
  width: min(1880px, calc(100% - 1rem));
  margin: 0 auto;
}

main {
  display: grid;
  gap: 0.35rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 300;
  background: #fff;
  color: #000;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
}

.skip-link:focus {
  left: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 130;
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(120deg, rgba(10, 0, 22, 0.92), rgba(29, 7, 52, 0.84));
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.nav-wrap {
  min-height: 84px;
  padding: 0.65rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  flex-wrap: wrap;
}

.site-top-note {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(95deg, rgba(255, 231, 79, 0.12), rgba(255, 46, 166, 0.12), rgba(45, 247, 255, 0.12));
}

.top-note-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.46rem 0;
}

.top-note-grid p {
  margin: 0;
  font-size: 0.9rem;
  color: #f8fbff;
}

.top-note-actions {
  display: flex;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.top-note-actions a {
  text-decoration: none;
  color: #120014;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 800;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: conic-gradient(from 120deg, var(--accent-pink), var(--accent-yellow), var(--accent-cyan), var(--accent-pink));
  color: #14031b;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 20px rgba(255, 46, 166, 0.36);
  font-weight: 900;
  animation: pulseSpin 14s linear infinite;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: #f7f2ff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.34rem 0.62rem;
  line-height: 1.25;
  border-radius: 999px;
}

.site-nav a:nth-child(odd) {
  background: rgba(255, 46, 166, 0.16);
}

.site-nav a:nth-child(even) {
  background: rgba(45, 247, 255, 0.14);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #0f0012;
  background: #fff;
}

.nav-toggle {
  display: none !important;
  border: 1px solid var(--line);
  background: rgba(42, 17, 58, 0.88);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.62rem;
  font-weight: 700;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.16rem;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  color: #120015;
  background: linear-gradient(110deg, var(--accent-pink), var(--accent-yellow), var(--accent-cyan));
  box-shadow: 0 12px 28px rgba(255, 46, 166, 0.32);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px) rotate(-1deg);
  filter: brightness(1.06);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.hero {
  padding: 2.1rem 0 1.35rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.3rem;
}

.chaos-burst {
  position: relative;
}

.chaos-burst::before,
.chaos-burst::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 24px;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: screen;
}

.chaos-burst::before {
  left: -18px;
  top: 12px;
  background: linear-gradient(45deg, rgba(255, 138, 31, 0.36), rgba(147, 80, 255, 0.24));
  transform: rotate(17deg);
}

.chaos-burst::after {
  right: -22px;
  bottom: 8px;
  background: linear-gradient(45deg, rgba(45, 247, 255, 0.34), rgba(255, 46, 166, 0.22));
  transform: rotate(-12deg);
}

.eyebrow {
  margin: 0;
  color: var(--accent-yellow);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 900;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 {
  margin-top: 0.55rem;
  font-size: clamp(2.4rem, 4.9vw, 4.35rem);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.24);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.78rem, 3.1vw, 2.7rem);
}

h3 {
  font-size: clamp(1.22rem, 2.2vw, 1.62rem);
}

.hero-copy p {
  max-width: 72ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.hero-aside {
  border-radius: var(--radius);
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, rgba(29, 15, 56, 0.92), rgba(16, 7, 31, 0.9));
  box-shadow: var(--shadow);
}

.hero-side-stack {
  display: grid;
  gap: 0.9rem;
}

.sticker-panel {
  position: relative;
}

.sticker-panel::before {
  content: "CHAOS EXPLAINED";
  position: absolute;
  right: 0.7rem;
  top: -0.7rem;
  font-size: 0.62rem;
  font-weight: 900;
  color: #14000f;
  background: linear-gradient(100deg, var(--accent-yellow), var(--accent-orange));
  border-radius: 999px;
  padding: 0.2rem 0.46rem;
  transform: rotate(8deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.section {
  padding: 1.75rem 0;
}

.section-head {
  max-width: 980px;
  margin-bottom: 1.35rem;
}

.section-head p {
  margin-top: 0.7rem;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.15rem;
}

.grid > *,
.hero-grid > *,
.form-grid > *,
.fun-zone-grid > *,
.lane-grid > * {
  min-width: 0;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(170deg, rgba(35, 20, 60, 0.95), rgba(12, 8, 27, 0.95));
  box-shadow: var(--shadow);
  padding: 1.2rem;
  display: grid;
  align-content: start;
  gap: 0.72rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.42);
  border-color: rgba(255, 255, 255, 0.34);
}

.splash-card:nth-child(1) {
  border-color: rgba(255, 46, 166, 0.5);
  animation: floatBob 7s ease-in-out infinite;
}

.splash-card:nth-child(2) {
  border-color: rgba(45, 247, 255, 0.5);
  animation: floatBob 8.5s ease-in-out infinite 0.6s;
}

.splash-card:nth-child(3) {
  border-color: rgba(255, 231, 79, 0.45);
  animation: floatBob 9.2s ease-in-out infinite 1.1s;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.52rem;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.badge.warning {
  color: #ffd8e8;
  border-color: rgba(255, 95, 139, 0.55);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.72rem 0;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.product-actions,
.inline-actions {
  display: flex;
  gap: 0.72rem;
  flex-wrap: wrap;
  margin-top: 0.95rem;
}

.product-actions > *,
.inline-actions > * {
  flex: 1 1 180px;
  min-width: 0;
}

.kicker-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.kicker {
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  color: #0c0010;
  background: linear-gradient(120deg, rgba(255, 231, 79, 0.95), rgba(255, 138, 31, 0.95));
}

.kicker:nth-child(2n) {
  background: linear-gradient(120deg, rgba(45, 247, 255, 0.95), rgba(142, 255, 90, 0.95));
}

.list {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.list li {
  margin-top: 0.52rem;
  color: var(--muted);
}

.compact-list li {
  margin-top: 0.32rem;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.94rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.field input,
.field textarea,
.field select,
.admin-table input,
.admin-table textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 7, 24, 0.93);
  color: var(--ink);
  padding: 0.68rem 0.74rem;
  font-size: 0.99rem;
}

.field textarea,
.admin-table textarea {
  min-height: 116px;
  resize: vertical;
}

.fieldset-box {
  border: 1px dashed rgba(255, 231, 79, 0.62);
  border-radius: 12px;
  margin: 0.84rem 0 0;
  padding: 0.82rem 0.9rem;
  display: grid;
  gap: 0.34rem;
  background: rgba(255, 255, 255, 0.03);
}

.fieldset-box legend {
  padding: 0 0.4rem;
  color: var(--accent-yellow);
  font-weight: 800;
  font-size: 0.84rem;
}

.fieldset-box label {
  color: var(--muted);
  font-size: 0.92rem;
}

.status {
  margin-top: 0.65rem;
  font-weight: 800;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

.idea-lab {
  margin-bottom: 1.2rem;
}

.idea-answer {
  margin-top: 0.95rem;
  background: linear-gradient(170deg, rgba(21, 15, 41, 0.95), rgba(9, 13, 26, 0.95));
}

.idea-output {
  white-space: pre-wrap;
  margin: 0.65rem 0 0;
  color: var(--ink);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
}

.idea-log-wrap {
  margin-top: 1rem;
}

.idea-log {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.idea-entry {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
}

.idea-entry p {
  margin: 0.38rem 0 0;
}

.fun-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.footer {
  margin-top: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  padding: 1.15rem 0 2rem;
  background: linear-gradient(90deg, rgba(8, 3, 17, 0.7), rgba(16, 9, 35, 0.65));
}

.footer-grid {
  display: grid;
  gap: 0.4rem;
}

.admin-wrap {
  padding: 2rem 0 3rem;
}

.admin-panel,
.admin-auth,
.admin-content {
  display: grid;
  gap: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}

.admin-table th,
.admin-table td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.44rem;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  text-align: left;
  font-size: 0.84rem;
}

.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: grid;
  place-items: center;
  z-index: 400;
}

.overlay-card {
  width: min(520px, calc(100% - 2rem));
}

.site-helper {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 260;
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.helper-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.4rem 0.62rem;
  background: linear-gradient(120deg, rgba(255, 46, 166, 0.92), rgba(29, 15, 56, 0.95));
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.helper-face {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(120deg, var(--accent-yellow), var(--accent-cyan));
  color: #120014;
  font-size: 0.66rem;
  font-weight: 900;
}

.helper-toggle-label {
  font-size: 0.85rem;
}

.helper-panel {
  width: min(360px, calc(100vw - 1.5rem));
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(165deg, rgba(29, 13, 50, 0.98), rgba(10, 7, 24, 0.98));
  box-shadow: var(--shadow);
  padding: 0.78rem;
  display: grid;
  gap: 0.7rem;
}

.helper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.helper-close {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 800;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.helper-message {
  margin: 0;
  color: var(--muted);
}

.helper-intents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.helper-chip {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.78rem;
  padding: 0.25rem 0.52rem;
  cursor: pointer;
  font-weight: 700;
}

.helper-chip.active {
  color: #120014;
  background: linear-gradient(120deg, var(--accent-yellow), var(--accent-cyan));
  border-color: transparent;
}

.helper-actions {
  display: grid;
  gap: 0.45rem;
}

.helper-action {
  width: 100%;
}

@media (max-width: 1020px) {
  .shell {
    width: min(100%, calc(100% - 1.4rem));
  }

  .hero-grid,
  .grid.two,
  .grid.three,
  .form-grid,
  .fun-zone-grid {
    grid-template-columns: 1fr;
  }

  .lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .nav-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }

  .brand {
    justify-content: center;
  }

  .site-nav {
    display: flex;
    position: static;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .site-nav a {
    width: auto;
    text-align: center;
    font-size: 0.92rem;
    padding: 0.3rem 0.5rem;
  }

  .top-note-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .site-helper {
    right: 0.6rem;
    left: 0.6rem;
    bottom: 0.6rem;
    justify-items: stretch;
  }

  .helper-panel {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .nav-wrap {
    gap: 0.55rem;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.34rem;
    justify-content: stretch;
  }

  .site-nav a {
    width: 100%;
    font-size: 0.82rem;
    padding: 0.32rem 0.36rem;
    white-space: normal;
    text-align: center;
  }

  .lane-grid {
    grid-template-columns: 1fr;
  }

  .product-actions > *,
  .inline-actions > * {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::after,
  .brand-mark,
  .splash-card {
    animation: none !important;
  }

  .btn,
  .site-nav a {
    transition: none;
  }

  .card {
    transition: none;
  }
}
