/* v2 builder: "Configurator" on a light page. The box stands on a plinth in the one dark spotlight band:
   sticky at the top on phones, a dark panel on the left on desktop. The steps are on Paper; a light
   price bar sticks to the bottom. */

.config { position: relative; background: var(--paper); }

/* ------------------------------------------------------------------ the stage (dark) */
.stage-col { position: sticky; top: 0; z-index: 6; }
.stage {
  position: relative;
  height: 300px;
  display: flex; flex-direction: column;
  background-color: var(--night);
  background-image: radial-gradient(60% 80% at 50% 30%, rgba(255, 240, 215, .045), transparent 70%), var(--vignette), var(--texture);
  background-size: 100% 100%, 100% 100%, var(--texture-size);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 16px 26px -18px rgba(11, 9, 8, .7);
  overflow: hidden;
}
.spot { /* a cone of soft light from above, toned down so the near-black box never reads brown */
  position: absolute; left: 50%; top: -10%; width: 92%; height: 120%;
  transform: translateX(-50%);
  background: radial-gradient(46% 62% at 50% 0%, rgba(255, 244, 226, .11), rgba(255, 236, 205, .03) 55%, transparent 75%);
  pointer-events: none;
}
.stage-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 54px; flex: none;
  padding: 6px var(--gutter) 0;
}
.stage-cap { font-size: 14px; line-height: 1.3; color: var(--muted); min-width: 0; }
.stage-cap b { font-weight: 400; color: var(--head); font-size: 16px; margin-right: 6px; }
.view {
  display: flex; flex: none;
  padding: 3px;
  border-radius: 23px;
  background: rgba(7, 5, 5, .5);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.view button {
  -webkit-appearance: none; appearance: none; border: 0; background: none;
  min-height: 40px; padding: 0 14px; border-radius: 20px;
  font-size: 15px; color: var(--muted);
  transition: background-color var(--t-ui), color var(--t-ui), transform var(--t-micro) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.view button[aria-pressed="true"] { background: var(--kino); color: var(--paper); }
.view button:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .view button:not([aria-pressed="true"]):hover { color: var(--head); } }

/* the rig: the plinth is placed from the box's own frame, so the box always stands on it */
.rig { position: relative; width: min(72%, 290px); aspect-ratio: 5 / 4; margin: 0 auto; flex: none; }
.rig mg-box { position: relative; z-index: 1; }
/* measured: the closed box's front edge sits at 76-82% of the frame, its footprint reaches back to ~50% */
.plinth { position: absolute; left: -16%; width: 132%; top: 41%; z-index: 0; }
.plinth-top {
  position: relative; z-index: 1; display: block;
  aspect-ratio: 3.75 / 1; border-radius: 50%;
  background-color: #171412;
  background-image: radial-gradient(54% 64% at 50% 46%, rgba(255, 236, 205, .09) 0%, rgba(255, 236, 205, 0) 60%), radial-gradient(70% 90% at 50% 40%, #1C1917 0%, #151210 52%, #0E0C0A 100%);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, .2), inset 0 -2px 3px rgba(0, 0, 0, .35);
}
.plinth-face {
  display: block; margin-top: -13.3%; height: 170px;
  border-radius: 0 0 50% 50% / 0 0 50px 50px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(10, 8, 6, .55) 70%, rgba(10, 8, 6, .9) 100%),
    linear-gradient(90deg, #110E0C 0%, #13110F 22%, #1A1715 46%, #161311 60%, #0E0C0A 84%, #0E0C0A 100%);
  box-shadow: 0 30px 40px -10px rgba(0, 0, 0, .7);
}

/* ------------------------------------------------------------------ the panel (Paper) */
.panel { position: relative; padding: 0 var(--gutter); max-width: 620px; margin: 0 auto; }
.intro { padding: 26px 0 4px; }
.intro h1 { font-size: 32px; letter-spacing: -0.02em; line-height: 1.08; }
.intro .fine { margin-top: 8px; }
.example {
  margin: 0 0 18px; padding: 12px 14px;
  border-left: 2px solid var(--gold-ink);
  background: var(--ash);
  color: var(--text); font-size: 16px;
}
.example b { font-weight: 400; color: var(--head); display: block; }
.example a { color: var(--accent); }

.step { padding: 30px 0 34px; border-bottom: 1px solid var(--rule); scroll-margin-top: 316px; }
.step h2 { display: flex; align-items: center; gap: 12px; font-size: 27px; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 18px; }
.step-num { position: relative; flex: none; line-height: 0; }
.step-num img { display: block; width: auto; height: 22px; }
.step-num::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, rgba(255, 250, 232, 0) 36%, rgba(255, 251, 238, .95) 50%, rgba(255, 250, 232, 0) 64%) no-repeat;
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-mask: var(--num) center / contain no-repeat; mask: var(--num) center / contain no-repeat;
}
.step-num.lit::after { animation: sheen 1400ms var(--ease-inout) 150ms 1; }
.group { margin: 26px 0 0; padding: 0; border: 0; min-width: 0; }
.step > h2 + .group { margin-top: 0; }
.panel input, .panel textarea { scroll-margin-top: 330px; scroll-margin-bottom: 96px; }
fieldset.group > legend { padding: 0; margin-bottom: 10px; }
.group > .label { margin-bottom: 10px; }

