/* ============ tokens ============ */
:root {
  --bg: #07090f;
  --panel: rgba(10, 12, 20, 0.66);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --text-dim: #aab3c5;
  --accent: #3ddc84;        /* Jhome green */
  --accent-soft: rgba(61, 220, 132, 0.16);
  --danger: #ff3b30;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

/* ============ background scene ============ */
#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}
.bg-poster {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../poster.jpg") center / cover no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  #scene-canvas { display: none; }
  .bg-poster { display: block; }
}

/* ============ layout ============ */
main { position: relative; z-index: 1; }
.panel-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8vh 5vw;
}
.hero { justify-content: center; text-align: center; }
.side.left  { justify-content: flex-start; }
.side.right { justify-content: flex-end; }

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 34px 36px;
  max-width: 470px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.glass-center { max-width: 640px; padding: 48px 44px; }

/* ============ type ============ */
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 14px;
}
h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.12;
}
h1 .dot { color: var(--accent); padding: 0 0.18em; }
.tagline { font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--text-dim); margin-top: 14px; }
.scroll-cue {
  margin-top: 34px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0%,100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } }

h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 14px; }
.glass p { color: var(--text-dim); margin-bottom: 14px; }

/* ============ arsenal columns ============ */
.glass-wide { max-width: 780px; }

.arsenal-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 6px;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  margin-bottom: 12px;
}
.col-head.live { color: var(--accent); }
.col-head.soon { color: #ffb84d; }
.dot-live, .dot-soon {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
}
.dot-live { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s ease-in-out infinite; }
.dot-soon { background: #ffb84d; box-shadow: 0 0 8px rgba(255, 184, 77, 0.7); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.col-viewport {
  height: 380px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.col-track { display: flex; flex-direction: column; }
.track-up   { animation: colUp 36s linear infinite; }
.track-down { animation: colDown 40s linear infinite; }
.col-viewport:hover .col-track { animation-play-state: paused; }
@keyframes colUp   { from { transform: translateY(0); }    to { transform: translateY(-50%); } }
@keyframes colDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .track-up, .track-down { animation: none; }
  .col-viewport { height: auto; -webkit-mask-image: none; mask-image: none; }
  .col-track ul[aria-hidden="true"] { display: none; }
  .dot-live { animation: none; }
}

/* ============ app cards (logo + name, hover expands description) ============ */
.apps { list-style: none; }
.apps li { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.apps a,
.apps-soon li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 10px;
  border-radius: 12px;
  text-decoration: none;
  transition: background .2s;
}
.apps a:hover, .apps-soon li:hover { background: var(--accent-soft); }
.apps a:hover strong { color: var(--accent); }

.app-logo {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.app-logo img { width: 100%; height: 100%; object-fit: cover; }
.app-logo.logo-wide img { object-fit: contain; padding: 4px; }
.app-logo.mono {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}
.mono-nat  { background: linear-gradient(135deg, #1f7a4d, #3ddc84); }
.mono-halo { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.mono-cal  { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }

.app-info { display: flex; flex-direction: column; min-width: 0; }
.apps strong { font-size: 17px; color: var(--text); transition: color .15s; }
.apps-soon strong { color: rgba(238, 241, 247, 0.85); }

.desc {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.45;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .3s ease, margin-top .35s ease;
}
.apps a:hover .desc,
.apps-soon li:hover .desc {
  max-height: 90px;
  opacity: 1;
  margin-top: 3px;
}
/* touch devices have no hover — keep descriptions visible */
@media (hover: none) {
  .desc { max-height: none; opacity: 1; margin-top: 3px; }
}

/* ============ buttons ============ */
.btn-solid, .btn-ghost {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 22px;
  margin: 8px 10px 0 0;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, background .15s;
}
.btn-solid { background: var(--accent); color: #06210f; border: 0; }
.btn-solid:hover { filter: brightness(1.1); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); }

/* ============ footer credit ============ */
.credit {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 0 calc(14px + env(safe-area-inset-bottom));
}
.credit a {
  color: var(--text-dim);
  opacity: 0.65;
  font-size: 14px;
  text-decoration: none;
}
.credit a:hover { opacity: 1; }

/* ============ lightbox / history modal ============ */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); }
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.history-body {
  position: relative;
  width: min(92vw, 680px);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 38px 40px 34px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6);
}
.history-intro { color: var(--text-dim); margin-bottom: 26px; }

.chapters { list-style: none; margin: 0 0 26px; }
.chapters li {
  position: relative;
  padding: 0 0 26px 26px;
  border-left: 1px solid rgba(61, 220, 132, 0.35);
  margin-left: 6px;
}
.chapters li:last-child { padding-bottom: 4px; border-left-color: transparent; }
.chapters li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.8);
}
.chapters .era {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.chapters h3 { font-size: 19px; font-weight: 800; margin: 6px 0 2px; }
.chapters .org { color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.chapters p { color: var(--text-dim); font-size: 16px; }

@media (max-width: 720px) {
  .history-body { padding: 28px 22px 26px; max-height: 88vh; }
}

/* ============ mobile ============ */
@media (max-width: 720px) {
  .panel-wrap { padding: 10vh 5vw; }
  h1 { font-size: clamp(1.5rem, 7.2vw, 2.2rem); }
  .arsenal-cols { grid-template-columns: 1fr; gap: 20px; }
  .col-viewport { height: 250px; }
  .side.left, .side.right { justify-content: center; }
  .glass { max-width: 100%; padding: 26px 22px; }
  .glass-center { padding: 34px 24px; }
}
