/* Cinematic Split Landing — Cloudflare Pages ready */
:root{
  --bg: #05070d;
  --ink: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --glassBorder: rgba(255,255,255,.10);
  --shadow: 0 20px 50px rgba(0,0,0,.55);
}

*{ box-sizing: border-box; }
html,body{ height:100%; margin:0; background:var(--bg); }
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--ink);
  overflow: hidden;
}

.stage{
  position: relative;
  height: 100%;
  width: 100%;
  background: radial-gradient(1200px 800px at 50% 35%, rgba(95,140,255,.18), transparent 60%),
              radial-gradient(900px 700px at 30% 70%, rgba(124,197,255,.10), transparent 55%),
              var(--bg);
}

/* Video */
.bgVideo{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.03) brightness(.92);
  transform: scale(1.02);
  will-change: transform;
}

/* Vignette */
.stage::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,.15) 25%, rgba(0,0,0,.25) 70%, rgba(0,0,0,.60)),
    radial-gradient(1200px 900px at 50% 50%, transparent 35%, rgba(0,0,0,.58) 85%);
  pointer-events:none;
  z-index: 2;
}

/* Intro overlay */
.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 5;
  padding: 24px;
}

.overlayInner{
  width:min(820px, 92vw);
  padding: 28px 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10,12,20,.40), rgba(10,12,20,.12));
  border: 1px solid var(--glassBorder);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle emblem in intro card */
.overlayInner::after{
  content:"";
  position:absolute;
  inset:-30px -40px -40px -40px;
  background-image: url("assets/jedi.jpg");
  background-size: cover;
  background-position: center;
  opacity: .10;
  filter: grayscale(1) contrast(1.1);
  transform: rotate(-2deg) scale(1.05);
  pointer-events:none;
}

.kicker{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
  letter-spacing: .08em;
  font-weight: 700;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}

.title{
  margin:0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: .02em;
  position: relative;
  z-index: 2;
}

.subtitle{
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  position: relative;
  z-index: 2;
}

.skip{
  appearance:none;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  position: relative;
  z-index: 2;
}
.skip:hover{ transform: translateY(-1px); background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.32); }
.skip:active{ transform: translateY(0px); }

.hint{
  position:absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
  font-size: 0.92rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 6;
}

.dot{
  width:8px; height:8px;
  border-radius:999px;
  background: rgba(124,197,255,.9);
  box-shadow: 0 0 18px rgba(124,197,255,.75);
}

/* Choice split screen */
.choice{
  position:absolute;
  inset:0;
  display:grid;
  grid-template-columns: 1fr 1fr;
  z-index: 8;
  opacity:0;
  pointer-events:none;
  transition: opacity .45s ease;
}
.choice.show{ opacity:1; pointer-events:auto; }

/* Watermark across both halves */
.choice::after{
  content:"";
  position:absolute;
  inset:-20px;
  background-image: url("assets/jedi.jpg");
  background-size: cover;
  background-position: center;
  opacity: .14;
  filter: grayscale(1) contrast(1.15);
  mix-blend-mode: screen;
  pointer-events:none;
  z-index: 0;
}

.half{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  overflow:hidden;
  z-index: 1;
}

.half::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:.95;
  transform: scale(1.05);
  transition: transform .35s ease, opacity .35s ease;
}
.half:hover::before{ transform: scale(1.10); opacity: 1; }

