/* ===== GLOBAL RESET ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body
{ 
    overflow:hidden;
    background:black;
    font-family:'Inter', sans-serif; color:white;
    position: relative; /*Otherwise some mobile browsers miscalculate stacking contexts.*/
}
html, body {height: 100%;} /*to prevent weird overscroll layout shifts.*/

/* ===== PROGRESS BAR ===== */
#progressBar{ position:fixed; top:0; left:0; width:100%; height:6px; background:rgba(255,255,255,0.1); z-index:1000; }

#progressFill{ height:100%; width:0%; background:linear-gradient(90deg,#ff8c00,#ffd27f); transition:width .6s ease; }

/* ===== SKY ANIMATION ===== */
.sky 
{
    position:fixed; width:100%; height:100%; z-index:-3;
    /*background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%); /* OLD VERSION */
    /*animation: skyShift 40s ease infinite alternate; /* OLD VERSION */
    background: linear-gradient(to top, #ff8c42 0%, #ffb347 20%, #2c3e50 60%, #090a0f 100%); /* NEW SUNRISE */
    animation:sunrise 25s ease infinite alternate; /* NEW SUNRISE */
}

@keyframes skyShift 
{
    0% { filter:hue-rotate(-10deg) brightness(.7); } /* Changed from 0deg to -10deg; brightness from 1 to .7 */
    100% { filter:hue-rotate(10deg) brightness(1.2); } /* Changed from 20deg to 10deg */
}

#starCanvas 
{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:50%;
    z-index:-2; /* Lower than lanterns, but higher than sky */
    pointer-events:none;
}

.sunrise-horizon
{
    position:fixed;
    bottom:-5vh;
    left:0;
    width:100%;
    height:60vh;
    background:
    radial-gradient(ellipse at center bottom, rgba(255,190,120,.9), rgba(255,140,60,.6), rgba(255,120,40,.25), transparent 75%);
    filter:blur(40px);
    z-index:-1;
    animation:sunriseDrift 60s linear infinite;
}

@keyframes sunriseDrift
{
    0% {transform:translateY(0px);}
    100% {transform:translateY(-40px);}
}

/* ===== LANTERN ANIMATION ===== */
#lanternCanvas {
  position: fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  z-index:-1; /* highest */
  pointer-events:none;
}

canvas {
  display:block;
}

/* ===== DISCLAIMER STYLE ===== */
.disclaimer{
  max-width:700px;
}

.disclaimer p{
  font-size:1.2rem;
  line-height:1.6;
  opacity:.9;
  margin-bottom:25px;
}

.disclaimer .soft{
  opacity:.7;
  font-style:italic;
}

/* ===== SCENE ENGINE ===== */
.scene {
  position:absolute;
  width:100%;
  height: calc(var(--vh, 1vh) * 100); /*1vh fallback prevents the page from breaking.*/
  top:0;
  left:0;
  opacity:0;
  transform:scale(1.05);
  transition: all 1.8s cubic-bezier(.77,0,.18,1);
  pointer-events:none;
  z-index:0;
}

.scene.active {
  opacity:1;
  transform:scale(1);
  pointer-events:auto;
  z-index:10;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  transform: scale(1.05);
  z-index: -1;
}

.content
{ 
    position:absolute;
    width:100%;
    max-width:1600px;   /* increase from 1200 */
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    text-align:center;
    padding:0 10%;
}

h1 {
  font-size:3rem; font-weight:300; letter-spacing:3px; margin-bottom:60px;
  text-shadow:0 0 40px rgba(255,200,120,0.6);
  animation: fadeIn 2s ease;
}
@keyframes fadeIn { from {opacity:0; transform:translateY(30px);} to {opacity:1; transform:translateY(0);} }

/* ===== GLASSMORPHIC CARDS ===== */
.card-container 
{
    /*display:grid;*/
    display:flex;
    flex-wrap:wrap;
    /*grid-template-columns: repeat(4,1fr);  4 cards per row */
    /*grid-template-columns: repeat(auto-fit,minmax(220px,1fr));*/
    /*grid-template-columns: repeat(auto-fit, minmax(220px, 260px)); /* doesn't appear to give 4 per row... */
    justify-content:center;   /* centers incomplete rows, but doesn't apperar to be working */
    gap:30px;
    max-width:1500px;
    margin:auto;
}

