/* Project pages: full-bleed trailer up top, then a fact sheet, the pillars, and one gallery specific to each game.
   Builds on styles.css (tokens, nav, buttons, tags, sprites, journal mock). */

/* ---------- Trailer hero ---------- */
main > section.pv-hero { position: relative; max-width: none; padding: 0; }
.pv-media {
  position: relative; overflow: hidden;
  width: 100%; max-width: 100%;
  aspect-ratio: 16 / 9; max-height: min(78vh, 820px);
  background: var(--bg-2);
}
.pv-fallback { position: absolute; inset: 0; }
.pv-fallback > img { width: 100%; height: 100%; object-fit: cover; }
/* The video stays invisible until it has a frame to show, so the art underneath is what people see
   while it loads, or for good if the file isn't there yet. */
.pv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease; }
.pv-hero.has-video .pv-video { opacity: 1; }
/* Trailers carry their own captions and logos, often low in the frame, so once one plays the title
   moves below it and the frame stays clear. */
.pv-hero.has-video .pv-title { position: static; padding-top: clamp(20px, 3vw, 32px); }
.pv-hero.has-video .pv-scrim { background: linear-gradient(0deg, var(--bg) 0%, transparent 12%); }
.pv-hero.has-video .pv-title h1, .pv-hero.has-video .pv-tagline { text-shadow: none; }
.pv-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 9, 16, 0.55) 0%, transparent 22%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11, 9, 16, 0.82) 22%, transparent 58%);
}

.pv-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: var(--wrap); margin: 0 auto;
  padding-block: 0 clamp(28px, 5vw, 56px);
  padding-left: var(--pad-l); padding-right: var(--pad-r);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.pv-title-text { min-width: 0; max-width: 760px; }
.pv-title h1 { font-size: clamp(2.3rem, 6vw, 5rem); margin: 14px 0 10px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.pv-tagline { font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--text); max-width: 36em; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }

.back-link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 500 0.75rem/1 var(--font-label); letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.back-link:hover { color: var(--lavender); }
.back-link:focus-visible, .pv-btn:focus-visible, .next-card:focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; }

.pv-controls { display: flex; gap: 8px; flex: none; }
.pv-controls[hidden], .pv-btn[hidden] { display: none; }
.pv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(11, 9, 16, 0.6); color: var(--text);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 500 0.72rem/1 var(--font-label); letter-spacing: 0.16em; text-transform: uppercase;
  transition: background 0.2s;
}
.pv-btn:hover { background: rgba(155, 108, 240, 0.25); }
.pv-btn svg { width: 16px; height: 16px; fill: currentColor; }
.pv-btn .on, .pv-btn[aria-pressed="true"] .off { display: none; }
.pv-btn[aria-pressed="true"] .on { display: inline; }

/* ---------- Intro + fact sheet ---------- */
.pv-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.pv-intro-text { display: grid; gap: 1.1rem; }
.pv-intro-text p { color: var(--muted); font-size: 1.08rem; max-width: 38em; }
.pv-intro-text p:first-of-type { color: var(--text); font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.55; }
.facts { margin: 0; border-top: 2px solid var(--violet); }
.facts div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 500 0.72rem/1.6 var(--font-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 0.95rem; }
.facts .gold { color: var(--gold); }

