:root {
  --ink: #11120f;
  --muted: #66685f;
  --paper: #f3f2ec;
  --panel: #ffffff;
  --line: #d9d8d0;
  --acid: #c8ff36;
  --acid-dark: #9fd900;
  --dark: #171914;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.site-header {
  height: 78px;
  padding: 0 clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; letter-spacing: .13em; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 8px); gap: 3px; transform: skew(-12deg); }
.brand-mark i { display: block; width: 8px; height: 23px; background: var(--ink); border-radius: 2px; }
.brand-mark i:nth-child(2) { height: 17px; margin-top: 6px; background: var(--acid-dark); }
.brand-mark i:nth-child(3) { height: 11px; margin-top: 12px; }
.status { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.status span { width: 7px; height: 7px; border-radius: 50%; background: #59c65b; box-shadow: 0 0 0 4px #59c65b1f; }

main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; }
.hero { padding: clamp(70px, 10vw, 132px) 0 62px; position: relative; }
.hero::after { content: "∆"; position: absolute; right: 2%; top: 22%; font-size: clamp(120px, 18vw, 250px); line-height: 1; color: transparent; -webkit-text-stroke: 1px #cfcec6; z-index: -1; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 700; margin-bottom: 25px; }
h1 { margin: 0; font-size: clamp(49px, 8vw, 104px); line-height: .91; letter-spacing: -.065em; font-weight: 780; max-width: 980px; }
h1 em { font-style: normal; color: var(--acid-dark); }
.intro { max-width: 620px; margin: 35px 0 0; font-size: clamp(17px, 2vw, 21px); line-height: 1.6; color: var(--muted); }

.matcher { background: var(--dark); color: white; border-radius: var(--radius); padding: clamp(25px, 5vw, 58px); box-shadow: 0 28px 70px #11120f18; }
.matcher-head, .results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.step { display: block; font-size: 11px; letter-spacing: .14em; color: #8b8e83; margin-bottom: 8px; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; line-height: 1.05; }
.source-pill { border: 1px solid #ffffff25; border-radius: 100px; padding: 9px 13px; color: #b9bcb1; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
.mode-tabs { display: flex; gap: 5px; margin: 45px 0 25px; border-bottom: 1px solid #ffffff20; }
.mode-tab { appearance: none; border: 0; background: transparent; color: #8f9289; padding: 12px 19px 16px; font-weight: 700; position: relative; }
.mode-tab.active { color: white; }
.mode-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--acid); }
.single-input-wrap label { display: block; font-size: 12px; color: #9ea196; margin-bottom: 9px; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
input { border: 1px solid #ffffff28; background: #ffffff0c; color: white; outline: none; border-radius: 13px; padding: 17px 18px; min-width: 0; }
input:focus { border-color: var(--acid); box-shadow: 0 0 0 3px #c8ff3617; }
input::placeholder { color: #777a71; }
.primary-button { border: 0; border-radius: 13px; background: var(--acid); color: #10110e; padding: 0 25px; min-height: 57px; font-weight: 800; }
.primary-button:hover { background: #d5ff65; }
.primary-button span { margin-left: 14px; font-size: 20px; }
.input-hint { color: #787b72; font-size: 12px; margin: 13px 0 0; }
.form-message { margin-top: 14px; padding: 13px 15px; border-radius: 10px; background: #ff6b6b22; color: #ffb1b1; font-size: 13px; }
.cmyk-fields { display: grid; grid-template-columns: repeat(4, minmax(75px, 1fr)) auto; gap: 12px; align-items: end; }
.cmyk-fields label { color: #a6a99f; font-size: 12px; font-weight: 700; }
.cmyk-fields input { display: block; width: 100%; margin-top: 8px; }

.results-section { padding: 100px 0; }
.results-head { align-items: end; }
.results-tools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
select { border: 1px solid var(--line); background: var(--panel); padding: 10px 34px 10px 12px; border-radius: 10px; color: var(--ink); }
.results-tools input { width: 175px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 10px 12px; border-radius: 10px; }
.target-summary { margin-top: 35px; border: 1px solid var(--line); border-radius: 16px; background: #ffffff78; padding: 15px; display: flex; align-items: center; gap: 15px; }
.target-swatch { width: 48px; height: 48px; border-radius: 11px; box-shadow: inset 0 0 0 1px #00000012; }
.target-summary span, .target-summary strong { display: block; }
.target-summary span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.target-summary strong { font-size: 15px; }
.method-note { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; }
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.result-count { margin-top: 18px; color: var(--muted); font-size: 12px; }
.result-card { background: var(--panel); border-radius: 17px; overflow: hidden; border: 1px solid #e3e2da; transition: transform .2s ease, box-shadow .2s ease; }
.result-card:hover { transform: translateY(-3px); box-shadow: 0 16px 35px #11120f12; }
.product-photo { height: 205px; background: #e9e8e1; position: relative; overflow: hidden; box-shadow: inset 0 -1px #00000012; }
.product-photo::after { content: ""; position: absolute; inset: auto 0 0; height: 7px; background: var(--acid); box-shadow: 0 -1px #00000018; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank { position: absolute; left: 13px; top: 13px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #ffffffde; color: #151611; font-size: 11px; font-weight: 800; backdrop-filter: blur(8px); }
.photo-label { position: absolute; right: 13px; top: 13px; border-radius: 100px; padding: 7px 9px; background: #10110ed9; color: white; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.film-swatch { position: absolute; right: 14px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; border: 5px solid white; box-shadow: 0 8px 24px #0003; }
.result-body { padding: 19px; }
.result-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.brand-name { display: block; color: #787b72; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; }
.result-title h3 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.result-code { font-size: 12px; color: var(--muted); margin-top: 4px; }
.reference-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.reference-badges span { border-radius: 999px; background: #eef4dc; color: #556c16; padding: 4px 7px; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.match-score { text-align: right; white-space: nowrap; }
.match-score strong, .match-score span { display: block; }
.match-score strong { font-size: 24px; line-height: 1; }
.match-score span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.match-bar { appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 10px; overflow: hidden; background: #ecebe5; margin-top: 17px; }
.match-bar::-webkit-progress-bar { background: #ecebe5; border-radius: 10px; }
.match-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--acid-dark), var(--acid)); border-radius: 10px; }
.match-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--acid-dark), var(--acid)); border-radius: 10px; }
.quality-row { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 10px; color: var(--muted); }
.quality-row strong { color: var(--ink); }
.color-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #ecebe5; }
.color-meta div { min-width: 0; }
.color-meta span, .color-meta strong { display: block; }
.color-meta span { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: #96988f; margin-bottom: 4px; }
.color-meta strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-link { display: flex; justify-content: space-between; align-items: center; margin-top: 17px; padding-top: 14px; border-top: 1px solid #ecebe5; color: var(--ink); font-size: 11px; font-weight: 750; text-decoration: none; }
.shop-link:hover { color: #6d9900; }
.shop-link span { font-size: 15px; }
.shop-link.secondary { margin-top: 10px; padding-top: 10px; color: #6c6f66; }
.load-more { display: block; margin: 28px auto 0; border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 13px 22px; font-weight: 800; }
.load-more[hidden] { display: none; }
.load-more:hover { background: var(--ink); color: white; }
.empty-state { grid-column: 1 / -1; padding: 55px 25px; border: 1px dashed #c8c7be; border-radius: 16px; text-align: center; color: var(--muted); }

.explain { border-top: 1px solid var(--line); padding: 90px 0 110px; }
.explain h2 { max-width: 650px; }
.explain-grid { margin-top: 50px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.explain article { border-top: 2px solid var(--ink); padding-top: 18px; }
.explain article strong { font-size: 16px; }
.explain article p { color: var(--muted); font-size: 14px; line-height: 1.65; }
footer { background: var(--dark); color: white; min-height: 150px; padding: 45px clamp(22px, 5vw, 76px); display: flex; justify-content: space-between; align-items: center; gap: 35px; }
footer strong, footer span { display: block; }
footer strong { letter-spacing: .12em; }
footer span { color: #777a70; margin-top: 7px; font-size: 12px; }
.footer-links { display: flex; gap: 25px; flex-wrap: wrap; }
.footer-links a { color: #b7baaf; font-size: 12px; text-decoration: none; }
.footer-links a:hover { color: var(--acid); }

@media (max-width: 820px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explain-grid { grid-template-columns: 1fr; }
  .cmyk-fields { grid-template-columns: repeat(2, 1fr); }
  .cmyk-fields .primary-button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .site-header { height: 68px; }
  .status { font-size: 0; }
  .status::after { content: "Beta"; font-size: 11px; }
  main { width: min(100% - 28px, 1180px); }
  .hero { padding-top: 66px; }
  .hero::after { display: none; }
  .matcher-head, .results-head { display: block; }
  .source-pill { display: inline-block; margin-top: 18px; white-space: normal; }
  .input-row { grid-template-columns: 1fr; }
  .primary-button { min-height: 54px; }
  .results-tools { margin-top: 22px; }
  .results-tools label { display: none; }
  .results-tools select, .results-tools input { flex: 1 1 45%; min-width: 0; width: auto; }
  .method-note { display: none; }
  .results-grid { grid-template-columns: 1fr; }
  .product-photo { height: 220px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
