/* PEDROGRAD — Living City cinematic layer (v2, 2026-11-09).
   One fixed, decorative, pointer-transparent stage behind the real HTML:
   A base colour → backdrop (blurred still, landscape only) → frame (poster + one video)
   → C scrims → D scroll depth → E interface.
   Single native 9:16 source. Portrait viewports: frame covers the screen.
   Landscape viewports: frame is a sharp 9:16 panel on the left (no upscaling to fill a
   wide screen); the rest of the stage shows a 4 KB pre-blurred neon-street backdrop cut
   from the same clip (no face, no runtime CSS filter). */
:root{
 --pg-night:#080B1D;--pg-deep:#101A3B;--pg-violet:#7137D9;
 --pg-electric:#168DFF;--pg-cyan-ref:#20D9F2;--pg-magenta:#C53DCB;
 /* Focal point of the 9:16 clip (head ≈ x 22–69 %, y 14–44 % of frame). */
 --pg-fx:40%;--pg-fy:30%;
}
html{background:var(--pg-night)}
body.pg-cinematic{background:var(--pg-night)}
body.pg-cinematic::before{display:none}

/* ---- Stage: viewport-sized, never stretched to document height ---- */
.pg-cine{
 position:fixed;left:0;top:0;z-index:0;
 width:100%;height:100vh;height:100lvh; /* large viewport: no resize when mobile bars collapse */
 overflow:hidden;pointer-events:none;user-select:none;
 background:var(--pg-night);contain:layout paint style;
}
.pg-cine-backdrop{display:none}
.pg-cine-frame{position:absolute;inset:0;overflow:hidden}
.pg-cine-poster,.pg-cine-video{
 position:absolute;inset:0;width:100%;height:100%;display:block;
 object-fit:cover;object-position:var(--pg-fx) var(--pg-fy);
}
.pg-cine-video{opacity:0;transition:opacity .9s ease;background:transparent}
html[data-cine-state="playing"] .pg-cine-video{opacity:1}

/* ---- Readability scrims (static) ---- */
.pg-cine-scrim{
 position:absolute;inset:0;
 background:
  linear-gradient(180deg,rgba(8,11,29,.62) 0,rgba(8,11,29,0) 15%),
  linear-gradient(0deg,rgba(8,11,29,.95) 0,rgba(8,11,29,.8) 24%,rgba(8,11,29,.25) 46%,rgba(8,11,29,0) 56%),
  radial-gradient(ellipse 120% 90% at 50% 40%,transparent 60%,rgba(8,11,29,.5) 100%);
}
/* ---- Scroll depth: one composited layer, opacity driven by cinematic.js ---- */
.pg-cine-depth{
 position:absolute;inset:0;opacity:0;will-change:opacity;
 background:
  radial-gradient(ellipse 90% 70% at 30% 40%,rgba(113,55,217,.10),transparent 70%),
  linear-gradient(180deg,rgba(16,26,59,.86),rgba(8,11,29,.94));
}

