/* ---- Home page (home.js) ----
   The hero keeps the model on the left; the intro on the right leads with a search field. Each layer
   and system carries its colour (--c), the same colour as its switch on the model pages. */
.layer-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; } /* below the model */
.layer-chips button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 13.5px/1.2 inherit; font-family: inherit; cursor: pointer; }
.layer-chips button[data-layer]::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.layer-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.layer-chips button.busy::after { content: '…'; }

.v2home .home-hero > * { min-width: 0; } /* the scrolling layer row must not widen the column */
.v2home .home-intro { padding-top: 6px; }
.v2home .region-list { margin-top: 22px; }
.v2home .home-intro .lead { margin-bottom: 22px; }
.hero-search { display: flex; align-items: center; gap: 12px; max-width: 520px; height: 56px; padding: 0 20px; border: 1.5px solid #cfc9bc; border-radius: 999px; background: var(--card); color: #7a8288; font-size: 17px; text-decoration: none; cursor: text; box-shadow: 0 6px 20px rgba(28, 33, 38, 0.06); }
.hero-search:hover { border-color: var(--muted); }
.hero-search svg { flex: none; width: 21px; height: 21px; color: var(--ink); }
.hero-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.region-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.region-cards li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color 0.15s; }
.region-cards li:hover, .region-cards li.on { border-color: var(--focus); }
.region-cards .thumb { display: block; aspect-ratio: 1280 / 800; background: radial-gradient(120% 90% at 50% 35%, var(--stage-a), var(--stage-b)); }
.region-cards .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.region-cards .meta { padding: 10px 13px 12px; }
.region-cards h3 { margin: 0 0 6px; font-size: 16px; }
.region-cards h3 a { color: var(--ink); text-decoration: none; }
.region-cards .sys { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: 13px; }
.region-cards .sys a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; }
.region-cards .sys a::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
.region-cards .sys a:hover { color: var(--ink); }

.system-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.system-cards a { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color 0.15s; }
.system-cards a:hover { border-color: var(--focus); }
.system-cards .pic { display: block; aspect-ratio: 16 / 11; background: radial-gradient(120% 90% at 50% 35%, var(--stage-a), var(--stage-b)); border-bottom: 3px solid var(--c); overflow: hidden; }
.system-cards .pic img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); transition: transform 0.3s; }
.system-cards a:hover .pic img { transform: scale(1.32); }
.system-cards .txt { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 11px 14px 13px; }
.system-cards strong { font-size: 16px; }
.system-cards .txt span { grid-column: 1 / -1; color: var(--muted); font-size: 14px; line-height: 1.45; }
.system-cards em { align-self: center; font-style: normal; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.home-index { margin: 30px 0 40px; font-size: 15.5px; font-weight: 600; }
.home-index a { text-decoration: none; }

@media (max-width: 860px) {
  .v2home .home-intro { padding-top: 0; }
  .system-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .layer-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 10px -20px 0; padding: 0 20px; }
  .layer-chips::-webkit-scrollbar { display: none; }
  .layer-chips button { flex: none; min-height: 40px; }
  .hero-search { height: 52px; font-size: 16px; }
  .region-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .region-cards .meta { padding: 8px 10px 10px; }
  .region-cards .sys { font-size: 12px; gap: 3px 8px; }
  .system-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .system-cards .txt { padding: 8px 10px 10px; }
  .system-cards .txt span { font-size: 13px; }
  .system-cards strong { font-size: 14.5px; }
  .system-cards em { grid-column: 1 / -1; grid-row: 3; font-size: 12px; }
}

/* the X-ray box sits in the model's top-left corner, as on the model pages, on phones too */
.v2home .viewer-panel { width: auto; }
@media (max-width: 620px) {
  .v2home .viewer-panel { position: absolute; left: 10px; top: 10px; right: auto; bottom: auto; margin: 0; }
  .v2home .viewer-panel button { flex: none; min-height: 40px; }
}

/* full page, as on the model pages */
.v2home .home-viewer.fullpage { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; border-radius: 0; }
.v2home .viewer-tools [data-fullpage] { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding-left: 0; padding-right: 0; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E"); }
.v2home .viewer-tools [data-fullpage][aria-pressed="true"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5'/%3E%3C/svg%3E"); }
.v2home .viewer-tools [data-fullpage]::before { content: ''; width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }

/* the region names beside the model, three to a row; pointing at one lights it up */
.region-grid { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.region-grid a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 16.5px; font-weight: 600; text-decoration: none; }
.region-grid li:hover a, .region-grid li.on a { border-color: var(--focus); box-shadow: inset 3px 0 0 var(--focus); }
@media (max-width: 620px) { .region-grid { grid-template-columns: 1fr 1fr; } }
