:root {
  color-scheme: light;
  --ink: #21150f;
  --muted: #75695e;
  --paper: #fffdf8;
  --cream: #f4ecde;
  --line: #dbcdbb;
  --cocoa: #3b2116;
  --gold: #b27a22;
  --shadow: 0 16px 45px rgba(55, 32, 21, .1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 20; padding: .75rem 1rem; color: white; background: var(--cocoa); border-radius: .5rem; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header {
  min-height: 21rem;
  padding: clamp(2rem, 7vw, 5.5rem) max(1.25rem, calc((100vw - 1240px) / 2));
  color: white;
  background:
    radial-gradient(circle at 82% 18%, rgba(217, 158, 60, .27), transparent 28rem),
    linear-gradient(135deg, #21110c 0%, #3c2116 58%, #20100b 100%);
  display: grid;
  align-content: center;
  gap: 1.4rem;
}
.brand-lockup { display: flex; align-items: center; gap: 1.2rem; }
.brand-lockup img { width: clamp(4.8rem, 9vw, 7rem); height: clamp(4.8rem, 9vw, 7rem); object-fit: contain; filter: brightness(0) invert(1); }
.brand-lockup div { display: grid; gap: .4rem; }
.brand-lockup span { color: #ddb367; font-size: clamp(.65rem, 1.5vw, .82rem); font-weight: 800; letter-spacing: .2em; }
.brand-lockup strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 8vw, 6.3rem); font-weight: 400; line-height: .9; letter-spacing: -.045em; }
.site-header > p { max-width: 43rem; margin: 0; color: #e6d9ca; font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.6; }

main { width: min(1240px, calc(100% - 2.5rem)); margin: 0 auto; padding: 0 0 5rem; }
.photo-match-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin: -2.5rem 0 1rem; padding: 1.35rem 1.5rem; border: 1px solid #c99b50; border-radius: 1.2rem; background: linear-gradient(115deg, #fffaf0, #f2e1c7); box-shadow: var(--shadow); }
.photo-match-card > div { display: grid; gap: .35rem; }
.eyebrow { color: var(--gold); font-size: .67rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.photo-match-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 400; }
.photo-match-card p { margin: 0; color: #66574b; line-height: 1.45; }
.primary-action, .secondary-action, .text-action { border-radius: .75rem; padding: .85rem 1rem; font-weight: 850; cursor: pointer; }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; flex: 0 0 auto; border: 1px solid var(--cocoa); color: white; background: var(--cocoa); box-shadow: 0 7px 18px rgba(59, 33, 22, .16); }
.primary-action:hover { background: #24130d; }
.primary-action span { font-size: 1.4rem; line-height: .7; }
.secondary-action { border: 1px solid #c9b79f; background: white; }
.secondary-action:hover { border-color: var(--gold); }
.text-action { border: 0; color: var(--gold); background: transparent; }
.guide-tools { position: sticky; top: 0; z-index: 8; margin: -2.5rem 0 1rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: 1.2rem; background: rgba(255, 253, 248, .96); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.photo-match-card + .guide-tools { margin-top: 0; }
.search-box { position: relative; display: grid; gap: .45rem; }
.search-box > span { font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.search-box input { width: 100%; padding: .95rem 3rem .95rem 1rem; border: 1px solid #cdbda8; border-radius: .8rem; color: var(--ink); background: white; outline: none; }
.search-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(178, 122, 34, .18); }
.search-box button { position: absolute; right: .55rem; bottom: .35rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: transparent; font-size: 1.5rem; cursor: pointer; }
.search-box button[hidden] { display: none; }
.filter-row { display: flex; gap: .5rem; margin-top: .8rem; overflow-x: auto; scrollbar-width: thin; padding-bottom: .1rem; }
.filter-row.secondary { padding-top: .7rem; border-top: 1px solid #eadfce; }
.filter-chip { flex: 0 0 auto; padding: .58rem .82rem; border: 1px solid #d9cbb9; border-radius: 999px; background: white; font-size: .78rem; font-weight: 750; cursor: pointer; }
.filter-chip:hover { border-color: var(--gold); }
.filter-chip.active { color: white; border-color: var(--cocoa); background: var(--cocoa); }
.filter-row.secondary .filter-chip.active { border-color: var(--gold); background: var(--gold); }

.guide-status { min-height: 3.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .15rem; }
.guide-status strong { color: var(--muted); font-size: .86rem; }
.guide-status button, .empty-state button { border: 0; border-bottom: 1px solid currentColor; padding: .25rem 0; color: var(--gold); background: transparent; font-weight: 800; cursor: pointer; }
.collection-section { margin: 2.2rem 0 4rem; }
.collection-section > header { display: flex; align-items: center; gap: .8rem; margin: 0 0 1.1rem; }
.collection-section > header span { display: grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .45rem; color: white; background: var(--gold); border-radius: 999px; font-size: .72rem; font-weight: 900; }
.collection-section h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 4vw, 2.7rem); font-weight: 400; }
.bonbon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.bonbon-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: 0 4px 20px rgba(55, 32, 21, .05); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.bonbon-card:hover { transform: translateY(-3px); border-color: #c99b50; box-shadow: 0 13px 33px rgba(55, 32, 21, .12); }
.bonbon-card:focus-visible { outline: 3px solid rgba(178, 122, 34, .38); outline-offset: 3px; }
.bonbon-photo { aspect-ratio: 1.25; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 50% 43%, #fff 0, #faf6ed 55%, #efe4d3 100%); }
.bonbon-photo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 13px 10px rgba(48, 26, 16, .17)); transition: transform .2s ease; }
.bonbon-card:hover img { transform: scale(1.035); }
.bonbon-copy { min-height: 8.2rem; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; padding: .9rem 1rem 1rem; border-top: 1px solid #eee3d3; }
.bonbon-copy small { color: var(--gold); font-size: .61rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.bonbon-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; line-height: 1.08; }
.bonbon-tags { display: flex; flex-wrap: wrap; gap: .28rem; margin-top: auto; }
.bonbon-tags span { padding: .24rem .45rem; border-radius: 999px; color: #6a584a; background: #f1e9dc; font-size: .64rem; font-weight: 700; }

.empty-state { margin: 3rem 0; padding: 4rem 1.5rem; border: 1px dashed #ccbba3; border-radius: 1rem; text-align: center; background: #faf5ec; }
.empty-state strong { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.empty-state p { color: var(--muted); }
.allergen-note { margin: 1rem 0 0; padding: 1.2rem 1.35rem; border-left: 4px solid var(--gold); background: var(--cream); }
.allergen-note strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.allergen-note p { margin: .4rem 0 0; color: #65584d; font-size: .86rem; line-height: 1.6; }

dialog { width: min(860px, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; overflow: hidden; border: 0; border-radius: 1.2rem; color: var(--ink); background: white; box-shadow: 0 30px 100px rgba(18, 9, 5, .45); }
dialog::backdrop { background: rgba(27, 14, 9, .72); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: .65rem; right: .65rem; z-index: 2; width: 2.7rem; height: 2.7rem; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; color: white; background: rgba(37, 21, 15, .72); font-size: 1.6rem; cursor: pointer; }
dialog [data-dialog-content] { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 31rem; }
.dialog-photo { display: grid; place-items: center; min-height: 31rem; padding: 2rem; background: radial-gradient(circle, #fff 0, #f6eddf 65%, #e8d8c3 100%); }
.dialog-photo img { width: 100%; height: 100%; max-height: 27rem; object-fit: contain; filter: drop-shadow(0 20px 18px rgba(48, 26, 16, .22)); }
.dialog-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .8rem; padding: 2.25rem; }
.dialog-copy > span { color: var(--gold); font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.dialog-copy h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 400; line-height: .97; }
.dialog-copy p { margin: .2rem 0 1rem; color: #58483d; font-size: 1.05rem; text-transform: capitalize; }
.dialog-copy small { color: var(--muted); line-height: 1.55; }

.matcher-dialog { width: min(940px, calc(100% - 1.5rem)); overflow-y: auto; }
.matcher-shell { min-height: min(650px, calc(100dvh - 1.5rem)); display: flex; flex-direction: column; padding: clamp(1.3rem, 4vw, 2.4rem); }
.matcher-shell > header { padding-right: 3.2rem; }
.matcher-shell > header h2 { margin: .25rem 0 .55rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 400; line-height: 1; }
.matcher-shell > header p { max-width: 43rem; margin: 0; color: var(--muted); line-height: 1.55; }
.matcher-upload { margin: 1.5rem 0; }
.photo-picker { min-height: 19rem; display: grid; place-items: center; align-content: center; gap: .55rem; padding: 2rem; border: 2px dashed #c8ae87; border-radius: 1.1rem; background: #faf5ec; text-align: center; cursor: pointer; }
.photo-picker:hover { border-color: var(--gold); background: #fff9ee; }
.photo-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.camera-mark { display: grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%; color: white; background: var(--cocoa); font-size: 2.6rem; line-height: 1; }
.photo-picker strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 400; }
.photo-picker small { color: var(--muted); }
.photo-review { display: grid; grid-template-columns: minmax(250px, .9fr) 1.1fr; gap: 1.4rem; align-items: center; margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 1.1rem; background: #faf6ee; }
.photo-preview { min-height: 21rem; display: grid; place-items: center; overflow: hidden; border-radius: .8rem; background: #eae0d1; }
.photo-preview img { width: 100%; height: 21rem; object-fit: contain; }
.photo-review-copy { padding: .5rem; }
.photo-review-copy > strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 400; }
.photo-review-copy > p { color: var(--muted); line-height: 1.5; }
.matcher-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.matcher-progress, .matcher-error { min-height: 20rem; display: grid; place-items: center; align-content: center; gap: .5rem; margin: 1.5rem 0; padding: 2rem; border-radius: 1.1rem; background: #faf5ec; text-align: center; }
.matcher-progress strong, .matcher-error strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 400; }
.matcher-progress p, .matcher-error p { margin: 0; color: var(--muted); }
.spinner { width: 3rem; height: 3rem; margin-bottom: .6rem; border: 4px solid #e4d6c3; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.matcher-results { margin: 1.5rem 0; }
.matcher-results > header h3 { margin: .2rem 0 .35rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 400; }
.matcher-results > header p { margin: 0; color: var(--muted); line-height: 1.5; }
.match-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.match-card { position: relative; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: white; text-align: left; cursor: pointer; }
.match-card:hover { border-color: var(--gold); box-shadow: 0 10px 25px rgba(55, 32, 21, .1); }
.match-rank { position: absolute; top: .55rem; left: .55rem; z-index: 1; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; color: white; background: var(--cocoa); font-size: .75rem; font-weight: 900; }
.match-photo { aspect-ratio: 1.2; display: grid; place-items: center; padding: .7rem; background: #f7efe3; }
.match-photo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 9px 8px rgba(48, 26, 16, .15)); }
.match-copy { min-height: 8.5rem; display: flex; flex-direction: column; gap: .3rem; padding: .8rem; }
.match-copy small { color: var(--gold); font-size: .58rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.match-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; }
.match-copy > span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.match-copy .match-chocolate { color: #6a584a; font-weight: 800; }
.match-copy .match-reason { margin-top: auto; }
.matcher-error { border: 1px solid #dfb9a9; background: #fff5f0; }
.matcher-privacy { margin-top: auto; padding-top: .9rem; border-top: 1px solid #eee3d3; color: var(--muted); font-size: .73rem; text-align: center; }

footer { display: grid; place-items: center; gap: .35rem; padding: 2.8rem 1.5rem; color: #d8c4ae; background: #20110c; text-align: center; }
footer strong { color: white; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; font-weight: 400; }
footer span { font-size: .75rem; letter-spacing: .04em; }
.matcher-shell > footer.matcher-privacy { display: block; padding: .9rem 0 0; color: var(--muted); background: transparent; font-size: .73rem; letter-spacing: 0; text-align: center; }

@media (max-width: 700px) {
  .site-header { min-height: 18rem; padding-bottom: 4rem; }
  .brand-lockup { align-items: flex-start; }
  .brand-lockup img { width: 4.2rem; height: 4.2rem; }
  main { width: min(100% - 1rem, 1240px); }
  .photo-match-card { align-items: stretch; flex-direction: column; gap: 1rem; margin-top: -2.7rem; padding: 1rem; }
  .photo-match-card .primary-action { width: 100%; }
  .guide-tools { top: .35rem; margin-top: -2.7rem; padding: .8rem; border-radius: .95rem; }
  .search-box input { font-size: 16px; }
  .filter-row { margin-right: -.8rem; padding-right: .8rem; }
  .bonbon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .bonbon-photo { aspect-ratio: 1.08; padding: .55rem; }
  .bonbon-copy { min-height: 7.1rem; padding: .75rem; }
  .bonbon-copy strong { font-size: 1.05rem; }
  .bonbon-copy small { font-size: .55rem; }
  .collection-section { margin: 1.5rem 0 2.6rem; }
  dialog { overflow-y: auto; }
  dialog [data-dialog-content] { grid-template-columns: 1fr; }
  .dialog-photo { min-height: 18rem; height: 46dvh; }
  .dialog-copy { padding: 1.4rem 1.4rem 2rem; }
  .matcher-shell { padding: 1.1rem; }
  .matcher-shell > header { padding-right: 2.4rem; }
  .photo-picker { min-height: 14rem; padding: 1.2rem; }
  .photo-review { grid-template-columns: 1fr; }
  .photo-preview, .photo-preview img { min-height: 15rem; height: 38dvh; }
  .matcher-actions { display: grid; grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
  .match-card { display: grid; grid-template-columns: 8rem 1fr; }
  .match-photo { aspect-ratio: 1; }
  .match-copy { min-height: 8rem; }
}

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