/* ---- Interface above the stage ---- */
body.pg-cinematic .site{position:relative;z-index:1}
body.pg-cinematic .grain{z-index:2}
body.pg-cinematic .hero{
 height:auto;min-height:calc(100vh - 140px);min-height:calc(100svh - 140px);
 justify-content:flex-end;padding:0 0 clamp(10px,2.4svh,26px);
}
body.pg-cinematic .hero::before{display:none}
body.pg-cinematic .hero h1{text-shadow:0 2px 28px rgba(8,11,29,.85)}
body.pg-cinematic .hero p,body.pg-cinematic .hero .subtitle{text-shadow:0 1px 14px rgba(8,11,29,.95)}
body.pg-cinematic .hero .subtitle{color:#c9c4de}
body.pg-cinematic .hero .eyebrow{color:#ffc6ee;text-shadow:0 1px 12px rgba(8,11,29,.9)}
body.pg-cinematic .socialproof{margin:16px 0 30px}
body.pg-cinematic .group-title h2,body.pg-cinematic .group-title small,
body.pg-cinematic .note,body.pg-cinematic .footer p{text-shadow:0 1px 10px rgba(8,11,29,.9)}
body.pg-cinematic .group-title small{color:#9b98b8}
body.pg-cinematic .note,body.pg-cinematic .footer p{color:#a3a0bd}
body.pg-cinematic .footer{padding-bottom:max(50px,env(safe-area-inset-bottom,0px))}

/* Glass over moving video: blur only on fine pointers; touch gets near-opaque surfaces. */
@media (hover:hover) and (pointer:fine){
 body.pg-cinematic .site .card[href]{-webkit-backdrop-filter:blur(12px) saturate(140%);backdrop-filter:blur(12px) saturate(140%)}
}
@media (hover:none),(pointer:coarse){
 body.pg-cinematic .site .card,body.pg-cinematic .site .socialproof span,body.pg-cinematic .site .status{
  -webkit-backdrop-filter:none;backdrop-filter:none
 }
 body.pg-cinematic .site .card.primary{background:linear-gradient(113deg,rgba(84,38,106,.95),rgba(48,42,100,.95) 60%,rgba(28,48,82,.94))}
 body.pg-cinematic .site .card.primary:nth-child(2){background:linear-gradient(113deg,rgba(22,82,122,.95),rgba(34,45,98,.94) 61%,rgba(78,36,96,.93))}
}

/* Portrait screens wider than 9:16 (tablets): crop from the top less aggressively. */
@media (min-aspect-ratio:9/16) and (max-aspect-ratio:1/1){
 :root{--pg-fy:22%}
}
/* Short portrait screens (iPhone SE class): smaller headline so it never meets the chin. */
@media (max-aspect-ratio:1/1) and (max-height:700px){
 body.pg-cinematic .hero h1{font-size:clamp(40px,10.5vw,52px)}
 body.pg-cinematic .hero p{margin-top:10px}
}

/* ---- Landscape: 9:16 panel left, content column over the blurred city on the right ---- */
@media (min-aspect-ratio:1/1) and (min-width:640px){
 .pg-cine-backdrop{
  display:block;position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;object-position:50% 50%;
 }
 .pg-cine-frame{
  inset:0 auto 0 clamp(0px,5vw,140px);
  width:auto;height:100%;aspect-ratio:9/16;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 9%,#000 80%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 9%,#000 80%,transparent 100%);
 }
 body.pg-cinematic .site{
  width:auto;max-width:none;margin:0;
  padding:0 clamp(16px,4vw,96px);
 }
 body.pg-cinematic .site>main,body.pg-cinematic .site>.divider,body.pg-cinematic .site>.footer{
  width:min(580px,46vw);margin-left:auto;margin-right:0;
 }
 body.pg-cinematic .hero{
  align-items:flex-start;text-align:left;
  min-height:calc(100vh - 160px);min-height:calc(100svh - 160px);
 }
 body.pg-cinematic .hero h1{font-size:clamp(50px,5.6vw,98px)}
 body.pg-cinematic .socialproof{justify-content:flex-start}
 .pg-cine-scrim{
  background:
   linear-gradient(180deg,rgba(8,11,29,.55) 0,rgba(8,11,29,0) 18%),
   linear-gradient(270deg,rgba(8,11,29,.8) 0,rgba(8,11,29,.5) 32%,rgba(8,11,29,0) 58%),
   linear-gradient(0deg,rgba(8,11,29,.7) 0,rgba(8,11,29,0) 30%);
 }
}
/* Short landscape (phones on their side): compact hero so links stay reachable. */
@media (min-aspect-ratio:1/1) and (max-height:500px){
 body.pg-cinematic .hero{min-height:0;padding-top:8px}
 body.pg-cinematic .hero h1{font-size:clamp(38px,6vw,52px)}
}

/* Reduced motion: the poster is the experience; no video is requested (cinematic.js). */
@media (prefers-reduced-motion:reduce){
 .pg-cine-video{display:none}
}
