:root {
  --bg:          #07080b;
  --bg-2:        #0b0d12;
  --panel:       rgba(255,255,255,.032);
  --panel-hi:    rgba(255,255,255,.055);
  --hairline:    rgba(255,255,255,.085);
  --hairline-hi: rgba(255,255,255,.16);
  --text:        #f2f4f8;
  --muted:       #8d94a6;
  --faint:       #626a7d;

  --accent:      #00e5d0;
  --accent-2:    #4d7cff;
  --accent-ink:  #04070a;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --ease: cubic-bezier(.22,.9,.28,1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: -20vh -10vw auto;
  height: 90vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(46vw 40vh at 22% 8%,  color-mix(in oklab, var(--accent) 26%, transparent), transparent 68%),
    radial-gradient(40vw 38vh at 82% 2%,  color-mix(in oklab, var(--accent-2) 22%, transparent), transparent 70%);
  filter: blur(28px);
  opacity: .5;
  transition: background 1s var(--ease);
}

.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 4vw, 44px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 0 14px color-mix(in oklab, var(--accent) 55%, transparent)); transition: filter .6s var(--ease); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.name { font-weight: 620; font-size: 17px; letter-spacing: -.02em; }
.tag { font-size: 11.5px; color: var(--faint); letter-spacing: .01em; }

.privacy {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  padding: 7px 13px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}
.privacy .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #35e08a;
  box-shadow: 0 0 0 3px rgba(53,224,138,.14);
}

main {
  position: relative; z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 34px) clamp(18px, 4vw, 44px) 64px;
}

.hero { max-width: 620px; margin-bottom: clamp(26px, 5vw, 44px); }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5.2vw, 50px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  transition: background .8s var(--ease);
}
.hero p { margin: 0; color: var(--muted); font-size: clamp(14.5px, 1.5vw, 16.5px); max-width: 54ch; }

.drop {
  display: block;
  border: 1px dashed var(--hairline-hi);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,.014));
  padding: clamp(30px, 6vw, 58px);
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
  backdrop-filter: blur(10px);
}
.drop:hover, .drop:focus-visible {
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  background: linear-gradient(180deg, var(--panel-hi), rgba(255,255,255,.02));
  outline: none;
}
.drop.dragging {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  transform: scale(1.006);
}
.drop.busy { opacity: .6; pointer-events: none; }

.drop-inner { display: flex; align-items: center; gap: 20px; justify-content: center; flex-wrap: wrap; text-align: left; }
.drop-icon {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  color: var(--accent);
}
.drop-icon svg { width: 24px; height: 24px; }
.drop-copy { display: flex; flex-direction: column; gap: 4px; }
.drop-copy strong { font-weight: 560; font-size: 16px; letter-spacing: -.01em; }
.drop-copy span { font-size: 13px; color: var(--faint); }

.fineprint { margin: 14px 2px 0; font-size: 12.5px; color: var(--faint); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

.card {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,.012));
  backdrop-filter: blur(16px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise .5s var(--ease) both;
}
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 {
  margin: 0;
  font-size: 12px; font-weight: 560;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}

.preview {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 44px;
  isolation: isolate;
}
.preview img {
  position: relative; z-index: 1;
  max-width: 100%;
  max-height: 52vh;
  border-radius: 6px;
  display: block;
  box-shadow: 0 0 46px -2px var(--accent), 0 0 120px -10px var(--accent);
  transition: box-shadow .5s var(--ease);
}
.glow {
  position: absolute; inset: -14%;
  z-index: 0;
  background: radial-gradient(closest-side, var(--accent), transparent 70%);
  filter: blur(30px);
  opacity: .95;
  transition: background .6s var(--ease), opacity .35s var(--ease);
}
.preview.no-glow .glow { opacity: 0; }
.preview.no-glow img { box-shadow: none; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 11px 6px 6px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 11.5px; color: var(--muted);
  background: rgba(255,255,255,.02);
}
.swatch i {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  flex: none;
}

.tabs { display: flex; gap: 3px; padding: 3px; background: rgba(255,255,255,.04); border-radius: 999px; border: 1px solid var(--hairline); }
.tabs button {
  appearance: none; border: 0; background: none;
  color: var(--muted);
  font: inherit; font-size: 12.5px;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 560;
}

