/* ============================================
   BISAMON — The Quiet Room (Evolved)
   ============================================ */

:root {
  --bg:         #030710;
  --bg-soft:    #0a1220;
  --bg-field:   #060d18;
  --tx:         #eef2f6;
  --tx-2:       #8a9aaa;
  --tx-dim:     rgba(138, 154, 170, 0.35);
  --tx-ghost:   rgba(138, 154, 170, 0.12);
  --accent:     #1abc9c;
  --accent-hi:  #2ee8b5;
  --accent-line:rgba(26, 188, 156, 0.2);
  --accent-glow:rgba(26, 188, 156, 0.08);
  --fd:         'Space Grotesk', sans-serif;
  --fm:         'JetBrains Mono', monospace;

  /* Easing tokens (tune here once for the whole experience)
     --ease       : expo-out, used on existing reveals
     --ease-luxe  : quart-out, slightly softer, used on scene choreography
     --ease-scene : expo-in-out, used when a scene fully reframes */
  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-luxe:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-scene: cubic-bezier(0.87, 0, 0.13, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { background: var(--bg); color: var(--tx); overflow-x: hidden; font-family: var(--fd); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
blockquote { margin: 0; }
::selection { background: var(--accent); color: var(--bg); }

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }


/* ============================================
   SHARED SCENE LAYER
   Every top-level section behaves as a full-height "scene".
   The .js-scene-content nodes are what JS transforms during
   scene transitions (opacity + translateY + scale + subtle blur).
   They are GPU-isolated via translate3d + will-change.
   ============================================ */
.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.js-scene-content {
  /* Force a compositor layer so transform/opacity/filter animate on GPU.
     Without this, scene-wide blur during scroll can cause paint jank.
     Tune the numeric values in js/main.js → CONFIG.scene. */
  will-change: transform, opacity, filter;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Mobile: strip the compositor hint — blur is disabled in JS on mobile,
   and keeping will-change on every scene wastes memory on low-end devices. */
@media (max-width: 768px) {
  .js-scene-content { will-change: auto; }
}



/* ============================================
   THE THREAD — dominant visual across scenes
   ============================================ */
.thread--exit {
  position: absolute;
  bottom: 0;
  left: 8vw;
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--accent-line));
}

/* thread--vertical removed (no image split) */


/* ============================================
   SCENE 1 — THE STATEMENT
   ============================================ */
.scene--statement {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 0 0 12vh 8vw;
  background: var(--bg);
  overflow: hidden;
}

.env-nav {
  position: absolute;
  top: clamp(28px, 4vh, 48px);
  left: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 1.8s forwards;
}
.env-nav__link {
  font-family: var(--fm);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tx-dim);
  transition: color 0.4s var(--ease);
}
.env-nav__link:hover { color: var(--tx-2); }
.env-nav__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.statement__mark {
  position: absolute;
  top: clamp(24px, 4vh, 48px);
  right: clamp(24px, 4vw, 48px);
  z-index: 10;
  opacity: 0;
  transform: translateY(-8px);
  animation: markEnter 0.8s var(--ease) 1.6s forwards;
}
.statement__mark img { width: 36px; height: auto; opacity: 0.7; transition: opacity 0.4s var(--ease); }
.statement__mark img:hover { opacity: 1; }

.env-trust {
  position: absolute;
  bottom: clamp(28px, 6vh, 60px);
  right: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 2.2s forwards;
}
.env-trust span { font-family: var(--fm); font-size: 9px; letter-spacing: 0.15em; color: var(--tx-dim); }

.statement__content { max-width: 90vw; }

.label {
  display: block;
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tx-dim);
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s var(--ease) 0.3s forwards;
}

.rule {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 20px 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: ruleIn 0.6s var(--ease) 0.6s forwards;
}

.headline {
  font-weight: 700;
  font-size: clamp(52px, 12vw, 180px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--tx);
  will-change: letter-spacing, opacity;
  white-space: nowrap;
}
.headline__line { display: block; overflow: hidden; }
.headline__line-inner {
  display: block;
  transform: translateY(105%);
  animation: lineReveal 0.9s var(--ease) forwards;
}
.headline__line:nth-child(1) .headline__line-inner { animation-delay: 0.8s; }
.headline__line:nth-child(2) .headline__line-inner { animation-delay: 0.95s; }

