:root {
  color-scheme: light;
  font-family: "Noto Sans SC", sans-serif;
  color: #252621;
  background: #f5f2eb;
  --picked-color: #ff6b35;
  --picked-rgb: 255, 107, 53;
  --picked-text: #ffffff;
  --ink: #252621;
  --muted: #74766d;
  --paper: rgba(255, 253, 248, 0.88);
  --line: rgba(37, 38, 33, 0.12);
  --accent: #ef5b2a;
  --lime: #c7df4f;
  --violet: #7255d9;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 5%, rgba(199, 223, 79, 0.34), transparent 25rem),
    radial-gradient(circle at 90% 18%, rgba(114, 85, 217, 0.18), transparent 29rem),
    #f5f2eb;
}

button, input { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  animation: drift 11s ease-in-out infinite alternate;
}

.ambient-one {
  width: 22rem;
  height: 22rem;
  left: -13rem;
  top: 45%;
  background: rgba(255, 107, 53, 0.13);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  right: -8rem;
  bottom: -4rem;
  background: rgba(199, 223, 79, 0.22);
  animation-delay: -5s;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: white;
  border-radius: 13px 13px 13px 4px;
  background: var(--ink);
  box-shadow: 0 8px 22px rgba(37, 38, 33, 0.18);
}

.brand-mark svg { width: 20px; }

.browser-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  color: #58603d;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(111, 128, 47, 0.2);
  border-radius: 999px;
  background: rgba(232, 241, 194, 0.62);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78912f;
  box-shadow: 0 0 0 4px rgba(120, 145, 47, 0.14);
}

