/* Project pages: hero + play button, phone type sizes, next project banner. */

.page { background: var(--bg); color: var(--fg); transition: color .4s ease; }
/* Top of the page (like Builders Club): the frame is the whole window, on black. The still/film fills the window
   when the window's shape is close to 16:9 (between about 3:2 and 2.1:1, i.e. at most ~20% trimmed); otherwise it
   shows complete with black bars, never half-trimmed and half-barred. */
.hero { position: relative; margin-top: calc(var(--hh) * -1); width: 100%; height: 100vh; height: 100svh; overflow: hidden; background: #000; container: hero / size; }
.hero .media { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: 16 / 9; width: min(100cqw, 100cqh * 16 / 9); }
@container hero (min-aspect-ratio: 148 / 100) and (max-aspect-ratio: 213 / 100) {
  .hero .media { width: max(100cqw, 100cqh * 16 / 9); }
  .hero.playing:not([data-player="custom"]) .media { width: min(100cqw, 100cqh * 16 / 9); }
}
.hero .media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.35) 100%); pointer-events: none; }
.hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; background: #000; }
/* While the Vimeo film plays it is shown complete (no trim), so Vimeo's controls along the bottom stay visible. */
.hero.is-vimeo .media { width: min(100cqw, 100cqh * 16 / 9) !important; }
.hero.playing .media > img { display: none; }
/* While a film plays, keep a soft dark band behind the menu (top only) so the white menu stays crisp over bright footage. */
.hero.playing .shade { z-index: 3; background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 22%); }
/* Our own player (assets/player.js): the film fills the frame like the still; our controls sit on top. */
.hero[data-player="custom"] iframe { pointer-events: none; }
.hero:fullscreen { margin: 0; width: 100vw; height: 100vh; aspect-ratio: auto; }
.film:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }
/* Films lower down the page: Vimeo's frame (no Vimeo interface) with our Play film button; plays in place with our controls. */
.film { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.vp { position: absolute; inset: 0; z-index: 4; }
.vp-hit { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.vp-bar { position: absolute; left: var(--gx); right: var(--gx); bottom: clamp(24px, 3vw, 48px); display: flex; align-items: center; gap: clamp(14px, 1.4vw, 22px);
  color: #ffffff; font-size: clamp(14px, 1.05vw, 16px); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.vp::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0)); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.vp-awake .vp-bar, .vp-awake .vp::after { opacity: 1; transform: none; }
.vp-host:not(.vp-awake) .vp { cursor: none; }
.vp-bar { z-index: 1; }
.vp-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0 -8px; padding: 0; border: 0; background: none; color: #ffffff; cursor: pointer; transition: color .25s ease; }
.vp-btn:hover { color: var(--accent); }
.vp-seek { flex: 1; height: 24px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.vp-track { position: relative; width: 100%; height: 2px; background: rgba(255,255,255,0.3); transition: height .2s ease; }
.vp-seek:hover .vp-track, .vp-seek:focus-visible .vp-track { height: 4px; }
.vp-load { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,255,255,0.3); }
.vp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }
@media (max-width: 600px) { .vp-bar { left: 20px; right: 20px; bottom: 14px; gap: 12px; } .vp-dur { display: none; } }

/* Phones and other tall screens: a full-width 16:9 frame, as before. */
@media (max-aspect-ratio: 1 / 1) { .hero { height: auto; aspect-ratio: 16 / 9; } }

/* Play film button (shared component: src/partials/play-button.html) */
.play { position: absolute; left: var(--gx); bottom: var(--gx); display: inline-flex; align-items: center; gap: 16px; color: #ffffff !important; font-size: clamp(19px, 1.68vw, 24px); font-weight: 500; letter-spacing: -0.02em; z-index: 1; }
.play .ring { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.85); display: inline-flex; align-items: center; justify-content: center; transition: transform .4s cubic-bezier(.2,.8,.2,1), background .3s ease; }
.play:hover .ring { transform: scale(1.08); background: rgba(255,255,255,0.14); }

/* Minimal Play button (src/partials/play-button-minimal.html): solid white triangle, centred, pulsing softly;
   solid orange on hover. */
.play.play-min { inset: 0; width: clamp(67px, 6.24vw, 115px); height: clamp(67px, 6.24vw, 115px); margin: auto; gap: 0;
  display: flex; align-items: center; justify-content: center; } /* centred with margin:auto (whole pixels, no half-pixel shift) */
/* The triangle is a high-resolution image used as a mask (assets/play-triangle.png, 640x736) and scaled down,
   so its edges come out smooth on every screen. Its colour is the background: white, pulsing; orange on hover. */
.play.play-min .tri { display: block; width: 62%; aspect-ratio: 40 / 46; margin-left: 10%; /* nudged right so it looks centred */
  background-color: #ffffff; -webkit-mask: url(/assets/play-triangle.png) center / contain no-repeat; mask: url(/assets/play-triangle.png) center / contain no-repeat;
  animation: playPulse 2.15s ease-in-out infinite; transition: background-color .3s ease; }
/* hover only on devices with a mouse (touch screens keep the pulse; no orange after a tap) */
@media (hover: hover) { .play.play-min:hover .tri { animation: none; background-color: var(--accent); } }
.play.play-min:focus-visible .tri { animation: none; background-color: var(--accent); }
@keyframes playPulse { 0%, 37.2% { background-color: rgba(255,255,255,1); } 65.1%, 72.1% { background-color: rgba(255,255,255,0); } 72.1% { animation-timing-function: cubic-bezier(.5, 0, .3, 1); } 100% { background-color: rgba(255,255,255,1); } } /* 0.8s hold, 0.6s fade out, 0.15s hold, 0.6s soft fade in */
@media (prefers-reduced-motion: reduce) { .play.play-min .tri { animation: none; } }
@media (max-width: 600px) { .play.play-min { inset: 0; left: 0; bottom: 0; width: 62px; height: 62px; } }

/* Next project */
.next { display: flex; flex-direction: column; gap: 20px; padding-bottom: 0; }
.next h2 { margin: 0; padding: 0 var(--gx); font-size: clamp(16px, 1.25vw, 18px); color: var(--muted); line-height: 1.4; font-weight: 400; }
@media (hover: none) { .tile .ttl { opacity: 1; transform: none; } }

/* Phone sizes (Wael: keep the hierarchy, scale down a touch, body stays bigger than subtitles) */
@media (max-width: 600px) {
  .g12, .g4 { padding-left: 20px !important; padding-right: 20px !important; padding-top: 56px !important; padding-bottom: 56px !important; row-gap: 24px !important; }
  .next h2 { padding-left: 20px !important; padding-right: 20px !important; font-size: 14px; }
  [style*="font-size: clamp(40px, 5vw, 72px)"] { font-size: 38px !important; } /* project name = section titles on phones */
  /* section titles (font-size: 38px) stay 38px on phones too, as Wael asked */
  [style*="font-size: 36px"] { font-size: 24px !important; line-height: 1.2 !important; }
  [style*="font-size: clamp(19px, 1.68vw, 24px)"] { font-size: 16px !important; }
  [style*="font-size: clamp(19px, 1.68vw, 24px)"][style*="line-height: 1.4"],
  [style*="font-size: clamp(19px, 1.68vw, 24px)"][style*="line-height: 1.2"] { font-size: 18px !important; }
  [style*="font-size: clamp(16px, 1.25vw, 18px)"] { font-size: 14px !important; }
  .dt { font-size: 14px; }
  .dd { font-size: 18px; }
  .cl { gap: 8px !important; }
  .cr { gap: 18px !important; }
  .tile .ttl { font-size: 24px !important; }
  .play { left: 20px; bottom: 20px; gap: 10px; font-size: 15px; }
  .play .ring { width: 44px; height: 44px; border-width: 1.2px; }
  .play svg { width: 10px; height: 12px; }
}