.blurb { margin: 0; font-size: 13.5px; color: var(--muted); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modes button {
  appearance: none;
  display: flex; flex-direction: column; gap: 3px;
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.02);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.modes button strong { font-size: 13px; font-weight: 560; color: var(--text); }
.modes button span { font-size: 11.5px; color: var(--faint); line-height: 1.35; }
.modes button:hover { border-color: var(--hairline-hi); }
.modes button[aria-checked="true"] {
  border-color: color-mix(in oklab, var(--accent) 62%, transparent);
  background: color-mix(in oklab, var(--accent) 11%, transparent);
}
@media (max-width: 520px) { .modes { grid-template-columns: 1fr; } }

.refpick {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: -2px 0;
}
.refpick-cap {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint);
}
.refpick-opts {
  display: flex; gap: 3px; padding: 3px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.refpick-opts button {
  appearance: none; border: 0; background: none;
  display: flex; align-items: center; gap: 7px;
  color: var(--muted);
  font: inherit; font-size: 12.5px;
  padding: 5px 13px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.refpick-opts button i {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.06);
  flex: none;
}
.refpick-opts button:hover:not(:disabled) { color: var(--text); }
.refpick-opts button[aria-checked="true"] {
  background: rgba(255,255,255,.10);
  color: var(--text);
  font-weight: 560;
}
.refpick-opts button:disabled { opacity: .38; cursor: not-allowed; }

@media (max-width: 380px) {
  .refpick { justify-content: stretch; }
  .refpick-opts { flex: 1; }
  .refpick-opts button { flex: 1; justify-content: center; }
}

.lands {
  display: flex; align-items: center; gap: 9px;
  margin: -6px 0 0;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.02);
  font-size: 12.5px;
  color: var(--muted);
}
.lands i {
  width: 16px; height: 16px; border-radius: 5px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.lands b { color: var(--text); font-weight: 560; }

.ch-caption {
  margin: 0 0 -6px;
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint);
}

.readout { display: flex; flex-direction: column; gap: 18px; }

.chip-row { display: flex; align-items: center; gap: 14px; }
.hexchip {
  width: 62px; height: 62px; flex: none;
  border-radius: 18px;
  background: var(--accent);
  box-shadow: 0 0 34px -4px var(--accent), inset 0 0 0 1px rgba(255,255,255,.18);
  transition: background .45s var(--ease), box-shadow .45s var(--ease);
}
.hexmeta { display: flex; flex-direction: column; gap: 2px; }
.hexval { font: 600 22px/1.1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; letter-spacing: -.01em; }
.huename { font-size: 12.5px; color: var(--faint); }

.channels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.channels li { display: grid; grid-template-columns: 18px 1fr 52px; align-items: center; gap: 12px; }
.channels .lbl { font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.channels .bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
}
.channels .bar i {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  transition: width .55s var(--ease);
}
.channels li[data-ch="r"] .bar i { background: linear-gradient(90deg, #7a1f2b, #ff4d5e); }
.channels li[data-ch="g"] .bar i { background: linear-gradient(90deg, #1c6a3d, #3ce07f); }
.channels li[data-ch="b"] .bar i { background: linear-gradient(90deg, #1d3d86, #5b8bff); }
.channels .val {
  text-align: right;
  font: 560 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.meta {
  flex: 1 1 90px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.02);
}
.meta span { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.meta strong { font: 560 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

button { font: inherit; }

.primary {
  appearance: none; border: 0;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 580; font-size: 14px;
  cursor: pointer;
  transition: transform .18s var(--ease), filter .18s var(--ease), background .45s var(--ease);
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(.985); }

.ghost {
  appearance: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.ghost:hover { color: var(--text); border-color: var(--hairline-hi); }
.ghost.wide { width: 100%; padding: 10px; border-radius: 12px; }
.ghost[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--accent) 62%, transparent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--text);
}

.head-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.preview.picking { cursor: crosshair; }
.preview.picking img { touch-action: none; }

.loupe {
  position: fixed;
  z-index: 30;
  width: 132px; height: 132px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 8px 28px -6px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.55);
}
.loupe[hidden] { display: none; }
.loupe canvas { width: 132px; height: 132px; display: block; }
.loupe-hex {
  position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(7,8,11,.82);
  font: 600 10.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f2f4f8;
  letter-spacing: .02em;
  white-space: nowrap;
}

.wheel-wrap { display: grid; place-items: center; }
#wheel {
  width: 100%;
  max-width: 380px;
  display: block;
}

.wheel-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.wheel-legend li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.wheel-legend i {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.wheel-legend .lg-primary i {
  width: 14px; height: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 0 10px -1px currentColor;
}
.wheel-legend .lg-primary { color: var(--text); font-weight: 560; }
.wheel-legend .lg-anchor { color: var(--text); }
.wheel-legend .lg-anchor i { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.wheel-legend .lg-note { color: var(--faint); font-size: 11.5px; }
.wheel-legend .lg-deg {
  font: 560 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.notes li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.notes li::before {
  content: "";
  position: absolute; left: 3px; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: background .45s var(--ease);
}

.kicker { display: flex; align-items: center; gap: 14px; }
.kicker-chip {
  width: 46px; height: 46px; flex: none;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.kicker-vals {
  font: 560 14px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.kicker-vals b { color: var(--text); font-weight: 560; }

footer {
  position: relative; z-index: 1;
  display: flex; gap: 10px; justify-content: center;
  padding: 22px;
  font-size: 12px;
  color: var(--faint);
  border-top: 1px solid rgba(255,255,255,.05);
}
.sep { opacity: .5; }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(20,22,28,.92);
  border: 1px solid var(--hairline-hi);
  backdrop-filter: blur(14px);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