/* What-is line below headline */
.statement__sub {
  margin-top: clamp(20px, 3vh, 32px);
  font-weight: 400;
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.5;
  color: var(--tx-2);
  max-width: 480px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s var(--ease) 1.3s forwards;
}

@keyframes fadeUp     { to { opacity: 1; transform: translateY(0); } }
@keyframes ruleIn     { to { transform: scaleX(1); } }
@keyframes lineReveal { to { transform: translateY(0); } }
@keyframes markEnter  { to { opacity: 1; transform: translateY(0); } }


/* ============================================
   SCENE 2 — THE NARRATIVE (split layout)
   ============================================ */
.scene--narrative {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 42fr 58fr;
  background: var(--bg-soft);
  overflow: hidden;
}

/* Left: text column — anchored to global left spine (8vw) */
.narrative__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10vh clamp(32px, 5vw, 80px) 10vh 8vw;
  max-width: 560px;
}

/* Right: immersive visual — bleeds, fades, atmospheric */
.narrative__visual {
  position: relative;
  overflow: hidden;
}

.narrative__clip {
  width: 100%;
  height: 100%;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
}

.narrative__clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  will-change: transform;
}

/* Atmospheric fade: dissolves image into the scene on the left edge */
.narrative__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--bg-soft) 0%, transparent 40%),
    linear-gradient(to top, var(--bg-soft) 0%, transparent 20%),
    linear-gradient(to bottom, var(--bg-soft) 0%, transparent 15%);
}

.quote { position: relative; padding-left: 20px; border-left: 2px solid var(--accent-line); }
.quote p {
  font-weight: 500;
  font-size: clamp(18px, 2.5vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--tx);
  text-wrap: balance;
}

.narrative__body {
  margin-top: clamp(24px, 4vh, 48px);
  padding-top: clamp(20px, 3vh, 36px);
  border-top: 1px solid rgba(255,255,255,0.04);
}
.narrative__body p {
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.7;
  color: var(--tx-2);
}

.subline {
  margin-top: clamp(16px, 2vh, 28px);
  font-family: var(--fm);
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.02em;
  color: var(--tx-dim);
  line-height: 1.6;
}


/* ============================================
   SCENE 3 — MODULES (1x4 horizontal strip)
   ============================================ */
.scene--modules {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 0;
  background: var(--bg-field);
  overflow: hidden;
}

.field__bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/img/footer.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.06;
  pointer-events: none;
}

.modules__header {
  position: relative;
  z-index: 2;
  padding: 0 8vw;
  margin-bottom: clamp(6vh, 8vh, 10vh);
}

.modules__label {
  display: block;
  font-family: var(--fm);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.modules__headline {
  font-weight: 600;
  font-size: clamp(24px, 4vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--tx);
}

/* 1x4 horizontal strip */
.modules__flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0 8vw;
  z-index: 2;
}

/* Module — separated by vertical dividers */
.mod {
  position: relative;
  z-index: 2;
  padding: clamp(24px, 3vh, 40px) clamp(20px, 2.5vw, 40px);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
}
.mod:first-child { border-left: none; }

/* Number */
.mod__num {
  display: block;
  font-family: var(--fm);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.55;
  margin-bottom: 14px;
}

/* Title */
.mod__name {
  font-weight: 600;
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--tx);
  margin-bottom: 14px;
}

/* Description */
.mod__desc {
  font-size: clamp(12px, 0.85vw, 14px);
  line-height: 1.6;
  color: var(--tx-2);
}


/* ============================================
   SCENE 4 — THE VAULT (Climax)
   ============================================ */
.scene--vault {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12vh clamp(24px, 4vw, 48px);
  background: var(--bg);
  overflow: hidden;
}

/* Radial glow from center */
.vault__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 80vh;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s var(--ease);
}
.vault__glow.is-visible { opacity: 1; }

/* Ghost eye — larger, brighter */
.vault__eye {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s var(--ease);
}
.vault__eye img {
  width: clamp(280px, 40vh, 560px);
  height: auto;
  filter: brightness(0.5);
}
.vault__eye.is-visible { opacity: 0.08; }

