.contrast-page{ background:var(--bg); }

/* ---------------- Hero ---------------- */
.hero-section{
  max-width:1040px;
  margin:0 auto;
  padding:36px 20px 28px;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.hero-eyebrow{
  font-family:var(--mono);
  font-size:11px;
  font-weight:600;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--text-faint);
}
.hero-section h1{
  font-family:var(--display);
  font-size:clamp(26px, 4.6vw, 38px);
  font-weight:700;
  letter-spacing:-0.02em;
  margin:2px 0 4px;
}
.hero-desc{ font-size:14.5px; color:var(--text-dim); line-height:1.6; max-width:68ch; }

.swatch-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.swatch-demo{
  border-radius:12px;
  padding:28px 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  border:1px solid var(--border-soft);
}
.swatch-demo span{ font-family:var(--display); font-size:34px; font-weight:700; }
.swatch-demo em{ font-style:normal; font-family:var(--mono); font-size:11px; opacity:.75; }

.ratio-badge{
  display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
  border-radius:10px;
  padding:12px 16px;
  border:1px solid var(--border-soft);
}
.ratio-badge.pass{ background:#eafff4; border-color:#8fd9b6; }
.ratio-badge.fail{ background:#fff1f1; border-color:#f0a8a8; }
.ratio-number{ font-family:var(--mono); font-size:24px; font-weight:700; }
.ratio-badge.pass .ratio-number{ color:#1a8f5c; }
.ratio-badge.fail .ratio-number{ color:#c23b3b; }
.ratio-label{ font-size:12.5px; color:var(--text-dim); }

/* ---------------- Quick nav ---------------- */
.quicknav{
  position:sticky; top:var(--header-h); z-index:90;
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border-soft);
  display:flex; gap:2px; overflow-x:auto; scrollbar-width:none;
  max-width:1040px; margin:0 auto; padding:0 20px;
}
.quicknav::-webkit-scrollbar{ display:none; }
.quicknav-link{ flex-shrink:0; padding:11px 12px; font-size:12.5px; font-weight:600; color:var(--text-dim); border-bottom:2px solid transparent; white-space:nowrap; }
.quicknav-link:hover{ color:var(--text); border-color:var(--border); }

/* ---------------- Layout ---------------- */
.main-container{ display:flex; gap:24px; max-width:1040px; margin:0 auto; padding:0 20px; }
.main-container .main{ flex:1 1 auto; min-width:0; padding:32px 0 72px; display:flex; flex-direction:column; gap:40px; }
.main-container .side{ flex:0 0 auto; min-width:220px; padding-top:32px; }
@media (max-width:860px){
  .main-container{ flex-direction:column; padding:0 16px; }
  .main-container .side{ padding-top:0; }
  .swatch-row{ grid-template-columns:1fr; }
}
.section{ display:flex; flex-direction:column; gap:14px; scroll-margin-top:calc(var(--header-h) + 50px); min-width:0; }
.section-title{ font-family:var(--display); font-size:19px; font-weight:600; }
.section-hint{ font-size:12.5px; color:var(--text-faint); margin-top:-8px; }

/* ---------------- Checker ---------------- */
.checker-box{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:12px;
  padding:16px;
}
.checker-input{ display:flex; align-items:center; gap:8px; }
.checker-input input[type=color]{
  width:36px; height:36px; border:none; border-radius:8px; padding:0; background:none; cursor:pointer;
}
.checker-input input[type=color]::-webkit-color-swatch-wrapper{ padding:0; }
.checker-input input[type=color]::-webkit-color-swatch{ border:1px solid var(--border-soft); border-radius:8px; }
.checker-input input[type=text]{
  width:100px;
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:7px;
  padding:8px 10px;
  font-family:var(--mono);
  font-size:13px;
  color:var(--text);
}
.checker-vs{ font-family:var(--mono); font-size:12px; color:var(--text-faint); }

.checker-result{ display:flex; flex-direction:column; gap:14px; }
.checker-preview{
  border-radius:10px;
  padding:24px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border-soft);
}
.checker-preview span{ font-family:var(--display); font-size:30px; font-weight:700; }
.checker-ratio{ font-family:var(--mono); font-size:22px; font-weight:700; align-self:flex-start; }
.checker-ratio.pass{ color:#1a8f5c; }
.checker-ratio.fail{ color:#c23b3b; }
.checker-for-label{ font-family:var(--mono); font-size:11.5px; color:var(--text-faint); }
.checker-error{ font-size:13px; color:#c23b3b; }
.checker-permalink{ font-size:12.5px; color:var(--accent-dim); align-self:flex-start; }

/* ---------------- WCAG table ---------------- */
.wcag-table{
  width:100%;
  border-collapse:collapse;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:10px;
  overflow:hidden;
  font-size:13px;
}
.wcag-table th{
  text-align:left; font-size:10.5px; letter-spacing:0.06em; text-transform:uppercase;
  color:var(--text-faint);
  padding:10px 14px;
  border-bottom:1px solid var(--border-soft);
}
.wcag-table td{ padding:9px 14px; border-bottom:1px solid var(--border-soft); }
.wcag-table tr:last-child td{ border-bottom:none; }
.wcag-table td.pass{ color:#1a8f5c; font-weight:700; }
.wcag-table td.fail{ color:#c23b3b; font-weight:700; }

/* ---------------- Other backgrounds grid ---------------- */
.other-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:10px; }
.other-swatch{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  border-radius:10px;
  padding:18px 10px;
  border:1px solid var(--border-soft);
}
.other-swatch:hover{ border-color:var(--accent-dim); }
.other-swatch span{ font-family:var(--display); font-size:22px; font-weight:700; }
.other-swatch em{ font-style:normal; font-family:var(--mono); font-size:10.5px; opacity:.8; }

/* ---------------- Formula ---------------- */
.formula-box{
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:10px;
  padding:16px 18px;
  font-size:14px;
  line-height:1.7;
  color:var(--text-dim);
}
.formula-box p{ margin:0 0 10px; }
.formula-box p:last-child{ margin-bottom:0; }
.formula-box code{
  font-family:var(--mono);
  background:var(--surface-3);
  border-radius:5px;
  padding:1px 6px;
  color:var(--text);
  font-size:12.5px;
}

/* ---------------- Code box ---------------- */
.code-box{
  position:relative;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:9px;
  padding:14px;
}
.code-box pre{
  margin:0;
  font-family:var(--mono);
  font-size:12.5px;
  line-height:1.7;
  white-space:pre-wrap;
  word-break:break-all;
}
.code-box .copy{
  position:absolute;top:10px;right:10px;
  font-family:var(--mono);
  font-size:10.5px;
  padding:4px 8px;
  background:var(--surface-3);
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text-dim);
}
.code-box .copy:hover{ color:var(--text); }
