/* Dev Crow Egg — 3D model preview pages (shared look; each page has its own copy). Phone first. */
:root {
  --paper: #fbf8f3;
  --paper-2: #f3ede3;
  --ink: #2f2c28;
  --muted: #645d54;
  --line: #e4dbcd;
  --oak: #c9a27a;
  --blue: #46668c;
  --blue-ink: #ffffff;
  --radius: 18px;
  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --arabic: 'Aref Ruqaa', 'Noto Naskh Arabic', 'Geeza Pro', 'Arabic Typesetting', serif;
  /* the shared "See it in your room" viewer */
  --rv-bg: var(--paper);
  --rv-surface: #ffffff;
  --rv-text: var(--ink);
  --rv-muted: var(--muted);
  --rv-line: var(--line);
  --rv-accent: var(--blue);
  --rv-accent-text: var(--blue-ink);
  --rv-radius: 14px;
  --rv-font: var(--sans);
  --rv-font-display: var(--serif);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 60px; padding: 0 16px;
  background: rgba(251, 248, 243, .94);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font: 400 19px/1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand-egg { width: 18px; height: 22px; flex: none; }
.top nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.top nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap;
}
.top nav a[aria-current='page'] { color: var(--ink); background: var(--paper-2); }
@media (max-width: 400px) {
  .top { padding: 0 10px; gap: 6px; }
  .brand { font-size: 17px; gap: 6px; }
  .brand-egg { width: 15px; height: 19px; }
  .top nav ul { gap: 0; }
  .top nav a { padding: 0 8px; font-size: 14px; }
}

/* ---------- layout */
main { display: block; }
.product {
  display: grid; gap: 20px;
  max-width: 1280px; margin: 0 auto; padding: 12px 16px 40px;
}
@media (min-width: 960px) {
  .product { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 48px; padding: 28px 40px 64px; align-items: start; }
  .stage-wrap { position: sticky; top: 84px; }
}

/* ---------- 3D stage */
.stage {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5; max-height: 74svh; min-height: 300px; width: 100%;
  border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 38%, #ffffff 0%, #f7f1e7 55%, #ece2d2 100%);
  isolation: isolate;
  transition: background-color .4s;
}
@media (min-width: 960px) { .stage { aspect-ratio: auto; height: min(78vh, 760px); max-height: none; } }
.stage::after { /* sunset wash for the low-sun mode */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .5s;
  background: radial-gradient(110% 80% at 15% 30%, #f6d7b0 0%, #e7c299 40%, #b98f6b 100%);
}
.stage.is-sunset::after { opacity: 1; }
.canvas-host { position: absolute; inset: 0; }
.canvas-host canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.poster {
  position: absolute; left: 8%; top: 7%; width: 84%; height: 68%; object-fit: contain;
  transition: opacity .5s ease; pointer-events: none;
}
.stage.is-ready .poster { opacity: 0; }
.stage.is-failed .poster { top: 22%; height: 54%; }
.status {
  position: absolute; left: 12px; top: 12px;
  max-width: calc(100% - 88px); margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 14px; font-weight: 600; text-align: center;
  box-shadow: 0 1px 2px rgba(47, 44, 40, .12);
}
.status[data-kind='error'] { border-radius: 14px; font-weight: 500; max-width: calc(100% - 24px); }
/* "See it in your room" sits on the stage, so it is on the first screen on a phone */
.stage-cta {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; pointer-events: none;
}
.stage-cta > * { pointer-events: auto; }
.stage-cta .truesize {
  font-size: 14px; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, .85);
  padding: 4px 10px; border-radius: 999px;
}
.stage-tools {
  position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 2;
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink);
  cursor: pointer; box-shadow: 0 1px 2px rgba(47, 44, 40, .1);
}
.icon-btn svg { width: 20px; height: 20px; }
@media (hover: hover) { .icon-btn:hover { background: #fff; border-color: var(--oak); } }
.hint {
  position: absolute; left: 14px; top: 14px; margin: 0; z-index: 1;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, .78); padding: 4px 10px; border-radius: 999px;
}
.stage.is-failed .hint, .stage.is-loading .hint { display: none; }
.stage:focus-visible { outline-offset: -3px; }

/* ---------- info column */
.info { min-width: 0; }
.eyebrow { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
h1 { margin: 0; font: 400 clamp(30px, 6.4vw, 44px)/1.08 var(--serif); letter-spacing: -.01em; }
.lede { margin: 10px 0 0; font-size: 17px; color: var(--ink); max-width: 46ch; }
.price-row { display: flex; align-items: baseline; gap: 12px; margin: 16px 0 4px; flex-wrap: wrap; }
.price { margin: 0; font: 400 28px/1 var(--serif); }
.seller { margin: 0; font-size: 16px; color: var(--muted); }

.choice { margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.choice legend { padding: 0; margin: 0 0 10px; font-weight: 700; font-size: 16px; }
.choice legend span { font-weight: 500; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { position: relative; display: grid; place-items: center; width: 48px; height: 48px; cursor: pointer; border-radius: 50%; }
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch .dot {
  width: 36px; height: 36px; border-radius: 50%; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(47, 44, 40, .22);
  transition: transform .15s;
}
.swatch input:checked + .dot { box-shadow: inset 0 0 0 1px rgba(47, 44, 40, .22), 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.swatch input:focus-visible + .dot { outline: 3px solid var(--blue); outline-offset: 6px; }
@media (hover: hover) { .swatch:hover .dot { transform: scale(1.06); } }
.note { margin: 8px 0 0; font-size: 16px; color: var(--muted); }
.note[data-kind='warn'] { color: #8a3d1c; }

.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.seg { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .15s, background-color .15s;
}
.seg .ar { font: 700 30px/1.2 var(--arabic); color: var(--ink); }
.seg .en { font-size: 14px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { border-color: var(--ink); background: var(--paper-2); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink);
  font: 600 16px/1 var(--sans); cursor: pointer;
}
.toggle[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.toggle svg { width: 20px; height: 20px; flex: none; }
.range { display: grid; gap: 4px; margin-top: 12px; }
.range label { font-size: 15px; font-weight: 600; }
.range input { width: 100%; height: 44px; margin: 0; accent-color: var(--blue); }
.range input:disabled { opacity: .45; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid var(--blue); background: var(--blue); color: var(--blue-ink);
  font: 600 16px/1 var(--sans); cursor: pointer; text-decoration: none;
}
.btn svg { width: 20px; height: 20px; }
.truesize { margin: 0; font-size: 16px; color: var(--muted); }

.specs { margin: 28px 0 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-weight: 700; }
.specs dd { margin: 0; }
.specs .src { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
  background: #e6edf5; color: #2c4866; font-size: 13px; font-weight: 700;
}
details.more { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
details.more summary { display: flex; align-items: center; min-height: 52px; padding: 0 16px; cursor: pointer; font-weight: 700; }
details.more > div { padding: 0 16px 14px; }
details.more p, details.more li { margin: 8px 0 0; }
details.more ul { padding-left: 1.2em; margin: 0; }
@media (max-width: 380px) { .specs div { grid-template-columns: 1fr; gap: 2px; } }

footer {
  border-top: 1px solid var(--line); padding: 22px 16px 32px; color: var(--muted); font-size: 15px;
  max-width: 1280px; margin: 0 auto;
}
footer p { margin: 0; }
@media (min-width: 960px) { footer { padding: 24px 40px 40px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
