:root {
  --bg: #050816;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --panel: rgba(5, 8, 22, 0.74);
  --panel-strong: rgba(9, 14, 32, 0.9);
  --line: rgba(148, 163, 184, 0.22);
  --cyan: #00fff0;
  --blue: #00d4ff;
  --orange: #ff7a00;
  --green: #39ff88;
  --purple: #8b5cf6;
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  overflow: hidden;
}

body {
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.88), rgba(5, 8, 22, 0.62) 45%, rgba(2, 6, 23, 0.86)),
    linear-gradient(to bottom, rgba(2, 6, 23, 0.22), rgba(2, 6, 23, 0.82)),
    url("assets/fire-to-firewall-hero.png") center / cover no-repeat;
}

.site-bg::before,
.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-bg::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 92%);
}

.site-bg::after {
  background:
    radial-gradient(circle at 15% 58%, rgba(255, 122, 0, 0.16), transparent 22rem),
    radial-gradient(circle at 74% 42%, rgba(0, 255, 240, 0.14), transparent 28rem),
    radial-gradient(circle at 60% 85%, rgba(139, 92, 246, 0.14), transparent 25rem);
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.particle-field span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 18px var(--c);
  opacity: 0.58;
  animation: particleDrift var(--d) linear infinite;
  animation-delay: var(--delay);
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links button {
  cursor: pointer;
  background: transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  box-shadow: 0 0 24px rgba(0, 255, 240, 0.5);
}

.nav-links {
  display: flex;
  gap: clamp(0.5rem, 2vw, 1.2rem);
}

.nav-links button {
  position: relative;
  color: var(--muted);
  padding: 0.2rem 0;
}

.nav-links button.is-active,
.nav-links button:hover {
  color: var(--ink);
}

.nav-links button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.24rem;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--orange), var(--cyan), var(--green));
  transition: transform 180ms ease;
}

.nav-links button.is-active::after,
.nav-links button:hover::after {
  transform: scaleX(1);
}

.deck {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.deck::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.scene {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: clamp(6rem, 9vh, 7.4rem) clamp(1rem, 4vw, 3rem) clamp(1rem, 2vh, 1.5rem);
  scroll-snap-align: start;
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 500ms ease, transform 500ms ease;
}

.scene.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scene-copy {
  max-width: 900px;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Orbitron, "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 1.06;
  letter-spacing: 0;
}

h1 {
  max-width: 1060px;
  font-size: clamp(3.3rem, 9vw, 8.2rem);
  text-shadow:
    0 0 18px rgba(0, 255, 240, 0.72),
    0 0 62px rgba(139, 92, 246, 0.48),
    0 0 92px rgba(255, 122, 0, 0.26);
  animation: titleGlow 3s ease-in-out infinite;
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(2rem, 4vw, 4.15rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.subtitle,
.lead,
.scene-copy p,
.info-panel p,
.future-card p,
.conclusion-panel p {
  color: #dbeafe;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.65;
}

.subtitle {
  margin: 0.9rem 0 0;
  font-weight: 800;
}

.lead {
  max-width: 820px;
  min-height: 5.8rem;
}

.lead.typing::after {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 1em;
  margin-left: 0.25rem;
  border-right: 2px solid var(--cyan);
  transform: translateY(0.14rem);
  animation: blink 800ms steps(2, start) infinite;
}

.hero-actions,
.mode-switch,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.primary-action,
.ghost-action,
.mode-switch button,
.panel-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.85rem;
  border-radius: var(--radius);
  padding: 0.72rem 1rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-action {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #001018;
  font-weight: 900;
  box-shadow: 0 0 34px rgba(0, 212, 255, 0.34);
}

.ghost-action,
.mode-switch button,
.panel-actions button {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.66);
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.primary-action:hover,
.ghost-action:hover,
.mode-switch button:hover,
.mode-switch button.is-active,
.panel-actions button:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 240, 0.52);
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.28);
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-icon] svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke-width: 1.8;
}

.scroll-hint {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1.2rem, 4vh, 2.4rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
}

.scroll-hint span {
  width: 1.25rem;
  height: 2rem;
  border: 1px solid rgba(248, 250, 252, 0.38);
  border-radius: 999px;
}

.scroll-hint span::after {
  content: "";
  display: block;
  width: 0.28rem;
  height: 0.28rem;
  margin: 0.42rem auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: hintDot 1.5s ease-in-out infinite;
}

.scene-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  width: min(1320px, 100%);
  margin: 0 auto 1rem;
}

.presentation-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(340px, 0.44fr);
  gap: 1rem;
  width: min(1320px, 100%);
  margin: 0 auto;
  min-height: min(600px, calc(100vh - 17rem));
}

.tree-stage,
.info-panel,
.future-card,
.conclusion-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.7));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.tree-stage {
  position: relative;
  min-height: min(600px, calc(100vh - 17rem));
  overflow: hidden;
}