.choice-card 
{
    flex: 0 0 260px;   /* 0 grow, 0 shrink, ideal width */
    width:260px;
    position:relative;
    width:100%;
    /*aspect-ratio: 4/3;   /* was 16/9 */
    min-height:120px; /* When no aspect ratio */
    height:clamp(120px,22vh,240px); /* When no aspect ratio */
    /*height:auto; /* when aspect ratio */
    /*height:150px;*/
    border-radius:20px;
    background: rgba(9,10,15,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border:1px solid rgba(255,200,120,0.2); cursor:pointer; overflow:hidden;
    display:flex; align-items:center; justify-content:center; text-align:center;
    transition:.6s cubic-bezier(.77,0,.18,1);
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    user-select:none; /* DISABLE TEXT SELECTION */
    -webkit-user-select:none; /* DISABLE TEXT SELECTION */
    -webkit-touch-callout:none; /* DISABLE TEXT SELECTION */
}

.choice-card span { font-size:1.1rem; letter-spacing:2px; }
.choice-card::before {
  content:""; position:absolute; width:200%; height:100%; left:-200%; top:0;
  background:linear-gradient(120deg, transparent, rgba(255,200,120,0.4), transparent);
  transition:.8s;
}
.choice-card:hover::before { left:100%; }
.choice-card:hover { transform:translateY(-20px) scale(1.08) rotateX(2deg) rotateY(2deg); box-shadow:0 40px 80px rgba(255,180,100,0.3); border-color:rgba(255,200,120,0.6); }
.choice-card.selected
{
    transform: scale(1.08);
    border: 2px solid rgba(255,210,130,.9);
    background: linear-gradient(145deg,rgba(255,200,120,0.25),rgba(255,150,60,0.12));
    box-shadow:
    0 0 25px rgba(255,190,110,.5),
    0 20px 60px rgba(255,140,60,.35);
    animation: selectedPulse 2s infinite;
}
@keyframes selectedPulse 
{
    0% { box-shadow: 0 0 10px rgba(255,190,110,.3); }
    50% { box-shadow: 0 0 40px rgba(255,190,110,.6); }
    100% { box-shadow: 0 0 10px rgba(255,190,110,.3); }
}



/* Scene4 cards hover larger + moving images */
#scene4 .img-card {
  /*background: rgba(255,255,255,0.05);*/
  position: relative;
  overflow: hidden;
  background-image: var(--bg); /* CAN DELETE once you move to video */
  background-size: cover;
  background-position: center;
  transition: transform .6s cubic-bezier(.77,0,.18,1), box-shadow .6s;
}

#scene4 .img-card video {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  top: 0;
  left: 0;
  z-index: 0;
  transition: transform .8s ease;
}

#scene4 .img-card span 
{
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.6);
    padding: 8px 14px;
    border-radius: 10px;
} 

#scene4 .img-card:hover {
  transform: scale(1.5); /* Very aggressive on mobile */
  z-index: 20;
}

#scene4 .img-card:hover video {
  transform: scale(1.2);
}

select {
  color: #fff;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
}

select option {
  color: #222;
  background: white;
}

/* ===== NEXT BUTTON ===== */
.next-btn
{
    margin-top:60px; padding:18px 55px; border-radius:60px; font-size:1.1rem; letter-spacing:1px; border:none; cursor:pointer; color:white; 
    background: linear-gradient(135deg, #ffd27f, #2c3e50, #090a0f);
    box-shadow:
    0 0 15px rgba(255,170,90,.5),
    0 10px 30px rgba(255,120,40,.45);
    animation: lanternButtonGlow 3s ease-in-out infinite alternate;
    transition: all .35s ease;
}

.next-btn:hover
{
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 25px 60px rgba(255,140,60,.65);
}

@keyframes lanternButtonGlow
{
    0% 
    {
        box-shadow:
        0 0 10px rgba(255,170,90,.4),
        0 10px 30px rgba(255,120,40,.3);
    }
    100% 
    {
        box-shadow:
        0 0 30px rgba(255,200,120,.9),
        0 20px 60px rgba(255,140,60,.7);
    }
}

.center-btn{
  display:block;
  margin:40px auto 0 auto;
}

/* ===== FINAL REVEAL ===== */
.reveal { font-size:3.5rem; font-weight:300; letter-spacing:4px; animation: glowReveal 3s ease infinite alternate; }
@keyframes glowReveal { from { text-shadow:0 0 20px #ffb347; } to {text-shadow:0 0 60px #ffd27f;} }

.form-container 
{
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  animation: fadeIn 2s ease; /* OPTIONAL */
}

.form-container input,
.form-container select {
  width: 320px;
  padding: 14px 20px;
  border-radius: 40px;
  border: 1px solid rgba(255,200,120,0.3);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: 0.4s;
}

.form-container input:focus,
.form-container select:focus {
  border-color: rgba(255,200,120,0.8);
  box-shadow: 0 0 20px rgba(255,180,100,0.3);
}

#scene9 h1 {
  animation: glowReveal 3s ease infinite alternate;
}

#scene10 h2{
  font-size:3rem;
  opacity:0;
  transform:scale(.7);
  transition:all 1.5s ease;
}

#scene10 h2.reveal{
  opacity:1;
  transform:scale(1);
}

