/* Atrium storefront. Mobile first: most visitors arrive on a phone, standing
   in the room they are furnishing. */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --media: #ece8e1;
  --ink: #1c1a17;
  --ink-2: #4a453e;
  --muted: #736c61;
  --line: #e2ddd4;
  --accent: #b5582e;
  --accent-ink: #9a4a26;
  --btn: #1c1a17;
  --btn-ink: #ffffff;
  --focus: #2d6cdf;
  --shadow: 0 1px 2px rgb(28 26 23 / .06), 0 8px 24px rgb(28 26 23 / .06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --header-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210;
    --surface: #1b1a17;
    --media: #25231f;
    --ink: #f2efe9;
    --ink-2: #d1cbc1;
    --muted: #a29b90;
    --line: #2f2c27;
    --accent: #e08a5f;
    --accent-ink: #e9a07b;
    --btn: #f2efe9;
    --btn-ink: #131210;
    --focus: #7aa7ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131210; --surface: #1b1a17; --media: #25231f; --ink: #f2efe9; --ink-2: #d1cbc1;
  --muted: #a29b90; --line: #2f2c27; --accent: #e08a5f; --accent-ink: #e9a07b;
  --btn: #f2efe9; --btn-ink: #131210; --focus: #7aa7ff; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body:has(dialog[open]) { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 28px; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--btn); color: var(--btn-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent-ink);
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 620; font-size: 15.5px; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--btn) 86%, var(--accent)); }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding-top: env(safe-area-inset-top);
}
.header-row { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 22px/1 var(--serif); letter-spacing: .01em; }
.brand svg { width: 28px; height: 28px; }
.nav { display: none; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 520; }
.nav a:hover { color: var(--ink); }
@media (min-width: 700px) { .nav { display: flex; } }
.cart-btn {
  position: relative; margin-left: auto; width: 44px; height: 44px;
  display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer;
}
@media (min-width: 700px) { .cart-btn { margin-left: 8px; } }
.cart-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.cart-btn svg { width: 24px; height: 24px; }
.cart-count {
  position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 19px; text-align: center;
}

/* ------------------------------------------------------------ notice */
.notice {
  margin: 12px auto 0; max-width: 1240px; width: calc(100% - 2 * var(--gutter));
  padding: 12px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: 14.5px; color: var(--ink);
}
.notice strong { display: block; margin-bottom: 2px; }
.notice a { font-weight: 600; word-break: break-all; }

/* ------------------------------------------------------------ hero */
.hero { display: grid; gap: 8px; padding-top: 28px; padding-bottom: 12px; align-items: center; }
.hero h1 {
  margin: 0 0 14px;
  font: 500 clamp(34px, 8.6vw, 62px)/1.04 var(--serif);
  letter-spacing: -.015em; text-wrap: balance;
}
.lede { margin: 0 0 22px; font-size: clamp(16.5px, 2.2vw, 19px); color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .hero-actions .btn { flex: 0 0 auto; } }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; color: var(--ink-2); font-size: 14.5px; }
.hero-points li { display: inline-flex; align-items: center; gap: 6px; }
.hero-points svg { color: var(--accent); width: 18px; height: 18px; stroke-width: 2.4; }
.hero-art { position: relative; margin: 8px 0 0; border-radius: 22px; background: var(--media); aspect-ratio: 1 / .82; overflow: hidden; }
.hero-art img { width: 100%; height: 100%; object-fit: contain; padding: 4% 6% 0; opacity: 0; transition: opacity .5s; }
.hero-art img.ready { opacity: 1; }
.hero-tag {
  position: absolute; left: 14px; bottom: 14px; padding: 7px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); font-size: 13px; font-weight: 600;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-tag:empty { display: none; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 48px; padding-top: 56px; padding-bottom: 36px; }
  .hero-art { margin: 0; aspect-ratio: 1 / .92; }
}

