:root {
  --void: #020504;
  --deep: #06100f;
  --cyan: #25dcff;
  --cyan-soft: rgba(37, 220, 255, 0.62);
  --ember: #ff9a20;
  --ember-hot: #ffd36e;
  --mist: #dffbff;
  --leaf: #5dbd9b;
  --glass: rgba(4, 18, 17, 0.52);
  --line: rgba(223, 251, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--mist);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 154, 32, 0.18), transparent 18rem),
    radial-gradient(circle at 50% 48%, rgba(37, 220, 255, 0.17), transparent 28rem),
    linear-gradient(160deg, #010101 0%, var(--deep) 48%, #030605 100%);
  font-family: Inter, system-ui, sans-serif;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
}

body::before {
  background-image:
    linear-gradient(rgba(37, 220, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 154, 32, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 72%);
  animation: gridDrift 18s linear infinite;
}

body::after {
  background:
    radial-gradient(circle at top, transparent 0 42%, rgba(0, 0, 0, 0.72) 92%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.5));
}

.spark-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.site-shell {
  min-height: 100vh;
  padding: 24px clamp(16px, 4vw, 56px);
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand,
.nav-actions a,
.tool-node {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: Cinzel, serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ember-hot);
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan) 0 24%, transparent 27% 100%);
  box-shadow: 0 0 18px var(--cyan), 0 0 28px rgba(255, 154, 32, 0.58);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-actions a {
  opacity: 0.72;
  transition: color 180ms ease, opacity 180ms ease, text-shadow 180ms ease;
}

.nav-actions a:hover {
  color: var(--cyan);
  opacity: 1;
  text-shadow: 0 0 16px var(--cyan);
}

.visit-counter {
  position: relative;
  display: inline-grid;
  grid-template-columns: 16px auto auto;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid rgba(37, 220, 255, 0.26);
  border-radius: 8px;
  background: rgba(4, 18, 17, 0.54);
  box-shadow: 0 0 24px rgba(37, 220, 255, 0.08), inset 0 0 22px rgba(255, 154, 32, 0.06);
  backdrop-filter: blur(16px);
}

.visit-counter::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 110, 0.13), transparent);
  transform: translateX(-120%);
  content: "";
  animation: scanNode 4.8s ease-in-out infinite;
}

.counter-orb {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan), 0 0 24px rgba(255, 154, 32, 0.42);
  animation: counterPulse 2.1s ease-in-out infinite;
}

.counter-label,
.visit-counter strong {
  position: relative;
  z-index: 1;
}

.counter-label {
  color: rgba(223, 251, 255, 0.68);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.visit-counter strong {
  color: var(--ember-hot);
  font-family: Cinzel, serif;
  font-size: 0.6rem;
  text-shadow: 0 0 16px rgba(255, 154, 32, 0.52);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.86fr) minmax(330px, 1.28fr) minmax(220px, 0.8fr);
  align-items: center;
  min-height: calc(100vh - 78px);
  gap: clamp(18px, 3vw, 42px);
}

.hero-copy {
  align-self: center;
  padding-bottom: 8vh;
}

.kicker {
  margin: 0 0 12px;
  color: var(--ember-hot);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #ffffff;
  font-family: Cinzel, serif;
  font-size: clamp(3.4rem, 9vw, 8.6rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: 0;
  text-shadow:
    0 0 18px rgba(255, 211, 110, 0.42),
    0 0 48px rgba(37, 220, 255, 0.22);
}

.subtitle {
  max-width: 27rem;
  margin: 18px 0 0;
  color: rgba(223, 251, 255, 0.76);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  line-height: 1.55;
}

.tree-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(72vw, 680px);
  aspect-ratio: 1;
  margin: auto;
  isolation: isolate;
}

.tree-stage::before {
  position: absolute;
  inset: 9%;
  z-index: -1;
  border-radius: 50%;
  background:
    conic-gradient(from 90deg, transparent, rgba(37, 220, 255, 0.62), transparent, rgba(255, 154, 32, 0.7), transparent),
    radial-gradient(circle, rgba(255, 211, 110, 0.28), transparent 58%);
  filter: blur(20px);
  opacity: 0.78;
  content: "";
  animation: pulseCore 3.8s ease-in-out infinite;
}

.tree-stage::after {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 211, 110, 0.32);
  border-radius: 50%;
  box-shadow: inset 0 0 28px rgba(37, 220, 255, 0.12), 0 0 34px rgba(255, 154, 32, 0.14);
  content: "";
}

.tree-image {
  width: min(92%, 620px);
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 0 20px rgba(37, 220, 255, 0.34)) drop-shadow(0 0 30px rgba(255, 154, 32, 0.24));
  animation: floatTree 6s ease-in-out infinite;
}

.aura,
.rune-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.aura {
  inset: var(--inset);
  border: 1px solid var(--color);
  opacity: 0.62;
  animation: orbit var(--speed) linear infinite;
}

