/* Descent (zejście narracyjne) - dopełnienie tokenów memento.css */

html { scroll-behavior: smooth; }
body { font-size: 19px; line-height: 1.65; overflow-x: hidden; }

.mono { font-family: var(--mono); }

section { position: relative; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }

/* ---------------------------- seen banner ---------------------------- */
.seen-banner { position: relative; z-index: 70; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.seen-banner-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 14px; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--bone-dim);
}
.seen-banner-inner a { color: var(--ember); letter-spacing: 0.1em; }

/* ---------------------------- corner nav ---------------------------- */
.corner-nav {
  position: fixed; top: 22px; right: clamp(20px, 4vw, 40px); z-index: 60;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.22em; display: flex; gap: 16px;
}
.corner-nav a { color: var(--bone-faint); text-decoration: none; padding-bottom: 2px; transition: color 0.25s; }
.corner-nav a:hover { color: var(--ember); }
.corner-nav a.active { color: var(--bone); border-bottom: 1px solid var(--blood); }

/* ---------------------------- progress dot-grid ---------------------------- */
.progress-nav {
  position: fixed; right: clamp(14px, 2.4vw, 30px); top: 50%; transform: translateY(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 10px;
}
.progress-nav button {
  width: 8px; height: 8px; padding: 0; margin: 0; border: 1px solid var(--bone-faint);
  background: transparent; cursor: pointer; transition: background 0.3s, border-color 0.3s;
}
.progress-nav button:hover { border-color: var(--bone); }
.progress-nav button.visited { background: var(--bone-faint); border-color: var(--bone-faint); }
.progress-nav button.current { background: var(--ember); border-color: var(--ember); animation: dotPulse 1.6s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 79, 79, 0.7); }
  50% { box-shadow: 0 0 0 4px rgba(217, 79, 79, 0); }
}

/* ---------------------------- hero ---------------------------- */
#hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.ghost-hero {
  position: absolute; right: -4vw; top: 50%; transform: translateY(-54%); z-index: 0;
  font-family: var(--serif); font-weight: 700; font-size: clamp(300px, 58vw, 760px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(169, 34, 34, 0.26); user-select: none; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-kicker { margin-bottom: clamp(24px, 4vh, 48px); }
.hero-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(3rem, 9vw, 6.6rem); line-height: 1; letter-spacing: -0.01em; margin: 0; }
.hero-lead { max-width: 56ch; margin-top: clamp(24px, 4vh, 40px); font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--bone-dim); }
.hero-cta-row { margin-top: clamp(36px, 6vh, 60px); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hero-skip { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone-faint); }
.hero-skip:hover { color: var(--ember); text-decoration: none; }

