/* ==========================================================================
   PicoBlu — component + layout layer (rides on tokens.css)
   ONE coherent system: same containers, card component, rhythm on every page.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body { margin: 0; overflow-x: hidden; background: transparent; }
img, svg, video { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---- Background environment — ONE cohesive dark "space" the page sits in -- */
.site-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background-color: var(--ink-950);
  /* faint fallback glow if the rendered plate fails to load */
  background-image:
    radial-gradient(85% 55% at 50% -8%, rgba(47,127,208,0.12), transparent 62%),
    radial-gradient(70% 50% at 8% 20%, rgba(18,41,74,0.10), transparent 58%); }
.site-bg-plate { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0; opacity: 0.9; mix-blend-mode: screen; }
.site-bg::after { content: ""; position: absolute; inset: 0;
  background-image: url(/assets/img/bg-noise.png); background-size: 200px; opacity: 0.045; }

/* ---- Containers ---------------------------------------------------------- */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { width: 100%; max-width: var(--container-wide); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-tight { padding-block: var(--space-8); }

.eyebrow { color: var(--brand-400); font-size: var(--fs-overline); text-transform: uppercase; letter-spacing: var(--tracking-overline); font-weight: var(--fw-semibold); margin: 0 0 var(--space-3); }
.section-head { max-width: var(--container-narrow); margin: 0 0 var(--space-7); }
.section-head h2 { margin: 0 0 var(--space-4); }
.section-head p { color: var(--text-secondary); font-size: var(--fs-lead); line-height: var(--lh-snug); margin: 0; }

/* ---- Buttons ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--btn-height); padding-inline: var(--btn-padding-x); border-radius: var(--btn-radius);
  font-family: var(--font-body); font-size: var(--fs-body-sm); font-weight: var(--fw-semibold);
  text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base), transform var(--dur-base); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-600); color: var(--text-on-brand); }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--brand-500); }
.btn-lg { height: var(--btn-height-lg); font-size: var(--fs-body); }

/* ---- Header / nav -------------------------------------------------------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-height);
  background: rgba(10,10,10,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur-base), background var(--dur-base); }
.site-header.scrolled { border-bottom-color: var(--border-soft); background: rgba(10,10,10,0.9); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { display: inline-flex; align-items: center; gap: var(--space-3); }
.nav-logo img { height: 30px; width: auto; }
.nav-wordmark { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 1.35rem;
  letter-spacing: -0.01em; color: var(--text-primary); line-height: 1; }
.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links a { color: var(--text-secondary); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); text-decoration: none; transition: color var(--dur-base); }
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: var(--space-5); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text-primary); cursor: pointer; padding: var(--space-2); }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---- Hero ---------------------------------------------------------------- */
/* Hero is transparent so the fixed background-space glow reads through it. */
.hero { position: relative; padding-top: calc(var(--nav-height) + var(--space-8)); padding-bottom: var(--space-9);
  min-height: 92vh; display: flex; align-items: center; text-align: center;
  /* dark pool centered on the content so the reveal + headline sit on clean near-black,
     while the top of the fixed background-space glow still reads as atmosphere above it */
  background: radial-gradient(115% 62% at 50% 60%, #0a0a0a 34%, rgba(10,10,10,0) 78%); }
.hero-inner { max-width: var(--container-narrow); margin-inline: auto; display: flex; flex-direction: column; align-items: center; }
/* Reveal: two stacked videos. The loop plays underneath; the intro plays once on top then
   fades out (its last frame == the loop's first frame, so the handoff is seamless). The video
   content is light-on-near-black; edges are feathered into the surrounding space. */
.hero-reveal { position: relative; width: min(540px, 84vw); aspect-ratio: 16/9; margin-bottom: var(--space-6);
  -webkit-mask-image: radial-gradient(ellipse 78% 82% at 50% 50%, #000 22%, transparent 82%);
  mask-image: radial-gradient(ellipse 78% 82% at 50% 50%, #000 22%, transparent 82%); }
.hero-reveal video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.reveal-loop { z-index: 1; }
.reveal-intro { z-index: 2; opacity: 1; transition: opacity 550ms var(--ease-out); }
.reveal-intro.done { opacity: 0; }
/* Long locked hero sentence → smaller display step + wider measure so it doesn't wall up */
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); font-weight: var(--fw-bold); line-height: 1.12; letter-spacing: var(--tracking-display); margin: 0 0 var(--space-5); max-width: 22ch; }
.hero .lead { max-width: 60ch; margin: 0 auto var(--space-7); }
.hero-cta { display: flex; gap: var(--space-4); flex-wrap: wrap; justify-content: center; }

/* ---- Logo belt ----------------------------------------------------------- */
.belt { padding-block: var(--space-8); border-block: 1px solid var(--border-soft); background: var(--ink-900); }
.belt-label { text-align: center; color: var(--text-tertiary); font-size: var(--fs-overline); text-transform: uppercase; letter-spacing: var(--tracking-overline); font-weight: var(--fw-semibold); margin: 0 0 var(--space-6); }
.belt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-7) var(--space-8); }
.belt-row img { height: var(--logo-belt-height); width: auto; opacity: var(--logo-belt-opacity);
  filter: brightness(0) invert(1); transition: opacity var(--dur-base); }
.belt-row img:hover { opacity: 1; }

/* ---- Divisions grid (the coherence component) ---------------------------- */
.divisions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); }
.division-card { display: flex; flex-direction: column; background: var(--surface-1);
  border: 1px solid var(--border-soft); border-radius: var(--card-radius); overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base); }
