/* =========================================================
   DAM Games Company — live-site additions
   Behaviour hooks for site.js on top of dam.css (the design system).
   ========================================================= */

html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }

/* Header gets a firmer background once the page scrolls */
.site-header.is-scrolled { background: rgba(6, 10, 20, 0.92); }

/* Scroll-reveal: content is only hidden when JS is running */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal-delay="1"] { transition-delay: 0.08s; }
.js [data-reveal-delay="2"] { transition-delay: 0.16s; }
.js [data-reveal-delay="3"] { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* FAQ uses native <details> so it works without JavaScript */
details.faq-item > summary { list-style: none; }
details.faq-item > summary::-webkit-details-marker { display: none; }
details.faq-item[open] .pm { transform: rotate(45deg); background: var(--text); color: var(--bg); border-color: var(--text); }

/* Lightbox uses the native <dialog> element */
dialog.lightbox { width: min(1100px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
dialog.lightbox::backdrop { background: rgba(3, 5, 12, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
dialog.lightbox[open] { animation: fade 0.25s ease both; }

/* Hero figure keeps its proportions while the SVG scales */
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Home: studio card stack and closing call to action */
.studio-stack { position: relative; height: 480px; max-width: 520px; width: 100%; justify-self: center; }
.studio-card { position: absolute; padding: 22px; }
.studio-card svg { width: 100%; margin-top: 14px; display: block; }
.cta-panel { position: relative; overflow: hidden; border-radius: 32px; border: 1px solid rgba(150,170,215,.2); background: radial-gradient(80% 120% at 85% 0%, rgba(155,107,255,.35) 0%, transparent 55%), radial-gradient(60% 100% at 0% 100%, rgba(255,138,61,.22) 0%, transparent 60%), #0D1530; padding: clamp(48px, 7vw, 104px) clamp(24px, 6vw, 88px); }
.cta-art { position: absolute; right: -60px; top: 50%; width: 460px; height: 460px; transform: translateY(-50%); opacity: .9; }
@media (max-width: 899px) {
  .mobile-panel { min-height: calc(100dvh - 64px); overflow-y: auto; }
}
@media (max-width: 639px) {
  .studio-stack { height: 400px; width: calc(100% - 16px); }
  .cta-art { width: 300px; height: 300px; right: -120px; top: 0; transform: none; opacity: .45; }
}

/* About: process timeline */
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.process li { display: flex; flex-direction: column; gap: 12px; padding: 28px 24px 0 0; }
.process .process-dot { width: 14px; height: 14px; transform: rotate(45deg); margin-top: -36px; margin-bottom: 14px; }
.process p { font-size: 15px; }
@media (max-width: 899px) {
  .process { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-2); padding-left: 24px; gap: 28px; }
  .process li { padding: 0; }
  .process .process-dot { margin: 0 0 4px -32px; }
}

/* Tables and the deletion request preview */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.data-table th { background: var(--surface); text-align: left; padding: 16px 20px; font: 600 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.data-table td { padding: 16px 20px; border-top: 1px solid var(--line); }
.request-preview { margin: 20px 0 0; padding: 20px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-2); font: 500 13px/1.8 var(--font-mono); color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
a.tab { text-decoration: none; }

/* Official logo — shown complete (DAM · GAMES · COMPANY + arcs), never cropped */
:root { --header-h: 92px; }
.bar { height: var(--header-h); }
.brand-logo { display: block; height: 78px; width: auto; transition: filter 0.25s, transform 0.25s var(--ease); }
.brand:hover .brand-logo { filter: drop-shadow(0 0 10px rgba(59, 139, 255, 0.45)); transform: translateY(-1px); }
.footer-brand-link { display: inline-block; }
[id], .prose h2 { scroll-margin-top: calc(var(--header-h) + 20px); }
.footer-logo { display: block; width: 260px; height: auto; }
@media (max-width: 899px) {
  :root { --header-h: 76px; }
  .bar { height: var(--header-h); }
  .brand-logo { height: 64px; }
  .mobile-panel { min-height: calc(100dvh - var(--header-h)); }
}

/* Social placeholders (no profile yet) */
.social .social-ph { width: 44px; height: 44px; border-radius: 12px; border: 1px dashed var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: var(--dim); }
.social .social-ph svg { width: 20px; height: 20px; }

/* Game detail hero */
.detail-art-wrap { position: absolute; inset: 0; }
.detail-art-wrap .detail-art { position: absolute; right: 0; top: 0; width: 70%; height: 100%; }
.detail-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,10,20,.96) 0%, rgba(6,10,20,.8) 42%, rgba(6,10,20,.1) 78%); }
@media (max-width: 899px) {
  .detail-art-wrap .detail-art { width: 100%; opacity: .45; }
  .detail-shade { background: linear-gradient(180deg, rgba(6,10,20,.55) 0%, rgba(6,10,20,.92) 70%); }
}
.info-list { margin: 0; display: grid; grid-template-columns: auto 1fr; font-size: 15px; }
.info-list dt { color: var(--muted); padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.info-list dd { margin: 0; padding: 12px 0; text-align: right; border-bottom: 1px solid var(--line); }
.info-list dt:last-of-type, .info-list dd:last-of-type { border-bottom: 0; }

/* Store badge rendered as a real link */
a.store { text-decoration: none; }

/* Sticky in-page navigation on long legal pages */
.toc a { text-decoration: none; }

/* Pagination counter for the catalogue */
.load-more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; }

/* Copy-button feedback */
[data-copy].is-done { border-color: var(--green); color: var(--green); }

/* Small screens: keep the hero art compact so the headline is visible on first screen */
@media (max-width: 639px) {
  .hero-art { max-width: 300px; }
  .hero { padding-top: 24px; }
  .section-head .btn { width: 100%; }
}

/* ---------- Real in-game footage (home hero, world reel, game page hero) ---------- */
.hero-film { min-height: min(calc(100vh - var(--header-h)), 860px); display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(96px, 12vw, 160px) 0 28px; }
.film { position: absolute; inset: 0; background: #05080F; }
.film-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s var(--ease); }
.film-clip.is-on { opacity: 1; }
.film-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 10, 20, 0.9) 0%, rgba(6, 10, 20, 0.7) 30%, rgba(6, 10, 20, 0.12) 60%, rgba(6, 10, 20, 0) 78%),
    linear-gradient(180deg, rgba(6, 10, 20, 0.5) 0%, rgba(6, 10, 20, 0) 22%, rgba(6, 10, 20, 0) 62%, var(--bg) 100%); }