.seg { max-width: none; }
.contents { margin-top: 16px; }
.contents p { color: var(--text); }
.contents ul { list-style: none; margin: 12px 0 0; padding: 0; columns: 2; column-gap: 18px; color: var(--muted); font-size: 16px; line-height: 1.35; }
.contents li { break-inside: avoid; padding: 3px 0 3px 14px; position: relative; }
.contents li::before { content: ""; position: absolute; left: 0; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: rgba(160, 122, 46, .5); }
.contents li.new { color: var(--head); }
.contents li.new::before { background: var(--gold-ink); }
.contents .key { margin-top: 8px; font-size: 14px; color: var(--muted); }
.contents .key i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-ink); margin-right: 8px; vertical-align: middle; }

/* sleeve chips (the chip itself is in foil.css, shared with the home page) */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }

.logo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-row .btn { min-height: 48px; padding: 0 16px; font-size: 16px; flex: 1 1 auto; }
.file-btn { cursor: pointer; }
input.sr:focus-visible + .btn, .file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.logo-status { min-height: 0; margin-top: 8px; color: var(--head); font-size: 16px; }
.logo-status:empty { display: none; }
.logo-status .link { margin-left: 8px; font-size: 15px; min-height: 32px; }
.seg-2 { grid-template-columns: repeat(2, 1fr); max-width: none; }
.seg-2 .seg-thumb { width: calc((100% - 8px) / 2); }
.seg-2 button { min-height: 48px; }
.count { text-align: right; margin-top: -2px; }

/* quantity */
.qty-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.qty-label { font-size: 17px; color: var(--muted); padding-bottom: 12px; }
.qty-n {
  -webkit-appearance: none; appearance: none; -moz-appearance: textfield;
  width: 5.2ch; min-height: 64px;
  padding: 0 8px; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0;
  background: transparent; color: var(--head);
  font-weight: 300; font-size: 54px; line-height: 1; letter-spacing: -0.02em; text-align: right;
}
.qty-n::-webkit-outer-spin-button, .qty-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-n:focus { outline: none; border-bottom-color: var(--gold-ink); }
.range-wrap { position: relative; margin-top: 18px; padding-bottom: 38px; }
.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; margin: 0; background: transparent;
  --fill: 50%;
}
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #A07A2E 0 var(--fill), rgba(11, 9, 8, .14) var(--fill) 100%);
}
.range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(11, 9, 8, .14); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: #A07A2E; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; margin-top: -13px; border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, #2A2522, #0B0908 70%);
  box-shadow: 0 0 0 1px rgba(11, 9, 8, .3), 0 6px 14px -4px rgba(11, 9, 8, .5), 0 0 0 6px rgba(160, 122, 46, .16);
  transition: transform 200ms var(--ease-settle), box-shadow 200ms var(--ease-out);
}
.range:active::-webkit-slider-thumb { transform: scale(1.22); box-shadow: 0 0 0 1px rgba(11, 9, 8, .3), 0 10px 18px -6px rgba(11, 9, 8, .5), 0 0 0 9px rgba(160, 122, 46, .22); }
@media (hover: hover) and (pointer: fine) { .range:hover::-webkit-slider-thumb { transform: scale(1.08); } }
.range::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #0B0908; }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--kino); }
.ticks { position: absolute; left: 15px; right: 15px; top: 34px; height: 36px; }
.ticks span {
  position: absolute; top: 0; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 0;
  font-size: 14px; line-height: 1.2; color: var(--muted);
}
.ticks span::before { content: ""; width: 1px; height: 6px; background: rgba(11, 9, 8, .3); margin-bottom: 3px; }
.ticks small { font-size: 13px; color: var(--gold-ink); }
.ticks span.on { color: var(--head); }
.unit-line { margin-top: 4px; font-size: 18px; color: var(--head); }
.unit-line b { font-weight: 300; font-size: 30px; color: var(--gold-ink); letter-spacing: -0.01em; }
.nudge { margin-top: 8px; color: var(--text); }
.nudge:empty { display: none; }
.nudge .link { font-size: 16px; min-height: 36px; margin-left: 4px; }
#qty-fine { margin-top: 12px; }

