*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --surface: #f5f2ec;
  --surface2: #ebe8e1;
  --border: #d8d4cb;
  --t1: #1c1a16;
  --t2: #7a776e;
  --green: #3a9e5c;
  --red: #d94f4f;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 2px 6px rgba(0, 0, 0, 0.18), 0 14px 44px rgba(0, 0, 0, 0.32);
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, monospace;
}

body {
  font-family: var(--sans);
  background-color: #0d0c0a;
  background-image:
    radial-gradient(ellipse 70% 50% at 8% 20%, oklch(0.44 0.22 28 / 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 92% 12%, oklch(0.47 0.22 258 / 0.48) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 42% 72%, oklch(0.5 0.18 162 / 0.32) 0%, transparent 48%);
  background-attachment: fixed;
  color: var(--t1);
  min-height: 100vh;
}

/* ── Hero ── */

.hero {
  padding: 100px 32px 80px;
  text-align: center;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.hero-link {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.15s;
}

.hero-link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.hero-title {
  font-family: var(--mono);
  font-size: 88px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.05em;
  line-height: 1;
}

.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.42);
  max-width: 480px;
  text-align: center;
}


/* ── App section ── */

.app-section {
  padding: 40px 24px 48px;
}

.app-wrap {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#swatch {
  height: 130px;
  flex-shrink: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  transition: background-color 0.08s;
}

.left-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tabs {
  display: flex;
  background: var(--surface2);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}

.tab {
  flex: 1;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--t2);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.tab.on {
  background: var(--surface);
  color: var(--t1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--t2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 6px;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.txt {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  background: var(--surface2);
  color: var(--t1);
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.txt:focus {
  border-color: #aaa8a2;
  background: var(--surface);
}

.txt.err {
  border-color: var(--red);
}

.ibtn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 9px;
  cursor: pointer;
  color: var(--t2);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}

.ibtn:hover {
  background: var(--border);
  color: var(--t1);
}

.ibtn.ok {
  color: var(--green);
  border-color: var(--green);
  background: #f0faf4;
}

.hint {
  font-size: 10.5px;
  color: var(--t2);
  padding: 0 2px;
}

hr.div {
  border: none;
  border-top: 1px solid var(--border);
}

.gamut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gamut-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}

.gamut-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 2px #d0f0de;
}

.gamut-dot.out {
  background: #e07b00;
  box-shadow: 0 0 0 2px #fce8c0;
}

.gamut-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--t2);
  flex: 1;
  transition: color 0.2s;
}

.gamut-lbl.out {
  color: #b86200;
}

.gamut-btn {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  background: #fff4e0;
  border: 1.5px solid #e8c070;
  color: #9a5500;
  cursor: pointer;
  transition: all 0.15s;
  display: none;
}

.gamut-btn:hover {
  background: #ffe8b0;
  border-color: #d4a030;
}

.out-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.out-row:hover {
  background: var(--surface2);
}

.out-lbl {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t2);
  width: 38px;
  flex-shrink: 0;
}

.out-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--t1);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.out-cp {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--t2);
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}

.out-row:hover .out-cp {
  opacity: 1;
}

.out-cp.ok {
  color: var(--green);
  opacity: 1;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sc-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  width: 76px;
  text-align: right;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 7px;
  background: var(--surface2);
  color: var(--t1);
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.sc-num::-webkit-inner-spin-button,
.sc-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.sc-num:focus {
  border-color: #aaa8a2;
}

.sw {
  flex: 1;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  min-height: 72px;
}

.sw-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 10px;
}

.checker {
  background-color: #d0cfc9;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%), linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%), linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: 14px 14px;
  background-position:
    0 0,
    0 7px,
    7px -7px,
    -7px 0px;
}

.alpha-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

input[type='range'].rng {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 48px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
}

input[type='range'].rng::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1px;
}

input[type='range'].rng::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -9px;
  background: #fff;
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.28),
    0 0 0 1.5px rgba(255, 255, 255, 0.5) inset;
  cursor: grab;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}

input[type='range'].rng:active::-webkit-slider-thumb {
  cursor: grabbing;
  box-shadow:
    0 3px 12px rgba(0, 0, 0, 0.35),
    0 0 0 1.5px rgba(255, 255, 255, 0.5) inset;
}

input[type='range'].rng::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1px;
}

input[type='range'].rng::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 4px;
  border: none;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  cursor: grab;
}

/* ── Accessibility ── */

.a11y-section {
  padding: 64px 24px 0;
}

.a11y-wrap {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 14px;
}

.a11y-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.a11y-preview {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 24px 20px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  transition: background-color 0.12s;
  background-color: #cf674a;
}

.a11y-sample {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #202122;
  transition: color 0.12s;
}

.a11y-sample.sm {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
}

.a11y-controls {
  padding: 14px 16px 16px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.a11y-pair {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a11y-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--t2);
}

.a11y-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.a11y-picker {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface2);
  cursor: pointer;
  flex-shrink: 0;
}

.a11y-hex {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.a11y-swap {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--t2);
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-bottom: 1px;
}

.a11y-swap:hover {
  background: var(--border);
  color: var(--t1);
}

.a11y-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.a11y-metric-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.a11y-metric-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.a11y-metric-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.a11y-metric-link {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--t2);
  text-decoration: none;
  transition: color 0.15s;
  flex: 1;
}

.a11y-metric-link:hover {
  color: var(--t1);
}

.a11y-metric-val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--t1);
  letter-spacing: -0.03em;
  margin-left: auto;
}

.a11y-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.a11y-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}

.a11y-badge.pass {
  background: #e8f8ee;
  border: 1.5px solid #a8ddb8;
  color: #1e7a3c;
}

.a11y-badge.fail {
  background: #fdf0f0;
  border: 1.5px solid #f0b8b8;
  color: #b03030;
}

/* ── Getting started ── */

.gs-section {
  padding: 64px 24px;
}

.section-wrap {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.85);
}

.gs-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gs-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gs-step-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.35);
}

.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-md);
  overflow: hidden;
}

.code-block pre {
  padding: 20px 52px 20px 22px;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.62);
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.8);
}

/* ── FAQ ── */

.faq-section {
  padding: 48px 24px 80px;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.faq-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}

.faq-q {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.faq-a {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--t2);
}

.faq-a code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--t1);
}

/* ── Footer ── */

.footer {
  padding: 28px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
}

.footer a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Tablet ── */

@media (max-width: 860px) {
  .app-wrap {
    grid-template-columns: 1fr;
  }

  .a11y-wrap {
    grid-template-columns: 1fr;
  }

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

/* ── Mobile ── */

@media (max-width: 600px) {
  .hero {
    padding: 64px 20px 56px;
  }

  .hero-inner {
    gap: 14px;
  }

  .hero-title {
    font-size: 52px;
  }

  .hero-desc {
    font-size: 14.5px;
  }

  .hero-links {
    gap: 16px;
  }

  .app-section {
    padding: 28px 16px 36px;
  }

  .gs-section {
    padding: 48px 16px;
  }

  .faq-section {
    padding: 36px 16px 60px;
  }

  .section-title {
    font-size: 22px;
  }

  .code-block pre {
    padding: 16px 44px 16px 16px;
  }

  .code-block code {
    font-size: 12px;
  }

  .faq-item {
    padding: 18px 20px;
  }

  .sc-num {
    width: 64px;
  }
}
