:root{
  --bg:#6F8B6F;
  --bg-dark:#5f7a5f;
  --text:#ffffff;
  --muted:#e7efe7;
  --button:#e6f0e6;
  --button-text:#2f3a2f;
  --button-hover:#f7faf7;
  --shadow: 0 8px 30px rgba(0,0,0,.25);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background: var(--bg) center/cover no-repeat fixed;
}

/* Landing */
.landing{
  min-height:100vh;
  width:100%;
  background: url('./assets/bg.jpg') center/cover no-repeat fixed;
  display:flex; align-items:center; justify-content:center;
  position:relative;
}
.overlay{
  position:absolute; inset:0; background:linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35) 70%);
}
.container{
  position:relative; width:min(740px,92vw); padding:24px;
  display:flex; flex-direction:column; align-items:center; gap:16px;
}

.brand{
  margin-top:36vh;
  text-align:center;
  text-shadow: var(--shadow);
}

.btns{display:flex; gap:16px; flex-wrap:wrap; justify-content:center; margin-top:12px;}
button, .btn{
  appearance:none; border:none; cursor:pointer;
  padding:14px 22px; border-radius:999px;
  background:var(--button); color:var(--button-text);
  font-weight:600; letter-spacing:.3px; font-size:16px;
  box-shadow: var(--shadow);
  transition: transform .1s ease, background .2s ease, opacity .2s ease;
  text-decoration:none;
}
button:hover, .btn:hover{ transform: translateY(-1px); background:var(--button-hover); }
button:active, .btn:active{ transform: translateY(0); opacity:.9; }

/* Viewer */
.header{
  position:sticky; top:0; z-index:5;
  background:linear-gradient(180deg, rgba(25,30,25,.85), rgba(25,30,25,.6));
  backdrop-filter: blur(6px);
  padding:10px 14px;
  display:flex; align-items:center; gap:10px; justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.header .left, .header .right{display:flex; align-items:center; gap:8px}
.header a.home{
  color:var(--text); text-decoration:none; opacity:.9; font-weight:600;
  padding:8px 12px; border-radius:10px; background:rgba(255,255,255,.08);
}
.header select, .header input{
  background:rgba(255,255,255,.08); color:var(--text);
  border:1px solid rgba(255,255,255,.15);
  border-radius:10px; padding:8px 10px; outline:none;
}
.viewer{
  min-height:100vh;
  background: var(--bg) center/cover fixed;
}
.stage{
  display:flex; justify-content:center; align-items:center;
  padding: 12px;
}
.page{
  width:min(960px, 95vw); aspect-ratio: 3/5;
  background:#111; border-radius:16px; overflow:hidden;
  box-shadow: var(--shadow);
  display:flex; justify-content:center; align-items:center;
}
.page img{
  width:100%; height:100%; object-fit:contain; background:#0c0f0c;
}
.controls{
  position:fixed; bottom:18px; left:50%; transform:translateX(-50%);
  display:flex; gap:10px;
}
.controls .ctrl{
  padding:12px 16px; border-radius:14px;
  background:rgba(0,0,0,.4); color:#fff; border:1px solid rgba(255,255,255,.15);
  cursor:pointer; font-weight:700; letter-spacing:.4px;
}
.controls .ctrl:hover{ background:rgba(0,0,0,.55) }
.footer{
  text-align:center; color:var(--muted); padding:24px 12px 36px;
}


/* === Mobile responsive enhancements === */
:root{
  --ctrl-size: 48px;
}

/* Improve tap targets on small screens */
@media (max-width: 640px){
  .btn, button{ padding:16px 24px; font-size:18px; }
  .controls{ bottom:14px; gap:12px; }
  .controls .ctrl{ padding:14px 18px; font-size:16px; border-radius:16px; min-width: var(--ctrl-size); }
  .header{ flex-wrap:wrap; gap:10px; }
  .header .right{ width:100%; justify-content:flex-end; }
  .header select, .header input{ padding:10px 12px; font-size:16px; }
  .stage{ padding:8px; }
  /* Let the image size itself naturally to fit viewport height */
  .page{ width:100vw; max-width:100vw; height:auto; aspect-ratio:auto; border-radius:0; box-shadow:none; background:transparent; }
  .page img{ width:100%; height:auto; max-height: calc(100svh - 160px); object-fit:contain; }
}

/* Prevent accidental horizontal scroll/bounce while allowing vertical scroll */
.page{ touch-action: pan-y; }
