/* Showroom look (Ryan, 2026-10-11): his designs on tables behind frosted glass. */
:root {
  --ink: #f2ecdc;
  --muted: #c9c2ae;
  --soft: #dcd5c2;
  --gold: #ffc94a;            /* the top of the logo's gradient */
  --gold-deep: #b8962e;
  --night: #07130d;
  --glass: rgba(16, 40, 29, 0.58);
  --glass-line: rgba(255, 201, 74, 0.28);
  --field: rgba(0, 0, 0, 0.35);
  --field-line: rgba(242, 236, 220, 0.35);
  --felt: #0f6b47;
  --danger: #ffb4a8;
  --radius: 20px;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: "Figtree", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ink); font: 16px/1.5 var(--body); }
a { color: var(--gold); }
a:hover { color: #fff1c4; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }

/* The room: pinned to the screen and sized to it, never stretched over the page. */
.room { position: fixed; inset: 0; z-index: -1; background: var(--night) url(generated/scene.jpg) center / cover no-repeat; }
.room::after { content: ""; position: absolute; inset: 0; background: rgba(5, 16, 11, 0.72); }
@media (max-aspect-ratio: 1/1) { .room { background-image: url(generated/scene_tall.jpg); } }

.wrap { max-width: 1220px; margin: 0 auto; padding: 0 24px; }
.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5)); }
.hero-logo { width: min(440px, 82vw); height: auto; margin-bottom: 6px; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6)); }
.nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 24px; border-radius: 999px;
  font: 500 18px var(--display); letter-spacing: 1px; text-transform: uppercase; text-decoration: none; cursor: pointer; border: 0; }