.aura-one {
  --inset: 3%;
  --color: rgba(255, 211, 110, 0.55);
  --speed: 18s;
}

.aura-two {
  --inset: 0;
  --color: rgba(37, 220, 255, 0.3);
  --speed: 27s;
  border-style: dashed;
  animation-direction: reverse;
}

.aura-three {
  --inset: 15%;
  --color: rgba(93, 189, 155, 0.32);
  --speed: 13s;
}

.rune-ring {
  inset: -2%;
  animation: orbit 34s linear infinite reverse;
}

.rune-ring span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 16px var(--ember), 0 0 32px rgba(37, 220, 255, 0.45);
  transform: rotate(calc(var(--i) * 45deg)) translateX(min(38vw, 370px));
}

.portal-panel {
  display: grid;
  gap: 14px;
  align-self: end;
  padding-bottom: 12vh;
}

.tool-node {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  min-height: 68px;
  padding: 14px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.tool-node::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(37, 220, 255, 0.18), transparent);
  transform: translateX(-110%);
  content: "";
  animation: scanNode 5s ease-in-out infinite;
}

.tool-node:nth-child(2)::before {
  animation-delay: 1.5s;
}

.tool-node:nth-child(3)::before {
  animation-delay: 3s;
}

.tool-node span {
  color: var(--ember-hot);
  font-family: Cinzel, serif;
  font-weight: 700;
}

.tool-node strong {
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
}

.tool-node:hover,
.tool-node.active {
  border-color: rgba(37, 220, 255, 0.58);
  box-shadow: 0 0 24px rgba(37, 220, 255, 0.13);
  transform: translateX(-6px);
}

@keyframes floatTree {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-14px) scale(1.012);
  }
}

@keyframes pulseCore {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.97);
  }
  50% {
    opacity: 0.88;
    transform: scale(1.04);
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scanNode {
  0%,
  42% {
    transform: translateX(-110%);
  }
  58%,
  100% {
    transform: translateX(110%);
  }
}

@keyframes gridDrift {
  to {
    background-position: 72px 72px;
  }
}

@keyframes counterPulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 48px 0 36px;
    text-align: center;
  }

  .hero-copy,
  .portal-panel {
    justify-self: center;
    width: min(100%, 620px);
    padding-bottom: 0;
  }

  .subtitle {
    margin-inline: auto;
  }

  .tree-stage {
    width: min(92vw, 620px);
    order: -1;
  }

  .rune-ring span {
    transform: rotate(calc(var(--i) * 45deg)) translateX(min(45vw, 320px));
  }

  .portal-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-node {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 88px;
  }

  .tool-node:hover,
  .tool-node.active {
    transform: translateY(-4px);
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 50% 34%, rgba(255, 154, 32, 0.16), transparent 12rem),
      radial-gradient(circle at 50% 40%, rgba(37, 220, 255, 0.15), transparent 18rem),
      linear-gradient(160deg, #010101 0%, var(--deep) 48%, #030605 100%);
  }

  .site-shell {
    padding: 14px 14px 22px;
  }

  .topbar {
    align-items: center;
    gap: 10px;
  }

  .brand {
    gap: 8px;
    font-size: 0.82rem;
  }

  .brand-mark {
    width: 14px;
    height: 14px;
  }

  .nav-actions {
    gap: 10px;
    font-size: 0.68rem;
  }

  .visit-counter {
    grid-template-columns: 12px auto;
    gap: 7px;
    min-height: 34px;
    padding: 7px 9px;
  }

  .counter-label {
    display: none;
  }

  .visit-counter strong {
    font-size: 0.72rem;
  }

  .hero {
    align-content: start;
    min-height: auto;
    gap: 18px;
    padding: 34px 0 12px;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .kicker {
    margin-bottom: 8px;
    font-size: 0.64rem;
    letter-spacing: 0.14em;
  }

  h1 {
    font-size: clamp(2.05rem, 11.8vw, 3.05rem);
    line-height: 0.94;
    overflow-wrap: anywhere;
  }

  .subtitle {
    max-width: 18rem;
    margin-top: 12px;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .tree-stage {
    order: 0;
    width: min(86vw, 360px);
    margin-top: 4px;
  }

  .tree-stage::before {
    inset: 7%;
    filter: blur(14px);
  }

  .tree-stage::after {
    inset: 9%;
  }

  .tree-image {
    width: 90%;
  }

  .aura-one {
    --inset: 6%;
  }

  .aura-two {
    --inset: 2%;
  }

  .aura-three {
    --inset: 18%;
  }

  .rune-ring {
    inset: 1%;
  }

  .rune-ring span {
    width: 6px;
    height: 6px;
    transform: rotate(calc(var(--i) * 45deg)) translateX(min(42vw, 174px));
  }

  .portal-panel {
    grid-template-columns: 1fr;
    width: min(100%, 360px);
  }

  .tool-node {
    min-height: 58px;
  }
}

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