/* ===================================== */
/* ===== MOBILE LAYOUT SYSTEM (NEW) ===== */
/* ===================================== */

@media (max-width: 768px)
{

/* ---------- Scene Layout ---------- */

.scene
{
    height: calc(var(--vh) * 100);
    min-height: calc(var(--vh) * 100);
}

/* Move content slightly higher so button fits */

.content
{
    top:45%;
    transform:translate(-50%,-45%);
    padding:0 16px;
}

/* ---------- Typography ---------- */

h1
{
    font-size:1.6rem;
    margin-bottom:18px;
    letter-spacing:1px;
}

/* ---------- Card Layout ---------- */

.card-container
{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    padding:0 10px;
    max-width:500px;
    margin:auto;
}

/* Card sizing tied to safe viewport height */

.choice-card
{
    width:100%;
    max-width:none;
    flex:none;

    height: clamp(
        70px,
        calc(var(--vh) * 13),
        140px
    );

    min-height:70px;

    font-size:16px;
}

/* Card text */

.choice-card span
{
    font-size:16px;
    letter-spacing:1px;
}

/* ---------- Disable Heavy Effects ---------- */

.choice-card
{
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
    background:rgba(0,0,0,0.35);
}

.choice-card:hover
{
    transform:none;
    box-shadow:none;
}

/* ---------- Multi-select glow simplified ---------- */

.choice-card.selected
{
    transform:scale(1.03);
    box-shadow:
        0 0 12px rgba(255,190,110,.45),
        0 6px 20px rgba(255,140,60,.25);
}

/* ---------- Scene 4 Image Cards ---------- */

#scene4 .img-card:hover
{
    transform:none;
}

#scene4 .img-card video
{
    transform:none !important;
}

/* ---------- Continue Button ---------- */

.next-btn
{
    margin-top:16px;
    padding:14px 36px;
    font-size:1rem;
    animation:none;
}

/* ---------- Form Inputs ---------- */

.form-container input,
.form-container select
{
    width:100%;
    max-width:320px;
}

/* ---------- Background Optimization ---------- */

.sunrise-horizon
{
    filter:blur(20px);
}

/* ---------- Canvas Safety ---------- */

canvas
{
    pointer-events:none;
}

}

/* ===================================== */
/* LANDSCAPE PHONE LAYOUT (FULL FIX) */
/* ===================================== */

@media (max-width:900px) and (orientation:landscape)
{

.scene
{
    height:calc(var(--vh)*100);
}

/* ---------- horizontal layout ---------- */

.content
{
    display:grid;
    grid-template-columns: 40% 60%;
    grid-template-rows:auto auto;
    align-items:center;

    top:50%;
    transform:translate(-50%,-50%);
    padding:0 20px;
}

/* ---------- title ---------- */

h1
{
    grid-column:1;
    grid-row:1;

    font-size:1.4rem;
    text-align:left;
    margin-bottom:10px;
}

/* ---------- cards ---------- */

.card-container
{
    grid-column:2;
    grid-row:1 / span 2;

    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;

    max-width:none;
}

/* card size tuned for small vertical space */

.choice-card
{
    height: clamp(
        55px,
        calc(var(--vh) * 28),
        100px
    );

    min-height:55px;
}

/* card text */

.choice-card span
{
    font-size:14px;
}

/* ---------- continue button ---------- */

.next-btn
{
    grid-column:1;
    grid-row:2;

    margin-top:6px;
    padding:10px 24px;
    font-size:.9rem;

    width:max-content;
}

/* ---------- scene 4 fix (image cards) ---------- */

#scene4 .img-card:hover
{
    transform:none;
}

#scene4 .img-card video
{
    transform:none !important;
}

}

/* ===================================== */
/* FINAL SCENE LANDSCAPE FIX */
/* ===================================== */

@media (max-width:900px) and (orientation:landscape)
{

#sceneFinal .content
{
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:20px;

    width:100%;
}

/* title on the left */

#sceneFinal h1
{
    font-size:1.3rem;
    text-align:left;
    max-width:260px;
}

/* form on the right */

#sceneFinal form
{
    display:flex;
    flex-direction:column;
    gap:8px;
    max-height:80vh;
    overflow:auto;
    width:260px;
}

/* smaller inputs */

#sceneFinal input,
#sceneFinal textarea
{
    font-size:14px;
    padding:8px;
}

/* shrink textarea */

#sceneFinal textarea
{
    height:60px;
    resize:none;
}

/* smaller submit button */

#sceneFinal button
{
    padding:10px;
    font-size:.9rem;
}

}