/* jonson3d Showcase. Colours from the cover of "Dieter Rams: As Little Design as
   Possible": pale cool grey, blue-grey speaker-grille dots; deep blue-grey for dark. */
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #D8DCDC; --card: #F1F3F2; --ink: #1C2022; --ink-2: #57636A; --ink-3: #85909A; --line: #C5CCCE;
  --photo: #F3F3F2; --chip: #E2E6E7; --wa: #1FA855; --dot: #8A949A;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1A1E20; --card: #23282A; --ink: #E7EBEC; --ink-2: #A9B3B8; --ink-3: #78848A; --line: #343B3E;
  --photo: #2B3134; --chip: #2E3437; --dot: #3D464B;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1E20; --card: #23282A; --ink: #E7EBEC; --ink-2: #A9B3B8; --ink-3: #78848A; --line: #343B3E;
    --photo: #2B3134; --chip: #2E3437; --dot: #3D464B;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: Geist, "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
main { flex: 1; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 40px; gap: 16px; }
.brand { font-weight: 680; font-size: 19px; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; }
.brand small { font-weight: 450; color: var(--ink-3); font-size: 13px; letter-spacing: 0; }
.top nav { display: flex; gap: 22px; color: var(--ink-2); font-size: 14px; align-items: center; }
.top nav a:hover { color: var(--ink); }
.theme { width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: grid; place-items: center; border: 1px solid var(--line); }
.theme i { width: 13px; height: 13px; border-radius: 50%; background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* gallery */
.intro { padding: 34px 40px 26px; position: relative; }
.intro h1, .intro p { position: relative; }   /* above the .grille dots, which come first */
.intro h1 { font-size: 44px; font-weight: 640; letter-spacing: -0.035em; line-height: 1.05; max-width: 640px; }
.intro p { color: var(--ink-2); margin-top: 12px; font-size: 16px; max-width: 520px; line-height: 1.5; }
.grille { position: absolute; right: 60px; top: 6px; width: 190px; height: 190px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--dot) 1.15px, transparent 1.55px) 0 0 / 5px 5px; opacity: .9; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 10px 40px 60px; position: relative; }
.card { background: var(--card); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); display: block;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.card .ph { aspect-ratio: 5 / 4; background: var(--photo); overflow: hidden; display: grid; place-items: center; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.55); opacity: 0; transition: opacity .3s; }
.card .ph img.drawn { object-fit: contain; transform: scale(1.05); }
.card .ph img.ready { opacity: 1; }
.card .meta { padding: 14px 16px 16px; display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.card h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.price { font-weight: 620; font-size: 15px; white-space: nowrap; }
.empty { padding: 60px 40px; color: var(--ink-2); max-width: 560px; line-height: 1.6; }

/* product page */
.back { padding: 4px 40px 14px; color: var(--ink-2); font-size: 14px; display: inline-block; }
.back:hover { color: var(--ink); }
.pp { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 34px; padding: 6px 40px 40px; align-items: start; }
.viewer { position: relative; background: var(--photo); border-radius: 22px; aspect-ratio: 1 / 1; overflow: hidden; touch-action: none; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); background: var(--photo);
  opacity: 0; pointer-events: none; transition: opacity .25s; }
.viewer.photos .photo { opacity: 1; pointer-events: auto; }
.viewer .hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); font-size: 12.5px; color: var(--ink-2); z-index: 2;
  background: color-mix(in srgb, var(--card) 80%, transparent); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px);
  white-space: nowrap; transition: opacity .4s; }
.viewer .hint.gone, .viewer.photos .hint { opacity: 0; }
.viewer .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; z-index: 1; }
.viewer.photos .loading { display: none; }  /* the 3D view's spinner or message never covers the photos */
.viewer .loading i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink-2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs button { width: 74px; height: 74px; border-radius: 12px; background: var(--photo); overflow: hidden; border: 1px solid var(--line); padding: 0; }
.thumbs button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.6); display: block; }
.thumbs .tile3d { position: relative; }   /* the 3D view, first in the strip: the hero photo, faded, with a 3D pill */
.tile3d img { opacity: .45; }
.tile3d span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 12.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; color: var(--card); background: var(--ink); }
.side h1 { font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
.side .dims { color: var(--ink-3); font-size: 13.5px; margin-top: 6px; }
.side .price { font-size: 26px; margin-top: 16px; display: block; }
.side .price small { font-size: 13px; color: var(--ink-3); font-weight: 450; margin-left: 6px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.parts { display: flex; gap: 8px; flex-wrap: wrap; }
.parts button { padding: 7px 13px; border-radius: 999px; background: var(--chip); font-size: 13.5px; color: var(--ink-2); border: 1px solid transparent; }
.parts button[aria-pressed="true"] { background: var(--card); color: var(--ink); border-color: var(--ink); }
.parts button small { color: var(--ink-3); margin-left: 4px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.sw { text-align: center; font-size: 12px; color: var(--ink-2); padding: 2px; border-radius: 10px; line-height: 1.3; }
.sw .ball { display: block; width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 6px; overflow: hidden; }
.sw .ball img { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .25s; }
.sw .ball img.ready { opacity: 1; }
.sw .ball.flat { box-shadow: inset -7px -9px 16px rgba(0,0,0,.35), inset 6px 7px 12px rgba(255,255,255,.35); }
.sw[aria-checked="true"] .ball { outline: 2px solid var(--ink); outline-offset: 3px; }
.sw[aria-checked="true"] { color: var(--ink); font-weight: 560; }
.picked { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--chip); font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.picked b { color: var(--ink); }
.wa { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 14px;
  background: var(--wa); color: #fff; font-weight: 620; font-size: 16px; }
.wa:hover { filter: brightness(1.05); }
.wa[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.note { color: var(--ink-3); font-size: 12.5px; margin-top: 10px; text-align: center; }

.foot { display: flex; justify-content: space-between; gap: 12px; padding: 18px 40px 26px; color: var(--ink-3); font-size: 12.5px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .pp { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .top { padding: 16px 18px; } .hide-sm { display: none; } .brand small { display: none; }
  .intro { padding: 18px 18px 14px; } .intro h1 { font-size: 30px; }
  .grille { width: 110px; height: 110px; right: 14px; top: 12px; opacity: .55; }
  .grid { gap: 12px; padding: 6px 16px 40px; }
  .card { border-radius: 14px; } .card .meta { padding: 10px 11px 12px; flex-direction: column; align-items: start; gap: 6px; }
  .card h3 { font-size: 14px; }
  .pp { gap: 18px; padding: 0 16px 30px; }
  .viewer { border-radius: 18px; } .thumbs button { width: 60px; height: 60px; }
  .back { padding: 0 16px 10px; }
  .side h1 { font-size: 26px; }
  .foot { padding: 16px 18px 22px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
