:root {
  --page: #e7e7e7;
  --panel: #ffffff;
  --ink: #101010;
  --muted: #5d5d62;
  --line: #dedee3;
  --soft: #f3f3f5;
  --accent: #6c63ff;
  --radius: 8px;
  --shadow: 0 18px 55px rgba(18, 18, 20, 0.08);
}

body.dark-theme {
  --page: #121214;
  --panel: #1d1d21;
  --ink: #f4f4f5;
  --muted: #b2b2bb;
  --line: #35353c;
  --soft: #29292f;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.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;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 18px;
}

.brand-mini,
.nav-actions a {
  color: var(--ink);
  text-decoration: none;
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: conic-gradient(#ff4057, #ffcc3d, #28d17c, #2fb6ff, #6c63ff, #ff4057);
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px #111;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 500;
}

.nav-actions .coffee-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--panel);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.language-menu select {
  appearance: none;
  min-height: 38px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.language-menu {
  position: relative;
}

.language-menu::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-56%);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.language-menu select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.icon-button,
.copy-button,
.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(1220px, calc(100% - 40px));
  margin: 104px auto 86px;
  text-align: center;
}

.hero h1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.98;
  font-weight: 500;
  text-transform: uppercase;
}

.hero h1::after {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: conic-gradient(#ff4057, #ffcc3d, #28d17c, #2fb6ff, #6c63ff, #ff4057);
  box-shadow: inset 0 0 0 8px #fff, 0 0 0 4px #111;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: min(840px, calc(100% - 40px));
  margin: 0 auto 80px;
  align-items: start;
}

.seo-copy {
  width: min(840px, calc(100% - 40px));
  margin: -40px auto 80px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.seo-copy h2 {
  color: var(--ink);
  margin-bottom: 8px;
}

.seo-copy p {
  margin: 0 0 14px;
}

.panel {
  min-width: 0;
  height: fit-content;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h2,
h3,
p {
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 500;
}

h3 {
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
}

.copy-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.copy-button.copied,
.mini-copy.copied {
  background: #111;
  color: #fff;
}

.hex-field input {
  width: 100%;
  height: 55px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  outline: none;
}

.hex-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.color-stage {
  display: grid;
  position: relative;
  min-height: 233px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--soft);
}

#colorInput {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.selected-color {
  min-height: 233px;
  background: var(--accent);
}

.picker-message {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #111;
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  white-space: nowrap;
}

.color-readout {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.color-readout span {
  font-weight: 800;
}

.color-readout strong {
  color: var(--muted);
  font-size: 13px;
}

body.dark-theme .brand-dot,
body.dark-theme .hero h1::after {
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px #fff;
}

body.dark-theme .hero h1::after {
  box-shadow: inset 0 0 0 8px #fff, 0 0 0 4px #fff;
}

body.dark-theme .picker-message,
body.dark-theme .color-readout {
  background: rgba(18, 18, 20, 0.78);
  color: #fff;
}

body.dark-theme .color-readout strong {
  color: #d6d6dc;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.system-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 17px;
}

.tab {
  min-height: 38px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tab.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--panel);
}

.value-list {
  display: grid;
  gap: 10px;
}

.system-note {
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, var(--soft));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.value-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 43px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--soft);
  font-size: 13px;
}

.value-row span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.value-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mini-copy {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.mini-copy.copied {
  width: auto;
  padding: 0 8px;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.swatch {
  aspect-ratio: 1;
  min-height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}

.swatch.selected {
  border-color: #111;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px #111;
}

body.dark-theme .swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px #111, 0 0 0 5px #fff;
}

.harmony-list {
  display: grid;
  gap: 14px;
}

.harmony-group {
  display: grid;
  gap: 9px;
}

.harmony-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #3d3d42;
  font-size: 14px;
  font-weight: 800;
}

.harmony-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.harmony-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.family-card {
  display: grid;
  align-content: end;
  min-height: 58px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contrast-panel {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 20px;
}

.contrast-section h3 {
  margin-top: 0;
}

.contrast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.contrast-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 78px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}

.contrast-card strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.contrast-card span {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .workspace {
    width: min(840px, calc(100% - 40px));
  }
}

@media (max-width: 720px) {
  .topbar {
    width: min(100% - 28px, 1220px);
    padding-top: 22px;
  }

  .nav-actions {
    gap: 14px;
  }

  .hero {
    width: min(100% - 28px, 1220px);
    margin: 66px auto 42px;
  }

  .hero h1 {
    flex-direction: column;
    font-size: clamp(38px, 15vw, 58px);
  }

  .hero p {
    font-size: 15px;
  }

  .workspace {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 1220px);
    gap: 16px;
    margin-bottom: 40px;
  }

  .panel {
    min-height: auto;
    padding: 20px;
  }

  .system-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}