/* ---------- Pillars ---------- */
.pillars { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pillars.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pillars li { background: var(--bg); padding: clamp(24px, 3vw, 36px); }
.pillars h3 { color: var(--lavender); margin-bottom: 0.6rem; font-size: 1.2rem; }
.pillars p { color: var(--muted); font-size: 0.97rem; }
.pillars .step { display: block; font: 700 0.85rem/1 var(--font-display); color: var(--violet); margin-bottom: 14px; }

/* ---------- Generic tile grid (modules, systems) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 0.9rem; }
.chip-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.chip-groups h3 { font: 500 0.78rem/1 var(--font-label); letter-spacing: 0.24em; text-transform: uppercase; color: var(--violet); margin-bottom: 16px; }

/* ---------- Sillage: hero scene, roster, bestiary ---------- */
.pv-fallback.sillage-art { padding: 0 10% 24%; }
.pv-fallback.sillage-art .sprite { --size: clamp(56px, 8vw, 110px); }
.pv-fallback.sillage-art .sprite-boss { --size: clamp(110px, 15vw, 200px); }

.roster { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.roster li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; display: grid; justify-items: center; text-align: center; gap: 6px; }
.roster .sprite { --size: 96px; animation-duration: 1s; }
.roster b { font-family: var(--font-display); color: var(--lavender); font-size: 1.05rem; }
.roster small { color: var(--muted); font-size: 0.85rem; }

.biomes { display: grid; gap: 20px; }
.biome { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.biome header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.biome h3 { color: var(--lavender); font-size: 1.15rem; }
.biome header p { color: var(--muted); font-size: 0.9rem; }
.biome ul { list-style: none; margin: 0; padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.biome li { display: grid; justify-items: center; align-content: end; gap: 8px; min-height: 150px; padding: 10px 6px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); text-align: center; }
.biome li span:last-child { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.biome .sprite { --size: 72px; }
.biome .sprite.big { --size: 120px; }
.biome-shore { --tint: rgba(70, 170, 160, 0.16); }
.biome-isle { --tint: rgba(210, 180, 90, 0.14); }
.biome-ether { --tint: rgba(140, 120, 240, 0.18); }
.biome-wild { --tint: rgba(120, 170, 70, 0.15); }
.biome header { background: linear-gradient(90deg, var(--tint), transparent 70%); }

.boss-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px; border: 1px solid rgba(255, 110, 130, 0.35); border-radius: var(--radius); background: linear-gradient(120deg, rgba(255, 70, 90, 0.1), transparent 60%), var(--surface); }
.boss-card .sprite { --size: 150px; filter: drop-shadow(0 0 22px rgba(255, 70, 90, 0.4)); }
.boss-card h3 { color: var(--lavender); font-size: 1.5rem; margin: 10px 0 8px; }
.boss-card p { color: var(--muted); }

/* ---------- Quidditch: season timeline and crest wall ---------- */
.season { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.season::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--violet)); opacity: 0.6; }
.season li { position: relative; padding: 30px 16px 0 0; }
.season li::before { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.season time { font: 500 0.75rem/1 var(--font-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.season h3 { margin: 10px 0 6px; font-size: 1.05rem; color: var(--lavender); }
.season p { color: var(--muted); font-size: 0.9rem; }

.crest-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; }
.crest-wall li { display: grid; justify-items: center; gap: 10px; padding: 18px 8px; text-align: center; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.25s, transform 0.25s; }
.crest-wall li:hover { border-color: rgba(232, 196, 106, 0.5); transform: translateY(-3px); }
.crest-wall img { width: 64px; height: 64px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.crest-wall span { font-size: 0.78rem; line-height: 1.3; color: var(--muted); }
.crest-wall b { display: block; color: var(--text); font-weight: 600; }

/* ---------- Journal ---------- */
/* The phone sits right of centre so the title can take the lower left. */
.pv-fallback.journal-art { min-height: 0; justify-content: flex-end; padding-right: clamp(40px, 18vw, 340px); }
.pv-fallback.journal-art .jphone { transform: rotate(-3deg) scale(1.15); }
.pv-fallback.journal-art .j-notif { right: 5%; top: 30%; }
.pv-fallback.journal-art .journal-icon { left: auto; right: 24px; top: 24px; }

/* ---------- ArcanaOS fallback ---------- */
/* The dashboard is busy, so it sits back behind the title until the trailer exists. */
.pv-fallback.arcana-art > img { object-position: 50% 45%; transform: scale(1.06); filter: saturate(0.85) brightness(0.42) blur(1.5px); }

/* ---------- Quidditch fallback ---------- */
/* The cover carries its own logo, so on wide screens it moves right, clear of the page title. */
.pv-fallback.quid-art { background: #0a1024; }
@media (min-width: 721px) {
  .pv-fallback.quid-art > img {
    position: absolute; right: 0; top: 0; width: 64%; height: 100%; object-fit: cover; object-position: 50% 40%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%);
    mask-image: linear-gradient(90deg, transparent, #000 35%);
  }
  .quid-page .pv-title-text { max-width: 520px; }
}

/* ---------- Next projects ---------- */
.next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.next-card {
  display: grid; gap: 8px; padding: 24px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.25s, transform 0.25s;
}
.next-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.next-card small { font: 500 0.7rem/1 var(--font-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--violet); }
.next-card b { font-family: var(--font-display); font-size: 1.25rem; color: var(--lavender); }
.next-card span { color: var(--muted); font-size: 0.9rem; }

.pv-section-head { margin-bottom: 36px; max-width: 720px; }
.pv-section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.pv-section-head p:not(.eyebrow) { color: var(--muted); margin-top: 0.9rem; font-size: 1.05rem; }
main > section.tight { padding-block: clamp(48px, 6vw, 80px); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pv-intro { grid-template-columns: 1fr; }
  .pillars.three { grid-template-columns: 1fr 1fr; }
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crest-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .season { grid-template-columns: 1fr; gap: 22px; padding-left: 30px; }
  .season::before { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(180deg, var(--gold), var(--violet)); }
  .season li { padding: 0; }
  .season li::before { left: -30px; top: 2px; }
  .next-grid { grid-template-columns: 1fr; }
}

/* On phones the 16:9 frame is too short to carry the title, so the title drops below it. */
@media (max-width: 720px) {
  .pv-title { position: static; flex-direction: column; align-items: stretch; padding-top: 20px; }
  .pv-controls { order: -1; }
  .pv-scrim { background: linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
  .pv-media { max-height: none; }
  .pv-fallback.journal-art { justify-content: center; padding: 0; }
  .pv-fallback.journal-art .jphone { transform: rotate(-3deg) scale(0.42); }
  .pv-fallback.journal-art .j-notif { transform: scale(0.62); transform-origin: right center; right: 4%; top: 38%; }
  .pv-fallback.journal-art .journal-icon { width: 36px; height: 36px; top: 14px; right: 14px; }
}

@media (max-width: 600px) {
  .pillars, .pillars.three, .chip-groups { grid-template-columns: 1fr; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crest-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .boss-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .facts div { grid-template-columns: 7em minmax(0, 1fr); }
  .pv-fallback.sillage-art { padding: 0 4% 24%; }
  .pv-fallback.sillage-art .sprite { --size: 40px; }
  .pv-fallback.sillage-art .sprite-boss { --size: 76px; }
}
