/* ===========================================================================
   StereoTimo 3D club – stereotimo.fi/3d/
   Phone-first. Content cards are normal HTML laid over a fixed WebGL canvas.
   =========================================================================== */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/opensans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/opensans-latin-italic.woff2") format("woff2");
}

:root {
  --bg: #07030f;
  --cyan: #00e5ff;
  --pink: #ff2bd6;
  --text: #f3f0ff;
  --muted: #b9b2d6;
  --card: rgba(10, 5, 24, 0.82);
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }
body {
  margin: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(120% 60% at 50% 0%, #2a0a4a 0%, transparent 60%),
    linear-gradient(#07030f, #0d0524);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, p, ul, blockquote, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }

/* ---- 3D canvas --------------------------------------------------------- */
#club {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.9s ease;
  touch-action: pan-y;
}
.is-ready #club { opacity: 1; }
.no-webgl #club { display: none; }
.no-webgl body, body.no-webgl {
  background: linear-gradient(rgba(7, 3, 15, 0.55), rgba(7, 3, 15, 0.9)),
    url("../img/background/tablet/01_Background_image_1.jpg") center / cover fixed #07030f;
}

.loader {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
  pointer-events: none;
  transition: opacity 0.4s ease;
  animation: blink 1.2s ease-in-out infinite;
}
.is-ready .loader, .no-webgl .loader { opacity: 0; animation: none; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---- HUD ---------------------------------------------------------------- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 18px;
  background: linear-gradient(rgba(7, 3, 15, 0.85), rgba(7, 3, 15, 0));
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-logo { flex: 0 1 150px; min-width: 96px; line-height: 0; }
.hud-logo img { width: 100%; height: auto; display: block; }
.hud-actions { display: flex; align-items: center; gap: 8px; }
.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: rgba(10, 5, 24, 0.6);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.hud-btn:hover, .hud-btn:focus-visible { border-color: var(--cyan); outline: none; }
.hud-btn svg { width: 18px; height: 18px; fill: currentColor; }
.hud-btn.sound .wave { opacity: 0.25; }
.hud-btn.sound[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.5); }
.hud-btn.sound[aria-pressed="true"] .wave { opacity: 1; }
.hud-btn.cta {
  border-color: var(--pink);
  color: #fff;
  background: rgba(255, 43, 214, 0.2);
  box-shadow: 0 0 14px rgba(255, 43, 214, 0.45);
}
@media (max-width: 420px) {
  .hud-btn.sound span { display: none; }
  .hud-btn { padding: 0 10px; }
}

/* ---- Progress dots ----------------------------------------------------- */
.dots {
  position: fixed;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dots button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.dots button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}
.dots button.is-active::before {
  background: var(--cyan);
  transform: scale(1.7);
  box-shadow: 0 0 10px var(--cyan);
}

/* ---- Route sections + cards -------------------------------------------- */
#route { position: relative; z-index: 10; pointer-events: none; }
.stop {
  min-height: 160vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter);
}
.stop:first-child { min-height: 100vh; min-height: 100svh; }
.stop-last { min-height: 100vh; min-height: 100svh; }

.card {
  position: sticky;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: 440px;
  margin: 0 auto 14px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.18), 0 0 28px rgba(0, 229, 255, 0.16), 0 14px 40px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  max-height: calc(100vh - 110px);
  max-height: calc(100svh - 110px);
  overflow-y: auto;
}
/* With JS the card for the stop you are standing at fades in. */
.js .card {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.js .card.is-here { opacity: 1; transform: none; pointer-events: auto; }

.card h1, .card h2 {
  font-weight: 300;
  text-transform: uppercase;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.55);
}
.card h1 { font-size: 30px; }
.card h2 { font-size: 24px; margin-bottom: 10px; }
.card p + p { margin-top: 10px; }
.lead { font-size: 17px; margin-top: 8px; color: var(--text); }
.meta { font-size: 13px; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-top: 12px; }
.hint .arrow { display: inline-block; color: var(--cyan); animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

.card-hero { background: rgba(10, 5, 24, 0.6); text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  margin-top: 12px;
  border-radius: 23px;
  border: 1px solid var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn-primary { border-color: var(--pink); background: rgba(255, 43, 214, 0.22); box-shadow: 0 0 18px rgba(255, 43, 214, 0.45); }
.btn-row { display: flex; flex-direction: column; gap: 0; }
.btn-row .btn { width: 100%; font-size: 17px; }

.social { display: flex; justify-content: center; gap: 22px; margin: 16px 0 10px; }
.social a { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; }
.social svg { width: 32px; height: 32px; fill: #fff; filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.7)); }
.card-contact .meta { text-align: center; }

/* Club video: in 3D it plays on the wall screen, so the element itself stays out of sight */
.club-video { display: block; width: 100%; border-radius: 10px; background: #000; }
.js .club-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#playVideo[aria-pressed="true"] .when-off, #playVideo[aria-pressed="false"] .when-on { display: none; }
.no-webgl #playVideo { display: none; }

/* Gallery thumbs: one swipeable strip (a plain grid in the static fallback) */
.thumbs { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin; }
.thumbs { scrollbar-color: rgba(0, 229, 255, 0.5) transparent; }
.thumbs::-webkit-scrollbar { height: 4px; }
.thumbs::-webkit-scrollbar-track { background: transparent; }
.thumbs::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.5); border-radius: 2px; }
.thumbs li { flex: 0 0 64px; scroll-snap-align: start; }
.thumbs a { position: relative; display: block; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.18); line-height: 0; }
.thumbs img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.thumbs a.is-video::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 0 4px #000);
}
.no-webgl .thumbs { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }

