/* Hub home opening: full-bleed film, headline in the quiet left, the chain card bottom right (build plan §2.7).
   Ported from the prototype (mikrositeler/prototip/ortak/wone.css "Full-bleed photo hero", ana-site.css "Ana sayfa
   hero", "Ana giriş filmi", "Giriş filmi"). Owner: PK4. The chain card's own look (.hub-card …) belongs to the hub
   page styles (PK2); this file places it. Markup: src/pages/hub-hero.mjs, player: src/assets/js/hub-intro.js. */

/* ---------- frame: photo or film, directional scrim, copy left, card bottom right ---------- */
.hero.hub-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  min-height: max(560px, min(calc(100svh - var(--header-h)), 940px)); background: var(--ink-0); color: var(--fg);
  transition: min-height 0.9s var(--ease); }
.hub-hero .hero-media { position: absolute; inset: 0; z-index: -2; background: #0c1714; overflow: hidden; }
.hub-hero .hero-media picture { display: block; width: 100%; height: 100%; }
.hub-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity 0.9s var(--ease); background:
  linear-gradient(90deg, rgba(7, 18, 15, 0.94) 0%, rgba(7, 18, 15, 0.8) 28%, rgba(7, 18, 15, 0.35) 58%, rgba(7, 18, 15, 0.06) 100%),
  linear-gradient(0deg, rgba(7, 18, 15, 0.92) 0%, rgba(7, 18, 15, 0) 38%),
  linear-gradient(180deg, rgba(7, 18, 15, 0.55) 0%, rgba(7, 18, 15, 0) 22%); }
.hub-hero .hero-in { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); align-items: end; gap: clamp(28px, 5vw, 72px);
  padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(76px, 8vw, 96px); transition: opacity 0.9s var(--ease); }
