:root {
  --map-progress: 1;
  --ink-950: #eaf2ff;
  --ink-800: #c6d7ee;
  --ink-700: #9ab1cc;
  --ink-500: #748ea9;
  --line: rgba(129, 162, 198, 0.24);
  --panel: rgba(10, 18, 30, 0.64);
  --panel-strong: rgba(7, 13, 24, 0.82);
  --accent: #8fd1ff;
  --accent-strong: #b8e2ff;
  --max-width: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  background: #040910;
}

body {
  position: relative;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--ink-950);
  background:
    radial-gradient(1200px 620px at 82% -12%, rgba(74, 122, 172, 0.33), transparent 64%),
    radial-gradient(1000px 580px at -10% 18%, rgba(68, 108, 148, 0.24), transparent 60%),
    linear-gradient(180deg, #040910 0%, #07101c 38%, #091423 100%);
  min-height: 100svh;
  background-color: #040910;
  line-height: 1.45;
  overflow-x: clip;
}

/* Prevent light flash/gray reveal on iOS rubber-band overscroll past page bottom */
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: 100%;
  height: 55svh;
  pointer-events: none;
  z-index: -1;
  background: #040910;
}

::selection {
  background: var(--accent);
  color: #04101e;
}

.geo-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.geo-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    90deg,
    rgba(4, 9, 17, 0.9) 0%,
    rgba(4, 9, 17, 0.78) 30%,
    rgba(4, 9, 17, 0.44) 54%,
    rgba(4, 9, 17, 0.12) 72%,
    rgba(4, 9, 17, 0) 100%
  );
}

.geo-grid,
.geo-map,
.geo-glow {
  position: absolute;
  inset: 0;
}

.geo-grid {
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(137, 174, 214, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(137, 174, 214, 0.08) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, transparent 74%);
  opacity: 0.34;
}

.geo-map {
  z-index: 1;
  width: min(60vw, 930px);
  aspect-ratio: 2200 / 1400;
  right: -4.2vw;
  top: 16.2vh;
  bottom: auto;
  left: auto;
  border: none;
  overflow: hidden;
  background: transparent;
  filter: drop-shadow(0 22px 62px rgba(3, 9, 17, 0.78));
  transform-origin: top left;
  will-change: transform, opacity;
  opacity: calc(0.78 + var(--map-progress) * 0.22);
}

.geo-map::before,
.geo-map::after {
  content: '';
  position: absolute;
  inset: 0;
}

.geo-map::before {
  z-index: 0;
  background: url('./assets/montana-usgs-hillshade-state.png') center / contain no-repeat;
  filter: grayscale(1)
    contrast(calc(1.15 + var(--map-progress) * 0.26))
    brightness(calc(0.58 + var(--map-progress) * 0.26));
  opacity: calc(0.7 + var(--map-progress) * 0.24);
}

.geo-map::after {
  z-index: 1;
  background:
    url('./assets/montana-state-outline.png') center / contain no-repeat,
    url('./assets/montana-usgs-contour-lines-state.png') center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(146, 203, 248, 0.2));
  opacity: calc(0.62 + var(--map-progress) * 0.34);
}

.geo-credit {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(198, 224, 247, 0.74);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  padding: 0.28rem 0.4rem;
  border: 1px solid rgba(138, 181, 219, 0.32);
  background: rgba(6, 12, 22, 0.56);
  opacity: calc(0.42 + var(--map-progress) * 0.58);
}

