/* Page-specific */

/* ---- Landing product strip ---- */
.product-split {
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 800px) {
  .product-split { grid-template-columns: 1fr 1fr; }
}
.product-split .card h3 { color: var(--amber); }
.layer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.layer-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--night-line);
  color: rgba(243, 235, 224, 0.85);
}
.layer-list li:last-child { border-bottom: 0; }
.layer-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--coral);
  width: 1.5rem;
}

/* ---- Market pages ---- */
.market-hero {
  padding: var(--space-7) 0 var(--space-5);
}
.market-hero.business .accent-bar { background: var(--coral); }
.market-hero.accessibility .accent-bar { background: var(--cyan); }
.market-hero.elderly .accent-bar { background: var(--amber); }

.accent-bar {
  width: 3rem;
  height: 3px;
  margin-bottom: var(--space-4);
  border-radius: 2px;
}

.field-demo {
  display: grid;
  gap: var(--space-3);
}
.field-row {
  display: grid;
  gap: 0.25rem;
}
.field-row label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-row .fake {
  background: rgba(243, 235, 224, 0.04);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: rgba(243, 235, 224, 0.55);
  font-style: italic;
}
.field-row .fake.big {
  font-size: 1.35rem;
  font-style: normal;
  font-family: var(--font-display);
  color: var(--paper);
  min-height: 3.25rem;
  display: flex;
  align-items: center;
}

.elderly-preview .btn-big {
  width: 100%;
  min-height: 3.5rem;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  background: var(--paper);
  color: var(--night);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 600;
  cursor: default;
}
.elderly-preview .btn-big.emergency {
  background: var(--coral);
  color: #fff;
}

.access-script {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--paper);
  background: rgba(31, 247, 242, 0.06);
  border: 1px solid rgba(31, 247, 242, 0.25);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
}
.access-script em {
  color: var(--cyan);
  font-style: normal;
  border-bottom: 1px dashed var(--cyan);
}