/* Testimonials */
.quote { display: none; }
.quote.is-active { display: block; }
.no-js .quote, .quotes.all .quote { display: block; }
.quote p { font-weight: 300; font-size: 16px; }
.quote footer { margin-top: 8px; font-weight: 600; font-style: italic; color: var(--cyan); }
.quote-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.quote-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* ---- Toast (toy feedback) ---------------------------------------------- */
.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 25;
  padding: 7px 14px;
  border-radius: 16px;
  background: rgba(10, 5, 24, 0.85);
  border: 1px solid var(--pink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- Modals ------------------------------------------------------------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 1, 8, 0.94);
}
.modal figure { max-width: 94vw; text-align: center; }
.modal img, .modal video { max-width: 94vw; max-height: 74vh; display: block; margin: 0 auto; border: 1px solid rgba(0, 229, 255, 0.5); box-shadow: 0 0 30px rgba(0, 229, 255, 0.25); }
.modal [hidden] { display: none; }
.modal figcaption { margin-top: 12px; padding: 0 16px; font-size: 15px; color: var(--text); }
.modal button {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}
.modal-close { top: max(8px, env(safe-area-inset-top)); right: 8px; }
.modal-prev { left: 2px; top: 50%; transform: translateY(-50%); }
.modal-next { right: 2px; top: 50%; transform: translateY(-50%); }

/* ---- Static fallback (no WebGL): a plain, compact page ------------------ */
.no-webgl .stop { min-height: 0; padding-top: 14px; }
.no-webgl .stop:first-child { min-height: 100vh; min-height: 100svh; }
.no-webgl .card { position: static; max-height: none; }
.no-webgl .hint, .no-webgl .quote-nav { display: none; }
.no-webgl .quote + .quote { margin-top: 16px; }

/* ---- Larger screens ----------------------------------------------------- */
@media (min-width: 900px), (orientation: landscape) and (min-width: 640px) {
  :root { --gutter: 40px; }
  .hud-logo { flex-basis: 210px; }
  .card { margin-left: 4vw; margin-bottom: 36px; max-width: 460px; padding: 24px 26px 22px; }
  .card h1 { font-size: 42px; }
  .card h2 { font-size: 30px; }
  .card-hero { text-align: left; }
  .dots { right: 16px; }
  .btn-row { flex-direction: row; gap: 12px; }
  .btn-row .btn { font-size: 15px; }
}

/* Landscape phones: short viewport, keep the card compact */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --gutter: 16px; }
  .card { max-width: 360px; margin-left: 0; margin-bottom: 10px; padding: 14px 16px; }
  .card h1 { font-size: 24px; }
  .card h2 { font-size: 20px; margin-bottom: 6px; }
  .lead { font-size: 15px; }
  .btn-row { flex-direction: column; gap: 0; }
  .hud-logo { flex-basis: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .card { transition: opacity 0.2s; transform: none; }
  .hint .arrow, .loader { animation: none; }
}
