:root {
  --navy-900: #061329;
  --navy-800: #081a33;
  --navy-700: #0d2550;
  --blue-600: #1d4fa8;
  --blue-500: #2a6fd6;
  --blue-300: #6fb7ff;
  --teal-400: #3fd0b5;
  --ink: #0b1f3a;
  --ink-soft: #52627a;
  --paper: #f3f6fb;
  --card: #ffffff;
  --line: #d9e1ee;
  --error: #e0705c;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-500); }

/* ---------- Hero (dark blue, graph-paper grid) ---------- */
.hero-bg {
  position: relative;
  color: #fff;
  background:
    radial-gradient(1000px 600px at 50% 38%, rgba(42, 111, 214, .38), transparent 70%),
    radial-gradient(700px 400px at 85% 0%, rgba(63, 208, 181, .12), transparent 70%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  overflow: hidden;
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
}

.topbar {
  position: relative; display: flex; justify-content: space-between; align-items: center;
  max-width: 1160px; margin: 0 auto; padding: 22px 20px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 15px; line-height: 1.1; color: #fff; text-decoration: none; letter-spacing: .01em; }
.logo-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-500), var(--teal-400)); color: #fff; font-size: 22px;
  box-shadow: 0 6px 20px rgba(42, 111, 214, .45);
}
.topnav { display: flex; gap: 22px; align-items: center; }
.topnav a { color: rgba(255, 255, 255, .75); text-decoration: none; font-weight: 600; font-size: 15px; }
.topnav a:hover { color: #fff; }
.topnav .topnav-cta { padding: 9px 16px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; color: #fff; }
.topnav .topnav-cta:hover { background: rgba(255, 255, 255, .08); }

.hero { position: relative; max-width: 1160px; margin: 0 auto; padding: 40px 20px 96px; text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 700; color: var(--teal-400); margin: 0 0 18px; }
.eyebrow-dark { color: var(--blue-500); }
h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.06; margin: 0 auto 22px; font-weight: 800; letter-spacing: -.025em; max-width: 15em; }
.accent {
  background: linear-gradient(90deg, var(--blue-300), var(--teal-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(16px, 1.6vw, 19px); color: rgba(255, 255, 255, .72); margin: 0 auto; max-width: 34em; font-weight: 400; }

/* ---------- Triangle ---------- */
.triangle-wrap { margin: 28px auto 8px; max-width: 640px; scroll-margin-top: 20px; }
.triangle { width: 100%; height: auto; display: block; overflow: visible; user-select: none; -webkit-tap-highlight-color: transparent; }
.tri-inner { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.tri-median { stroke: rgba(255, 255, 255, .06); stroke-width: 1; stroke-dasharray: 3 7; }
.edge { stroke: rgba(255, 255, 255, .22); stroke-width: 2; stroke-linecap: round; transition: stroke .35s, stroke-width .35s, opacity .35s; }
.edge.on { stroke: url(#edgeGlow); stroke-width: 5; filter: url(#glow); }
.triangle.has-pair .edge:not(.on) { opacity: .35; }
.tri-sigma { font-size: 120px; font-weight: 300; fill: rgba(255, 255, 255, .06); transition: fill .4s; pointer-events: none; }
.triangle.has-pair .tri-sigma { fill: rgba(111, 183, 255, .16); }

.vertex { cursor: pointer; outline: none; }
.v-halo { fill: rgba(111, 183, 255, .08); stroke: rgba(111, 183, 255, .25); stroke-width: 1; transition: all .3s; }
.v-dot { fill: var(--navy-800); stroke: rgba(255, 255, 255, .7); stroke-width: 3; transition: all .3s; }
.v-label { fill: rgba(255, 255, 255, .85); font-size: 26px; font-weight: 700; letter-spacing: .01em; transition: fill .3s; }
.vertex:hover .v-halo, .vertex:focus-visible .v-halo { fill: rgba(111, 183, 255, .18); stroke: rgba(111, 183, 255, .6); }
.vertex.on .v-dot { fill: var(--teal-400); stroke: #fff; }
.vertex.on .v-halo { fill: rgba(63, 208, 181, .22); stroke: var(--teal-400); stroke-width: 2; }
.vertex.on .v-label { fill: #fff; }
.triangle.has-pair .vertex:not(.on) .v-label { fill: rgba(255, 255, 255, .35); }
.triangle.has-pair .vertex:not(.on) .v-dot { stroke: rgba(255, 255, 255, .3); }

.triangle-result {
  margin: 4px auto 0; min-height: 3em; max-width: 30em;
  font-size: clamp(16px, 1.7vw, 19px); font-weight: 600; color: rgba(255, 255, 255, .8);
}
.triangle-result.done { color: #fff; }

/* ---------- Form ---------- */
.card {
  background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .06);
}
.lead-form { max-width: 720px; margin: 24px auto 0; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
  font: inherit; font-weight: 400; font-size: 16px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fbfcfe; color: var(--ink); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 4px rgba(42, 111, 214, .12); }
.hp { position: absolute; left: -9999px; }
.consent { display: flex; gap: 10px; font-size: 13px; color: var(--ink-soft); align-items: flex-start; }
.consent input { margin-top: 3px; accent-color: var(--blue-500); }
.form-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.btn {
  display: block; text-align: center; font: inherit; font-weight: 700; font-size: 16px; padding: 16px;
  border-radius: 14px; border: 0; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500) 55%, #2a9fc4); color: #fff;
  box-shadow: 0 10px 24px rgba(42, 111, 214, .35); transition: transform .12s, box-shadow .2s;
}
.btn:hover { box-shadow: 0 14px 30px rgba(42, 111, 214, .45); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--navy-700); border: 1.5px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--blue-500); box-shadow: none; }
.form-status { margin: 0; font-size: 14px; min-height: 1.5em; text-align: center; }
.form-status.ok { color: #138a6f; font-weight: 600; }
.form-status.err { color: #c0412b; }

/* ---------- Reviews carousel ---------- */
.reviews { max-width: 1160px; margin: 0 auto; padding: 90px 20px 70px; }
.reviews-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
h2 { font-size: clamp(28px, 3.6vw, 42px); color: var(--navy-800); margin: 0; letter-spacing: -.02em; line-height: 1.1; }
.carousel-nav { display: flex; gap: 10px; flex-shrink: 0; }
.nav-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff;
  font-size: 20px; color: var(--navy-700); cursor: pointer; transition: all .2s;
}
.nav-btn:hover:not(:disabled) { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.nav-btn:disabled { opacity: .35; cursor: default; }

.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 22px) / 4); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 2px 18px; scrollbar-width: none; outline: none;
}
.carousel::-webkit-scrollbar { display: none; }
.review {
  scroll-snap-align: start; padding: 0; border: 0; background: var(--card); border-radius: 16px; overflow: hidden;
  cursor: zoom-in; text-align: left; font: inherit; color: inherit;
  box-shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 14px 34px rgba(11, 31, 58, .09); transition: transform .2s, box-shadow .2s;
}
.review:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 22px 44px rgba(11, 31, 58, .14); }
.review img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top;
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.review-caption { display: block; padding: 14px 16px 16px; border-top: 1px solid #eef2f8; }
.review-caption b { display: block; font-size: 15px; font-weight: 700; color: var(--navy-800); }
.review-caption small { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: #c6d2e4; cursor: pointer; transition: all .25s; }
.dots button.on { width: 26px; background: var(--blue-500); }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(6, 19, 41, .9); backdrop-filter: blur(4px); }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { display: block; max-width: min(88vw, 900px); max-height: 84vh; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
.lightbox figcaption { color: #fff; font-weight: 600; margin-top: 12px; }
.lb-btn {
  position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--navy-800); font-size: 22px; line-height: 1;
}
.lb-btn:hover { background: #fff; }
.lb-close { top: 16px; right: 18px; font-size: 28px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- Footer & legal ---------- */
.footer {
  max-width: 1160px; margin: 0 auto; padding: 28px 20px 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft);
}
.legal { max-width: 760px; margin: 0 auto; padding: 20px 20px 80px; }
.legal h1 { font-size: 32px; color: var(--navy-800); text-align: left; margin: 0 0 16px; }
.legal h2 { font-size: 20px; margin-top: 28px; }
.legal-top { background: var(--navy-800); }

@media (max-width: 960px) {
  .carousel { grid-auto-columns: calc((100% - 22px) / 2.3); }
}
@media (max-width: 640px) {
  .topnav a:not(.topnav-cta) { display: none; }
  .hero { padding: 24px 16px 64px; }
  .field-row, .form-actions { grid-template-columns: 1fr; }
  .card { padding: 22px 16px; }
  .triangle-wrap { margin-top: 12px; }
  .reviews { padding: 64px 16px 50px; }
  .reviews-head { align-items: center; }
  .nav-btn { width: 44px; height: 44px; }
  .carousel { grid-auto-columns: 72%; gap: 14px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
  .lightbox img { max-height: 74vh; }
}
