:root {
  --bg-1: #050505;
  --bg-2: #121212;
  --bg-3: #1b1b1b;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(7, 8, 10, 0.32);
  --text: #f8fafc;
  --muted: #b6bec8;
  --accent: #f5a300;
  --accent-2: #ffbf3f;
  --success: #7ad03a;
  --danger: #ff6b57;
  --shadow: rgba(245, 163, 0, 0.22);
  --border: rgba(255, 255, 255, 0.08);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 163, 0, 0.12), transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(255, 191, 63, 0.08), transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.04), transparent 30%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.03), transparent 20%),
    radial-gradient(circle at 70% 60%, rgba(245,163,0,0.05), transparent 22%),
    radial-gradient(circle at 50% 50%, rgba(255,191,63,0.04), transparent 18%);
  animation: drift 16s ease-in-out infinite alternate;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  opacity: 0.25;
  z-index: 0;
}

.cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 170, 40, 0.28) 0%, rgba(255, 170, 40, 0.12) 35%, rgba(255, 170, 40, 0.05) 55%, transparent 72%);
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  filter: blur(40px);
  z-index: 0;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,200,100,0.15) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: particleMove 40s linear infinite;
  opacity: 0.4;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 56px 20px 48px;
  perspective: 1400px;
}

.site-menu {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 20;
}

.menu-toggle {
  display: inline-grid;
  gap: 5px;
  width: 58px;
  height: 58px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.66);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.26);
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.menu-toggle:hover {
  border-color: rgba(245, 163, 0, 0.55);
  box-shadow: 0 14px 36px rgba(0,0,0,0.26), 0 0 0 1px rgba(245, 163, 0, 0.18), 0 0 24px rgba(245, 163, 0, 0.18);
  transform: translateY(-1px);
}

.menu-panel {
  position: absolute;
  top: 70px;
  left: 0;
  width: min(300px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)), rgba(12, 12, 12, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 54px rgba(0,0,0,0.32);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.menu-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-link,
.menu-parent,
.submenu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  color: #eef2f6;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  background: transparent;
  border: 0;
}

.menu-link:hover,
.menu-parent:hover,
.submenu-link:hover {
  background: rgba(255,255,255,0.06);
}

.menu-group {
  margin-top: 4px;
}

.menu-group summary {
  list-style: none;
  cursor: pointer;
}

.menu-group summary::-webkit-details-marker {
  display: none;
}

.menu-parent::after {
  content: "+";
  color: var(--accent-2);
  font-size: 18px;
}

.menu-group[open] .menu-parent::after {
  content: "-";
}

.submenu {
  padding: 4px 0 0 10px;
}

.submenu-link {
  font-size: 14px;
  color: #cfd7df;
  justify-content: flex-start;
}

.tool-page-brand {
  display: block;
  width: fit-content;
  margin: 0 auto 18px;
}

.tool-page-brand-image {
  width: min(320px, 78vw);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 18px rgba(245, 163, 0, 0.1)) drop-shadow(0 0 36px rgba(245, 163, 0, 0.06));
  animation: logoFloat 5s ease-in-out infinite;
}

.hero-card {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px 30px 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.022)), linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008));
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow: hidden;
  text-align: left;
}

.hero-card > * {
  position: relative;
  z-index: 1;
  transform: translateZ(24px);
}

.tool-shell-main,
.tool-heading,
.tool-title-lockup,
.panel-block,
.workspace-panel {
  display: grid;
}

.tool-shell-main {
  gap: 28px;
}

.tool-heading,
.tool-title-lockup {
  gap: 14px;
}

.status-row {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.status-pill,
.panel-hint,
.confidence-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #e7edf3;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
}

.tool-kicker,
.eyebrow,
.field-label {
  margin: 0;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  font-size: 12px;
  text-transform: uppercase;
}

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

.field-label {
  color: var(--accent-2);
  font-weight: 700;
}

.tool-title {
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: 0;
  max-width: 920px;
}

.tool-title .accent {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(245, 163, 0, 0.18);
}

.tool-subtitle {
  max-width: 890px;
  margin: 0;
  color: #c5ced8;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.7;
}

.result-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(245, 163, 0, 0.18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245, 163, 0, 0.12), rgba(255, 255, 255, 0.035));
}

.result-panel strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(30px, 6vw, 54px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.result-panel span:not(.confidence-pill) {
  display: block;
  margin-top: 8px;
  color: #d8dee6;
  font-weight: 700;
}

.result-panel[data-tone="success"] {
  border-color: rgba(122, 208, 58, 0.28);
  background: linear-gradient(135deg, rgba(122, 208, 58, 0.14), rgba(255, 255, 255, 0.035));
}

.result-panel[data-tone="danger"] {
  border-color: rgba(255, 107, 87, 0.32);
  background: linear-gradient(135deg, rgba(255, 107, 87, 0.13), rgba(255, 255, 255, 0.035));
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.tool-panel {
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.022)), linear-gradient(135deg, rgba(255,163,0,0.03), rgba(255,255,255,0.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025), 0 12px 30px rgba(0, 0, 0, 0.18);
}

.workspace-panel {
  gap: 20px;
}

.panel-block {
  gap: 14px;
}

.panel-block + .panel-block {
  margin-top: 22px;
}

.zoom-card,
.stat-card,
.preview-shell,
.status-banner,
.hover-card,
.gradient-card,
.colour-card {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  border-radius: 18px;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 172px;
  align-content: center;
  padding: 42px 22px;
  border: 1px dashed rgba(255, 191, 63, 0.35);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,163,0,0.08), rgba(255,255,255,0.02)), rgba(7, 8, 10, 0.34);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  transform: translateY(-2px);
  border-color: rgba(255, 191, 63, 0.6);
  box-shadow: 0 12px 28px rgba(245, 163, 0, 0.12);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-size: 22px;
  font-weight: 700;
}

