*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Iosevka Charon';
  src: url('./fonts/Iosevka Charon Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Iosevka Charon';
  src: url('./fonts/Iosevka Charon Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111111;
  --ink-muted: #2e2e2e;
  --panel: #ffffff;
  --grad-cta: linear-gradient(90deg, #c9a7eb 0%, #c84ef0 48%, #b538e1 100%);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.32);
  --font: "Iosevka Charon", monospace;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  overflow-y: auto;
  overflow-x: hidden;
  background: #030a10;
}

.scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 58% 72% at 26% 48%, #2fb3ae 0%, #157a82 28%, transparent 62%),
    radial-gradient(ellipse 40% 50% at 12% 78%, #0a5a63 0%, transparent 55%),
    linear-gradient(108deg, #0a5560 0%, #083844 28%, #061820 55%, #02080c 100%);
}

.grid--right {
  position: absolute;
  top: 0;
  right: 0;
  width: min(52vw, 780px);
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 150px 50px;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.45) 28%, #000 55%);
}

.grid--corner {
  position: absolute;
  left: -2%;
  bottom: -4%;
  width: min(48vw, 620px);
  height: min(52vh, 460px);
  background-image:
    linear-gradient(rgba(90, 210, 255, 0.7) 2px, transparent 2px),
    linear-gradient(90deg, rgba(90, 210, 255, 0.7) 2px, transparent 2px),
    linear-gradient(rgba(50, 170, 230, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 170, 230, 0.28) 1px, transparent 1px);
  background-size:
    150px 50px,
    150px 50px,
    50px 16.67px,
    50px 16.67px;
  mask-image: radial-gradient(ellipse 85% 85% at 8% 92%, #000 15%, transparent 68%);
  filter: drop-shadow(0 0 18px rgba(70, 210, 255, 0.45));
}

.colored-cells {
  position: absolute;
  top: 0;
  right: 0;
  width: min(52vw, 780px);
  height: 100%;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.page-2 .colored-cells {
  opacity: 0;
  pointer-events: none;
}

.cell {
  position: absolute;
  width: 150px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}

.cell::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
  z-index: 0;
}

.cell--1::before { background: rgba(100, 180, 220, 0.9); }
.cell--2::before { background: rgba(240, 150, 170, 0.9); }
.cell--3::before { background: rgba(120, 200, 230, 0.9); }

.cell:hover::before {
  transform: translate(-50%, -50%) scale(3);
  opacity: 1;
}

.cell--1 { background: rgba(173, 216, 230, 0.6); }
.cell--2 { background: rgba(255, 182, 193, 0.6); }
.cell--3 { background: rgba(135, 206, 235, 0.6); }

.chart-h {
  position: absolute;
  top: -30px;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chart-h__bar {
  height: clamp(140px, 20vh, 220px);
  border-radius: 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: growFromLeft 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.chart-h__bar--top.nav,
.chart-h__bar--bottom {
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s ease;
}

.chart-h__bar--top.nav {
  width: clamp(360px, 59vw, 630px);
  background: linear-gradient(90deg, #e8e8e8 0%, #ffffff 40%);
  animation-delay: 0.05s;
  display: flex;
  align-items: stretch;
  box-shadow: none;
  position: relative;
  pointer-events: auto;
}

.chart-h__bar--top.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(150, 150, 150, 0.3) 20%,
    rgba(150, 150, 150, 0.5) 50%,
    rgba(150, 150, 150, 0.3) 80%,
    transparent 100%
  );
  z-index: 1;
}

.chart-h__bar--mid.title-bar {
  width: clamp(400px, 70vw, 850px);
  background: var(--grad-cta);
  display: inline-flex;
  align-items: center;
  padding: 0 clamp(32px, 3.8vw, 52px);
  white-space: nowrap;
  animation-delay: 0.15s;
  border-radius: 0;
  box-shadow:
    0 -6px 14px rgba(0, 0, 0, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.10);
  z-index: 2;
  position: relative;
}

.chart-h__bar--bottom {
  width: clamp(220px, 38vw, 500px);
  background: linear-gradient(90deg, #e8e8e8 0%, #ffffff 40%);
  animation-delay: 0.25s;
}

@keyframes growFromLeft {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.page-2 .chart-h__bar--top.nav,
.page-2 .chart-h__bar--bottom {
  animation: none;
  transform: translateX(-150%) scaleX(1);
  opacity: 0;
}

.nav__link {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background-color 0.2s ease;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  white-space: nowrap;
}

.nav__link:first-child {
  padding-left: 0;
}

.nav__link + .nav__link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(150, 150, 150, 0.3) 20%,
    rgba(150, 150, 150, 0.5) 50%,
    rgba(150, 150, 150, 0.3) 80%,
    transparent 100%
  );
  z-index: 1;
}

.nav__link:last-child:hover {
  background: linear-gradient(to right bottom, rgba(243, 238, 249, 0.5), transparent);
}

.nav__link:first-child:hover {
  background: linear-gradient(to left bottom, rgba(243, 238, 249, 0.5), transparent);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--ink);
  background: linear-gradient(to bottom, rgba(243, 238, 249, 0.5), transparent);
  outline: none;
}

.title-bar__text {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

.title-bar__cursor {
  margin-left: 1px;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 500;
  color: var(--ink);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.description {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(80vw, 720px);
  text-align: center;
  color: rgba(230, 240, 255, 0.85);
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.7s ease 0.8s;
  pointer-events: none;
  z-index: 5;
}

.page-2 .description {
  opacity: 1;
}

.description2 {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(80vw, 720px);
  text-align: center;
  color: rgba(230, 240, 255, 0.85);
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.7s ease 0.8s;
  pointer-events: none;
  z-index: 5;
}

.page-3 .description2 {
  opacity: 1;
}

.cta {
  position: fixed;
  left: 50%;
  bottom: 10.5%;
  z-index: 2;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  padding: 1.8rem 4rem;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--grad-cta);
  box-shadow: var(--shadow-soft);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, opacity 0.4s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateX(-50%) translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 14px 34px rgba(170, 40, 220, 0.38);
  outline: none;
}

.cta:active {
  transform: translateX(-50%) translateY(0);
}

.page-2 .cta {
  opacity: 0;
  pointer-events: none;
}

.cta-group {
  position: fixed;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease 0.9s;
}

.cta-group2 {
  position: fixed;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease 0.9s;
}

.page-2 .cta-group {
  opacity: 1;
  pointer-events: auto;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 1.4rem 3rem;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn--primary {
  color: var(--ink);
  background: var(--grad-cta);
  box-shadow: var(--shadow-soft);
}

.cta-btn--primary:hover,
.cta-btn--primary:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 14px 34px rgba(170, 40, 220, 0.38);
  outline: none;
}

.cta-btn--secondary {
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cta-btn--secondary:hover,
.cta-btn--secondary:focus-visible {
  transform: translateY(-2px);
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
  }

  .chart-h {
    top: -20px;
    left: 0;
    gap: 0;
  }

  .chart-h__bar {
    height: 110px;
    border-radius: 0;
  }

  .chart-h__bar--top.nav {
    width: 92vw;
    max-width: none;
  }

  .chart-h__bar--mid.title-bar {
    width: 98vw;
    padding: 0 1rem;
    white-space: normal;
  }

  .chart-h__bar--bottom {
    width: 60vw;
  }

  .nav__link {
    padding: 0 1.5rem;
    font-size: 0.95rem;
  }

  .nav__link:first-child {
    padding-left: 1rem;
  }

  .title-bar__text,
  .title-bar__cursor {
    font-size: 1.4rem;
  }

  .cta {
    bottom: 8%;
    min-width: 220px;
    padding: 1.4rem 3rem;
    font-size: 1.2rem;
  }

  .grid--right {
    width: 70vw;
    opacity: 0.55;
    background-size: 100px 34px;
  }

  .grid--corner {
    width: 75vw;
    height: 38vh;
    background-size: 100px 34px, 100px 34px, 33px 11.3px, 33px 11.3px;
  }

  .colored-cells {
    width: 70vw;
  }

  .cell {
    width: 100px;
    height: 34px;
    font-size: 0.75rem;
  }
  .cell--1 { top: 68px; left: 200px; }
  .cell--2 { top: 170px; left: 400px; }
  .cell--3 { top: 272px; left: 300px; }

  .cell::before {
    width: 70px;
    height: 70px;
  }

  .cta-group {
    flex-direction: column;
    gap: 1rem;
    width: 90vw;
    bottom: 5%;
  }

  .cta-group2 {
    flex-direction: column;
    gap: 1rem;
    width: 90vw;
    bottom: 5%;
  }

  .cta-btn {
    min-width: 0;
    width: 100%;
    padding: 1.2rem 2rem;
    font-size: 1rem;
  }
}