:root {
  --ink: #171714;
  --paper: #f3efe7;
  --panel: #fbfaf6;
  --accent: #f05a2a;
  --line: #cbc4b7;
  --muted: #706c64;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(#504a40 .55px, transparent .55px);
  background-size: 5px 5px;
}

.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.brand { color: inherit; display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 11px; letter-spacing: .08em; }
.prototype-badge { border: 1px solid var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

.hero { padding: 92px 0 66px; max-width: 940px; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 28px; font-family: Georgia, serif; font-size: clamp(50px, 7.6vw, 104px); font-weight: 400; line-height: .92; letter-spacing: -.065em; }
h1 em { color: var(--accent); font-weight: 400; }
.hero-copy { max-width: 590px; color: var(--muted); font-size: 18px; line-height: 1.55; }

.search-panel { border: 1px solid var(--ink); background: var(--panel); box-shadow: 8px 8px 0 var(--ink); }
.panel-heading { display: flex; gap: 22px; padding: 25px 28px; border-bottom: 1px solid var(--ink); }
.panel-heading > span { color: var(--accent); font: 700 12px/1 Arial; }
.panel-heading h2 { margin-bottom: 5px; font: 400 28px/1 Georgia, serif; }
.panel-heading p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
form { padding: 28px; }

.upload-zone { position: relative; display: grid; min-height: 310px; place-items: center; overflow: hidden; cursor: pointer; border: 1px dashed #857e72; background: #ede8de; }
.upload-zone:hover { border-color: var(--accent); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
#image-preview { display: none; width: 100%; height: 310px; object-fit: contain; }
.upload-prompt { display: flex; align-items: center; flex-direction: column; gap: 7px; text-align: center; }
.upload-prompt.with-preview { position: absolute; right: 14px; bottom: 14px; padding: 10px 14px; align-items: flex-start; background: var(--ink); color: white; }
.upload-prompt.with-preview .upload-icon, .upload-prompt.with-preview small { display: none; }
.upload-prompt.with-preview strong { font-size: 12px; }
.upload-icon { display: grid; width: 48px; height: 48px; margin-bottom: 5px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-size: 24px; }
.upload-prompt small { color: var(--muted); }
.filter-note { margin: 20px 0 -4px; padding: 13px 15px; border-left: 3px solid var(--accent); background: #f7e6da; color: var(--muted); font-size: 13px; line-height: 1.45; }
.filter-note strong { color: var(--ink); }

.fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.fields label > span { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
select { width: 100%; height: 48px; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); font: inherit; }
.search-button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border: 0; background: var(--accent); color: white; cursor: pointer; font-size: 15px; font-weight: 800; }
.search-button:hover { background: #d9471d; }
.search-button:disabled { cursor: wait; opacity: .75; }
.form-error { margin: 12px 0 0; color: #a0210a; }
.spinner { width: 16px; height: 16px; border: 2px solid #ffffff70; border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.results-section { padding: 96px 0 30px; scroll-margin-top: 20px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; border-bottom: 1px solid var(--ink); }
.results-heading h2 { margin-bottom: 20px; font: 400 clamp(38px, 6vw, 68px)/1 Georgia, serif; letter-spacing: -.04em; }
.results-heading > p { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.product-card { border: 1px solid var(--line); background: var(--panel); transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--ink); }
.product-card-link { display: grid; grid-template-columns: 44% 1fr; min-height: 240px; color: inherit; text-decoration: none; }
.product-card-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.product-image { position: relative; display: grid; place-items: center; background: #e8e3d9; }
.catalog-image { width: 100%; height: 100%; min-height: 240px; object-fit: contain; }
.rank { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 800; }
.garment-shape { width: 105px; height: 120px; background: var(--garment-color); clip-path: polygon(22% 5%, 39% 0, 50% 9%, 61% 0, 78% 5%, 100% 25%, 83% 39%, 74% 31%, 78% 100%, 22% 100%, 26% 31%, 17% 39%, 0 25%); filter: drop-shadow(0 8px 7px #0002); }
.product-info { display: flex; flex-direction: column; padding: 22px; }
.score-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.score-row strong { color: var(--accent); }
.product-info h3 { margin: auto 0 8px; font: 400 24px/1.08 Georgia, serif; }
.product-info > p { color: var(--muted); font-size: 13px; }
.view-product { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.feedback-actions { min-height: 51px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.feedback-question { margin-right: auto; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.feedback-button { padding: 7px 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 700; }
.feedback-button:hover:not(:disabled) { border-color: var(--ink); }
.feedback-button.is-selected { border-color: var(--accent); background: var(--accent); color: white; }
.feedback-button:disabled:not(.is-selected) { opacity: .4; }
.feedback-status { min-width: 42px; color: var(--muted); font-size: 10px; }
.load-more-button { width: 100%; display: flex; justify-content: space-between; margin-top: 28px; padding: 18px 20px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 800; }
.load-more-button:hover { background: var(--ink); color: var(--paper); }
.load-more-button[hidden] { display: none; }

.product-page { padding-top: 38px; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--ink); font-size: 13px; font-weight: 800; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.product-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); border: 1px solid var(--ink); background: var(--panel); box-shadow: 8px 8px 0 var(--ink); }
.product-detail-image { min-height: 650px; display: grid; place-items: center; background: #e8e3d9; border-right: 1px solid var(--ink); }
.product-detail-image img { width: 100%; height: 100%; max-height: 720px; object-fit: contain; }
.garment-shape-large { width: 230px; height: 270px; }
.product-detail-copy { padding: clamp(30px, 5vw, 68px); }
.product-detail-copy h1 { margin-bottom: 26px; font-size: clamp(42px, 5.4vw, 76px); line-height: .98; }
.detail-intro { max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.product-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 36px 0; border-top: 1px solid var(--line); }
.product-facts div { padding: 17px 0; border-bottom: 1px solid var(--line); }
.product-facts div:nth-child(odd) { padding-right: 18px; }
.product-facts div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.product-facts dt { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.product-facts dd { margin: 0; font: 400 18px/1.2 Georgia, serif; }
.retailer-button { width: 100%; padding: 18px 20px; border: 0; background: var(--ink); color: white; font-size: 14px; font-weight: 800; opacity: .45; }

footer { display: flex; justify-content: space-between; margin-top: 80px; padding: 28px 0 38px; border-top: 1px solid var(--ink); color: var(--muted); font-size: 12px; }
footer span:first-child { color: var(--ink); font-weight: 800; }
.footer-brand { display: flex; gap: 22px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

.information-page { padding-top: 38px; }
.information-page-narrow { max-width: 920px; }
.information-hero { max-width: 1040px; padding: 34px 0 68px; }
.information-hero h1 { font-size: clamp(48px, 7vw, 92px); }
.information-hero > p:last-child { max-width: 700px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.legal-hero { padding-bottom: 42px; border-bottom: 1px solid var(--ink); }
.information-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.information-grid section { min-height: 270px; padding: 34px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--panel); }
.information-grid section > span { color: var(--accent); font-size: 11px; font-weight: 800; }
.information-grid h2, .legal-copy h2 { margin: 55px 0 14px; font: 400 30px/1.1 Georgia, serif; }
.information-grid p, .legal-copy p { margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.faq-list { border-top: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--ink); }
.faq-list summary { position: relative; padding: 24px 48px 24px 0; cursor: pointer; list-style: none; font: 400 24px/1.25 Georgia, serif; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 4px; top: 22px; color: var(--accent); font: 400 28px/1 Arial, sans-serif; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 720px; margin-bottom: 26px; color: var(--muted); line-height: 1.65; }
.legal-copy { counter-reset: legal-section; }
.legal-copy section { position: relative; padding: 34px 0 34px 82px; border-bottom: 1px solid var(--line); counter-increment: legal-section; }
.legal-copy section::before { content: counter(legal-section, decimal-leading-zero); position: absolute; left: 0; top: 42px; color: var(--accent); font-size: 11px; font-weight: 800; }
.legal-copy h2 { margin: 0 0 13px; }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .hero { padding: 64px 0 46px; }
  h1 { font-size: clamp(47px, 14vw, 74px); }
  form, .panel-heading { padding: 20px; }
  .fields { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .results-heading { align-items: start; flex-direction: column; }
  .product-card-link { min-height: 210px; }
  .catalog-image { min-height: 210px; }
  .product-detail { grid-template-columns: 1fr; }
  .product-detail-image { min-height: 430px; border-right: 0; border-bottom: 1px solid var(--ink); }
  footer { gap: 24px; flex-direction: column; }
  .footer-brand { align-items: flex-start; flex-direction: column; gap: 8px; }
  .footer-links { flex-wrap: wrap; }
  .information-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .fields { grid-template-columns: 1fr; }
  .product-card-link { grid-template-columns: 40% 1fr; }
  .product-info { padding: 16px; }
  .feedback-actions { align-items: stretch; flex-wrap: wrap; }
  .feedback-question { width: 100%; }
  .garment-shape { transform: scale(.78); }
  .product-facts { grid-template-columns: 1fr; }
  .product-facts div:nth-child(odd), .product-facts div:nth-child(even) { padding: 15px 0; border-left: 0; }
  .legal-copy section { padding-left: 44px; }
}
