/*
 * Copyright (c) 2024-2026 Luca Vitiello. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-Proprietary
 */

/* ═══════════════════════════════════════════════════════════════════════
   Homepage additions (October 2026). Loaded after main.css on index.html
   only; extends the shared tokens and classes, never renames them.
═══════════════════════════════════════════════════════════════════════ */

/* ── Focus ────────────────────────────────────────────────────────────── */
.product-home :focus-visible {
  outline: 2px solid var(--blue-hi);
  outline-offset: 4px;
}

/* The hero sits inside <main>, so main.css's `.nav:has(+ .hero)` no longer
   matches. Re-create "transparent until scrolled" for this page only; the
   open mobile menu keeps its solid background. */
.product-home .nav:not(.scrolled):not(.open) {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.product-home .hero { padding: 112px 0 3rem; }

.product-home .hero-eyebrow { margin-bottom: 1.25rem; }

.beta-tag {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border-3);
  color: var(--text-2);
  font-size: 0.68rem;
  white-space: nowrap;
  vertical-align: 1px;
}

.product-home .hero-sub {
  max-width: 62ch;
  margin-bottom: 2rem;
}

.product-home .log-section { padding-bottom: 4rem; }
.product-home .log-body { line-height: 1.9; }

/* ── Product screenshots ──────────────────────────────────────────────── */
.product-section .shot + .shots-stack,
.shots-stack .shot + .shot,
.engine-section .text-link + .shot,
.setup-section .how-inner + .shot {
  margin-top: 3rem;
}

/* Detail crops are shown at their natural 1x width so the UI text is
   readable; the lightbox still enlarges them. On wide viewports the
   caption sits beside the panel instead of leaving the right third empty. */
.shot-detail {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  gap: 0.75rem 2.5rem;
  align-items: start;
}

@media (min-width: 1100px) {
  .shot-detail { grid-template-columns: minmax(0, 760px) minmax(14rem, 1fr); }
  .shot-detail .shot-caption {
    margin-top: 0;
    padding-top: 2.75rem;
    font-family: var(--f-ui);
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.7;
  }
  .shot-detail .shot-caption b { color: var(--text-1); font-weight: 600; }
}

.feature-example .ok { color: var(--green); }

/* The nowrap example line must scroll inside its card, not widen the grid. */
.product-home .feature-card { min-width: 0; }

/* ── Unreal import cards ──────────────────────────────────────────────── */
.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-2);
  border: 1px solid var(--border-2);
}

.engine-grid article {
  background: var(--bg);
  padding: 2rem 2rem 1.75rem;
}

.engine-grid article:hover { background: var(--surface-1); }

/* These are named concepts (profile, manifest, stack), not bridge events, so
   they don't get the amber event-hook style: a neutral mono key tag instead. */
.engine-grid .feature-hook {
  display: inline-block;
  margin-bottom: 0.9rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border-3);
  border-radius: var(--r);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-2);
}

.engine-grid h3 {
  font-family: var(--f-dis);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.6rem;
}

.engine-grid p {
  font-size: 0.925rem;
  color: var(--text-2);
  line-height: 1.7;
}

.engine-grid code {
  font-family: var(--f-mon);
  font-size: 0.82em;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r);
  padding: 0.05rem 0.35rem;
}

.text-link {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--blue-hi);
}

.text-link:hover { color: var(--blue); }

/* ── Setup ────────────────────────────────────────────────────────────── */
.setup-section {
  border-top: 1px solid var(--border-1);
  background: var(--surface-1);
}

.setup-section .step { border-top-color: var(--border-2); }

.studio-column { padding-top: 0.35rem; }

.studio-label {
  font-family: var(--f-mon);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.studio-links { display: grid; }

.studio-links a {
  padding: 0.9rem 0;
  border-top: 1px solid var(--border-2);
  font-size: 0.95rem;
  color: var(--text-2);
  transition: color 0.12s;
}

.studio-links a:last-child { border-bottom: 1px solid var(--border-2); }
.studio-links a:hover { color: var(--blue-hi); }

.setup-section .shot .log-panel { background: var(--bg); }

/* ── Docs cards ───────────────────────────────────────────────────────── */
.docs-section { border-top: 1px solid var(--border-1); }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-2);
  border: 1px solid var(--border-2);
}

.guide-grid a {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg);
  transition: background 0.15s;
}

.guide-grid a:hover { background: var(--surface-1); }

.guide-grid span {
  font-family: var(--f-mon);
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 0.9rem;
}

.guide-grid h3 {
  font-family: var(--f-dis);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.5rem;
}

.guide-grid p {
  font-size: 0.925rem;
  color: var(--text-2);
  line-height: 1.7;
}

.guide-grid b {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--blue-hi);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .engine-grid, .guide-grid { grid-template-columns: 1fr; }
  .engine-grid article, .guide-grid a { padding: 1.5rem; }
  .studio-column { padding-top: 0; }
}

/* Below 720px the log's fixed four-column rows no longer fit the viewport.
   Stack each entry: time · source · event on one row, payload wrapped on
   the next, so the log reads without horizontal scrolling. */
@media (max-width: 720px) {
  .product-home .log-body {
    font-size: 0.78rem;
    line-height: 1.55;
    padding: 0.75rem 1rem;
    overflow-x: visible;
  }
  .product-home .log-line {
    min-width: 0;
    white-space: normal;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "t s e"
      "p p p";
    gap: 0 0.9rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--border-1);
  }
  .product-home .log-line:first-child { border-top: 0; }
  .product-home .log-line .lt { grid-area: t; }
  .product-home .log-line .ls { grid-area: s; }
  .product-home .log-line .le { grid-area: e; }
  .product-home .log-line .lp { grid-area: p; overflow-wrap: anywhere; }
  .product-home .log-line:last-child {
    grid-template-areas: "p p p";
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }
  .product-home .log-line:last-child .lt,
  .product-home .log-line:last-child .ls,
  .product-home .log-line:last-child .le { display: none; }
}

@media (max-width: 640px) {
  .product-home .hero { padding: 104px 0 2.5rem; }
  /* Let the headline wrap to the viewport instead of the desktop line break. */
  .product-home .hero-title br { display: none; }
  .shot-caption b { font-weight: 600; }
}

@media (max-width: 480px) {
  .product-home .hero-cta .btn-primary { padding: 0.7rem 1.1rem; }
  .product-home .hero-cta .btn-ghost { padding: 0.7rem 1rem; }
}
