:root {
  color-scheme: light;
  --ink: #343437;
  --muted: #68696b;
  --line: #e2e2df;
  --paper: #ffffff;
  --soft: #f4f3f1;
  --burgundy: #891a3a;
  --charcoal: #343437;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button, a { font: inherit; }
a { color: inherit; }

.visualizer-shell { min-height: 100vh; }

.site-header {
  min-height: 82px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { position: relative; display: flex; align-items: flex-end; gap: 3px; width: 39px; height: 28px; overflow: hidden; }
.brand-mark i { display: block; height: 23px; width: 8px; background: var(--burgundy); transform: skew(-34deg); }
.brand-mark i:last-child { height: 17px; background: #68696b; transform: skew(34deg); margin-left: 1px; }
.brand-name { display: flex; flex-direction: column; font-size: 16px; letter-spacing: .18em; font-weight: 700; line-height: 1.15; }
.brand-name span { margin-top: 4px; font-size: 9px; font-weight: 500; letter-spacing: .14em; color: var(--muted); }
.header-call { text-decoration: none; font-weight: 700; color: var(--ink); white-space: nowrap; }
.header-call:hover, .site-footer a:hover, .call-note a:hover { color: var(--burgundy); }

main { max-width: 1480px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 64px) 40px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 42px 0 25px; }
.eyebrow { margin: 0 0 10px; color: var(--burgundy); font-weight: 800; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.04em; line-height: 1.05; }
.intro-copy { margin: 0; max-width: 650px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.preview-label { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #55565a; font-size: 10px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #5d8468; }

.visualizer-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 20px; align-items: stretch; }
.viewer-card, .controls-card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 12px 36px rgba(20, 20, 23, .06); overflow: hidden; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 58px; padding: 0 19px; border-bottom: 1px solid var(--line); }
.toolbar-title { font-weight: 750; font-size: 14px; }
.view-actions { display: flex; align-items: center; gap: 11px; }
.drag-hint { color: var(--muted); font-size: 11px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 20px; cursor: pointer; }
.icon-button:hover { border-color: #9d9da0; background: var(--soft); }
.canvas-wrap { position: relative; min-height: 490px; height: min(60vw, 650px); background: radial-gradient(ellipse at 50% 42%, #fff 0%, #f5f5f3 63%, #e9e9e6 100%); }
#home-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.canvas-loader, .canvas-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 25px; text-align: center; color: var(--muted); background: #f5f5f3; }
.canvas-error { color: #8a2933; }
.fallback-preview { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; background: radial-gradient(ellipse at 50% 42%, #fff 0%, #f5f5f3 63%, #e9e9e6 100%); }
.fallback-preview[hidden] { display: none !important; }
.fallback-preview svg { display: block; width: 100%; height: calc(100% - 28px); max-width: 900px; }
.fallback-preview > p { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }
.canvas-caption { position: absolute; right: 14px; bottom: 13px; padding: 7px 10px; border-radius: 6px; background: rgba(255,255,255,.9); color: #595a5d; font-size: 10px; font-weight: 650; }
.viewer-footer { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12px; }
.text-button { border: 0; padding: 5px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--burgundy); text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.text-button:hover { color: var(--burgundy); }

.controls-card { padding: 25px 23px; }
.controls-heading h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.025em; }
.controls-heading > p:last-child { margin-bottom: 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.control-group { min-width: 0; margin: 0 0 21px; padding: 0; border: 0; }
.control-group legend { width: 100%; margin-bottom: 10px; font-size: 12px; font-weight: 750; }
.current-choice { float: right; color: var(--muted); font-weight: 500; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 9px; background: #f0f0ee; }
.segment { min-height: 37px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #55565a; font-size: 11px; font-weight: 650; cursor: pointer; }
.segment.is-active { border-color: #d7d7d4; background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.swatch-list { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 32px; height: 32px; border: 2px solid #fff; border-radius: 50%; outline: 1px solid #d1d1ce; cursor: pointer; }
.swatch:hover { transform: translateY(-1px); }
.swatch.is-active { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.swatch:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 3px; }
.sample-note { margin: 4px 0 18px; color: #67686b; font-size: 11px; line-height: 1.55; }
.accessory-accordion { margin: 3px 0 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfa; }
.accessory-accordion > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px; color: var(--ink); font-size: 12px; font-weight: 750; cursor: pointer; }
.accessory-accordion > summary span { color: var(--muted); font-size: 10px; font-weight: 600; }
.accessory-note { margin: 0; padding: 0 12px 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
#accessory-groups { max-height: 360px; overflow-y: auto; padding: 0 12px 12px; }
.accessory-group { padding: 10px 0; border-top: 1px solid var(--line); }
.accessory-group h3 { margin: 0 0 7px; color: #535458; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.accessory-option { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; color: #444549; font-size: 11px; line-height: 1.4; cursor: pointer; }
.accessory-option input { flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--charcoal); }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 27px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.save-row .text-button { font-size: 10px; }
.quote-button { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 17px; border-radius: 8px; background: var(--charcoal); color: #fff; text-decoration: none; font-size: 13px; font-weight: 750; transition: background .15s ease, transform .15s ease; }
.quote-button span { font-size: 20px; line-height: 1; }
.quote-button:hover { background: #242426; transform: translateY(-1px); }
.call-note { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.call-note a { color: var(--ink); font-weight: 750; text-decoration-color: var(--burgundy); text-underline-offset: 3px; }
.copy-status { min-height: 14px; margin: 9px 0 0; color: #52765d; text-align: center; font-size: 11px; }
.visualizer-disclaimer { display: flex; gap: 13px; align-items: flex-start; max-width: 900px; margin: 24px auto 0; color: #696a6d; font-size: 11px; line-height: 1.6; }
.visualizer-disclaimer p { margin: 0; }
.accent-rule { flex: 0 0 3px; min-height: 29px; border-radius: 4px; background: var(--burgundy); }
.site-footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px clamp(20px, 4vw, 64px); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer a { color: var(--ink); font-weight: 650; text-decoration: underline; text-decoration-color: var(--burgundy); text-underline-offset: 3px; }

@media (max-width: 900px) {
  .visualizer-layout { grid-template-columns: minmax(0, 1fr); }
  .canvas-wrap { height: min(78vw, 610px); min-height: 350px; }
  .controls-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 23px; }
  .controls-heading, .sample-note, .quote-button, .call-note, .copy-status { grid-column: 1 / -1; }
  .control-group { margin-bottom: 14px; }
}

@media (max-width: 560px) {
  .site-header { min-height: 68px; padding-inline: 16px; }
  .brand-mark { transform: scale(.86); transform-origin: left center; width: 33px; }
  .brand-name { font-size: 13px; letter-spacing: .14em; }
  .brand-name span { font-size: 7px; letter-spacing: .1em; }
  .header-call { font-size: 12px; }
  main { padding-inline: 14px; }
  .intro { align-items: flex-start; flex-direction: column; padding: 30px 2px 19px; }
  .preview-label { align-self: flex-start; }
  .viewer-toolbar { padding-inline: 13px; }
  .drag-hint { max-width: 130px; text-align: right; line-height: 1.35; }
  .canvas-wrap { min-height: 330px; height: 94vw; }
  .viewer-footer { align-items: flex-start; flex-direction: column; }
  .controls-card { display: block; padding: 22px 18px; }
  .site-footer { align-items: flex-start; flex-direction: column; padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