.hub-hero .hero-copy { align-self: center; min-width: 0; padding-bottom: clamp(24px, 6vh, 80px); }
.hub-hero .hero-copy h1 { max-width: 15ch; margin: 0 0 20px; text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35); }
.hub-hero .hero-copy .lead { max-width: 46ch; margin: 0; color: #d4e1da; text-shadow: 0 1px 16px rgba(0, 0, 0, 0.4); }
.hub-hero .hero-copy .lead + .btn-row { margin-top: 30px; }
.hub-hero .btn-ghost { border-color: rgba(255, 255, 255, 0.38); color: #fff; background: rgba(7, 18, 15, 0.25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hub-hero .btn-ghost:hover { border-color: #fff; color: #fff; }
.hero-side.hub-side { justify-self: end; align-self: end; width: 100%; max-width: 560px; min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hub-hero .hero-copy > * { animation: hh-rise 0.8s var(--ease) both; }
  .hub-hero .hero-copy > :nth-child(2) { animation-delay: 60ms; }
  .hub-hero .hero-copy > :nth-child(3) { animation-delay: 120ms; }
  .hub-hero .hero-copy > :nth-child(4) { animation-delay: 180ms; }
  .hub-hero .hero-copy > :nth-child(5) { animation-delay: 240ms; }
  .hero-side.hub-side { animation: hh-rise 0.7s var(--ease) 0.48s both; }
}
@keyframes hh-rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- media layers: three loop scenes, the cover still, the intro film ---------- */
.hero-film .hf-v, .hero-film .hf-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.hero-film .hf-v { opacity: 0; transition: opacity 1s ease; }
.hero-film .hf-v.is-on { opacity: 1; }
.hero-film .hf-poster { aspect-ratio: auto !important; transition: opacity 0.6s ease; }
.hero-film.is-playing .hf-poster { opacity: 0; }
.hero-film.is-still .hf-poster { opacity: 1; }
.hero-film .hf-v { z-index: 1; }
.hero-film picture { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero-film .hf-intro { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; object-fit: contain; background: #000;
  opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 0s linear 1.2s; }
.hub-hero.is-intro .hf-intro, .hub-hero.is-fs .hf-intro { opacity: 1; visibility: visible; transition: opacity 0.6s ease; }
.hub-hero.is-intro .hero-media, .hub-hero.is-fs .hero-media { background: #000; }
.hub-hero.is-intro::before, .hub-hero.is-fs::before { opacity: 0; transition: opacity 0.4s ease; }
.hub-hero.is-intro .hero-in, .hub-hero.is-fs .hero-in { opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.hub-hero.is-intro { min-height: min(56.25vw, calc(100svh - var(--header-h))); }
/* The hero can be taller than the screen (its copy sets the height): keep the whole film frame above the fold. */
.hub-hero.is-intro .hf-intro { bottom: auto; height: min(100%, calc(100svh - var(--header-h))); }

/* ---------- scene chips: Flora · Fauna · İnsan with a progress line ---------- */
.scene-chips { display: flex; flex-wrap: wrap; gap: clamp(18px, 2.4vw, 30px); margin: clamp(18px, 2.4vh, 26px) 0 clamp(20px, 3vh, 30px); }
html:not(.js) .scene-chips { display: none; }
.scene-chips + .btn-row { margin-top: 0; }
.scene-chip { position: relative; appearance: none; background: none; border: 0; padding: 8px 0 10px; min-width: 64px; min-height: 36px; cursor: pointer; text-align: left;
  font: 700 0.8rem/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); transition: color 0.3s ease; }
.scene-chip::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }
.scene-chip i { position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); border-radius: 2px; z-index: 1; background: var(--sc, var(--brand-mint)); }
.scene-chip[data-scene='flora'] { --sc: #ff5a8e; }
.scene-chip[data-scene='fauna'] { --sc: #e0b84a; }
.scene-chip[data-scene='insan'] { --sc: #ffb07a; }
.scene-chip[aria-pressed='true'], .scene-chip:hover { color: #fff; }
.hero-film.is-still ~ .hero-in .scene-chip[aria-pressed='true'] i { width: 100%; }
.scene-chip:focus-visible { outline: 2px solid var(--brand-mint); outline-offset: 4px; }

/* ---------- film controls: Sesi aç · Girişi geç · Filmi izle ---------- */
.hero-ctrls { position: absolute; z-index: 3; left: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); bottom: clamp(18px, 3vh, 30px); display: flex; flex-wrap: wrap; gap: 10px; }
.sound-btn, .hero-ctl { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 9px 14px 9px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(7, 18, 15, 0.42); color: #fff; font: 600 0.82rem/1 var(--font);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }
.sound-btn[hidden], .hero-ctl[hidden] { display: none; }
.hero-ctl:hover, .sound-btn:hover { border-color: rgba(255, 255, 255, 0.6); background: rgba(7, 18, 15, 0.6); }
.hero-ctl:focus-visible, .sound-btn:focus-visible { outline: 2px solid var(--brand-mint); outline-offset: 3px; }
.hero-ctl .hc-play { width: 12px; height: 12px; flex: none; }
.sound-btn .sb-ic { position: relative; width: 16px; height: 12px; flex: none; opacity: 0.85; background:
  linear-gradient(currentColor, currentColor) 0 100% / 2px 40% no-repeat,
  linear-gradient(currentColor, currentColor) 5px 100% / 2px 100% no-repeat,
  linear-gradient(currentColor, currentColor) 10px 100% / 2px 65% no-repeat,
  linear-gradient(currentColor, currentColor) 14px 100% / 2px 30% no-repeat; }
.sound-btn[aria-pressed='false'] .sb-ic::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-35deg); }
.sound-btn[aria-pressed='true'] { border-color: rgba(66, 211, 156, 0.7); background: rgba(8, 128, 90, 0.35); }
@media (prefers-reduced-motion: no-preference) {
  .sound-btn[aria-pressed='true'] .sb-ic { animation: hh-eq 1.1s ease-in-out infinite alternate; }
}
@keyframes hh-eq { to { background-size: 2px 85%, 2px 55%, 2px 100%, 2px 60%; } }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
  .hub-hero .hero-in { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero-side.hub-side { justify-self: start; max-width: 640px; }
}
@media (max-width: 900px) {
  .hero.hub-hero { min-height: 0; }
  .hub-hero .hero-media { bottom: auto; height: 560px; }
  .hub-hero .hero-media .hf-v, .hub-hero .hero-media .hf-poster { --focus: 66% 50%; }
  .hub-hero::before { background: linear-gradient(180deg, rgba(7, 18, 15, 0.5) 0, rgba(7, 18, 15, 0.08) 110px, rgba(7, 18, 15, 0.2) 220px, rgba(7, 18, 15, 0.9) 430px, #07120f 560px); }
  .hub-hero .hero-in { padding-top: 0; padding-bottom: clamp(36px, 6vw, 56px); }
  .hub-hero .hero-copy { padding: 250px 0 8px; }
  .hero-side.hub-side { max-width: none; }
  /* the film on request, when the browser keeps it in the page instead of full screen: the film frame only */
  .hero.hub-hero.is-fs { min-height: 560px; }
  .hub-hero.is-fs .hero-in { display: none; }
}
@media (max-width: 760px) {
  .scene-chips { gap: 22px; }
  .hero-ctrls { left: auto; right: var(--gutter); bottom: auto; top: 16px; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .hub-hero .hero-copy { padding-top: 210px; }
  .hub-hero .hero-media { height: 480px; }
  .hero.hub-hero.is-fs { min-height: 480px; }
  .hub-hero::before { background: linear-gradient(180deg, rgba(7, 18, 15, 0.45) 0, rgba(7, 18, 15, 0.05) 90px, rgba(7, 18, 15, 0.25) 190px, rgba(7, 18, 15, 0.92) 380px, #07120f 480px); }
  .hub-hero .btn-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hub-hero .btn-row .btn { width: 100%; min-height: 48px; white-space: normal; text-align: center; }
}

/* ---------- reduced motion: no transitions between scenes, no film fades ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero.hub-hero, .hub-hero::before, .hub-hero .hero-in, .hero-film .hf-v, .hero-film .hf-poster, .hero-film .hf-intro, .scene-chip { transition: none; }
}