.division-card:hover { border-color: var(--brand-500); transform: translateY(-2px); box-shadow: var(--glow-brand); }
.division-visual { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--gradient-panel); border-bottom: 1px solid var(--border-soft); }
.division-visual img { width: 100%; height: 100%; object-fit: cover; }
.division-visual.contain { background: #0c0e13; }
.division-visual.contain img { object-fit: contain; padding: var(--space-5); }
/* type-led visual panel (fallback where no clean photo exists) */
.visual-type { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4);
  height: 100%; background: linear-gradient(150deg, var(--brand-900) 0%, var(--surface-1) 70%); }
.visual-type.eco { background: linear-gradient(150deg, #0e2a1f 0%, var(--surface-1) 70%); }
.visual-type svg { width: 60px; height: 60px; opacity: 0.9; }
.visual-type .vt-mark { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h3); color: var(--text-primary); letter-spacing: var(--tracking-heading); }
.visual-type .vt-sub { font-size: var(--fs-caption); color: var(--text-tertiary); }

.division-body { display: flex; flex-direction: column; flex: 1; padding: var(--card-padding); }
.division-num { color: var(--brand-400); font-size: var(--fs-overline); text-transform: uppercase; letter-spacing: var(--tracking-overline); font-weight: var(--fw-semibold); margin: 0 0 var(--space-3); }
.division-body h3 { margin: 0 0 var(--space-3); }
.division-brand { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--text-primary); margin: 0 0 var(--space-2); }
.division-body p { color: var(--text-secondary); font-size: var(--fs-body-sm); line-height: var(--lh-body); margin: 0; max-width: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.chip { font-size: var(--fs-caption); color: var(--text-secondary); background: var(--surface-3);
  border: 1px solid var(--border-soft); border-radius: var(--radius-pill); padding: 4px var(--space-3); }

/* Full-bleed feature bands (flagship Publishing + the games video-wall) — imagery weight */
.division-card.feature { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.division-card.feature.reverse { flex-direction: row-reverse; }
.division-card.feature .division-visual { flex: 1.4; aspect-ratio: auto; min-height: 360px;
  border-bottom: none; border-right: 1px solid var(--border-soft); }
.division-card.feature.reverse .division-visual { border-right: none; border-left: 1px solid var(--border-soft); }
.division-card.feature .division-body { flex: 1; justify-content: center; padding: var(--space-8); }
.division-card.feature .division-body h3 { font-size: var(--fs-h2); }
.division-visual.games-wall { background: #0a1020; }
.division-visual.games-wall img { object-position: center; }

/* Selected-clients wordmark row */
.client-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.client-row li { font-family: var(--font-display); font-weight: var(--fw-semibold);
  font-size: var(--fs-h4); color: var(--text-secondary); }

/* Games crossfade slideshow — contained in the identical 16:10 visual frame */
.slideshow { position: absolute; inset: 0; }
.slideshow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: slidefade 24s infinite; }
.slideshow img:nth-child(1) { animation-delay: 0s; }
.slideshow img:nth-child(2) { animation-delay: 4s; }
.slideshow img:nth-child(3) { animation-delay: 8s; }
.slideshow img:nth-child(4) { animation-delay: 12s; }
.slideshow img:nth-child(5) { animation-delay: 16s; }
.slideshow img:nth-child(6) { animation-delay: 20s; }
@keyframes slidefade { 0% { opacity: 0; } 1.5% { opacity: 1; } 15% { opacity: 1; } 17% { opacity: 0; } 100% { opacity: 0; } }
.slideshow-dots { position: absolute; left: 0; right: 0; bottom: var(--space-3); display: flex; justify-content: center; gap: 6px; z-index: 2; }
.slideshow-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.5); }

