/* Ring Studio: customer-facing showcase. Builds on the tokens in app.css. */
[hidden] { display: none !important; }   /* component display rules must never un-hide */
body.studio { background: var(--bg); }
/* pictures are part of the controls: they can't be dragged off or selected like page content */
body.studio img, .card-btn, .tile { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
body.studio img { -webkit-touch-callout: none; }
.showcase-note { font-size: 12px; text-align: center; padding: 6px 12px; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--ink); }
.studio-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo svg { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn { display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.theme-btn svg { width: 16px; height: 16px; }
.total-pill { font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }

/* landing */
.landing { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { color: var(--quiet); max-width: 560px; margin: 0 auto; font-size: 16px; }
.landing h2 { margin-top: 32px; }
.section-note { color: var(--quiet); margin: -4px 0 12px; }
.style-filter { margin-bottom: 16px; }
.preset-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.card-btn { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-btn:hover, .card-btn:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.08); outline: none; }
.card-btn .pic { aspect-ratio: 1 / 1; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel) 70%); }
.card-btn .pic img { width: 88%; height: 88%; object-fit: contain; }
.card-btn .pic.loading { animation: pulse 1.4s ease-in-out infinite; }
/* card picture: the 3D view above, the top and side views below (one image, 2:3) */
.card-btn .pic.card-pic { aspect-ratio: 2 / 3; position: relative; background: var(--panel); }
.card-btn .pic.card-pic img { width: 100%; height: 100%; object-fit: contain; }
/* live 3D on the cards: one shared canvas over the page draws into each card's 3D area */
.showcase-canvas { position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10;
  will-change: transform; }
/* the 3D area shows a quiet placeholder until the live ring is ready (no swap from a picture);
   the card picture's own 3D view is shown only where live 3D can't run */
.card-btn .pic .live3d { position: absolute; left: 0; top: 0; width: 100%; height: 66.67%; background: var(--panel); }
.card-btn .pic .live3d::after { content: ""; position: absolute; left: 30%; top: 25%; width: 40%; height: 50%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  animation: pulse 1.4s ease-in-out infinite; }
.card-btn .pic .live3d.live::after { display: none; }
.card-btn .pic .live3d.fallback { display: none; }
.view-labels { position: absolute; inset: 0; pointer-events: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--quiet); text-transform: uppercase; }
.view-labels span { position: absolute; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 80%, transparent); }
.view-labels span:nth-child(1) { top: 8px; left: 8px; }
.view-labels span:nth-child(2) { top: calc(66.7% + 4px); left: 8px; }
.view-labels span:nth-child(3) { top: calc(66.7% + 4px); left: calc(50% + 8px); }
.card-btn .txt { padding: 10px 14px 14px; }
.card-btn .txt strong { display: block; font-size: 16px; }
.card-btn .txt span { color: var(--quiet); font-size: 13px; }

/* designer layout */
.designer { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; align-items: start; }
.stage { position: sticky; top: 72px; }
.stage-box { position: relative; aspect-ratio: 1 / 1; max-height: calc(100vh - 190px); width: 100%; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, var(--stage-a), var(--stage-b) 75%); border: 1px solid var(--line); }
.viewer3d { position: absolute; inset: 0; touch-action: none; }
.view-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6%; touch-action: pan-y; }
.busy { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.view-tabs { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.view-tabs button { border-radius: 999px; padding: 6px 14px; }
.view-tabs button[aria-selected=true] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.stage-hint { text-align: center; color: var(--quiet); font-size: 12px; margin: 8px 0 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 18px; min-width: 0; }
.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.stepper button { flex: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.stepper button .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); font-size: 11px; font-weight: 700; }
.stepper button[aria-current=step] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.stepper button[aria-current=step] .n, .stepper button.done .n { background: var(--accent); color: var(--accent-ink); }
.step { min-height: 320px; outline: none; }
.step h2 { font-size: 20px; margin: 10px 0 2px; }
.step .lead { color: var(--quiet); margin: 0 0 12px; font-size: 14px; }
.step h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--quiet); margin: 18px 0 8px; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* pickers */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 104px), 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-align: center; font-size: 13px; line-height: 1.25; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.tile[aria-checked=true] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.tile[aria-checked=true]::after { content: "✓"; position: absolute; top: 4px; right: 7px; font-size: 12px; font-weight: 700; color: var(--accent); }
.tile:focus-visible, .chip:focus-visible, .card-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile .price { font-size: 12px; color: var(--quiet); }
.tile .price.add { color: var(--accent); font-weight: 600; }
.tile img.art { width: 56px; height: 56px; object-fit: contain; }
.tile img.art { filter: var(--art-filter); }
.tile.wide { flex-direction: row; text-align: left; gap: 12px; padding: 10px 12px; }
.tile.wide .meta { display: flex; flex-direction: column; gap: 2px; }
.tile .font-img { height: 30px; max-width: 100%; object-fit: contain; }
.tile .font-img { filter: var(--art-filter); }
.tile svg.icon { width: 48px; height: 48px; flex: none; }

.swatch { width: 52px; height: 52px; border-radius: 50%; box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.2); }
.gem { width: 46px; height: 46px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 2px 5px rgba(0,0,0,.2); }
.finish-swatch { width: 64px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; letter-spacing: .05em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; padding: 6px 12px; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 14px; min-width: 52px; }
.chip[aria-checked=true], .chip[aria-pressed=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); font-weight: 600; }

.field { margin-top: 6px; }
.field input[type=text] { font-size: 16px; padding: 10px 12px; letter-spacing: .02em; }
.field .counter { font-size: 12px; color: var(--quiet); text-align: right; margin-top: 3px; }
.field .counter.over { color: var(--bad); }
.picker-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.picker-tools input[type=search] { flex: 1 1 160px; font: inherit; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.upload-tile input { display: none; }
.note { font-size: 13px; color: var(--quiet); margin: 8px 0 0; }
.warn-box { font-size: 13px; color: var(--warn); margin-top: 10px; }

/* summary */
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-list li span:first-child { color: var(--quiet); }
.quote { width: 100%; margin-top: 12px; font-size: 14px; }
.quote td:last-child, .quote th:last-child { text-align: right; }
.quote tr.total th { font-size: 16px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.summary-views { width: 100%; border-radius: 12px; background: var(--bg); margin-top: 12px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cta .primary { font-size: 16px; padding: 10px 22px; }
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); max-width: min(560px, 92vw); }
dialog pre { max-height: 50vh; overflow: auto; background: var(--bg); padding: 10px; border-radius: 8px; font-size: 12px; }
dialog::backdrop { background: rgba(0,0,0,.4); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .spinner, .card-btn .pic.loading { animation: none; } .card-btn { transition: none; } }

/* phones and small tablets: ring on top, steps below */
@media (max-width: 900px) {
  .designer { grid-template-columns: 1fr; padding: 12px 12px 40px; gap: 14px; }
  .stage { position: static; }
  .stage-box { aspect-ratio: auto; height: min(52vh, 420px); max-height: none; }
  .studio-top { padding: 10px 14px; }
  .panel { padding: 12px; }
}
@media (max-width: 420px) {
  .tiles { --tile: 92px; gap: 8px; }
  .tile { padding: 8px 6px; }
}
