:root {
  --bg: #020203;
  --text: #f5f6f7;
  --muted: rgba(236, 240, 243, 0.68);
  --faint: rgba(236, 240, 243, 0.42);
  --teal: #06d6d0;
  --teal-soft: rgba(6, 214, 208, 0.18);
  --purple: #8e5dff;
  --amber: #ffad22;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
}

a {
  color: inherit;
}

.landing-page {
  height: 100svh;
  min-height: 720px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(6, 214, 208, 0.05), transparent 26rem),
    linear-gradient(180deg, #020203 0%, #050608 54%, #020203 100%);
}

.terrain-canvas {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 68vh;
  min-height: 560px;
  z-index: 0;
  pointer-events: none;
}

.page-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 2, 3, 0.04), rgba(2, 2, 3, 0.26) 51%, rgba(2, 2, 3, 0.06)),
    radial-gradient(circle at 50% 112%, transparent 0, transparent 23rem, rgba(2, 2, 3, 0.78) 53rem),
    linear-gradient(180deg, rgba(2, 2, 3, 0) 0%, rgba(2, 2, 3, 0.2) 64%, rgba(2, 2, 3, 0.66) 100%);
}

.site-header,
.hero {
  position: relative;
  z-index: 2;
}

.site-header {
  height: clamp(70px, 9.05vh, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1780px;
  margin: 0 auto;
  padding: 0 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1.35rem, 1.8vw, 2rem);
  font-weight: 600;
  letter-spacing: 0;
}

.brand img {
  width: clamp(34px, 2.28vw, 42px);
  height: clamp(34px, 2.28vw, 42px);
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(6, 214, 208, 0.28));
}

.nav-contact,
.hero-contact {
  border: 1px solid rgba(6, 214, 208, 0.84);
  background: rgba(4, 14, 17, 0.52);
  color: var(--text);
  box-shadow:
    inset 0 0 20px rgba(6, 214, 208, 0.06),
    0 0 30px rgba(6, 214, 208, 0.12);
  text-decoration: none;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.nav-contact {
  min-width: 142px;
  min-height: 46px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
}

.hero-contact {
  width: fit-content;
  min-width: clamp(220px, 15.55vw, 286px);
  min-height: clamp(58px, 7vh, 70px);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  margin-top: 1.9rem;
  padding: 0 2.1rem;
  font-size: clamp(1.25rem, 1.45vw, 1.6rem);
  font-weight: 600;
}

.nav-contact:hover,
.hero-contact:hover {
  background: rgba(6, 214, 208, 0.11);
  border-color: var(--teal);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 22px rgba(6, 214, 208, 0.09),
    0 0 34px rgba(6, 214, 208, 0.18);
}

.hero-contact span:last-child {
  font-size: 1.7rem;
  line-height: 1;
}

.capability-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  max-width: 720px;
  margin-top: clamp(1.25rem, 2.6vh, 2rem);
  color: var(--muted);
}

.capability-row div {
  min-width: 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(236, 240, 243, 0.12);
}

.capability-row strong {
  display: block;
  margin-bottom: 0.35rem;
  color: rgba(246, 248, 249, 0.92);
  font-size: clamp(0.82rem, 0.78vw, 0.94rem);
  font-weight: 600;
}

.capability-row span {
  display: block;
  color: rgba(236, 240, 243, 0.54);
  font-size: clamp(0.76rem, 0.72vw, 0.86rem);
  line-height: 1.42;
}

.hero {
  height: calc(100svh - clamp(70px, 9.05vh, 88px));
  min-height: 0;
  max-width: 1780px;
  margin: 0 auto;
  padding: 0 4.5rem;
  display: grid;
  grid-template-columns: minmax(500px, 0.86fr) minmax(520px, 1.14fr);
  align-items: start;
  gap: clamp(1.75rem, 2.3vw, 3rem);
}

.hero-copy {
  min-width: 0;
  padding-top: clamp(4.2rem, 12.3vh, 7.6rem);
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(3.7rem, 3.78vw, 4.45rem);
  line-height: 1.18;
  letter-spacing: 0;
  font-weight: 560;
  color: #f8f8f8;
  text-wrap: balance;
}

h1 span,
h1 strong {
  display: block;
  white-space: nowrap;
}

#heroMode {
  display: block;
  color: #ffffff;
  will-change: opacity, transform, filter;
}

#heroMode .mode-line {
  display: inline;
}

#heroMode .mode-line + .mode-line::before {
  content: " ";
}

#heroMode.is-switching {
  animation: heroModeSwitch 520ms ease both;
}

