/* ============================================================
   LOGIRA — dark industrial scroll-cinematic theme (mobile-first)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --steel: #181a1e;
  --steel-deep: #101216;
  --paper: #f2f4f7;
  --paper-soft: #c6cdd6;
  --amber: #f59e0b;
  --amber-bright: #fbbf24;
  --sans: "Manrope", sans-serif;
  --display: "Sora", sans-serif;
}

html { scroll-behavior: auto; }
body {
  background: var(--steel-deep);
  color: var(--paper);
  font-family: var(--sans);
  overflow-x: hidden;
}

/* ===== Preloader ===== */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--steel-deep);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-brand {
  font-family: var(--display); font-size: 1.9rem; font-weight: 800;
  letter-spacing: 0.3em; text-indent: 0.3em; color: var(--paper);
}
.dot { color: var(--amber); }
.loader-bar { width: min(220px, 60vw); height: 2px; background: rgba(242, 244, 247, 0.14); border-radius: 2px; overflow: hidden; }
.loader-fill { width: 0%; height: 100%; background: var(--amber); transition: width 0.25s ease; }
.loader-pct { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; color: var(--paper-soft); }

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem clamp(1rem, 4vw, 2.2rem);
  background: linear-gradient(to bottom, rgba(16, 18, 22, 0.9), rgba(16, 18, 22, 0));
}
.nav-brand {
  display: inline-flex; flex-direction: column; text-decoration: none;
  font-family: var(--display); font-size: 1.2rem; font-weight: 800;
  letter-spacing: 0.26em; color: var(--paper);
  white-space: nowrap;
}
.nav-brand em {
  font-family: var(--sans); font-style: normal; font-size: 0.5rem; font-weight: 700;
  letter-spacing: 0.4em; color: var(--amber); margin-top: 2px;
}
.nav-cta {
  border: 1px solid rgba(242, 244, 247, 0.25); border-radius: 999px;
  background: rgba(16, 18, 22, 0.5); color: var(--paper);
  padding: 0.55rem 1.1rem; text-decoration: none;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* ===== Cinematic scrub ===== */
.cinematic { position: relative; height: 520vh; background: var(--steel); }
.cinematic .sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.stage {
  position: relative; height: 100%;
  width: min(100vw, calc(100vh * 0.5578), calc(100svh * 0.5578));
  overflow: hidden;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.55);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(16, 18, 22, 0.42) 0%,
    rgba(16, 18, 22, 0.05) 26%,
    rgba(16, 18, 22, 0) 55%,
    rgba(16, 18, 22, 0.5) 100%
  );
}

/* ===== Steps ===== */
.step-panel { position: absolute; inset: 0; pointer-events: none; }
.step {
  position: absolute; left: 0; right: 0; bottom: max(7vh, 56px);
  padding: 0 clamp(1.2rem, 6vw, 2.4rem);
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.step.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.step-tag {
  display: inline-block; margin-bottom: 0.8rem;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.26em;
  color: var(--amber-bright); text-shadow: 0 1px 10px rgba(16, 18, 22, 0.8);
}
.step h1, .step h2 {
  font-family: var(--display); font-weight: 800; color: var(--paper);
  font-size: clamp(2rem, 8.6vw, 3rem); line-height: 1.06; letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(16, 18, 22, 0.85);
}
.step p {
  max-width: 32ch; margin-top: 0.9rem;
  color: var(--paper-soft); font-size: 1rem; line-height: 1.55; font-weight: 500;
  text-shadow: 0 1px 12px rgba(16, 18, 22, 0.9);
}
.step-actions { display: flex; gap: 0.7rem; margin-top: 1.4rem; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--amber); color: #1c1402;
  padding: 0.95rem 1.6rem; font-family: var(--sans);
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  transition: background 0.25s ease, transform 0.25s ease;
}
.btn-primary:hover { background: var(--amber-bright); transform: translateY(-1px); }