.geo-glow {
  z-index: 2;
  background:
    radial-gradient(circle at 75% 28%, rgba(146, 209, 255, 0.16), transparent 31%),
    radial-gradient(circle at 88% 62%, rgba(104, 156, 214, 0.1), transparent 35%),
    linear-gradient(180deg, rgba(5, 10, 19, 0.06), rgba(5, 10, 19, 0.52));
  animation: glowShift 26s ease-in-out infinite alternate;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  padding: 0.95rem 1.25rem;
  padding-left: max(1.25rem, calc((100vw - var(--max-width)) / 2 + 1.25rem));
  padding-right: max(1.25rem, calc((100vw - var(--max-width)) / 2 + 1.25rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  background: rgba(8, 14, 24, 0.52);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink-950);
}

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

.brand span {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.top-cta {
  margin-left: auto;
  text-decoration: none;
  border: 1px solid rgba(159, 206, 245, 0.6);
  color: var(--ink-950);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.78rem;
  background: rgba(104, 175, 228, 0.12);
  transition: all 0.2s var(--ease);
}

.top-cta:hover {
  background: var(--accent-strong);
  color: #061223;
}

main {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.2rem 1.25rem 5.5rem;
}

.hero {
  min-height: clamp(540px, 82vh, 780px);
  display: grid;
  align-content: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4.5rem;
}

.eyebrow,
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fb9d9;
}

.hero h1 {
  margin-top: 1.1rem;
  max-width: 15ch;
  font-size: clamp(2.5rem, 6.6vw, 5.7rem);
  line-height: 0.93;
  letter-spacing: -0.028em;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 5px 22px rgba(2, 7, 14, 0.56);
}

.hero-line {
  display: block;
}

.hero-line-software {
  letter-spacing: -0.012em;
}

.lede {
  margin-top: 1.3rem;
  max-width: 56ch;
  color: #cfddf0;
  font-size: clamp(1rem, 1.35vw, 1.17rem);
  text-shadow: 0 2px 14px rgba(2, 7, 14, 0.34);
}

.hero-actions {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.button {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  transition: all 0.22s var(--ease);
}

.button-solid {
  background: var(--accent);
  border-color: rgba(170, 222, 255, 0.88);
  color: #041221;
}

.button-solid:hover {
  background: var(--accent-strong);
}

.button-ghost {
  color: var(--ink-950);
  background: var(--panel);
}

.button-ghost:hover {
  background: rgba(14, 24, 40, 0.84);
}

.hero-strip {
  margin-top: 1.9rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-strip span {
  border: 1px solid var(--line);
  background: rgba(9, 17, 30, 0.82);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b3c8e2;
  padding: 0.45rem 0.58rem;
}

.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin-top: 0.75rem;
  font-size: clamp(1.8rem, 3.7vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.03;
  max-width: 22ch;
}

.card-grid,
.signals {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.card,
.signals article {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1.15rem;
  min-height: 188px;
  box-shadow: inset 0 0 0 1px rgba(171, 211, 247, 0.02);
}

.index {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.card h3,
.signals h3 {
  margin-top: 0.5rem;
  font-size: 1.05rem;
  line-height: 1.22;
}

.card p,
.signals p {
  margin-top: 0.65rem;
  color: #bfd1e7;
  font-size: 0.9rem;
  line-height: 1.58;
}

.advantage-layout {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem;
}

.advantage-statement {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 1.2rem;
  font-size: clamp(1.08rem, 1.95vw, 1.55rem);
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink-950);
}

.advantage-points {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.advantage-points li {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1rem;
  color: #bfd1e7;
  font-size: 0.9rem;
  line-height: 1.56;
}

.contact {
  padding: 4rem 0;
}

.contact h2 {
  margin-top: 0.75rem;
  max-width: 18ch;
  font-size: clamp(2rem, 4.8vw, 4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.contact-intro {
  margin-top: 1rem;
  max-width: 52ch;
  color: #c2d3e8;
  font-size: 1.02rem;
}

.contact-layout {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 0.85rem;
  align-items: start;
}

.engagement-form {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label,
.field legend {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb9d9;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 18, 30, 0.86);
  color: var(--ink-950);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.72rem 0.75rem;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #87a0bc;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 2px solid rgba(143, 209, 255, 0.5);
  outline-offset: 1px;
}

.field-span {
  grid-column: 1 / -1;
}

.field-set {
  border: 1px solid var(--line);
  padding: 0.7rem 0.75rem 0.8rem;
  background: rgba(9, 17, 29, 0.78);
}

.check-grid {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.check-grid label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  color: #d0deef;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.check-grid input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.turnstile-host {
  min-height: 66px;
  display: grid;
  align-items: center;
}

.turnstile-host .cf-turnstile {
  width: 100%;
}

.hp-field {
  position: absolute;
  left: -100vw;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-submit {
  width: fit-content;
}

.form-note {
  margin-top: 0.58rem;
  color: #9db5d2;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.form-note.is-success {
  color: #9fe3c3;
}

.form-note.is-error {
  color: #ffc2ba;
}

.contact-side {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1rem;
}

.contact-links {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.contact-links a,
.contact-links span {
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--ink-950);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.65rem;
}

.contact-signals {
  list-style: none;
  margin-top: 0.95rem;
  display: grid;
  gap: 0.55rem;
}

.contact-signals li {
  border: 1px solid var(--line);
  background: rgba(10, 18, 30, 0.74);
  padding: 0.75rem;
  color: #bed0e6;
  font-size: 0.88rem;
  line-height: 1.42;
}

.footer {
  position: relative;
  z-index: 2;
  width: 100%;
  border-top: 1px solid var(--line);
  padding: 1rem 1.25rem 2rem;
  padding-left: max(1.25rem, calc((100vw - var(--max-width)) / 2 + 1.25rem));
  padding-right: max(1.25rem, calc((100vw - var(--max-width)) / 2 + 1.25rem));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.footer img {
  height: 28px;
  width: auto;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.46s var(--ease), transform 0.46s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1140px) {
  .geo-map {
    width: min(70vw, 900px);
    right: -12vw;
    top: 18vh;
    opacity: 0.85;
  }
}

@media (max-width: 1024px) {
  .card-grid,
  .signals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advantage-layout {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .brand span {
    font-size: 0.64rem;
    letter-spacing: 0.07em;
  }

  .geo-grid {
    opacity: 0.24;
  }

  .geo-map {
    width: 152vw;
    right: -68vw;
    top: 24vh;
    opacity: 0.36;
  }

  .geo-credit {
    left: 14px;
    bottom: 14px;
    font-size: 0.5rem;
    letter-spacing: 0.06em;
  }

  .card-grid,
  .signals {
    grid-template-columns: 1fr;
  }

  .engagement-form {
    grid-template-columns: 1fr;
  }

  .form-submit {
    width: 100%;
    text-align: center;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes glowShift {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 0.64;
  }
}

@media (prefers-reduced-motion: reduce) {
  .geo-glow {
    animation: none;
  }
}