/* ---- Configurator ---- */
.config-layout {
  display: grid;
  gap: var(--space-6);
  padding-bottom: var(--space-7);
}
@media (min-width: 960px) {
  .config-layout {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}
.config-panel {
  background: var(--night-elev);
  border: 1px solid var(--night-line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.config-panel h2 {
  font-size: 1.1rem;
  margin-bottom: var(--space-4);
}
.stock-options {
  display: grid;
  gap: 0.75rem;
}
.stock-option {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.stock-option:hover,
.stock-option[aria-pressed="true"] {
  border-color: var(--coral);
  background: rgba(232, 93, 48, 0.08);
}
.stock-swatch {
  width: 56px;
  height: 72px;
  border-radius: 6px;
  border: 1px solid var(--night-line);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}
.stock-swatch.dir-a {
  background:
    linear-gradient(160deg, #1a1612 0%, #2a2218 60%, #3d2a1a 100%);
}
.stock-swatch.dir-b {
  background: linear-gradient(180deg, #0a0c10, #1a1f28);
  box-shadow: inset 0 0 0 1px rgba(243, 235, 224, 0.15);
}
.stock-swatch.dir-c {
  background: linear-gradient(180deg, #e8dcc8, #f3ebe0);
}
.stock-swatch.dir-custom {
  background:
    repeating-linear-gradient(45deg, #2a3444, #2a3444 4px, #1c2430 4px, #1c2430 8px);
}
.stock-meta strong { display: block; color: var(--paper); font-size: 0.95rem; }
.stock-meta span { font-size: 0.8rem; color: var(--muted); }
.stock-letter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
}

.custom-photo-zone {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px dashed var(--night-line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.custom-photo-zone.is-active {
  border-color: var(--amber);
  color: var(--amber);
}

/* Case face variants driven by data-direction */
.case-back-face {
  background: #1a1612;
}
.case-shell[data-direction="A"] .case-back-face {
  background: linear-gradient(165deg, #1a1612 0%, #2c2218 55%, #3a2818 100%);
}
.case-shell[data-direction="B"] .case-back-face {
  background: #0a0c10;
}
.case-shell[data-direction="B"] .qr-zone {
  background: #f3ebe0;
  box-shadow: 0 0 0 1px rgba(243, 235, 224, 0.5);
}
.case-shell[data-direction="C"] .case-back-face {
  background: #e8dcc8;
}
.case-shell[data-direction="C"] .motif-zone { opacity: 0.35; filter: grayscale(0.3); }
.case-shell[data-direction="C"] .qr-zone {
  width: 30%;
  background: #fff;
  box-shadow: 0 0 0 3px #1a1612;
}
.case-shell[data-direction="custom"] .case-back-face {
  background:
    linear-gradient(rgba(20,24,32,0.2), rgba(20,24,32,0.35)),
    repeating-conic-gradient(#4a5568 0% 25%, #3a4454 0% 50%) 0 0 / 24px 24px;
}
.case-shell[data-direction="custom"] .motif-zone { display: none; }
.case-shell[data-direction="custom"] .qr-zone {
  background: #f3ebe0;
  box-shadow: 0 0 0 4px #141820, 0 0 0 6px rgba(243, 235, 224, 0.3);
}
.case-shell[data-direction="custom"] .qr-plate-label {
  display: block;
}

.qr-plate-label {
  display: none;
  position: absolute;
  bottom: calc(9% + 26% + 4px);
  right: 10%;
  width: 26%;
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  text-align: center;
  z-index: 3;
}

/* ---- Resonant showcase ---- */
.resonant-layout {
  display: grid;
  gap: var(--space-6);
  padding-bottom: var(--space-7);
}
@media (min-width: 900px) {
  .resonant-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.placement-spec {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(243, 235, 224, 0.7);
}
.placement-spec dt {
  color: var(--coral);
  margin-top: 0.75rem;
}
.placement-spec dd { margin: 0.15rem 0 0; }

/* Motif wireframe + spin */
.motif-compose {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.motif-compose .hand-sil {
  position: absolute;
  inset: 8% 5% 0;
  width: 90%;
  height: 90%;
  z-index: 1;
}
.motif-compose .globe-spin {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 52%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  z-index: 2;
  animation: globe-rotate 12s linear infinite;
  transform-origin: center center;
}
.motif-compose .globe-spin {
  /* keep translate with rotate via wrapper */
}
.globe-wrap {
  position: absolute;
  top: 6%;
  left: 50%;
  width: 54%;
  aspect-ratio: 1;
  margin-left: -27%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.globe-wrap .globe-spin {
  position: relative;
  top: auto; left: auto;
  width: 100%;
  transform: none;
  margin: 0;
  animation: globe-rotate 14s linear infinite;
}

@keyframes globe-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Polly sprite sheet hook — if spin PNG lands, apply as stepped frames */
.motif-pixel-sheet {
  width: 100%;
  aspect-ratio: 1;
  background-image: var(--asset-motif-spin);
  background-size: 400% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: sheet-spin 1.2s steps(4) infinite;
}
@keyframes sheet-spin {
  from { background-position: 0 0; }
  to { background-position: 100% 0; }
}

.provisional-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(212, 160, 90, 0.12);
  border: 1px solid rgba(212, 160, 90, 0.35);
  border-radius: var(--radius);
  margin-bottom: var(--space-5);
  font-size: 0.9rem;
  color: var(--amber);
}

.case-shell[data-direction="B"] .motif-compose {
  filter: brightness(1.4) contrast(1.1);
  opacity: 0.85;
}

/* Polly spin sheet: 256×64 = 4 frames @ 64×64 */
.motif-pixel-sheet {
  width: 100%;
  max-width: 128px;
  aspect-ratio: 1;
  margin-inline: auto;
  background-image: var(--asset-motif-spin);
  background-size: 400% 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: sheet-spin 1s steps(4) infinite;
}
@keyframes sheet-spin {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

.motif-static-pixel {
  width: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.case-shell .motif-zone .motif-pixel-sheet {
  max-width: none;
  width: 100%;
}

/* Wireframe globe layer (fallback / education) */
.wire-compose {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.wire-compose .hand-sil {
  position: absolute;
  inset: 18% 4% 0;
  width: 92%;
  opacity: 0.9;
}
.wire-compose .globe-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 56%;
  margin-left: -28%;
  aspect-ratio: 1;
  z-index: 2;
}
.wire-compose .globe-spin {
  width: 100%;
  animation: globe-rotate 14s linear infinite;
}

body {
  background-color: var(--night-deep, #0C0F14);
}