/* ===== System layer (module chips over the final frame) ===== */
.shop-layer { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
body.shop-on .shop-layer { opacity: 1; pointer-events: auto; }
.shop-hint {
  position: absolute; top: max(13vh, 98px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; max-width: calc(100% - 32px);
  overflow: hidden; text-overflow: ellipsis;
  background: rgba(16, 18, 22, 0.82); color: var(--paper);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px; padding: 0.55rem 1.1rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hs {
  position: absolute; transform: translate(-50%, -120%);
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(245, 158, 11, 0.5); border-radius: 8px;
  background: rgba(16, 18, 22, 0.88); color: var(--paper);
  padding: 0.42rem 0.6rem; cursor: pointer;
  font-family: var(--sans); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}
.hs::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber-bright);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: chip-pulse 2s ease-out infinite;
}
.hs::after {
  content: ""; position: absolute; left: 50%; bottom: -9px;
  width: 2px; height: 9px; background: rgba(245, 158, 11, 0.6);
}
@keyframes chip-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); }
}

/* ===== Module sheet ===== */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 240;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s ease;
}
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 250;
  width: min(100%, 560px); transform: translate(-50%, 110%);
  display: flex; gap: 1rem; align-items: flex-start;
  background: #1d2026; border: 1px solid rgba(242, 244, 247, 0.08); border-bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 1.25rem; box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.6);
  transition: transform 0.45s cubic-bezier(0.22, 0.9, 0.3, 1);
}
body.sheet-open .sheet { transform: translate(-50%, 0); }
body.sheet-open .sheet-scrim { opacity: 1; visibility: visible; }
.sheet-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(242, 244, 247, 0.08); color: var(--paper);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.sheet-icon {
  flex: none; width: 52px; height: 52px; margin-top: 0.2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.4); border-radius: 13px;
  background: rgba(245, 158, 11, 0.12); color: var(--amber-bright);
  font-size: 1.4rem;
}
.sheet-body { flex: 1; min-width: 0; }
.sheet-tag { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.26em; color: var(--amber-bright); }
.sheet h3 { font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin: 0.3rem 0 0.35rem; }
.sheet-desc { color: var(--paper-soft); font-size: 0.86rem; line-height: 1.5; }
.sheet-list { margin: 0.7rem 0 0; padding: 0; list-style: none; }
.sheet-list li {
  position: relative; padding-left: 18px; margin-bottom: 0.35rem;
  color: var(--paper-soft); font-size: 0.82rem; line-height: 1.45;
}
.sheet-list li::before { content: "▪"; position: absolute; left: 0; color: var(--amber); }
.sheet-row { display: flex; margin-top: 1rem; }
.sheet-add { padding: 0.85rem 1.3rem; font-size: 0.72rem; width: 100%; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  transform: translate(-50%, 80px); opacity: 0;
  background: var(--amber); color: #1c1402;
  border-radius: 999px; padding: 0.75rem 1.4rem;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em;
  transition: transform 0.4s ease, opacity 0.4s ease; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===== Progress / hint / footer ===== */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(242, 244, 247, 0.1); }
.progress-fill { width: 0%; height: 100%; background: var(--amber); }
.scroll-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.3em; color: var(--paper-soft);
  transition: opacity 0.4s ease; pointer-events: none; white-space: nowrap;
}
.footer {
  padding: 1.6rem; text-align: center;
  font-size: 0.78rem; color: var(--paper-soft); background: var(--steel-deep);
}
.footer a { color: var(--amber-bright); font-weight: 700; text-decoration: none; }

/* ===== Narrow screens (incl. lightbox iframe) ===== */
@media (max-width: 600px) {
  .nav { padding: 0.7rem 1rem; }
  .nav-brand { font-size: 1rem; letter-spacing: 0.18em; }
  .nav-brand em { font-size: 0.44rem; letter-spacing: 0.3em; }
  .nav-cta { padding: 0.45rem 0.85rem; font-size: 0.62rem; letter-spacing: 0.08em; }
}

/* ===== Desktop polish ===== */
@media (min-width: 760px) {
  .step { bottom: 12vh; }
  .step p { max-width: 38ch; }
  .hs { font-size: 0.72rem; }
}