/* stagger wejścia hero */
.rise { opacity: 0; transform: translateY(26px); animation: descentRise 1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes descentRise { to { opacity: 1; transform: none; } }
.rise.d1 { animation-delay: 0.1s; }
.rise.d2 { animation-delay: 0.28s; }
.rise.d3 { animation-delay: 0.46s; }
.rise.d4 { animation-delay: 0.64s; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------- warstwa (rozdziały I-VIII) ---------------------------- */
.warstwa {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  border-top: 1px solid var(--line); overflow: hidden; padding-block: clamp(70px, 12vh, 140px);
}
.warstwa .ghost-num {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 0;
  font-family: var(--serif); font-weight: 700; line-height: 1; font-size: clamp(220px, 42vw, 560px);
  color: transparent; -webkit-text-stroke: 1px rgba(169, 34, 34, var(--ga, 0.14));
  user-select: none; pointer-events: none; white-space: nowrap;
}
.warstwa.depth-1 { --ga: 0.12; }
.warstwa.depth-2 { --ga: 0.16; }
.warstwa.depth-3 { --ga: 0.2; }
.warstwa.depth-4 { --ga: 0.22; }
.warstwa.depth-5 { --ga: 0.26; }
.warstwa.depth-6 { --ga: 0.3; }
.warstwa.depth-7 { --ga: 0.36; }
.warstwa.depth-8 { --ga: 0.42; }

.warstwa-inner { position: relative; z-index: 1; width: 100%; }
.warstwa-kicker { margin-bottom: clamp(24px, 4vh, 44px); }
.warstwa-lead {
  max-width: 62ch; font-size: clamp(1.15rem, 2.4vw, 1.6rem); line-height: 1.5; font-style: italic;
  color: var(--bone); text-wrap: balance;
}

/* ---------------------------- gateway grid (reveal-by-confrontation) ---------------------------- */
.gw-grid, .core-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); margin-top: clamp(40px, 6vh, 64px);
}
.gw, .core-card { position: relative; background: var(--ink); padding: 30px 26px 34px; }
.gw::after, .core-card::after {
  content: ""; position: absolute; left: 0; top: 0; width: 0; height: 2px; background: var(--blood);
  transition: width 0.45s cubic-bezier(0.7, 0, 0.2, 1);
}
.gw:hover::after { width: 100%; }
.gw-name, .core-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; line-height: 1.25; margin-bottom: 18px; }
.gw-btn { font-size: 0.7rem; }
.gw-reveal { margin-top: 26px; }
.gw-reveal[hidden] { display: none; }
.gw-reveal .verdict { margin-bottom: 16px; }
.gw-mech, .core-mech { color: var(--bone-dim); font-size: 0.98rem; line-height: 1.6; margin-bottom: 16px; max-width: 46ch; }
.gw-link { display: inline-block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.gw-link:hover { text-decoration: underline; }

/* ---------------------------- bramka cienia ---------------------------- */
.cien-gate {
  min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center;
  text-align: center; border-top: 1px solid var(--line); position: relative; overflow: hidden;
}
.gate-inner { display: flex; flex-direction: column; align-items: center; }
.gate-numeral {
  font-family: var(--serif); font-weight: 700; font-size: clamp(160px, 30vw, 420px); line-height: 1;
  color: var(--blood); opacity: 0.92;
}
.gate-line { max-width: 44ch; margin: 24px auto 0; font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--bone-dim); font-style: italic; }
.gate-btn { margin-top: 44px; }
.gate-btn:disabled { opacity: 0.4; cursor: default; }
.gate-btn:disabled::before { display: none; }

/* ---------------------------- rdzeń (odwrócona kolorystyka akcentów) ---------------------------- */
.core {
  position: relative; border-top: 1px solid var(--line); overflow: hidden;
  padding-block: clamp(70px, 12vh, 140px);
}
.core .ghost-num {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 0;
  font-family: var(--serif); font-weight: 700; line-height: 1; font-size: clamp(220px, 42vw, 560px);
  color: transparent; -webkit-text-stroke: 1px rgba(233, 226, 211, 0.16);
  user-select: none; pointer-events: none;
}
.core-inner { position: relative; z-index: 1; width: 100%; }
.core-kicker { margin-bottom: clamp(24px, 4vh, 44px); color: var(--ember); }
.core-card::after { background: var(--ember); }
.core-verdict { margin-top: clamp(48px, 8vh, 84px); border-left-color: var(--ember); }

/* ---------------------------- final ---------------------------- */
#final { min-height: 80vh; min-height: 80svh; display: flex; align-items: center; border-top: 1px solid var(--line); }
.final-coda { max-width: 56ch; color: var(--bone-dim); font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.7; }
.final-foot {
  margin-top: 8vh; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; color: var(--bone-faint); text-transform: uppercase;
}
.final-foot a { color: inherit; }

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 900px) {
  .warstwa .ghost-num, .core .ghost-num { font-size: clamp(160px, 50vw, 360px); }
  .gate-numeral { font-size: clamp(140px, 36vw, 300px); }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  body { font-size: 17px; }
  .progress-nav { right: 8px; gap: 7px; }
  .progress-nav button { width: 6px; height: 6px; }
  .corner-nav {
    top: 14px; right: 14px; padding: 8px 12px; gap: 14px; background: rgba(13, 11, 9, 0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line);
  }
  .gate-numeral { font-size: clamp(110px, 42vw, 220px); }
  .final-foot { flex-direction: column; gap: 10px; }
}