.tree-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 122, 0, 0.16), transparent 16rem),
    radial-gradient(circle at 54% 56%, rgba(0, 255, 240, 0.16), transparent 18rem),
    radial-gradient(circle at 74% 82%, rgba(57, 255, 136, 0.14), transparent 16rem);
}

.family-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 14 16;
  animation: lineFlow 5.8s linear infinite;
}

.line.warm {
  stroke: rgba(255, 122, 0, 0.74);
  filter: drop-shadow(0 0 8px rgba(255, 122, 0, 0.75));
}

.line.cool {
  stroke: rgba(0, 255, 240, 0.74);
  filter: drop-shadow(0 0 8px rgba(0, 255, 240, 0.75));
}

.line.future {
  stroke: rgba(57, 255, 136, 0.78);
  filter: drop-shadow(0 0 8px rgba(57, 255, 136, 0.8));
}

.line-set-child {
  display: none;
}

.tree-stage.future-mode .line-set-family {
  display: none;
}

.tree-stage.future-mode .line-set-child {
  display: block;
}

.family-node {
  --accent: var(--cyan);
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.35rem 0.75rem;
  width: 170px;
  min-height: 86px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius);
  padding: 0.78rem;
  text-align: left;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 88%), transparent 52%),
    rgba(2, 6, 23, 0.82);
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.035);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.schema-note {
  --accent: var(--cyan);
  position: absolute;
  z-index: 2;
  min-width: 130px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 56%);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  text-align: left;
  color: var(--ink);
  background: rgba(2, 6, 23, 0.72);
  cursor: pointer;
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent), transparent 76%);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.schema-note strong,
.schema-note small {
  display: block;
}

.schema-note strong {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.schema-note small {
  color: #dbeafe;
}

.schema-note:hover,
.schema-note.is-active {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent), transparent 56%);
}

.schema-label {
  position: absolute;
  z-index: 2;
  color: var(--green);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(57, 255, 136, 0.5);
}

.family-node span {
  grid-row: span 2;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 54%);
  border-radius: var(--radius);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.055);
}

.family-node strong {
  font-size: 0.98rem;
}

.family-node small {
  color: #cbd5e1;
}

.family-node:hover,
.family-node.is-active {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent), transparent 58%);
}

.family-node.is-dimmed {
  opacity: 0.52;
}

.grandparent {
  --accent: var(--orange);
}

.parent {
  --accent: #f8fafc;
}

.father {
  --accent: #ff3d00;
}

.mother {
  --accent: #f8fafc;
}

.me {
  --accent: var(--cyan);
  width: 165px;
  min-height: 98px;
}

.child {
  --accent: var(--green);
  width: 190px;
  min-height: 88px;
}

.gp1 {
  left: 4%;
  top: 7%;
}

.gp2 {
  left: 4%;
  top: 23%;
}

.gp3 {
  left: 4%;
  top: 57%;
}

.gp4 {
  left: 4%;
  top: 73%;
}

.father {
  left: 25%;
  top: 24%;
}

.mother {
  left: 25%;
  top: 58%;
}

.me {
  left: 48%;
  top: 42%;
}

.note-study {
  left: 44%;
  top: 18%;
}

.note-job {
  left: 69%;
  top: 13%;
}

.note-income {
  left: 36%;
  top: 74%;
}

.note-expenses {
  left: 61%;
  top: 74%;
}

.note-idh {
  left: 50%;
  bottom: 4%;
}

.heirs-label {
  right: 14%;
  top: 36%;
}

.child-one {
  right: 5%;
  top: 42%;
}

.tree-stage.future-mode .grandparent,
.tree-stage.future-mode .heirs-label {
  display: none;
}

.tree-stage.future-mode .father {
  left: 5%;
  top: 22%;
}

.tree-stage.future-mode .mother {
  left: 5%;
  top: 62%;
}

.tree-stage.future-mode .me {
  left: 34%;
  top: 43%;
}

.tree-stage.future-mode .child-one {
  left: 67%;
  right: auto;
  top: 43%;
}

.tree-stage.future-mode .note-study {
  left: 61%;
  top: 11%;
}

.tree-stage.future-mode .note-job {
  left: 78%;
  top: 15%;
}

.tree-stage.future-mode .note-income {
  left: 56%;
  top: 74%;
}

.tree-stage.future-mode .note-expenses {
  left: 77%;
  top: 74%;
}

.tree-stage.future-mode .note-idh {
  left: 70%;
  bottom: 4%;
}

.info-panel {
  --accent: var(--cyan);
  max-height: min(600px, calc(100vh - 17rem));
  overflow: auto;
  padding: 1.15rem;
}

.schema-scene h2 {
  max-width: 860px;
  font-size: clamp(1.45rem, 2.5vw, 2.65rem);
}