/* delivery paths */
.paths { display: grid; border-top: 1px solid var(--rule); }
.path {
  position: relative;
  display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
  padding: 16px 4px 16px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-ui);
}
.path input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.path-dot {
  width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--rule-strong);
  display: grid; place-items: center;
  transition: box-shadow var(--t-ui);
}
.path-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform var(--t-ui) var(--ease-settle); }
.path input:checked + .path-dot { box-shadow: inset 0 0 0 1.5px var(--ink); }
.path input:checked + .path-dot::after { transform: scale(1); }
.path input:focus-visible + .path-dot { outline: 2px solid var(--focus); outline-offset: 3px; }
.path:active { background-color: var(--press); }
@media (hover: hover) and (pointer: fine) { .path:hover { background-color: var(--wash); } .path:hover .path-dot { box-shadow: inset 0 0 0 1.5px var(--muted); } }
.path-text b { display: block; font-weight: 400; color: var(--head); font-size: 18px; }
.path-text span { display: block; color: var(--muted); font-size: 16px; margin-top: 2px; }
.path-panel { padding: 18px 0 0; }
.path-panel > p + p, .path-panel > .logo-row + .fine { margin-top: 10px; }
.path-panel .fine .link { font-size: 15px; min-height: 36px; }

.addr { margin-top: 14px; }
.addr:empty { display: none; }
.addr-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--head); }
.addr-head b { font-weight: 400; overflow-wrap: anywhere; }
.addr-head .num { color: var(--gold-ink); }
.addr-rows { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.addr-rows li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 16px; display: grid; gap: 1px; }
.addr-rows li span { color: var(--muted); font-size: 15px; }
.addr-more { margin-top: 8px; color: var(--muted); font-size: 15px; }
.probs { margin-top: 16px; }
.probs h3 { font-size: 18px; font-weight: 400; color: var(--head); }
.prob { margin-top: 10px; padding: 12px; border-left: 2px solid var(--kino); background: rgba(124, 40, 18, .05); }
.prob p { font-size: 16px; color: var(--text); }
.prob .fix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.prob .fix .input { min-height: 46px; font-size: 16px; }
.prob .fix .wide { grid-column: 1 / -1; }
.prob.ok { border-left-color: var(--gold-ink); background: rgba(160, 122, 46, .07); }
.ok-line { margin-top: 12px; color: var(--text); }
.match { margin-top: 14px; color: var(--text); }
.match .link { font-size: 16px; min-height: 36px; }