.browser-status.unsupported { color: #8d482f; background: #ffded1; border-color: #f4b7a0; }
.browser-status.unsupported .status-dot { background: #d55024; box-shadow: 0 0 0 4px rgba(213, 80, 36, 0.14); }

.hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 64px;
  align-items: center;
  min-height: 650px;
  padding: 68px 0 76px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #63665c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  letter-spacing: 0;
}

h1 {
  max-width: 640px;
  margin: 24px 0 22px;
  font-size: clamp(45px, 6vw, 75px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

h1 em {
  position: relative;
  color: var(--accent);
  font-style: normal;
  white-space: nowrap;
}

h1 em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  transform: rotate(-1.5deg);
  z-index: -1;
}

.hero-description {
  max-width: 560px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.pick-button {
  display: flex;
  width: min(100%, 470px);
  align-items: center;
  gap: 15px;
  padding: 13px 15px;
  color: white;
  border: 0;
  border-radius: 19px;
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(37, 38, 33, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.pick-button:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(37, 38, 33, 0.24); background: #32332d; }
.pick-button:active { transform: translateY(0); }
.pick-button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.pick-icon {
  display: grid;
  width: 53px;
  height: 53px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  border-radius: 14px;
  background: var(--lime);
}

.pick-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.pick-copy strong { font-size: 16px; }
.pick-copy small { margin-top: 3px; color: rgba(255,255,255,.58); font-size: 12px; }
.pick-button .arrow { width: 22px; margin-right: 8px; transition: transform 180ms ease; }
.pick-button:hover .arrow { transform: translate(3px, -3px); }

.shortcut-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 12px;
}
.shortcut-note svg { width: 17px; color: #6e862b; }

.color-stage {
  position: relative;
  min-height: 530px;
  overflow: hidden;
  color: var(--picked-text);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 34px;
  background: var(--picked-color);
  box-shadow: 0 34px 80px rgba(var(--picked-rgb), 0.24), inset 0 1px 0 rgba(255,255,255,.42);
  transition: background 420ms ease, color 420ms ease, box-shadow 420ms ease;
  isolation: isolate;
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.stage-label {
  position: absolute;
  top: 29px;
  left: 32px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  opacity: 0.76;
}

.color-orb {
  position: absolute;
  top: 86px;
  left: 50%;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
  background: var(--picked-color);
  box-shadow: inset -35px -42px 70px rgba(20,20,20,.15), inset 25px 20px 55px rgba(255,255,255,.34), 0 40px 70px rgba(43,38,31,.18);
  transform: translateX(-50%);
  transition: background 420ms ease;
  animation: breathe 5s ease-in-out infinite;
}

.orb-glare {
  position: absolute;
  top: 38px;
  left: 51px;
  width: 68px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.36);
  filter: blur(3px);
  transform: rotate(-32deg);
}

.current-values {
  position: absolute;
  right: 26px;
  bottom: 26px;
  left: 26px;
  display: grid;
  gap: 9px;
}

.value-chip {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  padding: 13px 15px;
  color: inherit;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 15px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, background 160ms ease;
}
.value-chip:hover { transform: translateX(-3px); background: rgba(255,255,255,.24); }
.value-chip span { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .12em; opacity: .72; }
.value-chip strong { text-align: left; font-family: "DM Mono", monospace; font-size: 17px; }
.value-chip svg { width: 17px; opacity: .75; }

.coordinate-mark {
  position: absolute;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  opacity: 0.48;
}
.coordinate-a { top: 61px; right: 35px; }
.coordinate-b { top: 135px; left: 30px; }
.coordinate-c { top: 285px; right: 42px; }

.tool-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
  padding-bottom: 22px;
}

.tool-card {
  min-height: 340px;
  padding: 31px;
  border: 1px solid rgba(37,38,33,.09);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(37, 38, 33, 0.07);
  backdrop-filter: blur(18px);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.card-heading.compact { margin-bottom: 20px; }
.card-heading h2 { margin: 12px 0 0; font-size: 25px; letter-spacing: -.035em; }

.native-color {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  cursor: pointer;
}
.native-color::-webkit-color-swatch-wrapper { padding: 0; }
.native-color::-webkit-color-swatch { border: 0; border-radius: 11px; }

.field-group {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  margin-bottom: 13px;
}
.field-label { color: #66695f; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.input-shell {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  transition: border 160ms ease, box-shadow 160ms ease;
}
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(239,91,42,.11); }
.hash-mark, .rgb-mark { padding-left: 15px; color: #9a9c94; font-family: "DM Mono", monospace; }
.rgb-mark { font-size: 12px; }
.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 14px 15px 14px 7px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "DM Mono", monospace;
  font-size: 16px;
}

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 23px; }
.field-message { max-width: 280px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.field-message.error { color: #c63e24; }
.apply-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 12px 16px;
  color: white;
  border: 0;
  border-radius: 12px;
  background: var(--violet);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(114,85,217,.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.apply-button:hover { transform: translateY(-2px); box-shadow: 0 14px 29px rgba(114,85,217,.28); }
.apply-button svg { width: 16px; }

.text-button { padding: 8px 0; color: var(--muted); border: 0; background: transparent; font-size: 12px; }
.text-button:hover { color: var(--accent); }

.history-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  transition: transform 150ms ease, border 150ms ease;
}
.history-item:hover { transform: translateY(-2px); border-color: rgba(37,38,33,.25); }
.history-swatch { width: 35px; height: 35px; flex: 0 0 auto; border: 1px solid rgba(37,38,33,.1); border-radius: 9px; }
.history-code { overflow: hidden; font-family: "DM Mono", monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { margin: 35px 0 0; color: #92958b; font-size: 13px; text-align: center; }

.compatibility {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 44px;
  padding: 20px 22px;
  border: 1px solid rgba(114,85,217,.15);
  border-radius: 20px;
  background: rgba(232,226,249,.55);
}
.compatibility-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; color: var(--violet); border-radius: 13px; background: white; }
.compatibility-icon svg { width: 20px; }
.compatibility h3 { margin: 0 0 4px; font-size: 14px; }
.compatibility p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

footer { display: flex; justify-content: space-between; padding: 25px 0 34px; color: #888b81; border-top: 1px solid var(--line); font-size: 12px; }

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 17px;
  color: white;
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 14px 34px rgba(37,38,33,.22);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 16px; color: var(--lime); }

@keyframes breathe { from { transform: translateX(-50%) translateY(-5px) scale(.98); } to { transform: translateX(-50%) translateY(7px) scale(1.02); } }
@keyframes drift { from { transform: translate(0,0); } to { transform: translate(30px,-20px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 42px; padding-top: 52px; }
  .color-stage { min-height: 500px; }
  .tool-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .topbar { padding-top: 16px; }
  .browser-status span:last-child { display: none; }
  .hero { min-height: auto; padding: 42px 0 50px; }
  h1 { font-size: 42px; }
  .hero-description { font-size: 15px; }
  .color-stage { min-height: 450px; border-radius: 25px; }
  .color-orb { width: 205px; height: 205px; }
  .tool-card { min-height: 0; padding: 23px 19px; border-radius: 21px; }
  .field-group { grid-template-columns: 1fr; gap: 7px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .apply-button { justify-content: center; }
  .history-list { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