.schema-scene {
  align-items: start;
  padding-top: clamp(4.8rem, 7vh, 5.8rem);
}

.info-panel.flash {
  animation: panelFlash 260ms ease;
}

.panel-tag {
  display: inline-flex;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: var(--accent);
  color: #001018;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.info-panel h3 {
  font-size: 1.65rem;
}

.value-tags,
.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.value-tags li {
  border: 1px solid color-mix(in srgb, var(--accent), transparent 45%);
  border-radius: 999px;
  padding: 0.28rem 0.58rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.84rem;
}

.panel-block {
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 0.9rem;
}

.panel-block h4 {
  margin: 0 0 0.55rem;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.86rem;
}

.panel-block ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.05rem;
  color: #dbeafe;
}

.finance-bars {
  display: grid;
  gap: 0.65rem;
}

.finance-row {
  display: grid;
  grid-template-columns: 6rem 1fr 6.8rem;
  gap: 0.6rem;
  align-items: center;
}

.finance-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.finance-track {
  height: 0.72rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}

.finance-track i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--bar);
  box-shadow: 0 0 16px var(--bar);
}

.money-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius);
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.42);
}

.money-table th,
.money-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding: 0.58rem 0.7rem;
  text-align: left;
}

.money-table th {
  font-weight: 800;
}

.money-table td {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.money-table tfoot th,
.money-table tfoot td {
  border-bottom: 0;
  color: var(--green);
  background: rgba(57, 255, 136, 0.08);
}

.future-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.65fr);
  gap: 1rem;
  align-items: center;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.future-card,
.conclusion-panel {
  padding: clamp(1.1rem, 3vw, 2rem);
}

.card-icon {
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  color: var(--green);
  background: rgba(57, 255, 136, 0.1);
  box-shadow: 0 0 28px rgba(57, 255, 136, 0.22);
}

.money-grid {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.money-grid div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  padding: 0.7rem;
  background: rgba(2, 6, 23, 0.42);
}

.money-grid span,
.small-note {
  color: var(--muted);
}

.money-grid strong {
  color: var(--green);
}

.conclusion-scene {
  justify-items: center;
  text-align: center;
}

.conclusion-panel {
  max-width: 980px;
}

.conclusion-panel h2 {
  text-shadow: 0 0 34px rgba(0, 255, 240, 0.42);
}

.final-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin: 2rem 0;
}

.final-words strong {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  background: rgba(2, 6, 23, 0.56);
  box-shadow: 0 0 22px rgba(0, 212, 255, 0.16);
}

.scene-dots {
  position: fixed;
  z-index: 22;
  right: clamp(0.6rem, 2vw, 1.4rem);
  top: 50%;
  display: grid;
  gap: 0.65rem;
  transform: translateY(-50%);
}

.scene-dots button {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.46);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.scene-dots button.is-active {
  transform: scale(1.35);
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

@keyframes particleDrift {
  to {
    transform: translate3d(26px, -110vh, 0);
  }
}

@keyframes titleGlow {
  50% {
    text-shadow:
      0 0 26px rgba(0, 255, 240, 0.9),
      0 0 70px rgba(139, 92, 246, 0.58),
      0 0 104px rgba(255, 122, 0, 0.32);
  }
}

@keyframes hintDot {
  50% {
    transform: translateY(0.7rem);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes lineFlow {
  to {
    stroke-dashoffset: -150;
  }
}

@keyframes panelFlash {
  50% {
    box-shadow: 0 0 36px color-mix(in srgb, var(--accent), transparent 52%);
  }
}

@media (max-width: 1050px) {
  .deck {
    scroll-snap-type: y proximity;
  }

  .presentation-grid,
  .future-layout {
    grid-template-columns: 1fr;
  }

  .tree-stage {
    min-height: 920px;
  }

  .family-lines {
    display: none;
  }

  .family-node {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 76px;
    margin-bottom: 0.65rem;
  }

  .schema-note {
    position: relative;
    inset: auto;
    width: 100%;
    margin-bottom: 0.65rem;
  }

  .schema-label {
    position: relative;
    inset: auto;
    margin: 0.7rem 0;
  }

  .tree-stage {
    display: grid;
    padding: 1rem;
    align-content: start;
  }

  .info-panel {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .scene {
    padding-top: 8.2rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.65rem, 12vw, 3.35rem);
  }

  .hero-actions {
    width: min(100%, 26rem);
  }

  .lead {
    min-height: 8rem;
  }

  .scene-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch,
  .primary-action,
  .ghost-action {
    width: 100%;
  }

  .primary-action,
  .ghost-action,
  .mode-switch button {
    width: 100%;
  }

  .scene-dots {
    display: none;
  }

  .finance-row {
    grid-template-columns: 5rem 1fr;
  }

  .finance-row strong {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