/* summary */
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 18px; font-size: 16px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; color: var(--head); overflow-wrap: anywhere; }
.sum { width: 100%; border-collapse: collapse; font-size: 16px; }
.sum td { padding: 11px 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--text); }
.sum td:last-child { text-align: right; white-space: nowrap; padding-left: 14px; color: var(--head); }
.sum tr.total td { border-bottom: 0; border-top: 1px solid var(--rule-strong); padding-top: 14px; color: var(--head); font-weight: 300; font-size: 30px; letter-spacing: -0.01em; }
.sum tr.total td:first-child { font-size: 20px; padding-top: 22px; }
.sum-each { text-align: right; color: var(--gold-ink); margin-top: 2px; }
.sum-actions { display: grid; gap: 10px; margin-top: 22px; }
#sum-fine { margin-top: 14px; }
.reg { margin-top: 22px; padding: 30px 22px 26px; }
.reg h3 { color: var(--ink); font-size: 26px; letter-spacing: -0.015em; }
.reg > p { margin-top: 8px; }

/* the price bar (light) */
.bar {
  position: sticky; bottom: 0; z-index: 7;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 28px calc(-1 * var(--gutter)) 0;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  box-shadow: 0 -1px 0 var(--rule), 0 -14px 26px -18px rgba(11, 9, 8, .35);
}
.bar-price { min-width: 0; }
/* the per-box price and the quantity give a small pulse when they change (on top of the digit roll) */
.pulse { display: inline-block; transform-origin: 0 70%; animation: pulse 420ms var(--ease-out); }
.qty-n.pulse { display: block; transform-origin: 100% 70%; }
@keyframes pulse { 0% { transform: scale(1); } 35% { transform: scale(1.07); text-shadow: 0 0 18px rgba(160, 122, 46, .35); } 100% { transform: scale(1); } }
.bar-each { line-height: 1.05; color: var(--head); white-space: nowrap; }
.bar-each .num { font-weight: 300; font-size: 30px; color: var(--gold-ink); letter-spacing: -0.01em; }
.bar-unit { font-size: 16px; color: var(--text); }
.bar-total { font-size: 14px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .btn { min-height: 50px; padding: 0 26px; flex: none; }

.builder .foot { margin-top: 0; }

/* ------------------------------------------------------------------ larger screens */
/* phones: while a field has focus (and the keyboard is up) the stage steps back */
.stage, .rig, .stage-top { transition: height var(--t-ui) var(--ease-out), width var(--t-ui) var(--ease-out), opacity var(--t-ui); }
@media (max-width: 559px) {
  body.typing .stage { height: 190px; }
  body.typing .stage-top { height: 0; opacity: 0; overflow: hidden; padding: 0; }
  body.typing .rig { width: 220px; }
  .typing .panel input, .typing .panel textarea { scroll-margin-top: 206px; }
}
@media (min-width: 560px) {
  .stage { height: 370px; }
  .rig { width: min(60%, 360px); }
  .step { scroll-margin-top: 390px; }
}
@media (min-width: 1024px) {
  /* desktop: the page is Paper, header included; the stage is one dark panel on the left */
  body.builder { background: var(--paper); }
  .builder .top { --head: var(--ink); --muted: #6B6158; --focus: var(--kino); max-width: 1440px; padding: 0 40px; }
  .config { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 520px); align-items: start; max-width: 1440px; margin: 0 auto; }
  .stage-col { top: 0; height: 100vh; padding: 0 0 24px 40px; background: none; }
  .stage { height: 100%; border-radius: 4px; justify-content: center; box-shadow: inset 0 1px 0 var(--edge-hi), 0 30px 60px -34px rgba(11, 9, 8, .6); }
  .stage-top { position: absolute; left: 0; right: 0; top: 0; height: auto; padding: 22px 24px; align-items: flex-start; }
  .stage-cap { font-size: 16px; }
  .stage-cap b { display: block; font-size: 30px; font-weight: 300; letter-spacing: -0.015em; margin: 0 0 2px; }
  .rig { width: min(68%, 660px, 78vh); margin-top: -2vh; }
  .plinth-face { height: min(24vh, 220px); }
  .panel { margin: 0; padding: 0 40px; max-width: none; }
  .intro { padding-top: 12px; }
  .intro h1 { font-size: 40px; }
  .step { scroll-margin-top: 24px; }
  .bar { margin: 28px -40px 0; padding: 14px 40px; }
  .sum-actions { grid-template-columns: 1fr 1fr; }
  .reg .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .chip:active i, .view button:active, .range:active::-webkit-slider-thumb { transform: none; }
}