.halfInner{
  position:relative;
  z-index: 2;
  width:min(520px, 90%);
  padding: 28px 24px;
  border-radius: 22px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.label{
  font-weight: 800;
  letter-spacing: .18em;
  font-size: 0.9rem;
  opacity: .92;
}

.link{
  margin-top: 10px;
  font-size: clamp(1.6rem, 2.7vw, 2.3rem);
  font-weight: 800;
}

.micro{
  margin-top: 10px;
  color: rgba(255,255,255,.72);
  font-size: 1rem;
}

/* Left / right vibes */
.light::before{
  background:
    radial-gradient(800px 800px at 30% 35%, rgba(233,244,255,.95), rgba(124,197,255,.40) 55%, rgba(0,0,0,.10) 85%),
    linear-gradient(135deg, rgba(233,244,255,.85), rgba(124,197,255,.22));
}
.dark::before{
  background:
    radial-gradient(900px 900px at 70% 40%, rgba(43,59,255,.55), rgba(0,0,0,.86) 60%),
    linear-gradient(225deg, rgba(10,12,20,.95), rgba(43,59,255,.12));
}

/* Divider line */
.choice::before{
  content:"";
  position:absolute;
  left:50%;
  top:0;
  width: 1px;
  height:100%;
  background: rgba(255,255,255,.15);
  box-shadow: 0 0 22px rgba(124,197,255,.25);
  z-index: 9;
}

/* Replay */
.replay{
  position:absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  appearance:none;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.88);
  padding: 10px 14px;
  border-radius: 999px;
  cursor:pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.replay:hover{ transform: translateX(-50%) translateY(-1px); background: rgba(0,0,0,.48); border-color: rgba(255,255,255,.30); }
.replay:active{ transform: translateX(-50%) translateY(0px); }

/* Film grain */
.grain{
  position:absolute;
  inset:-40%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  opacity: .10;
  mix-blend-mode: overlay;
  pointer-events:none;
  animation: grainMove 7s steps(10) infinite;
  z-index: 20;
}

@keyframes grainMove{
  0%{ transform: translate3d(0,0,0) rotate(0deg); }
  10%{ transform: translate3d(-2%, -3%, 0) rotate(.5deg); }
  20%{ transform: translate3d(-4%, 2%, 0) rotate(-.2deg); }
  30%{ transform: translate3d(3%, -2%, 0) rotate(.2deg); }
  40%{ transform: translate3d(-1%, 4%, 0) rotate(-.4deg); }
  50%{ transform: translate3d(4%, 1%, 0) rotate(.4deg); }
  60%{ transform: translate3d(-3%, 1%, 0) rotate(-.1deg); }
  70%{ transform: translate3d(2%, -4%, 0) rotate(.3deg); }
  80%{ transform: translate3d(-4%, -1%, 0) rotate(-.3deg); }
  90%{ transform: translate3d(1%, 3%, 0) rotate(.1deg); }
  100%{ transform: translate3d(0,0,0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce){
  .choice, .half::before, .skip, .replay{ transition: none !important; }
  .grain{ animation: none !important; }
}

@media (max-width: 820px){
  .choice{ grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .choice::before{ left:0; top:50%; width:100%; height:1px; }
  .choice::after{ opacity: .10; }
}


/* ===== Mobile viewport fixes (address bar + safe areas) ===== */

/* Prefer dynamic viewport units when supported */
.stage{
  height: 100vh;
  min-height: 100vh;
}
@supports (height: 100svh){
  .stage{ height: 100svh; min-height: 100svh; }
}
@supports (height: 100dvh){
  .stage{ height: 100dvh; min-height: 100dvh; }
}

/* Keep background video truly full-bleed on mobile */
.bgVideo{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}
@supports (height: 100svh){
  .bgVideo{ height: 100svh; }
}
@supports (height: 100dvh){
  .bgVideo{ height: 100dvh; }
}

/* Respect notches / gesture bars */
.overlay,
.choice{
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}

/* On mobile, allow the choice screen to scroll if needed (prevents cut-off) */
.choice{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 820px){
  .half{ min-height: 50svh; }
  .halfInner{ margin: 18px 0; }
}


/* ===== Mobile-only: better video crop + controls pinned (no obstruction) ===== */
@media (max-width: 820px){
  /* Show more of the video (less zoom) + bias crop upward a bit */
  .bgVideo{
    object-position: 50% 35%;
    transform: none;
    filter: contrast(1.04) saturate(1.02) brightness(.92);
  }

  /* Make the intro card lighter/smaller so video is visible */
  .overlay{
    align-items: flex-start;
    padding-top: calc(18px + env(safe-area-inset-top));
  }
  .overlayInner{
    margin-top: 14px;
    padding: 18px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(10,12,20,.22), rgba(10,12,20,.08));
  }
  .subtitle{ margin-bottom: 10px; }

  /* Pin Skip button to bottom (outside the card) */
  .skip{
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 30;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(0,0,0,.42);
    border-color: rgba(255,255,255,.26);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* Pin hint pill just above the Skip button */
  .hint{
    position: fixed;
    left: 50%;
    bottom: calc(64px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 30;
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  /* Ensure choice replay button isn't covering text on small screens */
  .replay{
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}


/* ===== Mobile landscape: ultra-compact overlay + edge controls ===== */
@media (max-width: 980px) and (orientation: landscape){
  /* Give the video more real estate */
  .overlay{
    align-items: flex-start;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .overlayInner{
    width: min(720px, 92vw);
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10,12,20,.18), rgba(10,12,20,.06));
  }

  /* Tighten typography */
  .kicker{ width: 34px; height: 34px; margin-bottom: 8px; }
  .title{ font-size: clamp(1.4rem, 3.2vw, 2rem); }
  .subtitle{ display:none; } /* remove line that overlaps in landscape */

  /* Put controls on corners instead of the center/bottom */
  .skip{
    left: auto;
    right: calc(12px + env(safe-area-inset-right));
    bottom: auto;
    top: calc(12px + env(safe-area-inset-top));
    transform: none;
    padding: 10px 14px;
  }

  .hint{
    left: calc(12px + env(safe-area-inset-left));
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: none;
    padding: 8px 12px;
    font-size: .9rem;
    max-width: min(520px, 70vw);
  }

  /* Bias crop to keep center logo visible */
  .bgVideo{
    object-position: 50% 45%;
  }
}


/* ===== Responsive copy helpers ===== */
.labelMobile, .microMobile, .hintMobile{ display:none; }
@media (max-width: 820px){
  .labelDesktop, .microDesktop, .hintDesktop{ display:none; }
  .labelMobile, .microMobile, .hintMobile{ display:inline; }
}

/* ===== Mobile landscape: smaller Skip + pin to absolute top edge ===== */
@media (max-width: 980px) and (orientation: landscape){
  .skip{
    font-size: 0.9rem;
    padding: 8px 12px;
    top: calc(6px + env(safe-area-inset-top));
    right: calc(8px + env(safe-area-inset-right));
  }
}

/* In stacked (top/bottom) mobile choice layout, reflect "path" language */
@media (max-width: 820px){
  .choice::before{ opacity: .20; }
}


/* Copy-variant classes kept harmless (in case cached HTML) */
.labelMobile,.microMobile,.hintMobile{ display:none !important; }
.labelDesktop,.microDesktop,.hintDesktop{ display:inline !important; }


/* ===== Force LIGHTSIDE (left) / DARKSIDE (right) even on mobile ===== */
@media (max-width: 820px){
  .choice{
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: none !important;
  }
  .choice::before{
    left: 50% !important;
    top: 0 !important;
    width: 1px !important;
    height: 100% !important;
    opacity: .18;
  }
  .halfInner{
    width: min(92%, 360px);
    padding: 18px 16px;
    border-radius: 18px;
  }
  .label{ font-size: .82rem; letter-spacing: .16em; }
  .link{ font-size: 1.35rem; }
  .micro{ font-size: .95rem; }
  /* Move replay button down but keep centered */
  .replay{
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 9px 12px;
    font-size: .92rem;
  }
}
