/* /website-designs only: the six design tiles, their device frames and specimen chips, and the <dialog> player.
   Site chrome, stages, buttons and the FAQ come from chrysis.css. Live thumbnails (>=760px) are injected by
   website-designs.js; below 760px, or without JS, the CSS specimen shows instead. */

.design-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 760px) { .design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .design-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.design-grid > li { display: flex; }

.design-tile {
  flex: 1; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.9rem 0.9rem 1.2rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; color: var(--fg); text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.design-tile:hover { border-color: var(--accent); box-shadow: 0 10px 28px rgba(24, 19, 16, 0.12); transform: translateY(-2px); }
.design-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.design-name { margin: 0.35rem 0 0; font-size: 1.15rem; line-height: 1.25; }
.design-trade { color: var(--fg-2); font-size: 0.92rem; font-weight: 600; }
.design-slip { color: var(--fg); font-size: 0.98rem; line-height: 1.5; }
.design-open { margin-top: auto; padding-top: 0.5rem; color: var(--accent); font-weight: 700; }
.design-open::after { content: " \2192"; }
.design-tag {
  align-self: flex-start; padding: 0.15rem 0.55rem; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--fg-2); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}
.design-tile .device { order: -2; }
.design-tile .design-tag { order: -1; }   /* tag shows above the name; in the DOM (and the .md twin) it follows the slip */
.design-tag.is-concept { border-color: var(--accent); color: var(--accent); }

/* Device frame: a 16:10 window with a browser bar. Holds the specimen, or the scaled live iframe when injected. */
.device {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; margin-bottom: 0.4rem;
  border: 1px solid var(--rule); border-top-width: 14px; border-radius: 8px; background: var(--void);
}
.device::before {   /* three window dots in the bar */
  content: ""; position: absolute; top: -10px; left: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-3); box-shadow: 10px 0 var(--fg-3), 20px 0 var(--fg-3); z-index: 1;
}
.device iframe {
  position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0;
  transform: scale(var(--scale, 0.3)); pointer-events: none; background: var(--paper);
}
.device.is-live .specimen { visibility: hidden; }
.specimen {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.6rem;
  padding: 1rem 1.25rem; background: var(--sp-bg); color: var(--sp-fg);
}
.specimen-name { font-family: var(--font-display); font-size: clamp(1.2rem, 4.5vw, 1.6rem); line-height: 1.15; font-weight: 600; }
.specimen-chips { display: flex; gap: 0.4rem; }
.specimen-chips i { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid rgba(128, 128, 128, 0.45); }
.specimen-trade { font-size: 0.85rem; font-weight: 600; opacity: 0.85; }

.design-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .design-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.design-facts li { padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: var(--card); color: var(--fg); }

/* Player */
.player {
  width: min(1400px, calc(100vw - 2rem)); height: min(940px, calc(100vh - 2rem)); max-width: none; max-height: none;
  margin: auto; padding: 0; border: 1px solid var(--seam); border-radius: 12px; background: var(--void); color: var(--bone);
  overflow: hidden;
}
.player[open] { display: flex; flex-direction: column; animation: player-in 0.16s ease-out; }
.player::backdrop { background: rgba(24, 19, 16, 0.8); }
@keyframes player-in { from { opacity: 0; transform: scale(0.98); } }
.player-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--seam); background: var(--coal);
}
.player-id { margin: 0 auto 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 700; }
.player-name { font-family: var(--font-display); font-size: 1.1rem; }
.player .design-tag { border-color: var(--seam); color: #c9c2bb; }
.player-view { display: inline-flex; border: 1px solid var(--seam); border-radius: 999px; overflow: hidden; }
.player-view button, .player-close {
  min-height: 44px; padding: 0 1rem; border: 0; background: transparent; color: var(--bone); font: inherit; font-weight: 600; cursor: pointer;
}
.player-view button[aria-pressed="true"] { background: var(--bone); color: var(--void); }
.player-close { border: 1px solid var(--seam); border-radius: 999px; }
.player-open { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold-hi); font-weight: 600; }
.player-cta { min-height: 44px; }
.player button:focus-visible, .player a:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.player-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.player-frame { position: relative; overflow: hidden; background: var(--paper); border-radius: 6px; flex: none; }
.player-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: var(--paper); }
.player-frame.is-mobile { border: 12px solid #0d0b09; border-radius: 36px; box-shadow: 0 0 0 1px var(--seam); box-sizing: content-box; }

@media (max-width: 759px) {   /* full-screen sheet: the phone shows the design at its own mobile layout */
  .player { width: 100vw; height: 100vh; width: 100dvw; height: 100dvh; border: 0; border-radius: 0; }
  .player-view { display: none; }
  .player-bar { padding: 0.5rem 0.75rem; gap: 0.25rem 0.6rem; font-size: 0.875rem; }
  .player-id { flex-basis: 100%; }
  .player-name { font-size: 1rem; }
  .player-bar .player-cta { padding: 0.55rem 0.8rem; font-size: 0.875rem; }
  .player-close { padding: 0 0.8rem; margin-left: auto; }
  .player-stage { padding: 0; }
  .player-frame, .player-frame.is-mobile { width: 100% !important; height: 100% !important; border: 0; border-radius: 0; }
  .player-frame iframe { width: 100% !important; height: 100% !important; transform: none !important; }
}

@supports selector(:has(*)) { html:has(dialog[open]) { overflow: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .player[open] { animation: none; }
  .design-tile, .design-tile:hover { transition: none; transform: none; }
}