.dropzone-copy,
.empty-state span,
.zoom-card span,
.hover-card span,
.gradient-card span,
.colour-card span {
  color: var(--muted);
  line-height: 1.6;
}

.tool-actions {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
}

.secondary-link,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 15px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.secondary-link:hover,
.mini-button:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(245, 163, 0, 0.35);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}

.tool-button {
  width: 100%;
  min-width: 0;
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px 14px;
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ea8b4;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.hover-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.hover-card.is-copied {
  border-color: rgba(138, 255, 122, 0.28);
  background: rgba(73, 144, 55, 0.14);
  box-shadow: 0 12px 28px rgba(73, 144, 55, 0.12);
}

.hover-card.is-copied #hoverValue {
  color: #f2ffe9;
}

.hover-card.is-copied #hoverMeta {
  color: #c9f6bd;
}

.hover-swatch,
.colour-swatch {
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    linear-gradient(var(--swatch-colour, transparent), var(--swatch-colour, transparent)),
    linear-gradient(45deg, rgba(255,255,255,0.32) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.32) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.32) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.32) 75%),
    #242424;
  background-position: 0 0, 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: auto, 16px 16px, 16px 16px, 16px 16px, 16px 16px;
}

.hover-swatch {
  width: 54px;
  height: 54px;
}

.zoom-card {
  display: grid;
}

.preview-zoom-card {
  grid-template-columns: auto minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.preview-zoom-card .field-label,
.preview-zoom-card span {
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.section-head h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.checker-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.checker-button {
  min-height: 32px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: #dce4ec;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.checker-button.is-active {
  color: #101010;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.preview-shell {
  min-height: 410px;
  overflow: auto;
  cursor: crosshair;
  user-select: none;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.055) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.055) 75%),
    #141414;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-shell[data-checker="light"] {
  background:
    linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.08) 75%),
    #f4f4f4;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-shell.is-panning {
  cursor: grabbing;
}

.preview-stage {
  min-width: 100%;
  min-height: 410px;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-stage.is-zoomed {
  place-items: start;
}

.preview-stage svg {
  display: block;
  max-width: min(100%, 760px);
  max-height: 680px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.preview-stage svg * {
  cursor: crosshair;
}

.preview-stage .is-hovered-colour {
  outline: 2px solid rgba(255, 191, 63, 0.85);
  outline-offset: 3px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  text-align: center;
  color: #eef2f6;
}

.colour-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.colour-card,
.gradient-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gradient-card {
  grid-template-columns: 92px minmax(0, 1fr);
  cursor: default;
}

.colour-card:hover,
.colour-card:focus-visible {
  border-color: rgba(245, 163, 0, 0.45);
  box-shadow: 0 12px 28px rgba(245, 163, 0, 0.12);
  outline: none;
}

.colour-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.gradient-card strong {
  display: block;
}

.colour-swatch,
.gradient-swatch {
  width: 58px;
  height: 48px;
}

.gradient-swatch {
  display: block;
  width: 92px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  background-color: #242424;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.colour-card .copy-pill {
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #101010;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.status-banner {
  padding: 16px 18px;
  color: #eaf0f6;
  line-height: 1.6;
}

.status-banner[data-tone="success"] {
  border-color: rgba(138, 255, 122, 0.18);
  background: rgba(73, 144, 55, 0.12);
}

.status-banner[data-tone="danger"] {
  border-color: rgba(255, 90, 90, 0.22);
  background: rgba(160, 36, 36, 0.14);
}

footer {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  padding-bottom: 20px;
  font-size: 14px;
  color: #8d97a3;
  text-align: center;
}

.footer-inline-link {
  color: #8d97a3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-inline-link:hover {
  color: var(--accent-2);
}

.support-strip {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 34px auto 0;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  text-align: center;
}

.support-strip p {
  margin: 0;
  color: #c5ced8;
  line-height: 1.6;
}

.support-link {
  min-width: 0;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
  white-space: nowrap;
}

@keyframes drift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 1%, 0) scale(1.04);
  }
}

@keyframes particleMove {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-120px);
  }
}

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

@media (max-width: 980px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    padding: 24px 18px 20px;
  }

  .tool-panel {
    padding: 18px;
  }
}

@media (max-width: 720px) {
  .site-menu {
    top: 16px;
    left: 16px;
  }

  .menu-toggle {
    width: 52px;
    height: 52px;
  }

  .container {
    padding-top: 88px;
  }

  .hero-card {
    border-radius: 20px;
  }

  .status-row,
  .section-head,
  .result-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-toolbar {
    justify-content: flex-start;
  }

  .stats-grid,
  .colour-list {
    grid-template-columns: 1fr;
  }

  .preview-zoom-card {
    grid-template-columns: 1fr;
  }

  .secondary-link,
  .mini-button {
    width: 100%;
    min-width: 0;
  }

  .colour-card,
  .gradient-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .gradient-swatch {
    width: 52px;
  }

  .copy-pill {
    grid-column: 1 / -1;
  }

  .tool-page-brand-image {
    width: min(240px, 68vw);
  }
}