.hero-film .hero-grid { grid-template-columns: minmax(0, 860px); }
.hero-film .d-hero { font-size: clamp(34px, 4.6vw, 72px); line-height: 1.02; text-wrap: wrap; text-shadow: 0 2px 30px rgba(6, 10, 20, 0.45); }
.hero-film .lead { color: #E3E8F2; }
.film-bar { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 40px; margin-top: clamp(48px, 7vw, 88px); }
.film-caption { margin: 0; font-size: 14px; color: var(--text-soft); }
.film-caption span { font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-right: 10px; }
.film-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 150px)); gap: 14px; }
.film-tab { position: relative; min-height: 56px; padding: 12px 0 0; background: none; border: 0; border-top: 2px solid rgba(205, 211, 225, 0.26); color: var(--text-soft); font: 600 14px var(--font-body); text-align: left; cursor: pointer; transition: color 0.2s; }
.film-tab small { display: block; font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.film-tab::before { content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 0; background: var(--gold); transition: width 0.25s linear; }
.film-tab.is-on { color: #fff; }
.film-tab.is-on::before { width: var(--p, 100%); }
.film-tab:hover { color: #fff; }
@media (max-width: 899px) {
  .hero-film { min-height: min(100svh, 820px); padding-top: 96px; }
  .film-shade { background: linear-gradient(180deg, rgba(6, 10, 20, 0.62) 0%, rgba(6, 10, 20, 0.42) 30%, rgba(6, 10, 20, 0.86) 60%, var(--bg) 100%); }
  .film-tabs { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .film-tab { font-size: 13px; }
}

.world-reel { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: minmax(0, auto); gap: 16px; }
.reel-item { position: relative; margin: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #0B1226; aspect-ratio: 16 / 9; }
.reel-item.is-lead { grid-row: span 2; aspect-ratio: auto; min-height: 100%; }
.reel-item:nth-child(4) { grid-column: span 2; aspect-ratio: 32 / 9; }
.reel-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.reel-item:hover video { transform: scale(1.03); }
.reel-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 18px; background: linear-gradient(180deg, rgba(6, 10, 20, 0) 0%, rgba(6, 10, 20, 0.88) 100%); display: flex; flex-direction: column; gap: 2px; }
.reel-item figcaption small { font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.reel-item figcaption b { font: 600 clamp(17px, 1.6vw, 22px)/1.2 var(--font-display); }
.reel-item figcaption span { font-size: 14px; color: var(--text-soft); }
.with-side .world-reel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.with-side .reel-item.is-lead { grid-row: auto; aspect-ratio: 16 / 9; }
.with-side .reel-item:nth-child(4) { grid-column: auto; aspect-ratio: 16 / 9; }
@media (max-width: 899px) {
  .world-reel, .with-side .world-reel { grid-template-columns: minmax(0, 1fr); }
  .reel-item.is-lead, .reel-item:nth-child(4) { grid-row: auto; grid-column: auto; aspect-ratio: 16 / 9; }
}
/* Portrait games: upright phone clips, four across (two on phones) */
.world-reel.is-portrait, .with-side .world-reel.is-portrait { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.world-reel.is-portrait > .reel-item:nth-child(n) { grid-row: auto; grid-column: auto; aspect-ratio: 9 / 16; min-height: 0; }
.world-reel.is-portrait .reel-item figcaption { padding: 48px 14px 14px; }
.world-reel.is-portrait .reel-item figcaption b { font-size: clamp(16px, 1.4vw, 19px); }
.world-reel.is-portrait .reel-item figcaption span { font-size: 13px; }
@media (max-width: 1099px) { .with-side .world-reel.is-portrait { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .world-reel.is-portrait, .with-side .world-reel.is-portrait { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .world-reel.is-portrait .reel-item figcaption span { display: none; } }
@media (prefers-reduced-motion: reduce) { .reel-item:hover video { transform: none; } .film-clip { transition: none; } }

.detail-art-wrap .detail-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
@media (max-width: 899px) { .detail-art-wrap .detail-film { width: 100%; opacity: 0.5; } }

/* ---------- Games not ready to show yet (games.json "inactive": true) ---------- */
.gcard.is-inactive { background: #0B1020; border-color: rgba(150, 170, 215, 0.08); }
.gcard.is-inactive .gcard-cover { filter: grayscale(1) brightness(0.55); }
.gcard.is-inactive .gcard-body { opacity: 0.55; }
.gcard.is-inactive:hover, .gcard.is-inactive:focus-within { transform: none; box-shadow: none; border-color: rgba(150, 170, 215, 0.08); }
.gcard.is-inactive:hover .gcard-cover .art { transform: none; }
.gcard-link.is-off { color: var(--muted); font-weight: 600; cursor: default; }
.status-off { color: #C7CEDD; background: rgba(6, 10, 20, 0.75); }
.status-off::before { background: #8F9AB5; box-shadow: none; }

/* Footer: brand + one Studio column */
.footer-grid { grid-template-columns: minmax(0, 1fr) minmax(180px, auto); align-items: start; }
@media (max-width: 899px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* Portrait games (games.json "shotsPortrait": true): show each screenshot whole */
.is-portrait .gallery-main, .is-portrait .thumb { background: #05080F; }
.is-portrait .gallery-main .cover-img, .is-portrait .thumb .cover-img { object-fit: contain; }
[data-lightbox-stage] .cover-img { object-fit: contain; }
.is-portrait .gallery-slide, .is-portrait .thumb { background: #05080F !important; }

/* Privacy Policy: key facts under the title */
.legal-facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 4px 0 0; }
.legal-facts dt { font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.legal-facts dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--text); }
