/* =========================================================
   Home page — cinematic, scroll-driven layer on top of style.css
   The WebGL canvas is fixed behind; sections scroll over it.
   ========================================================= */

.home {
  --night: #07040f;
  --violet: #2a1257;
  --gold: #f2b84b;
  --ice: #9fc4ff;
  --glass: rgba(16, 10, 34, .55);
  --glass-line: rgba(255, 255, 255, .09);
  background: var(--night);
  color: #f1ecff;
  overflow-x: hidden;
}

/* ---------- Canvas + fallback ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.fallback-sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: #0b0618 url("/assets/img/hero.jpg") center 60% / cover no-repeat;
}
.webgl .fallback-sky { display: none; }
@media (max-width: 820px) {
  .fallback-sky { background-image: url("/assets/img/hero-portrait.jpg"); background-position: center top; }
}

/* Phones: looping background video, orb in the upper third */
.bg-video {
  position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top; pointer-events: none;
  background: #0b0618 url("/assets/img/hero-portrait.jpg") center top / cover no-repeat;
}

/* Vignette + grain so text always reads over the scene */
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(3, 2, 8, .7) 100%);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; align-content: center; gap: 28px;
  background: #07040f; color: #cfc7e6;
  font: 600 11px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase;
  transition: opacity .9s ease, visibility .9s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader svg { width: 120px; height: 120px; overflow: visible; }
.loader .draw { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .6s ease; }
.loader .draw.thin { stroke: #6f60a0; stroke-width: 1; }
.loader .pct { font-size: 12px; color: #fff; letter-spacing: .1em; min-width: 4ch; text-align: center; }
.loader .line { color: #7d7598; }

/* ---------- Header on the home page ---------- */
.home .site-header { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
.home .site-header.scrolled { background: linear-gradient(180deg, rgba(7, 4, 15, .75), rgba(7, 4, 15, 0)); }
.home .brand span i { color: #8f86ab; }
.home .icon-btn { background: rgba(255, 255, 255, .04); border-color: var(--glass-line); color: #d8d0ee; }
.home .icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }
.home .nav a { color: #bdb4d8; }
.home .nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.phase-dots { display: flex; gap: 6px; position: absolute; left: 50%; transform: translateX(-50%); }
.phase-dots button {
  width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.phase-dots button::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .45);
  transition: transform .3s, background .3s, box-shadow .3s;
}
.phase-dots button[aria-current="step"]::before { background: var(--gold); transform: scale(1.7); box-shadow: 0 0 12px var(--gold); }
@media (max-width: 720px) { .phase-dots { display: none; } }

/* ---------- Phases ---------- */
.story { position: relative; z-index: 2; }
.phase {
  min-height: 150vh; display: flex; align-items: center;
  padding: 120px 0;
}
.phase:first-child { min-height: 100vh; padding-top: 90px; }
.phase .wrap { display: flex; }
.phase.right .wrap { justify-content: flex-end; }
.phase.center .wrap { justify-content: center; }

.panel { max-width: 500px; min-width: 0; }
.panel h1, .panel h2 { overflow-wrap: anywhere; hyphens: auto; }
.phase.center .panel { max-width: 980px; width: 100%; text-align: center; }

.tag {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: #120b02; background: var(--gold); padding: 6px 9px; border-radius: 3px;
}
.tag + .tag-line { display: inline-block; width: 40px; height: 1px; background: rgba(242, 184, 75, .6); vertical-align: middle; margin-left: 12px; }

.panel h1, .panel h2 {
  font-size: clamp(38px, 5.4vw, 72px); line-height: .98; letter-spacing: -.035em;
  text-transform: uppercase; font-weight: 800; margin: 22px 0 20px;
  text-shadow: 0 2px 30px rgba(7, 4, 15, .6);
}
.panel h1 em, .panel h2 em { font-style: normal; color: var(--gold); }
.panel p { color: #cfc6e8; font-size: clamp(16px, 1.4vw, 19px); margin: 0 0 30px; text-shadow: 0 1px 14px rgba(7, 4, 15, .8); }
.phase.center .panel p { margin-inline: auto; max-width: 36em; }

.more {
  display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: #fff;
  font: 600 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
}
.more .box {
  width: 52px; height: 52px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 4px;
  display: grid; place-items: center; transition: border-color .3s, background .3s;
}
.more .box svg { width: 18px; height: 18px; }
.more:hover .box { border-color: var(--gold); background: rgba(242, 184, 75, .1); }
.more .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; color: #9d94bb;
  font: 600 10px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase;
}
.scroll-hint span { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: drip 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Reveal: children slide in when a phase becomes active */
.js .reveal > * { opacity: 0; transform: translateY(26px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .is-active .reveal > * { opacity: 1; transform: none; }
.js .is-active .reveal > *:nth-child(2) { transition-delay: .08s; }
.js .is-active .reveal > *:nth-child(3) { transition-delay: .16s; }
.js .is-active .reveal > *:nth-child(4) { transition-delay: .24s; }
.js .is-active .reveal > *:nth-child(5) { transition-delay: .32s; }

/* ---------- Glass app cards ---------- */
.home .apps { text-align: left; margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 340px)); justify-content: center; }
.home .app-card {
  background: var(--glass); border-color: var(--glass-line);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9);
}
.home .app-card:hover { border-color: rgba(242, 184, 75, .5); }
.home .app-card p, .home .app-links a { color: #c9c0e2; }
.home .app-card h3 { color: #fff; }
.home .app-icon { background: rgba(255, 255, 255, .05); border-color: var(--glass-line); color: var(--gold); }
.home .badge { border-color: rgba(255, 255, 255, .18); color: #a9a0c6; }
.home .app-card.placeholder { background: rgba(16, 10, 34, .3); border-color: rgba(255, 255, 255, .2); }
.home .app-card.placeholder:hover { border-color: rgba(255, 255, 255, .3); }

/* ---------- Principles row inside phase 3 ---------- */
.mini-list { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 14px; }
.mini-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; color: #cfc6e8; }
.mini-list b { color: #fff; display: block; }
.mini-list .n { font: 600 11px/22px var(--mono); color: var(--gold); letter-spacing: .1em; }

/* ---------- Contact ---------- */
.home .contact-list { max-width: 520px; margin: 0 auto 10px; text-align: left; }
.home .contact-item { background: var(--glass); border-color: var(--glass-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; }
.home .contact-item:hover { border-color: var(--gold); }
.home .contact-item small { color: #a197c2; }

.home .site-footer { position: relative; z-index: 2; margin-top: 0; border-top-color: rgba(255, 255, 255, .08); background: linear-gradient(180deg, transparent, rgba(7, 4, 15, .9) 40%); color: #8d84aa; }
.home .site-footer a { color: #c4bbe0; }

/* ---------- Phones: text sits low, orb stays in the upper half ---------- */
@media (max-width: 820px) {
  .phase { min-height: 130vh; align-items: flex-end; padding: 0 0 18vh; }
  .phase:first-child { min-height: 110vh; padding-bottom: 22vh; }
  .phase .wrap, .phase.right .wrap { justify-content: flex-start; }
  .panel {
    padding: 22px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 6, 22, .35), rgba(10, 6, 22, .75));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-line);
  }
  .phase.center .panel { background: none; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; text-align: left; }
  .phase.center { align-items: center; padding: 100px 0; }
  .panel h1, .panel h2 { font-size: clamp(26px, 8vw, 44px); margin: 16px 0 14px; letter-spacing: -.03em; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal > * { opacity: 1; transform: none; }
}
