:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f1ebe1;
  --text: #1b1510;
  --text-2: #5b5044;
  --line: #e7dccb;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --ok: #2f7a4f;
  --ok-bg: #e5f2ea;
  --warn: #9a6212;
  --warn-bg: #fbf0dc;
  --bad: #b42323;
  --bad-bg: #fbe5e3;
  --code-bg: #1f1a15;
  --code-ink: #f3ece2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 8px 24px rgba(40, 25, 10, .06);
  color-scheme: light;
}
/* Light by default like stylemycrown.com; dark only when chosen with the toggle (smc-theme). */
:root[data-theme="dark"] {
  --bg: #14110e;
  --surface: #1d1915;
  --surface-2: #27211b;
  --text: #f3ece2;
  --text-2: #b9ab99;
  --line: #3a3129;
  --accent: #f08a4b;
  --accent-ink: #1b1510;
  --ok: #6fcf97;
  --ok-bg: #173323;
  --warn: #f2c06b;
  --warn-bg: #3a2c12;
  --bad: #f28b82;
  --bad-bg: #3d1a17;
  --code-bg: #0e0c0a;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
a { color: var(--accent); }
img, canvas { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-2); font-weight: 400; margin-left: 6px; font-size: .92em; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
.brand em { font-style: normal; font-weight: 400; color: var(--text-2); }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: none; }
@media (max-width: 720px) {
  .brand em { display: none; }
  .top-in { flex-wrap: wrap; gap: 4px 8px; padding-bottom: 6px; }
  .top-in .icon-btn { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: -8px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--text); color: var(--bg); border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; }

/* Hero */
.hero { padding-top: 40px; padding-bottom: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-size: clamp(34px, 5.2vw, 58px); max-width: 15ch; }
.hero h1 span { color: var(--text-2); font-weight: 400; display: block; }
.lede { font-size: 18px; color: var(--text-2); max-width: 64ch; margin: 18px 0 28px; }

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

.compare { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); cursor: ew-resize; touch-action: pan-y; user-select: none; --split: 50%; }
.compare canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#cmp-after { clip-path: inset(0 0 0 var(--split)); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.cmp-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #333; border-radius: 999px; padding: 6px 9px; font-size: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.25); white-space: nowrap; }
.cmp-tag { position: absolute; top: 12px; font-size: 12px; background: rgba(0,0,0,.55); color: #fff; padding: 3px 9px; border-radius: 999px; pointer-events: none; }
.cmp-tag.l { left: 12px; } .cmp-tag.r { right: 12px; }
.cmp-veil { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.cmp-veil[hidden] { display: none; }

.verdict { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--text-2); min-height: 28px; }
.verdict b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.v-more { font-size: 13px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.wait { background: var(--surface-2); color: var(--text-2); }

/* Controls */
.studio-controls { display: grid; gap: 18px; }
.ctl { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px 16px; margin: 0; min-width: 0; }
.ctl legend, .ctl .legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); padding: 0 4px; }
.ctl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.tone-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.tone { display: grid; justify-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; cursor: pointer; border-radius: 10px; min-width: 0; }
.tone-dot { display: inline-block; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.tone-name { font-size: 11px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tone[aria-pressed="true"] .tone-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.tone[aria-pressed="true"] .tone-name { color: var(--text); font-weight: 600; }
@media (max-width: 520px) {
  .tone-row { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 10px; }
}
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hint { font-size: 13px; color: var(--text-2); }

.layer { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.layer:first-child { border-top: 0; }
.layer.off .swatches, .layer.off .chips { opacity: .45; }
.layer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.layer-prod { color: var(--text-2); }
.layer-shade { margin-left: auto; color: var(--text-2); font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; min-width: 70px; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.prod-select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; max-width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 6px; }
.sw { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.sw.best::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.chip-btn { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Sections */
.band { padding-top: 56px; padding-bottom: 24px; }
.section-head { max-width: 70ch; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-head p:not(.eyebrow) { color: var(--text-2); margin: 12px 0 0; }

/* Pipeline stages */
.stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .stages { grid-template-columns: 1fr; } }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stage-img { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.stage-img canvas { width: 100%; height: 100%; display: block; }
.stage h3 { font-size: 18px; display: flex; gap: 8px; align-items: baseline; }
.stage h3 span { font-family: Inter, sans-serif; font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent); border-radius: 999px; width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; transform: translateY(-2px); }
.stage-what { font-size: 13px; color: var(--text-2); margin: 0; }
.stage-num { font-size: 13px; margin: auto 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.stage-gates, .stage-outcome { aspect-ratio: 4 / 5; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.gate { border-radius: 10px; padding: 10px; background: var(--surface-2); border-left: 4px solid var(--line); }
.gate.ok { border-left-color: var(--ok); }
.gate.warn { border-left-color: var(--warn); }
.gate.bad { border-left-color: var(--bad); }
.gate-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.gate-name { font-weight: 600; }
.gate-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.gate-rule { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.outcome { border-radius: 12px; padding: 18px 14px; display: grid; gap: 4px; text-align: center; height: 100%; align-content: center; }
.outcome strong { font-family: Fraunces, Georgia, serif; font-size: 26px; }
.outcome span { font-size: 13px; }
.outcome code { font-size: 11px; opacity: .75; }
.outcome.ok { background: var(--ok-bg); color: var(--ok); }
.outcome.warn { background: var(--warn-bg); color: var(--warn); }
.outcome.bad { background: var(--bad-bg); color: var(--bad); }
.outcome.wait { background: var(--surface-2); color: var(--text-2); }

/* Shades */
.shade-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; color: var(--text-2); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.shade-summary { min-height: 1.5em; color: var(--text-2); font-size: 14px; margin: 0 0 14px; }
.shade-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .shade-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .shade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shade-card { margin: 0; min-width: 0; }
.shade-img { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.shade-img canvas, .shade-img img { width: 100%; height: 100%; display: block; }
a.shade-img { display: block; }
.shade-img img { object-fit: cover; object-position: 50% 0; }
.hair-meta { margin: 2px 0 0; font-size: 12px; color: var(--text-2); }
.shade-status { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; }
.shade-status.ok { background: var(--ok); color: #fff; }
.shade-status.warn { background: var(--warn); color: #fff; }
.shade-status.bad { background: var(--bad); color: #fff; }
.shade-card figcaption { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-top: 6px; }
.shade-card .tone-dot { width: 14px; height: 14px; }
.shade-dist { margin-left: auto; font-weight: 400; color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.table-wrap { overflow-x: auto; margin-top: 24px; }
.results { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.results caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
.results th, .results td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.results thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; }
.results tbody th { font-weight: 600; white-space: nowrap; }
.results .tone-dot { width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; }

/* Integrate */
.integrate { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .integrate { grid-template-columns: 1fr; } }
.code-card { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); overflow: hidden; }
.code-head { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #b9ab99; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-head .link-btn { color: #f08a4b; }
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.facts li { padding-left: 16px; border-left: 3px solid var(--accent); color: var(--text-2); }
.facts strong { color: var(--text); }
.store-cta { margin: 28px 0 8px; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; font-size: 13px; color: var(--text-2); }
.foot p { max-width: 90ch; }
