:root {
  color-scheme: light;
  --bg: #f7f3eb;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #23201c;
  --muted: #756d63;
  --soft: #ebe2d4;
  --line: #ded2c0;
  --accent: #c7893f;
  --accent-dark: #8f5a21;
  --sage: #667860;
  --sage-soft: #eef3ea;
  --rose: #a85d4f;
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(45, 34, 22, 0.06) 0 10px 28px, rgba(45, 34, 22, 0.08) 0 18px 48px;
  --radius-sm: 12px;
  --radius: 22px;
  --radius-lg: 34px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 0%, rgba(199, 137, 63, 0.14), transparent 34%),
    linear-gradient(180deg, #fbf6ed 0%, #f7f3eb 46%, #fffdf8 100%);
  color: var(--ink);
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, select, input { border: 1px solid var(--line); border-radius: var(--radius-sm); }

button, .button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(35, 32, 28, 0.14); }
button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; box-shadow: none; }
.button.primary, .qr-modal-trigger { background: var(--accent-dark); }
.button.secondary, .text-button { border: 1px solid rgba(35, 32, 28, 0.14); background: rgba(255, 255, 255, 0.72); color: var(--ink); }

select, input { width: 100%; min-height: 46px; padding: 11px 13px; background: #fff; color: var(--ink); outline: none; }
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(199, 137, 63, 0.32); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 18px; font-size: clamp(44px, 7vw, 86px); line-height: 0.95; letter-spacing: -0.075em; }
h2 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 48px); line-height: 1.02; letter-spacing: -0.055em; }
h3 { margin-bottom: 8px; font-size: 20px; letter-spacing: -0.03em; }
.eyebrow { margin-bottom: 10px; color: var(--accent-dark); font-size: 12px; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid rgba(222, 210, 192, 0.78);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; letter-spacing: -0.04em; }
.brand strong, .brand small { display: block; }
.brand strong { line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; }
nav { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 750; }
nav a { border-radius: 999px; padding: 8px 12px; }
nav a:hover { background: rgba(255,255,255,.68); color: var(--ink); }

main { padding: clamp(18px, 4vw, 46px); }
.page { display: grid; gap: clamp(22px, 4vw, 44px); }

.store-hero, .store-collection, .store-story, .product-flow, .qr-modal-card {
  min-width: 0;
  border: 1px solid rgba(222, 210, 192, 0.82);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
}

