:root {
  --ink: #231815;
  --muted: #6e625a;
  --paper: #fbf7f1;
  --card: #ffffff;
  --line: #e7ded3;
  --ember: #c9401a;
  --ember-dark: #a8330f;
  --flame: #f08a24;
  --char: #17110f;
  --char-2: #241a16;
  --radius: 6px;
  --head: "Cinzel", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--ember); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(34px, 6vw, 60px); }
h2 { font-size: clamp(26px, 3.6vw, 38px); }
h3 { font-size: 18px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ember); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; border-radius: 3px; border: 1px solid transparent; font: 600 15px/1.2 var(--body); text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn-primary { background: var(--ember); color: #fff; }
.btn-primary:hover { background: var(--ember-dark); }
.btn-dark { background: var(--char); color: #fff; }
.btn-dark:hover { background: var(--ember); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn:focus-visible, input:focus-visible, .swatch:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 76px; }
.brand img { height: 64px; width: auto; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--ember); }

/* hero */
.hero { background: radial-gradient(120% 90% at 85% 0%, #3a1a0e 0%, var(--char) 55%); color: #f6eee6; padding: 88px 0 96px; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero .lede { max-width: 60ch; font-size: 18px; color: #e3d5c8; margin: 0 0 30px; }
.hero .eyebrow { color: var(--flame); }

/* configurator */
.configurator { padding: 72px 0; }
.config-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: start; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.step h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--char); color: #fff; font: 600 13px/1 var(--body); flex: none; }
.help { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.msg { margin: 10px 0 0; font-size: 14px; }
.msg:empty { display: none; }
.msg.warn { color: #8a4b06; background: #fff4e0; border-radius: 4px; padding: 10px 12px; }
.msg.error { color: #9b1c1c; background: #fdeaea; border-radius: 4px; padding: 10px 12px; }
.msg .linkish { background: none; border: 0; padding: 0; color: var(--ember); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 18px; border: 2px dashed #d3c4b4; border-radius: var(--radius); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.drag { border-color: var(--ember); background: #fff8f2; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-title { font-weight: 600; }
.dz-hint { font-size: 13px; color: var(--muted); }

.crop-box { position: relative; background: #2a2320; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
#crop-canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }

.size-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.size-row label { flex: 1; font-size: 13px; font-weight: 600; color: var(--muted); }
.times { padding-bottom: 12px; color: var(--muted); }
.unit-input { display: flex; align-items: center; margin-top: 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.unit-input input { width: 100%; min-width: 0; border: 0; padding: 11px 12px; font: 500 17px var(--body); color: var(--ink); background: transparent; border-radius: 4px; }
.unit-input span { padding: 0 12px; color: var(--muted); font-weight: 500; }

.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.swatch { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; border: 2px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; text-align: left; font: 500 13px/1.25 var(--body); color: var(--ink); }
.swatch .chip { height: 46px; border-radius: 3px; background-size: cover; background-position: center; }
.swatch[aria-checked="true"] { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember); }
.frame-desc { margin: 14px 0 0; font-size: 14px; color: var(--muted); min-height: 2.8em; }

.viewer-col { min-width: 0; }
.viewer-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
model-viewer { width: 100%; height: min(520px, 62vh); background: linear-gradient(#f3ede6, #e9e1d7); border-radius: 4px; --poster-color: transparent; }
.ar-btn { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.viewer-loading { display: none; }
.sample-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary .k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.summary .v { display: block; font-weight: 600; font-size: 15px; }
.ar-note { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.quote-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* fire */
.fire { background: var(--char); color: #eadfd4; padding: 80px 0; }
.fire h2 { color: #fff; }
.fire .eyebrow { color: var(--flame); }
.fire-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.fire p { max-width: 62ch; }
.fire strong { color: #fff; }
.fire-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.fire-steps li { padding: 18px 20px; background: var(--char-2); border-left: 3px solid var(--flame); border-radius: 3px; }
.fire-steps span { display: block; font-family: var(--head); font-size: 19px; color: #fff; margin-bottom: 2px; }

/* frames */
.frames { padding: 80px 0; }
.section-lede { max-width: 62ch; color: var(--muted); margin: 0 0 30px; }
.frame-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.frame-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.frame-card .tex { height: 120px; background-size: cover; background-position: center; }
.frame-card .body { padding: 16px 18px 20px; }
.frame-card h3 { margin-bottom: 6px; }
.frame-card p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.frame-card button { background: none; border: 0; padding: 0; color: var(--ember); font: 600 14px var(--body); cursor: pointer; }

/* how */
.how { padding: 0 0 80px; }
.how-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.how-steps li { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.how-steps .num { margin-bottom: 12px; background: var(--ember); }
.how-steps p { margin: 0; color: var(--muted); font-size: 15px; }

/* footer */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 56px 0; }
.footer-inner { display: flex; gap: 36px; align-items: center; }
.footer-logo { width: 150px; height: auto; flex: none; }
.small { font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .config-grid, .fire-inner { grid-template-columns: 1fr; }
  .viewer-col { position: static; }
  model-viewer { height: 380px; }
  .frame-cards, .how-steps { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .header-inner { height: 64px; }
  .brand img { height: 52px; }
  .hero { padding: 56px 0 64px; }
  .configurator, .frames, .fire { padding: 48px 0; }
  .step { padding: 18px 16px; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frame-cards, .how-steps { grid-template-columns: 1fr; }
  model-viewer { height: 340px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

.configurator h2 + .section-lede { margin-bottom: 24px; }
.frame-pick { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.frame-pick h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.frame-pick .frame-desc { min-height: 0; margin-top: 10px; }

/* hero with live 3D frame */
.hero { padding: 64px 0 72px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-outline-light { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }
.hero-stage { position: relative; margin: 0; }
.hero-stage::before { content: ""; position: absolute; inset: 6% 8% 18%; background: radial-gradient(closest-side, rgba(240,138,36,.32), rgba(201,64,26,.12) 55%, transparent 75%); filter: blur(10px); pointer-events: none; }
#hero-viewer { position: relative; height: min(520px, 58vh); background: transparent; }
.hero-chips { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.hero-chips button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.04); color: #e3d5c8; font: 500 13px var(--body); cursor: pointer; }
.hero-chips button .dot { width: 18px; height: 18px; border-radius: 50%; background-size: cover; background-position: center; border: 1px solid rgba(255,255,255,.25); }
.hero-chips button[aria-checked="true"] { border-color: var(--flame); color: #fff; background: rgba(240,138,36,.14); }
.hero-caption { position: relative; margin-top: 12px; text-align: center; font-size: 13px; color: #b9a89a; }

/* compare mode */
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pick-head h3 { margin: 0; }
.mode-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; padding: 2px; background: #f6f1ea; }
.mode-toggle button { border: 0; background: transparent; padding: 6px 12px; border-radius: 3px; font: 600 13px var(--body); color: var(--muted); cursor: pointer; }
.mode-toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.swatch .tick { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--ember); color: #fff; font: 700 12px/20px var(--body); text-align: center; display: none; }
.swatch[aria-checked="true"] .tick { display: block; }
.single .swatch .tick { display: none !important; }
.swatch[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.hs-label { padding: 3px 9px; border-radius: 3px; background: rgba(23,17,15,.82); color: #fff; font: 600 12px var(--body); white-space: nowrap; transform: translateY(14px); pointer-events: none; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 12px; }
  #hero-viewer { height: 360px; }
}
@media (max-width: 560px) {
  .hero { padding: 40px 0 48px; }
  #hero-viewer { height: 300px; }
}
@media (max-width: 560px) { .hs-label { font-size: 11px; padding: 2px 6px; } }

/* "Done" buttons between steps */
.step-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.step-actions.next-only { justify-content: flex-end; margin-top: 14px; }
#step-size, #step-frame, #viewer { scroll-margin-top: 90px; }
@media (max-width: 560px) {
  .step-actions .btn-primary { flex: 1 1 100%; }
  #step-size, #step-frame, #viewer { scroll-margin-top: 76px; }
}

.weight-note { margin: 8px 0 14px; font-size: 12px; color: var(--muted); }

/* hero: bracket markers */
.bracket-spot { position: relative; width: 30px; height: 30px; padding: 0; border: 2px solid var(--flame); border-radius: 50%; background: rgba(240,138,36,.08); box-shadow: 0 0 0 0 rgba(240,138,36,.7); animation: bracket-pulse 2s ease-out infinite; cursor: zoom-in; }
@keyframes bracket-pulse { 0% { box-shadow: 0 0 0 0 rgba(240,138,36,.7); } 70% { box-shadow: 0 0 0 12px rgba(240,138,36,0); } 100% { box-shadow: 0 0 0 0 rgba(240,138,36,0); } }
.bracket-label { position: absolute; right: -4px; top: 36px; display: block; width: 190px; padding: 6px 10px; border-radius: 4px; background: rgba(23,17,15,.9); border: 1px solid rgba(240,138,36,.6); color: #fff; font: 600 12px/1.3 var(--body); white-space: normal; text-align: left; pointer-events: none; }
.bracket-label small { display: block; font-weight: 400; color: #d9c8b9; }
@media (prefers-reduced-motion: reduce) { .bracket-spot { animation: none; } }
.bracket-spot:hover, .bracket-spot:focus-visible { background: rgba(240,138,36,.25); outline: none; }
#hero-viewer.zoomed .bracket-spot, #hero-viewer.from-back .bracket-spot { opacity: 0; pointer-events: none; }
.hero-back { position: absolute; top: 12px; left: 12px; background: rgba(23,17,15,.85); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.hero-back:hover { border-color: var(--flame); }
.hero-back[hidden] { display: none; }
.hero-hint { position: relative; margin: 4px 0 0; text-align: center; font-size: 12px; color: #9c8b7d; }
@media (pointer: coarse) { .hero-hint { font-size: 0; } .hero-hint::after { content: "Pinch to zoom. Tap a ring to look closer at a bracket."; font-size: 12px; } }