/* ------------------------------------------------------------ collection */
.collection { padding-top: 36px; padding-bottom: 20px; }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.section-head h2, .how h2 { margin: 0; font: 500 clamp(26px, 5vw, 36px)/1.1 var(--serif); letter-spacing: -.01em; }
@media (min-width: 800px) { .section-head { flex-direction: row; align-items: end; justify-content: space-between; } }
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 800px) { .chips { margin: 0; padding: 2px 0; } }
.chip {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 14.5px; font-weight: 560; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.chip .n { opacity: .6; margin-left: 4px; font-weight: 500; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid-empty { color: var(--muted); }
.grid-empty:empty { display: none; }

.card { display: flex; flex-direction: column; min-width: 0; }
.card[hidden] { display: none; }
.card-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 1; border-radius: var(--radius); background: var(--media); overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; }
@media (hover: hover) { .card-media:hover img { transform: scale(1.035); } }
.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.badge svg { width: 13px; height: 13px; stroke-width: 2.2; }
.card-body { padding: 12px 2px 10px; flex: 1; }
.card-title { margin: 0; font-size: 15.5px; font-weight: 620; line-height: 1.3; }
.card-title button { all: unset; cursor: pointer; }
.card-title button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.card-dims { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-price { margin: 6px 0 0; font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.card-ar {
  min-height: 44px; width: 100%; padding: 0 10px; gap: 7px;
  font-size: 14px; border-radius: 12px;
}
.card-ar svg { width: 19px; height: 19px; }

/* ------------------------------------------------------------ how */
.how { padding-top: 48px; padding-bottom: 56px; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps h3 { margin: 12px 0 6px; font-size: 17px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 15px; }
.step-n {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 15px;
}
.desk-hint { margin: 18px 0 0; color: var(--ink-2); }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13.5px; }
.footer-row { display: grid; gap: 6px; }
.footer-row p { margin: 0; }

/* ------------------------------------------------------------ product dialog */
dialog { color: var(--ink); }
dialog::backdrop { background: rgb(19 18 16 / .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.pd {
  padding: 0; border: 0; background: var(--surface);
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  overscroll-behavior: contain;
}
.pd[open] { display: block; }
.pd-layout { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pd-stage { position: relative; height: min(58svh, 560px); background: var(--media); }
#mv { width: 100%; height: 100%; --poster-color: transparent; --progress-bar-color: transparent; background: transparent; }
.pd-info { position: relative; padding: 22px var(--gutter) calc(32px + env(safe-area-inset-bottom)); }
.pd-info h2 { margin: 0; font: 500 clamp(26px, 6.5vw, 36px)/1.12 var(--serif); letter-spacing: -.01em; padding-right: 8px; }
.pd-price { margin: 8px 0 0; font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pd-close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 5;
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow);
}
.pd-close svg { width: 22px; height: 22px; }
.pd-close.static { position: static; box-shadow: none; }

.pd-dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 0; }
.pd-dims div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pd-dims dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pd-dims dd { margin: 2px 0 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

.ar-cta { margin-top: 18px; }
.ar-cta .btn { width: 100%; min-height: 54px; font-size: 16.5px; }
.ar-cta .btn svg { width: 22px; height: 22px; }
.fine { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.qr-panel { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.qr { flex: none; width: 132px; height: 132px; padding: 8px; background: #fff; border-radius: 10px; }
.qr svg { width: 100%; height: 100%; display: block; stroke: none; }
.qr-panel h3 { margin: 0 0 4px; font-size: 16px; }
.qr-panel p { margin: 0; font-size: 14px; color: var(--ink-2); }
.qr-panel .qr-url { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); word-break: break-all; }

.pd-actions { display: flex; gap: 10px; margin-top: 12px; }
.pd-actions .btn-secondary { flex: 1; }
.btn-icon-text { padding: 0 16px; }
.pd-desc { margin: 20px 0 0; color: var(--ink-2); font-size: 15.5px; }
.pd-materials { margin: 12px 0 0; font-size: 14.5px; color: var(--ink-2); }
.pd-materials strong { display: block; color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.pd-credit { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.pd-credit a { color: inherit; }

@media (min-width: 900px) {
  .pd {
    width: min(1180px, calc(100vw - 48px)); height: min(760px, calc(100vh - 48px));
    margin: auto; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgb(0 0 0 / .35);
  }
  .pd-layout { display: grid; grid-template-columns: 1.3fr 1fr; overflow: hidden; }
  .pd-stage { height: 100%; }
  .pd-info { overflow-y: auto; padding: 36px 32px 32px; }
  .pd-close { position: absolute; top: 16px; right: 16px; box-shadow: none; background: var(--bg); }
  .pd-info h2 { padding-right: 48px; }
}

/* 3D stage chrome */
.stage-tools {
  position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 2;
}
.tool {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 12px;
  border: 0; border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 620;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); box-shadow: var(--shadow);
}
.tool svg { width: 18px; height: 18px; }
.tool[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
#resetView { padding: 0; width: 40px; justify-content: center; }
.stage-error[hidden] { display: none; }
.stage-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ink-2); }
.mv-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; pointer-events: none; }
.mv-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s, opacity .4s; }
.mv-progress.done span { opacity: 0; }

/* Dimension overlay (hotspots + SVG lines) */
.dim-dot { display: none; }
.dim-label {
  border: 0; border-radius: 999px; padding: 4px 9px; pointer-events: none;
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgb(0 0 0 / .18);
  font: 650 12.5px/1.2 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap;
  transform: translate(-50%, -50%);
}
.dim-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; overflow: visible; }
.dim-lines line { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 4 3; }
.dims-off .dim-label, .dims-off .dim-lines, .dim-lines .hide, .dim-label.hide { visibility: hidden; }

/* ------------------------------------------------------------ cart drawer */
.drawer {
  padding: 0; border: 0; background: var(--surface);
  margin: 0 0 0 auto; height: 100%; max-height: none; width: min(420px, 100%);
  display: none; flex-direction: column;
}
.drawer[open] { display: flex; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px var(--gutter); border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 500 24px/1.2 var(--serif); }
.cart-list { list-style: none; margin: 0; padding: 8px var(--gutter); flex: 1; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 72px; height: 72px; border-radius: 10px; background: var(--media); object-fit: contain; }
.cart-item h3 { margin: 0; font-size: 14.5px; }
.cart-item .ci-price { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 18px; border-radius: 50%; }
.qty span { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.cart-empty { padding: 24px var(--gutter); color: var(--muted); margin: 0; }
.cart-empty[hidden] { display: none; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom)); }
.subtotal { display: flex; justify-content: space-between; margin: 0 0 12px; font-size: 17px; }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; inset: auto; margin: 0; border: 0; overflow: visible; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 1000;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 12px; background: var(--btn); color: var(--btn-ink);
  font-size: 14.5px; font-weight: 560; box-shadow: 0 10px 30px rgb(0 0 0 / .25);
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