h1 strong {
  color: var(--teal);
  font-weight: 620;
  text-shadow: 0 0 24px rgba(6, 214, 208, 0.18);
}

.hero-copy p {
  max-width: 520px;
  margin: clamp(1.15rem, 2vh, 1.85rem) 0 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 1.38vw, 1.65rem);
  line-height: 1.45;
}

.analytics-field {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 0;
  isolation: isolate;
}

.analytics-field::before {
  content: "";
  position: absolute;
  top: clamp(5.5rem, 14vh, 8.4rem);
  left: 14%;
  width: 68%;
  height: 42%;
  border-radius: 999px;
  background: radial-gradient(ellipse at 60% 44%, rgba(6, 214, 208, 0.11), rgba(6, 214, 208, 0.035) 42%, transparent 72%);
  filter: blur(8px);
  opacity: 0.72;
  z-index: -1;
}

.decision-map {
  position: absolute;
  top: clamp(6.2rem, 15vh, 9.1rem);
  left: 0;
  width: min(50vw, 580px);
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.map-lines path {
  fill: none;
  stroke: rgba(232, 236, 240, 0.45);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.map-lines .selected {
  stroke: url(#selectedPath);
  stroke-width: 2;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: drawPath 4.8s ease-in-out infinite;
}

.decision-node rect {
  fill: rgba(26, 15, 44, 0.55);
  stroke: var(--purple);
  stroke-width: 1.7;
  filter: drop-shadow(0 0 12px rgba(142, 93, 255, 0.2));
}

.decision-node.root rect {
  stroke-width: 2;
}

.decision-node text,
.chance-node text,
.outcome-labels text {
  fill: rgba(245, 247, 248, 0.9);
  font-size: 15px;
  font-family: inherit;
  text-anchor: middle;
  letter-spacing: 0;
}

.chance-node circle {
  fill: rgba(3, 16, 18, 0.66);
  stroke: var(--teal);
  stroke-width: 1.8;
  filter: url(#tealGlow);
  animation: breatheNode 4.8s ease-in-out infinite;
}

.chance-node.selected circle {
  stroke-width: 2.4;
}

.chance-node text {
  font-size: 14px;
}

.outcome-labels text {
  text-anchor: start;
  fill: rgba(237, 240, 243, 0.72);
  font-size: 14px;
}

.outcome-labels .value {
  font-size: 15px;
  font-weight: 600;
}

.outcome-labels .positive {
  fill: var(--teal);
}

.outcome-labels .negative {
  fill: var(--amber);
}

.chart-stack {
  position: absolute;
  top: clamp(5.25rem, 12vh, 7.3rem);
  right: 0;
  width: min(21vw, 340px);
  min-width: 280px;
  display: grid;
  gap: clamp(1rem, 2.25vh, 1.45rem);
}

.histogram-panel,
.sensitivity-panel,
.trace-chart {
  position: relative;
  z-index: 2;
}

.histogram-panel,
.sensitivity-panel {
  border-left: 1px solid rgba(6, 214, 208, 0.13);
  padding-left: 1.2rem;
}

.histogram-panel span,
.sensitivity-panel > span {
  display: block;
  color: rgba(235, 239, 242, 0.55);
  font-size: 0.96rem;
  margin-bottom: 0.35rem;
}

.histogram-panel strong {
  color: var(--teal);
  display: block;
  font-size: clamp(1.45rem, 1.55vw, 1.75rem);
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.histogram {
  height: clamp(104px, 14.2vh, 138px);
  display: flex;
  align-items: end;
  gap: 4px;
  border-bottom: 1px solid rgba(236, 240, 243, 0.16);
  position: relative;
}

.histogram::before {
  content: "";
  position: absolute;
  left: 36%;
  top: -10px;
  bottom: 0;
  border-left: 1px dashed rgba(246, 247, 248, 0.35);
}

.histogram i {
  flex: 1;
  height: var(--bar-height);
  min-height: 5px;
  background: linear-gradient(180deg, rgba(6, 214, 208, 0.82), rgba(6, 214, 208, 0.22));
  box-shadow: 0 0 12px rgba(6, 214, 208, 0.12);
  opacity: 0.74;
  transform-origin: bottom;
  animation: barWave 4.8s ease-in-out infinite;
  animation-delay: var(--bar-delay);
}

.axis {
  display: flex;
  justify-content: space-between;
  color: rgba(235, 239, 242, 0.45);
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.sensitivity-panel {
  color: var(--muted);
}

.sensitivity-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 0.8rem;
  min-height: clamp(21px, 2.7vh, 26px);
}

.sensitivity-row em {
  font-style: normal;
  font-size: 0.86rem;
  color: rgba(235, 239, 242, 0.58);
}

.sensitivity-row i {
  height: 1px;
  position: relative;
  background: rgba(235, 239, 242, 0.2);
}

.sensitivity-row i::before {
  content: "";
  position: absolute;
  left: var(--start);
  right: calc(100% - var(--end));
  top: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--purple));
  transform-origin: left;
  animation: sensitivityPulse 5.8s ease-in-out infinite;
}

.sensitivity-row i::after {
  content: "";
  position: absolute;
  left: var(--marker);
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(6, 214, 208, 0.35);
}

.trace-chart {
  width: 100%;
  height: clamp(104px, 14.4vh, 140px);
  overflow: visible;
}

.trace-chart .grid {
  fill: none;
  stroke: rgba(235, 239, 242, 0.13);
  stroke-width: 1;
}

.trace-chart .trace {
  fill: none !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 420;
  animation: traceMove 7.5s ease-in-out infinite;
}

.trace-chart .p90 {
  stroke: var(--teal);
}

.trace-chart text:nth-of-type(1) {
  fill: var(--teal);
}

.trace-chart .p50 {
  stroke: #08a99f;
}

.trace-chart text:nth-of-type(2) {
  fill: #08a99f;
}

.trace-chart .ev {
  stroke: var(--purple);
}

.trace-chart text:nth-of-type(3) {
  fill: var(--purple);
}

.trace-chart .p10 {
  stroke: var(--amber);
}

.trace-chart text:nth-of-type(4) {
  fill: var(--amber);
}

.trace-chart text {
  font-size: 14px;
  font-family: inherit;
  stroke: none;
}

.site-footer {
  position: relative;
  background:
    radial-gradient(circle at 84% 0%, rgba(6, 214, 208, 0.045), transparent 22rem),
    linear-gradient(180deg, #020203 0%, #050608 100%);
  border-top: 1px solid rgba(236, 240, 243, 0.1);
  color: rgba(236, 240, 243, 0.62);
}

.footer-inner {
  max-width: 1780px;
  margin: 0 auto;
  padding: 2.35rem 4.5rem;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(260px, 0.85fr) minmax(250px, 0.7fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.footer-logo {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 600;
}

.footer-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(6, 214, 208, 0.2));
}

.footer-brand p,
.footer-note span,
.footer-meta span,
.footer-meta a {
  margin: 0;
  color: rgba(236, 240, 243, 0.56);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-brand p {
  max-width: 430px;
  margin-top: 0.85rem;
}

.footer-note strong {
  display: block;
  margin-bottom: 0.6rem;
  color: rgba(246, 248, 249, 0.9);
  font-size: 0.96rem;
  font-weight: 600;
}

.footer-note span {
  display: block;
  max-width: 430px;
}

.footer-meta {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
  text-align: right;
}

.footer-meta a {
  color: var(--teal);
  text-decoration: none;
}

.footer-meta a:hover {
  color: #ffffff;
}

@keyframes drawPath {
  0%,
  26% {
    stroke-dashoffset: 520;
    opacity: 0.35;
  }
  54%,
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes breatheNode {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

@keyframes barWave {
  0%,
  100% {
    transform: scaleY(0.94);
    opacity: 0.62;
  }
  50% {
    transform: scaleY(1.05);
    opacity: 0.88;
  }
}

@keyframes sensitivityPulse {
  0%,
  100% {
    transform: scaleX(0.92);
    opacity: 0.72;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes traceMove {
  0%,
  100% {
    stroke-dashoffset: 0;
    opacity: 0.78;
  }
  50% {
    stroke-dashoffset: -18;
    opacity: 1;
  }
}

@keyframes heroModeSwitch {
  0% {
    opacity: 0;
    transform: translateY(0.18em);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (max-width: 1500px) {
  .decision-map {
    width: min(38vw, 500px);
  }

  .outcome-labels {
    display: block;
  }
}

@media (max-width: 1280px) {
  .landing-page {
    height: auto;
    min-height: 100svh;
    overflow: hidden;
  }

  .site-header {
    padding: 0 clamp(2rem, 5vw, 3rem);
  }

  .footer-inner {
    padding: 2.2rem clamp(2rem, 5vw, 3rem);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-meta {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
  }

  .hero {
    height: auto;
    min-height: calc(100svh - 74px);
    grid-template-columns: 1fr;
    gap: clamp(1.75rem, 3vw, 2.75rem);
    padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 3rem) 5rem;
  }

  .hero-copy {
    padding-top: clamp(1rem, 4vh, 2.5rem);
    max-width: 780px;
  }

  .analytics-field {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.42fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    height: auto;
    min-height: 0;
    margin-top: 0;
  }

  .decision-map {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 660px;
    justify-self: start;
    opacity: 0.86;
    transform: none;
  }

  .outcome-labels {
    display: block;
  }

  .chart-stack {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero {
    padding: 2rem 1.5rem 4.5rem;
  }

  h1 {
    max-width: 820px;
    font-size: clamp(3.1rem, 7vw, 4rem);
  }

  .hero-copy p {
    max-width: 620px;
  }

  .capability-row {
    max-width: 100%;
  }

  .analytics-field {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    max-width: 720px;
    min-height: 0;
    margin-top: 0.25rem;
  }

  .decision-map {
    width: 100%;
    max-width: 680px;
    justify-self: center;
    opacity: 0.76;
  }

  .chart-stack {
    width: 100%;
    max-width: 680px;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    justify-self: center;
  }

  .trace-chart {
    grid-column: 1 / -1;
    max-width: 360px;
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .site-header {
    height: 74px;
    padding: 0 1rem;
  }

  .brand {
    gap: 0.6rem;
    font-size: 1.25rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .nav-contact {
    min-width: 104px;
    min-height: 38px;
    font-size: 0.86rem;
  }

  .hero {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    padding: 1.45rem 1rem 3.5rem;
  }

  .hero-copy {
    display: contents;
    padding-top: 0.75rem;
  }

  h1 {
    order: 1;
    width: 100%;
    font-size: clamp(2.35rem, 10.7vw, 3.2rem);
    line-height: 1.08;
  }

  h1 span,
  h1 strong {
    white-space: normal;
  }

  #heroMode {
    min-height: 2.16em;
  }

  #heroMode .mode-line {
    display: block;
  }

  #heroMode .mode-line + .mode-line::before {
    content: "";
  }

  .hero-copy p {
    order: 2;
    width: 100%;
    font-size: 1.04rem;
    max-width: 100%;
  }

  .hero-contact {
    order: 3;
    width: 100%;
    max-width: 300px;
    min-width: 220px;
    min-height: 56px;
    font-size: 1.1rem;
    margin-top: 1.4rem;
  }

  .capability-row {
    display: contents;
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 0.8rem;
    margin-top: 1.25rem;
  }

  .capability-row div {
    width: 100%;
    padding-top: 0.65rem;
  }

  .capability-row div:nth-child(1) {
    order: 4;
    margin-top: 1.5rem;
  }

  .capability-row div:nth-child(2) {
    order: 6;
    margin-top: 1rem;
  }

  .capability-row div:nth-child(3) {
    order: 8;
    margin-top: 1rem;
  }

  .analytics-field {
    display: contents;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 1.1rem;
    min-height: 0;
    margin-top: 1.6rem;
    padding-bottom: 0;
    overflow: hidden;
  }

  .decision-map {
    order: 5;
    width: 100%;
    max-width: 430px;
    justify-self: center;
    opacity: 0.56;
    transform: translateX(clamp(1rem, 5vw, 2rem));
  }

  .chart-stack {
    order: 7;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    min-width: 0;
    margin: 0.35rem auto 0;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .outcome-labels {
    display: block;
  }

  .histogram-panel strong {
    font-size: 1.35rem;
  }

  .histogram {
    height: 90px;
    gap: 3px;
  }

  .sensitivity-row {
    grid-template-columns: 96px 1fr;
  }

  .trace-chart {
    display: block;
    width: 100%;
    max-width: 360px;
    justify-self: center;
  }

  .terrain-canvas {
    inset: 74px 0 auto;
    height: min(62vh, 520px);
    min-height: 420px;
    opacity: 1;
  }

  .contact-band {
    display: none;
  }

  .footer-inner {
    padding: 2rem 1rem;
    grid-template-columns: 1fr;
    gap: 1.45rem;
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 0 0.875rem;
  }

  .brand {
    font-size: 1.15rem;
  }

  .nav-contact {
    min-width: 96px;
    min-height: 36px;
  }

  h1 {
    font-size: clamp(2.15rem, 11vw, 2.85rem);
  }

  .hero-contact {
    max-width: none;
  }

  .decision-map {
    transform: translateX(clamp(1.25rem, 6vw, 2rem));
  }

  .axis {
    font-size: 0.76rem;
  }
}

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