.vault__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
}

/* Headline */
.vault__quote { margin-bottom: 20px; }
.vault__quote p {
  font-weight: 700;
  font-size: clamp(36px, 6vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--tx);
}

/* Supporting text */
.vault__sub {
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.6;
  color: var(--tx-2);
  margin-bottom: clamp(32px, 5vh, 52px);
  max-width: 420px;
}

.vault__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(24px, 3vh, 36px);
}

/* Primary CTA — prominent, with pulse ring */
.vault__enter {
  position: relative;
  font-family: var(--fm);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 16px 40px;
  border: 1px solid rgba(26, 188, 156, 0.35);
  border-radius: 2px;
  transition: all 0.5s var(--ease);
}
.vault__enter::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  opacity: 0;
  animation: ctaPulse 3s var(--ease) infinite;
}
@keyframes ctaPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%      { opacity: 0.15; transform: scale(1.04); }
}
.vault__enter:hover {
  background: rgba(26, 188, 156, 0.08);
  border-color: var(--accent);
  color: var(--accent-hi);
  box-shadow: 0 0 40px rgba(26, 188, 156, 0.1);
}
.vault__enter:hover::after { animation: none; opacity: 0; }
.vault__enter:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }

.vault__email {
  font-family: var(--fm);
  font-size: clamp(12px, 1vw, 14px);
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: clamp(40px, 6vh, 64px);
  transition: color 0.4s var(--ease);
}
.vault__email:hover { color: var(--accent-hi); }
.vault__email:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* Meta block: nav + legal + copyright */
.vault__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.vault__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.vault__nav a {
  font-family: var(--fm);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx-dim);
  transition: color 0.4s var(--ease);
}
.vault__nav a:hover { color: var(--tx-2); }
.vault__nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.vault__copy { font-family: var(--fm); font-size: 9px; letter-spacing: 0.12em; color: var(--tx-ghost); }

/* The Thread: vault seal — thicker, glows */
.vault__line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 1.6s var(--ease);
  box-shadow: 0 0 20px var(--accent-glow);
}
.vault__line.is-visible { transform: scaleX(1); }

@keyframes ghostPulse {
  0%, 100% { opacity: 0.08; }
  50%      { opacity: 0.12; }
}
.vault__eye.is-pulsing { animation: ghostPulse 4s ease-in-out 1; }


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .scene--statement { padding: 0 0 10vh 6vw; }
  .thread--exit { left: 6vw; }

  .env-nav {
    top: auto;
    bottom: clamp(28px, 6vh, 60px);
    left: auto;
    right: 6vw;
    align-items: flex-end;
  }
  .env-trust { display: none; }

  .scene--narrative {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 50vh;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .narrative__text {
    padding: 10vh 6vw 6vh;
    max-width: none;
  }
  .narrative__clip {
    clip-path: inset(0); /* No clip animation on mobile */
  }

  /* Modules: stack on mobile — still full-height scene */
  .scene--modules { min-height: 100vh; min-height: 100dvh; padding: 10vh 0 12vh; }
  .modules__header { padding: 0 6vw; }
  .modules__flow { grid-template-columns: 1fr; padding: 0 6vw; }
  .mod {
    padding: clamp(20px, 3vh, 32px) 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.04);
  }
  .mod:last-child { border-bottom: 1px solid rgba(255,255,255,0.04); }

  .scene--vault { min-height: 80vh; }
  .vault__glow { width: 120vw; }
}

@media (max-width: 480px) {
  .headline { font-size: clamp(42px, 13vw, 80px); }
}


/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .headline__line-inner { transform: none; }
  .label, .statement__mark, .statement__sub, .env-nav, .env-trust { opacity: 1; transform: none; }
  .vault__enter::after { animation: none; }
  .narrative__clip { clip-path: inset(0); }
  .rule { transform: scaleX(1); }
  .reveal { opacity: 1; transform: none; }
  .vault__eye { opacity: 0.08; }
  .vault__glow { opacity: 1; }
  .vault__line { transform: scaleX(1); }
}