.pill.gold { background: var(--gold); color: #08130d; }
.pill.gold:hover { background: #ffd978; color: #08130d; }
.pill.ghost { background: transparent; color: var(--ink); border: 2px solid rgba(242, 236, 220, 0.7); }
.pill.ghost:hover { border-color: var(--gold); color: var(--gold); }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }
.nav .pill { font-size: 16px; min-height: 44px; padding: 10px 20px; }

/* Hero */
.hero { padding: 64px 0 120px; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.eyebrow { font: 500 15px var(--display); letter-spacing: 5px; text-transform: uppercase; color: var(--gold); }
.hero h1 { margin: 0; font: 700 clamp(48px, 8vw, 84px)/1 var(--display); max-width: 820px; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); }
.hero p { margin: 0; font-size: 20px; max-width: 600px; color: var(--soft); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.facts { display: flex; gap: 10px 28px; flex-wrap: wrap; margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--soft); }

/* Sections */
section { scroll-margin-top: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; }
h2 { margin: 0; font: 600 clamp(28px, 4vw, 40px) var(--display); text-transform: uppercase; letter-spacing: 1px; }
h3 { margin: 0; font: 600 24px var(--display); text-transform: uppercase; letter-spacing: 1px; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.order { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-bottom: 60px; }
.steps { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.step { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.side { flex: 1 1 340px; min-width: 0; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) {
  /* Phones and tablets: the live table first, the price and Send button after the steps. */
  .side { display: contents; }
  .side > .glass:first-child { order: -1; flex: 1 1 100%; }
  .side > .estimate { order: 99; flex: 1 1 100%; }
  .nav .pill { display: none; }
}
@media (max-width: 700px) { .brand.on-hero { display: none; } }   /* the hero logo is right below */

/* Fields */
.fields { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea { font: 400 17px var(--body); color: #fff; background: var(--field); border: 1px solid var(--field-line); border-radius: 12px; padding: 12px 14px; min-height: 48px; }
.field textarea { min-height: 96px; resize: vertical; }
.field select option { color: #111; }
.field input.big { width: 140px; font: 500 32px var(--display); padding: 6px 14px; }
.field input:disabled { opacity: 0.45; }
.chip { font: 600 14px var(--body); color: var(--ink); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--field-line); border-radius: 999px; padding: 12px 16px; min-height: 46px; cursor: pointer; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.unit { display: inline-flex; border: 1px solid var(--field-line); border-radius: 999px; overflow: hidden; }
.unit button { font: 700 14px var(--body); color: var(--muted); background: transparent; border: 0; padding: 0 16px; min-height: 46px; cursor: pointer; }
.unit button[aria-pressed="true"] { background: var(--gold); color: #08130d; }

.choices { display: grid; gap: 10px; }
.choices.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .choices.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } .choices.three { grid-template-columns: 1fr; } }
.choice { text-align: left; background: rgba(0, 0, 0, 0.25); color: var(--soft); border: 1px solid rgba(242, 236, 220, 0.25); border-radius: 14px; padding: 16px; font: 500 14px var(--body); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.choice strong { font-size: 16px; color: #fff; }
.choice.shape { align-items: center; text-align: center; padding: 14px 4px; gap: 8px; }
.choice:hover { border-color: rgba(255, 201, 74, 0.7); }
.choice[aria-pressed="true"] { background: rgba(255, 201, 74, 0.18); border: 2px solid var(--gold); color: #fff; }

/* Upload */
.drop { border: 2px dashed rgba(255, 201, 74, 0.7); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: rgba(0, 0, 0, 0.2); cursor: pointer; }
.drop.over { background: rgba(255, 201, 74, 0.12); }
.drop strong { font: 500 22px var(--display); letter-spacing: 1px; text-transform: uppercase; }
.files { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.files li { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: rgba(0, 0, 0, 0.3); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.files .ok { color: #9fe3b8; } .files .warn { color: var(--danger); }
.files button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; min-height: 36px; }

/* Live table preview: the chosen design on a table, in perspective */
.stage { perspective: 1300px; padding: 26px 10px 34px; display: flex; justify-content: center; }
.table { position: relative; width: 100%; transform: rotateX(46deg); transform-style: preserve-3d; transition: aspect-ratio 0.3s ease; }
.table > .rail { position: relative; }
/* The table's thickness: slices under the top (see addDepth in common.js) */
.slice { position: absolute; inset: 0; border-radius: 9999px; background: #2b2b30; pointer-events: none; }
.slice.apron { inset: 7% 9%; background: #141416; }
.rail { width: 100%; height: 100%; background: #121214; padding: 5.5%; border-radius: 9999px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.5); }
.track { width: 100%; height: 100%; background: #5c341a; padding: 1.6%; border-radius: 9999px; box-shadow: inset 0 0 0 2px #8c5830; }
.felt { width: 100%; height: 100%; border-radius: 9999px; background: var(--felt) center / cover no-repeat; box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45); }
.table[data-shape="rectangle"] .rail, .table[data-shape="square"] .rail,
.table[data-shape="rectangle"] .slice, .table[data-shape="square"] .slice { border-radius: 18px; }
.table[data-shape="rectangle"] .track, .table[data-shape="square"] .track { border-radius: 12px; }
.table[data-shape="rectangle"] .felt, .table[data-shape="square"] .felt { border-radius: 8px; }
.table[data-shape="round"] .rail, .table[data-shape="round"] .track, .table[data-shape="round"] .felt, .table[data-shape="round"] .slice,
.table[data-shape="ellipse"] .rail, .table[data-shape="ellipse"] .track, .table[data-shape="ellipse"] .felt, .table[data-shape="ellipse"] .slice { border-radius: 50%; }
.table[data-shape="octagon"] .rail, .table[data-shape="octagon"] .track, .table[data-shape="octagon"] .felt, .table[data-shape="octagon"] .slice {
  border-radius: 0; clip-path: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%); }
.dims { text-align: center; font: 600 15px var(--body); color: var(--soft); margin-top: -10px; }

/* Estimate */
.estimate { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.price b { font: 700 64px/1 var(--display); }
.lines { margin: 0; padding: 0; list-style: none; font-size: 14px; display: flex; flex-direction: column; gap: 4px; color: var(--soft); }
.lines li { display: flex; justify-content: space-between; gap: 10px; }
.error { color: var(--danger); font-weight: 600; font-size: 14px; }

/* Gallery */
.gallery-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.gallery-tools input { flex: 1 1 260px; font: 400 17px var(--body); color: #fff; background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; padding: 12px 20px; min-height: 48px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: contain; display: block; }
.card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
@media (max-width: 600px) {   /* phones: two designs per row, compact cards */
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 8px; gap: 6px; border-radius: 14px; }
  .card figcaption { flex-direction: column; align-items: stretch; gap: 6px; font-size: 14px; line-height: 1.25; }
  .card button { width: 100%; padding: 8px 10px; }
}
.card small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.card button { font: 700 13px var(--body); color: var(--gold); background: transparent; border: 1px solid var(--gold); border-radius: 999px; padding: 10px 14px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.card button[aria-pressed="true"] { background: var(--gold); color: #08130d; }
.more { display: flex; justify-content: center; margin-top: 22px; }

/* Dialog */
dialog { border: 1px solid var(--glass-line); border-radius: 22px; background: #10261c; color: var(--ink); max-width: 560px; width: calc(100% - 32px); padding: 26px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.foot { padding: 40px 0 60px; color: var(--muted); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Design viewer: the design on a big table you can spin, tilt and zoom */
.card .peek { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.card .peek:hover img { transform: scale(1.03); }
.card .peek img { transition: transform 0.2s ease; }
dialog.viewer { max-width: 1100px; width: calc(100% - 24px); padding: 0; overflow: hidden; background: #0c1d15; }
.v-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 0; }
.v-close { background: none; border: 0; color: var(--ink); width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }
.v-close:hover { background: rgba(255, 255, 255, 0.08); }
.v-stage { height: min(62vh, 560px); display: flex; align-items: center; justify-content: center; perspective: 1400px;
  touch-action: none; cursor: grab; overflow: hidden; user-select: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 201, 74, 0.10), transparent 60%); }
.v-stage:active { cursor: grabbing; }
.v-stage .table { width: min(86%, 900px); transition: none; will-change: transform; }
.v-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 20px 20px; }
.v-tools .chip { min-width: 46px; font-size: 18px; }
@media (max-width: 600px) { .v-stage { height: 52vh; } .v-stage .table { width: 94%; } .v-tools .hint { order: 3; flex-basis: 100%; } }

/* "*Railing not included": the topper is the felt; the rail is shown only for context */
.caveat { display: block; font-size: 11px; line-height: 1.2; color: rgba(242, 236, 220, 0.55); letter-spacing: 0.2px; margin-top: -2px; }
.caveat.center { text-align: center; padding-bottom: 12px; margin-top: 4px; }
.v-stage { position: relative; }
.v-caveat { position: absolute; right: 18px; bottom: 12px; font-size: 12px; margin: 0; }