/* ---- Split band (about teaser / stewardship feature) --------------------- */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--space-8); align-items: center; }
.split-media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-soft); aspect-ratio: 4/3; background: var(--gradient-panel); }
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.split h2 { margin: 0 0 var(--space-4); }
.split p { color: var(--text-secondary); margin: 0 0 var(--space-4); }

/* ---- At a glance (about) ------------------------------------------------- */
.glance { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; }
.glance dl { margin: 0; }
.glance .row { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-5); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-soft); }
.glance .row:last-child { border-bottom: 0; }
.glance dt { color: var(--text-tertiary); font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); margin: 0; }
.glance dd { color: var(--text-primary); font-size: var(--fs-body-sm); margin: 0; }

/* ---- Prose (about) ------------------------------------------------------- */
.prose { max-width: var(--container-text); }
.prose p { color: var(--text-secondary); font-size: var(--fs-body); line-height: var(--lh-body); margin: 0 0 var(--space-5); }
.prose p strong { color: var(--text-primary); font-weight: var(--fw-semibold); }

/* ---- Contact ------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: start; }
.contact-card { background: var(--surface-1); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: var(--space-7); }
.contact-card h3 { margin: 0 0 var(--space-3); }
.contact-card address { font-style: normal; color: var(--text-secondary); line-height: var(--lh-body); font-size: var(--fs-body); }
.contact-card a { color: var(--brand-400); }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink-900); border-top: 1px solid var(--border-soft); padding-block: var(--space-8) var(--space-7); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--space-7); margin-bottom: var(--space-8); }
.footer-brand img { height: 28px; margin-bottom: var(--space-4); }
.footer-brand p { color: var(--text-tertiary); font-size: var(--fs-caption); line-height: var(--lh-body); max-width: 34ch; margin: 0; }
.footer-col h4 { font-family: var(--font-body); font-size: var(--fs-overline); text-transform: uppercase; letter-spacing: var(--tracking-overline); color: var(--text-tertiary); font-weight: var(--fw-semibold); margin: 0 0 var(--space-4); }
.footer-col a { display: block; color: var(--text-secondary); font-size: var(--fs-body-sm); text-decoration: none; margin-bottom: var(--space-3); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; border-top: 1px solid var(--border-soft); padding-top: var(--space-5); color: var(--text-tertiary); font-size: var(--fs-caption); }
.footer-bottom a { color: var(--text-tertiary); }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .divisions-grid { grid-template-columns: 1fr; }
  .division-card.feature, .division-card.feature.reverse { flex-direction: column; }
  .division-card.feature .division-visual { flex: none; min-height: 0; aspect-ratio: 16/10;
    border: none; border-bottom: 1px solid var(--border-soft); }
  .division-card.feature .division-body { padding: var(--card-padding); }
  .split, .contact-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .nav-links { position: fixed; inset: var(--nav-height) 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0; background: var(--ink-900); border-bottom: 1px solid var(--border-soft); padding: var(--space-4) var(--gutter);
    transform: translateY(-120%); transition: transform var(--dur-slow) var(--ease-out); }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: var(--space-4) 0; width: 100%; border-bottom: 1px solid var(--border-soft); }
  .nav-toggle { display: inline-flex; }
  .nav-right .btn { display: none; }
  .glance .row { grid-template-columns: 1fr; gap: var(--space-2); }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 84vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slideshow img { animation: none; }
  .slideshow img:nth-child(1) { opacity: 1; }
}