.store-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(310px, 0.98fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: stretch;
  min-height: 640px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,253,248,.96), rgba(241,231,213,.72));
}
.store-hero-copy { align-self: center; padding: clamp(30px, 6vw, 76px); }
.hero-lede { max-width: 680px; margin-bottom: 28px; color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.45; letter-spacing: -0.02em; }
.hero-actions, .hero-points { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions { margin-bottom: 28px; }
.hero-points span, .source-pill { border: 1px solid rgba(199,137,63,.22); border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.64); color: #6b573e; font-size: 13px; font-weight: 750; }
.hero-showcase { display: grid; grid-template-rows: minmax(360px,1fr) auto; min-width: 0; margin: clamp(16px, 2vw, 26px); overflow: hidden; border-radius: 30px; background: #efe4d3; box-shadow: 0 24px 70px rgba(71,55,35,.12); }
.hero-showcase img { width: 100%; height: 100%; object-fit: cover; }
.showcase-caption { display: grid; gap: 4px; padding: 18px 20px; background: rgba(255,253,248,.94); }
.showcase-caption span { color: var(--muted); }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 14px; }
.section-heading > div { max-width: 820px; }
.store-collection, .store-story, .product-flow { padding: clamp(22px, 4vw, 42px); }
.store-collection p, .store-story p, .product-flow p, .field-note { color: var(--muted); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.product-card { display: grid; min-height: 100%; padding: 0; overflow: hidden; border: 1px solid rgba(222,210,192,.88); border-radius: var(--radius); background: #fff; color: var(--ink); text-align: left; box-shadow: none; }
.product-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.product-card strong, .product-card span, .product-card small { margin-inline: 20px; }
.product-card strong { margin-top: 18px; font-size: 22px; letter-spacing: -0.04em; }
.product-card span { color: var(--muted); }
.product-card small { margin-bottom: 20px; color: var(--accent-dark); font-weight: 800; }

.story-grid, .mounting-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.story-grid article, .mounting-steps article, .note-grid div, .trust-grid div, .variant-detail, .included-product, .checkout-summary div {
  border: 1px solid rgba(222,210,192,.82);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.66);
}
.story-grid span { display: inline-grid; width: 34px; height: 34px; place-items: center; margin-bottom: 18px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font-size: 12px; font-weight: 900; }

.product-page { max-width: 1180px; margin: 0 auto; }
.product-flow { display: grid; gap: 20px; }
.product-hero { grid-template-columns: 1fr; padding: 0; overflow: hidden; }
.product-media-card { background: #efe4d3; }
.product-media-card img { width: 100%; max-height: 640px; object-fit: cover; }
.product-main-copy { padding: clamp(24px, 5vw, 54px); }

.note-grid, .trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.note-grid span, .trust-grid span, .variant-detail span, .included-product span, .checkout-summary dt { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.note-grid strong, .trust-grid strong, .variant-detail strong, .included-product strong, .checkout-summary dd { margin: 0; font-weight: 850; letter-spacing: -0.02em; }
.variant-detail { gap: 10px; }

form { display: grid; gap: 18px; }
fieldset { display: grid; gap: 14px; margin: 0; padding: 18px; border: 1px solid rgba(222,210,192,.82); border-radius: var(--radius); background: rgba(255,255,255,.58); }
legend { padding: 0 8px; color: var(--accent-dark); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
label { display: grid; gap: 7px; color: var(--ink); font-weight: 750; }
.checkbox-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(222,210,192,.86);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.checkbox-card input { width: 20px; min-height: 20px; margin-top: 3px; accent-color: var(--accent-dark); }
.checkbox-card span { display: grid; gap: 3px; }
.checkbox-card small { color: var(--muted); font-weight: 600; line-height: 1.35; }
.wifi-fields { display: grid; gap: 14px; }
.qr-modal-trigger { width: fit-content; }
.segmented, .swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.segment, .swatch { min-height: 40px; border: 1px solid rgba(222,210,192,.88); background: #fff; color: var(--ink); }
.segment.is-active, .swatch.is-active { background: var(--ink); color: #fff; }
.swatch-chip { width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 999px; }

.mounting-visual-grid { display: grid; gap: 18px; }
.mounting-figure { margin: 0; overflow: hidden; border: 1px solid rgba(222,210,192,.82); border-radius: var(--radius); background: rgba(255,255,255,.72); }
.mounting-figure img { width: 100%; background: #efe4d3; }
.mounting-figure figcaption { padding: 14px 18px 18px; color: var(--muted); font-size: 14px; }
.mounting-icon { display: inline-grid; width: 44px; height: 44px; place-items: center; margin-bottom: 14px; border-radius: 16px; background: var(--sage-soft); color: var(--sage); font-size: 22px; font-weight: 900; }
.validation-status, .qr-preview-status { margin: 0; border-radius: 16px; padding: 12px 14px; background: var(--sage-soft); color: var(--sage); font-weight: 750; }
.validation-status.invalid, .qr-preview-status.invalid { background: #fff0eb; color: var(--rose); }
.checkout-summary { display: grid; gap: 10px; margin: 18px 0; }
.shopify-panel.warning { border-color: rgba(199,137,63,.45); }
.shopify-panel.configured { border-color: rgba(102,120,96,.45); }
.shopify-panel ul { margin: 18px 0 0; padding-left: 20px; color: var(--muted); }
pre { max-height: 360px; overflow: auto; border-radius: 16px; padding: 16px; background: #201c18; color: #f8ead8; font-size: 12px; }

.qr-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.qr-modal[hidden] { display: none !important; }
.qr-modal-backdrop { position: absolute; inset: 0; background: rgba(31, 25, 18, 0.46); backdrop-filter: blur(10px); }
.qr-modal-card { position: relative; z-index: 1; width: min(680px, 100%); padding: clamp(22px, 4vw, 34px); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 999px; padding: 0; background: rgba(35,32,28,.08); color: var(--ink); font-size: 24px; }
.qr-modal-heading-row { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; padding-right: 40px; }
.qr-info-icon { position: relative; display: grid; width: 58px; height: 58px; place-items: center; border-radius: 20px; background: var(--surface-strong); border: 1px solid var(--line); color: var(--ink); }
.wifi-arc { position: absolute; border: 3px solid var(--ink); border-bottom: 0; border-left-color: transparent; border-right-color: transparent; border-radius: 999px 999px 0 0; }
.arc-1 { width: 34px; height: 17px; top: 14px; }
.arc-2 { width: 22px; height: 11px; top: 24px; }
.wifi-dot { position: absolute; width: 7px; height: 7px; border-radius: 999px; background: var(--ink); bottom: 18px; }
.qr-info-icon small { position: absolute; right: 8px; bottom: 6px; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 999px; background: var(--accent-dark); color: #fff; font-size: 11px; font-weight: 900; }
.qr-preview-frame { display: grid; min-height: 330px; margin-top: 18px; place-items: center; border: 1px solid rgba(222,210,192,.9); border-radius: 28px; background: linear-gradient(135deg, #fff 0%, #fbf6ed 100%); }
.qr-preview-stack { position: relative; display: grid; place-items: center; width: min(100%, 330px); min-height: 280px; }
#qr-preview-svg { display: grid; place-items: center; width: 100%; min-height: 280px; }
#qr-preview-svg svg { width: min(100%, 270px); height: auto; border-radius: 16px; background: #fff; box-shadow: 0 18px 42px rgba(35,32,28,.12); }
.qr-preview-center-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 3px solid #111;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 6px #fff, 0 10px 24px rgba(35,32,28,.16);
  pointer-events: none;
}
.qr-preview-center-icon .arc-1 { top: 18px; }
.qr-preview-center-icon .arc-2 { top: 29px; }
.qr-preview-center-icon .wifi-dot { bottom: 20px; }
.qr-empty { max-width: 230px; color: var(--muted); text-align: center; }

@media (max-width: 980px) {
  .store-hero, .story-grid, .mounting-steps { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  main { padding-inline: 14px; }
  .store-hero { min-height: auto; }
  .hero-showcase { grid-template-rows: minmax(240px, 1fr) auto; }
  .store-hero-copy, .product-main-copy, .store-collection, .store-story, .product-flow, .qr-modal-card { padding: 22px; }
  .qr-modal { padding: 12px; }
  .qr-modal-heading-row { grid-template-columns: 1fr; padding-right: 34px; }
}
