/* While You Create — cinematic homepage enhancement (progressive, opt-in).
   Loaded only for capable clients gated in index.php. Everything is namespaced
   under #wyc-cine-root / .wyc-cine so it can never leak into the real homepage.
   Removing the <link>/<script> in index.php leaves the page byte-identical. */

/* Splash + scroll lock are declared inline in <head> (critical, pre-paint).
   This file styles the overlay that mounts on top of the real homepage. */

#wyc-cine-root {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  background: #05070d;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  transition: opacity 420ms ease;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
#wyc-cine-root.wyc-leaving { opacity: 0; }

.wyc-track { position: relative; width: 100%; height: 560vh; }
.wyc-spacer { width: 100%; height: 100vh; }

.wyc-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.wyc-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Contrast scrim so copy stays legible over every frame. */
.wyc-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 12%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.42) 100%),
    linear-gradient(180deg, rgba(4,6,12,0.30) 0%, rgba(4,6,12,0.05) 30%, rgba(4,6,12,0.35) 100%);
}

.wyc-teal { color: #5eead4; }
.wyc-serif { font-family: "Instrument Serif", Georgia, "Times New Roman", serif; }
.wyc-ink { text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.5); }

/* The homepage stylesheet sets `h1,h2{color:var(--ink)}` (dark); a direct rule
   beats our inherited white, so force the overlay's own colors explicitly and
   neutralise any inherited gradient-clip fill. */
#wyc-cine-root h1,
#wyc-cine-root h2 {
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: none;
}
#wyc-cine-root .wyc-teal { color: #5eead4; -webkit-text-fill-color: #5eead4; }

/* Centered layers on the sticky stage. */
.wyc-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

/* Hero */
.wyc-hero { pointer-events: none; }
.wyc-hero .k {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.wyc-hero h1 {
  margin: 0;
  max-width: 60rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-size: clamp(2.6rem, 6vw, 5rem);
  /* Extra-strong shadow: the title sits over the brightest streaks of the intro. */
  text-shadow: 0 2px 30px rgba(0,0,0,0.75), 0 1px 4px rgba(0,0,0,0.7), 0 0 60px rgba(0,0,0,0.5);
}
/* Soft vignette behind the hero copy so it never fights the video highlights. */
.wyc-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80rem, 96vw);
  height: 60vh;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 55% at 50% 50%, rgba(3,5,10,0.62) 0%, rgba(3,5,10,0.30) 45%, rgba(3,5,10,0) 75%);
}
.wyc-hero .sub {
  margin: 28px auto 0;
  max-width: 40rem;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.86);
}
.wyc-hint {
  margin-top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: wyc-bob 1.8s ease-in-out infinite;
}
.wyc-hint .arrow { font-size: 18px; line-height: 1; }
@keyframes wyc-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Book reveal cards */
/* The layer only centers the card and must never block clicks; the reveal
   opacity/transform are animated on the <a> ITSELF (same element as the
   backdrop-filter). iOS Safari drops backdrop-filter when an ANCESTOR has
   opacity < 1, so animating the ancestor (old approach) killed the glass on
   iPhone. Same-element opacity keeps the frosted glass on every device. */
.wyc-card { pointer-events: none; }
.wyc-card a {
  display: grid;
  grid-template-columns: minmax(0, 150px) 1fr;
  gap: 28px;
  width: 100%;
  max-width: 48rem;
  padding: 28px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  border-radius: 24px;
  background: rgba(10, 14, 24, 0.52);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity 0.12s linear, transform 0.12s linear;
}
.wyc-card a:hover { background: rgba(16, 22, 36, 0.62); }
.wyc-card img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  ring: 1px solid rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.15);
}
.wyc-card .body { display: flex; flex-direction: column; justify-content: center; }
.wyc-card .meta { margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.wyc-card .kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.wyc-card .age { font-size: 12px; color: rgba(255,255,255,0.56); }
.wyc-card h2 { margin: 0; font-style: italic; line-height: 1.15; font-size: clamp(1.7rem, 3vw, 2.25rem); }
.wyc-card .tag { margin: 12px 0 0; font-size: 1.05rem; line-height: 1.55; color: rgba(255,255,255,0.82); }
.wyc-card .disc { margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }

/* Outro CTA */
/* The V6 video ends on a bright sunset garden; darken behind the outro copy so
   the white CTA text stays legible over it. */
.wyc-outro::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72rem, 96vw);
  height: 66vh;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(58% 52% at 50% 50%, rgba(3,5,10,0.72) 0%, rgba(3,5,10,0.42) 46%, rgba(3,5,10,0) 78%);
}
.wyc-outro h2 { margin: 0; max-width: 40rem; font-style: italic; line-height: 1.15; font-size: clamp(1.9rem, 4vw, 3rem); }
.wyc-cta {
  margin-top: 36px;
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 200ms ease, transform 200ms ease;
}
.wyc-cta:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }

/* Language switch — top layer, always reachable. */
.wyc-nav {
  position: fixed;
  top: 16px;
  left: 18px;
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(10,14,24,0.5);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wyc-lang {
  min-width: 34px;
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.62);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.wyc-lang:hover { color: #fff; background: rgba(255,255,255,0.10); }
.wyc-lang.is-cur { color: #05070d; background: #5eead4; cursor: default; }

/* Skip / escape to the real homepage — always reachable, top layer. */
.wyc-skip {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 40;
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.82);
  background: rgba(10,14,24,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wyc-skip:hover { color: #fff; background: rgba(10,14,24,0.72); }

@media (max-width: 720px) {
  .wyc-card a { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .wyc-card img { width: 128px; margin: 0 auto; }
}
