:root {
  color-scheme: light;
  --canvas: #ffffff;
  --paper: #f7f8f6;
  --ink: #17352d;
  --muted: #485950;
  --accent: #8c2c41;
  --line: #dfe4df;
  --soft: #edf4ef;
  --soft-line: #d8e4db;
  --body: "Instrument Sans", "Inter", system-ui, sans-serif;
  --display: "Instrument Serif", "Baskervville", Georgia, serif;
  font-family: var(--body);
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
p, h1, h2, h3, ol, ul { margin: 0; }
button, select { font: inherit; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.wrap { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 12px 16px;
  transform: translateY(-150%);
  background: var(--paper);
}
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid #e7e2d6; }
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.brand-logo {
  position: relative;
  flex: 0 0 auto;
  width: clamp(124px, 21vw, 168px);
  aspect-ratio: 996 / 201;
  overflow: hidden;
}
.brand-logo img {
  position: absolute;
  inset: 50% auto auto 50%;
  /* The original image has a 102 px transparent border on each side. */
  width: calc(100% * 1200 / 996);
  height: auto;
  transform: translate(-50%, -50%);
}
.header-content p { color: var(--muted); font-size: 0.85rem; font-weight: 550; }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 0.83fr;
  align-items: stretch;
  min-height: 288px;
  margin-top: 32px;
  overflow: hidden;
  border: 1px solid #e5dfd2;
  border-radius: 20px;
  background: #faf5ed;
}
.hero-copy {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(30px, 5.4vw, 68px);
}
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 6.35vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.hero h1 em { color: var(--accent); font-weight: inherit; }
.hero p { max-width: 37ch; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 320px;
  object-fit: cover;
  object-position: center 48%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}
.card {
  min-width: 0;
  min-height: 307px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.controls { padding: clamp(22px, 3vw, 34px); background: var(--paper); }
.card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.18rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.controls h2 { margin-bottom: 22px; }
#stain-form { display: grid; gap: 16px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field label { display: flex; align-items: center; gap: 7px; font-size: 0.87rem; font-weight: 720; }
.field-number {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.7rem;
}
select {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  border: 1px solid #b5beb0;
  border-radius: 9px;
  padding: 0.62em 2em 0.62em 0.75em;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2317352d' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65em center;
  cursor: pointer;
}
select:invalid { color: var(--muted); }
select option { color: var(--ink); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 15px; margin-top: 3px; }
button {
  min-height: 46px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--canvas);
  background: var(--ink);
  font-weight: 720;
  font-size: 0.88rem;
  cursor: pointer;
}
button span { margin-left: 0.45em; }
button:hover { background: #285145; }
button.reset { padding-inline: 4px; background: transparent; color: var(--muted); font-weight: 600; }
button.reset:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.22em; }

.results { background: var(--soft); border-color: var(--soft-line); }
.results:has(.result-placeholder:not([hidden])) { display: grid; align-self: stretch; }
.result-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 305px;
  padding: 22px;
  text-align: center;
}
.result-placeholder svg { color: #527365; margin-bottom: 3px; }
.result-placeholder p, .context { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.result-content { padding: clamp(23px, 3vw, 34px); }
.result-content h2 { scroll-margin-top: 20px; }
.context { margin-top: 4px; }
.result-content h3 { margin: 20px 0 8px; font-size: 0.9rem; font-weight: 760; }
.result-content ol { display: grid; gap: 9px; padding-left: 1.35em; font-size: 0.94rem; line-height: 1.55; }
.result-content ol li { padding-left: 0.25em; }
.result-content ol li::marker { color: var(--accent); font-weight: 720; }
.product-section ul { display: grid; gap: 7px; padding: 0; list-style: none; }
.product-section li {
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.4;
}
.product-section li span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.79rem; }
.note { margin-top: 17px; padding-top: 12px; border-top: 1px solid #cbd4c7; font-size: 0.85rem; line-height: 1.55; }

.care-tip {
  display: flex;
  align-items: start;
  gap: 10px;
  margin-top: 20px;
  padding: 13px 16px;
  border: 1px solid #e7e2d6;
  border-radius: 10px;
  background: #fbf9f4;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}
.care-tip strong { color: var(--ink); }
.info-icon {
  display: grid;
  flex: 0 0 18px;
  place-items: center;
  height: 18px;
  margin-top: 1px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 750;
}

.sources { margin: 15px 0 25px; color: var(--muted); font-size: 0.86rem; }
.sources summary { display: list-item; width: fit-content; padding: 8px 2px; cursor: pointer; }
.sources ul { display: grid; gap: 8px; padding: 7px 0 0 23px; }
.sources a:hover { color: var(--accent); }
.site-footer { padding: 19px 0 24px; border-top: 1px solid #e7e2d6; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.075em; }

@media (max-width: 1080px) {
  .field-pair { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .hero h1 { font-size: clamp(2.7rem, 7.7vw, 4.8rem); }
  .card, .result-placeholder { min-height: 348px; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .header-content { min-height: 59px; }
  .header-content p { font-size: 0.76rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; margin-top: 17px; border-radius: 15px; }
  .hero-copy { padding: 28px 22px 23px; gap: 11px; }
  .hero h1 { font-size: clamp(2.7rem, 10.2vw, 4rem); }
  .hero p { font-size: 0.94rem; }
  .hero-image { height: clamp(105px, 26vw, 162px); object-position: center 50%; }
  .workspace { grid-template-columns: 1fr; margin-top: 14px; }
  .card { min-height: 0; border-radius: 14px; }
  .result-placeholder { min-height: 170px; }
  .field-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  select { font-size: 1rem; }
}

@media (max-width: 540px) {
  .field-pair { grid-template-columns: 1fr; }
}
