/* "See it in your home". Loads after site.css and reuses its tokens. */

.viz { display: flex; flex-direction: column; }
.viz-intro { display: flex; flex-direction: column; gap: 10px; padding-block: 44px 28px; }
.viz-intro :is(h1, h2) { font-size: var(--text-display-l); letter-spacing: -.035em; line-height: .95; }
.viz-intro p { max-width: 52ch; font-size: var(--text-body); line-height: 1.55; color: var(--muted); }

/* Stage on the left (about two thirds), picker on the right. Stacks below about 1140px. */
.viz-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px 40px; padding-bottom: 72px; }
.viz-stage-col { flex: 2 1 720px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.viz-panel { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* The room photo sets the stage size; the painting is positioned in % of it, so it scales with the photo. */
.viz-pieces { position: absolute; inset: 0; }
.viz-stage { position: relative; overflow: hidden; border-radius: var(--radius-media); background: var(--mat); }
.viz-stage > img { width: 100%; height: auto; aspect-ratio: 1800 / 1195; transition: opacity 250ms ease; }
.viz-stage > img.is-loading { opacity: .6; }
/* One piece per painting on the wall, each positioned in % of the photograph
   so the whole hang scales with it. */
.viz-piece { position: absolute; transition: width 400ms ease, left 400ms ease, bottom 400ms ease; }
.viz-canvas { position: relative; overflow: hidden; background: linear-gradient(160deg, #eee9df, #e2dacb); }
.viz-light { position: absolute; inset: 0; mix-blend-mode: multiply; pointer-events: none; }
.viz-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Choosing the hang: a diagram of the wall, one block per painting. */
.viz-hangs { display: flex; flex-wrap: wrap; gap: 8px; }
.viz-option-hang { flex: 1 1 108px; align-items: center; gap: 10px; padding: 10px 8px 12px; text-align: center; }
.viz-option-hang .viz-option-name { font-size: var(--text-small); padding: 0; }
.viz-shape { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 46px; height: 30px; }
.viz-shape-row { display: flex; justify-content: center; gap: 3px; flex: 1 1 0; }
.viz-shape-row span { flex: 1 1 0; max-width: 18px; background: var(--line-strong); border-radius: 1px; }
.viz-option-hang[aria-pressed="true"] .viz-shape-row span { background: var(--ink); }

/* The order a painting was chosen in, so a group can be rearranged on sight. */
.viz-badge { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 4px; border-radius: 999px;
  background: var(--ink); color: var(--bone); font-size: 11px; font-weight: 600; }
.viz-work-thumb { position: relative; }

.viz-summary { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.viz-summary .what { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.viz-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.viz-name { font-family: var(--display); font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.viz-meta { font-size: var(--text-ui); color: var(--muted); }
.viz-note { padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* Step tabs */
.viz-tabs { display: flex; flex-wrap: wrap; gap: 0 28px; border-bottom: 1px solid var(--line); }
.viz-tab { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 0 10px; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: var(--text-ui); font-weight: 600; }
.viz-tab:hover { color: var(--ink); }
.viz-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.viz-body { display: flex; flex-direction: column; gap: 16px; }
.viz-step { font-family: var(--display); font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.viz-hint { font-size: var(--text-ui); color: var(--muted); margin-top: -8px; }
.viz-grid { display: grid; gap: 12px; }
.viz-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.viz-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Option cards: unselected = 1px hairline ring, selected = 2px ink ring (aria-pressed drives it). */
.viz-option { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border: none; border-radius: var(--radius-card); background: var(--white); box-shadow: inset 0 0 0 1px var(--line); text-align: left; color: var(--ink); transition: box-shadow 150ms ease; }
.viz-option:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.viz-option[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.viz-option-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; }
.viz-option-text { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.viz-option-name { padding: 0 4px; font-size: var(--text-ui); font-weight: 600; line-height: 1.3; }
.viz-option-text .viz-option-name { padding: 0; }
.viz-option-note { font-size: var(--text-small); line-height: 1.35; color: var(--muted); }
.viz-option-work { padding: 6px 6px 10px; }
.viz-option-work .viz-option-name { font-size: var(--text-small); }
.viz-work-thumb { display: block; width: 100%; aspect-ratio: 1 / 1; background: var(--mat); overflow: hidden; }
.viz-work-thumb img { width: 100%; height: 100%; object-fit: contain; }
.viz-option-frame { flex-direction: row; align-items: center; gap: 14px; min-height: 84px; padding: 10px 12px; }
.viz-frame-swatch { flex: 0 0 56px; width: 56px; height: 64px; }
.viz-frame-swatch > span { display: block; width: 100%; height: 100%; }
.viz-frame-swatch > span > span { display: block; width: 100%; height: 100%; background: #ded7c9; }

.viz-next, .viz-panel .button { align-self: flex-start; }
.viz-panel .button[hidden] { display: none; }

@media (max-width: 760px) {
  /* On a phone the stage and the picker cannot both be on screen, so the wall
     stays put while the options scroll under it. display: contents lifts the
     stage, the summary and the note out of their column so the picker can sit
     directly beneath the photograph and the two readable parts follow. */
  .viz-stage-col { display: contents; }
  .viz-layout { flex-direction: column; gap: 20px; }
  .viz-stage { position: sticky; top: 0; z-index: 1; order: 1; box-shadow: 0 10px 20px -18px rgba(23, 21, 27, .55); }
  .viz-panel { order: 2; }
  .viz-summary { order: 3; }
  .viz-note { order: 4; }
}
@media (max-width: 480px) {
  .viz-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viz-tab { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .viz-art, .viz-stage > img, .viz-option { transition: none; }
}
