/* ============================================================
   Dussinger Data & Design — Design. Data. Dialogue.
   Tokens: space black, ice white, electric blue + aurora glows
   ============================================================ */

:root {
  --ink: #04070c;
  --ink-2: #0a111d;
  --ice: #e7eef8;
  --muted: #7f8da3;
  --blue: #4d9fff;
  --blue-glow: #7cc0ff;
  --blue-deep: #1450b8;
  --line: rgba(231, 238, 248, 0.1);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  --pad-x: clamp(1.25rem, 5vw, 5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ice);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--blue);
  color: var(--ink);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad-x);
  background: linear-gradient(to bottom, rgba(4, 7, 12, 0.85), rgba(4, 7, 12, 0));
}

.nav__mark {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  text-decoration: none;
}

.nav__d3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--blue);
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(77, 159, 255, 0.55);
}

.nav__d3 sup {
  font-size: 0.7em;
}

.nav__name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav__cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ice);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  background: rgba(10, 17, 29, 0.5);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.nav__cta:hover {
  border-color: var(--blue);
  color: var(--blue-glow);
  box-shadow: 0 0 24px rgba(77, 159, 255, 0.25);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn--solid {
  background: linear-gradient(180deg, var(--blue), #2f7fe6);
  color: #03060b;
  border: 1px solid var(--blue);
  box-shadow: 0 0 28px rgba(77, 159, 255, 0.3);
}

.btn--solid:hover {
  background: linear-gradient(180deg, var(--blue-glow), var(--blue));
  border-color: var(--blue-glow);
  box-shadow: 0 0 48px rgba(124, 192, 255, 0.5);
}

.btn--ghost {
  background: rgba(10, 17, 29, 0.5);
  color: var(--ice);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--blue);
  color: var(--blue-glow);
}

.btn--lg {
  font-size: 1rem;
  padding: 1.05rem 2.2rem;
}

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 7rem var(--pad-x) 8rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 50% -10%, rgba(31, 111, 235, 0.22), transparent 60%),
    radial-gradient(50% 40% at 14% 60%, rgba(0, 162, 255, 0.07), transparent 60%),
    var(--ink);
}

.hero > * {
  position: relative;
  z-index: 1;
}

/* glowing horizon arc */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -64vw;
  transform: translateX(-50%);
  width: 160vw;
  aspect-ratio: 2.2 / 1;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: var(--ink);
  border-top: 1px solid rgba(124, 192, 255, 0.55);
  box-shadow:
    0 -18px 60px rgba(77, 159, 255, 0.45),
    0 -60px 160px rgba(20, 80, 184, 0.35);
  pointer-events: none;
  z-index: 0;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 8.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 2rem;
}

.hero__line {
  display: block;
}

.hero__line--accent {
  color: var(--blue);
  text-shadow: 0 0 42px rgba(77, 159, 255, 0.45);
}

.hero__sub {
  max-width: 34em;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  margin: 0 auto 2.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.hero__scrollcue {
  position: absolute;
  bottom: 2rem;
  right: var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 1;
}

.hero__scrollcue-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
}

.hero__scrollcue-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--blue), transparent);
}

/* ---------- pinned chapters ---------- */

.chapters {
  position: relative;
}

.chapters__stage {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 60% at 70% 40%, rgba(20, 80, 184, 0.12), transparent 60%),
    var(--ink);
}

.chapters__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad-x);
  max-width: 44rem;
  opacity: 0;
  pointer-events: none;
}

.chapter__index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1.1rem;
}

.chapter__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.4rem;
}

.chapter__copy {
  max-width: 30em;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--muted);
  margin: 0;
}

.chapter__list {
  list-style: none;
  margin: 1.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  max-width: 30em;
}

.chapter__list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.97rem;
  color: var(--ice);
}

.chapter__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--blue);
  box-shadow: 0 0 10px rgba(77, 159, 255, 0.7);
}

.chapter__note {
  margin: 1.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---------- stats band ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  background: var(--ink);
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad-x);
  text-align: center;
}

.stat__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
  color: var(--ice);
  line-height: 1;
}

.stat__label {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- process ---------- */

.process {
  padding: clamp(5rem, 12vw, 9rem) var(--pad-x);
  background:
    radial-gradient(80% 60% at 50% -20%, rgba(20, 80, 184, 0.1), transparent 60%),
    var(--ink-2);
}

.process__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 3.5rem;
}

.process__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.4rem;
}

.process__step {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(4, 7, 12, 0.55);
  padding: 1.8rem 1.6rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.process__step:hover {
  border-color: rgba(77, 159, 255, 0.45);
  box-shadow: 0 0 36px rgba(20, 80, 184, 0.25);
}

.process__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue);
  letter-spacing: 0.12em;
}

.process__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0.6rem 0 0.7rem;
}

.process__detail {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0;
}

/* ---------- plans ---------- */

.plans {
  padding: clamp(5rem, 12vw, 9rem) var(--pad-x);
  border-top: 1px solid var(--line);
  background: var(--ink);
}

.plans__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.8rem;
}

.plans__sub {
  max-width: 44em;
  color: var(--muted);
  margin: 0 0 3rem;
}

.plans__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.4rem;
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 17, 29, 0.55);
  padding: 1.9rem 1.7rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.plan:hover {
  border-color: rgba(77, 159, 255, 0.45);
  box-shadow: 0 0 36px rgba(20, 80, 184, 0.25);
}

.plan--featured {
  border-color: rgba(77, 159, 255, 0.55);
  box-shadow: 0 0 44px rgba(20, 80, 184, 0.3);
  background: rgba(13, 24, 42, 0.7);
}

.plan__flag {
  position: absolute;
  top: -0.75rem;
  left: 1.6rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #03060b;
  background: linear-gradient(180deg, var(--blue), #2f7fe6);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

.plan__name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.9rem;
}

.plan__tag {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.3rem;
}

.plan__list {
  list-style: none;
  margin: 0 0 1.8rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  flex: 1;
}

.plan__list li {
  position: relative;
  padding-left: 1.3rem;
  font-size: 0.93rem;
  color: var(--ice);
}

.plan__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--blue);
  box-shadow: 0 0 8px rgba(77, 159, 255, 0.7);
}

.plan__cta {
  text-align: center;
}

.plans__note {
  margin: 2.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- cta ---------- */

.cta {
  padding: clamp(6rem, 14vw, 11rem) var(--pad-x);
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 80% at 50% 115%, rgba(31, 111, 235, 0.28), transparent 65%),
    var(--ink);
}

.cta__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1.2rem;
}

.cta__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 1.4rem;
}

.cta__copy {
  max-width: 36em;
  margin: 0 auto 2.6rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

/* ---------- contact form ---------- */

.contact-card {
  max-width: 40rem;
  margin: 0 auto;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(10, 17, 29, 0.55);
  backdrop-filter: blur(10px);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.form {
  display: grid;
  gap: 1.3rem;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}

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

.form__field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.form__field input,
.form__field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ice);
  background: rgba(4, 7, 12, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__field input::placeholder,
.form__field textarea::placeholder {
  color: rgba(127, 141, 163, 0.55);
}

.form__field input:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.18);
}

.form__field textarea {
  resize: vertical;
  min-height: 7rem;
}

.form__submit {
  justify-self: start;
  border: none;
}

.lazy {
  margin-top: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.lazy__label {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.lazy__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.lazy__form input {
  flex: 1 1 14rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ice);
  background: rgba(4, 7, 12, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lazy__form input::placeholder {
  color: rgba(127, 141, 163, 0.55);
}

.lazy__form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.18);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.6rem var(--pad-x);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- chat widget ---------- */

.dlg__fab {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--blue);
  background: linear-gradient(180deg, var(--blue), #2f7fe6);
  color: #03060b;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(77, 159, 255, 0.45);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dlg__fab:hover {
  box-shadow: 0 0 48px rgba(124, 192, 255, 0.6);
  transform: translateY(-2px);
}

.dlg__panel {
  position: fixed;
  right: 1.4rem;
  bottom: 5.6rem;
  z-index: 60;
  width: min(380px, calc(100vw - 2rem));
  height: min(540px, 72vh);
  display: flex;
  flex-direction: column;
  background: rgba(10, 17, 29, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(20, 80, 184, 0.25);
  overflow: hidden;
}

.dlg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.dlg__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ice);
}

.dlg__mark {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--blue);
  margin-right: 0.4rem;
}

.dlg__close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.dlg__close:hover {
  color: var(--ice);
}

.dlg__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dlg__msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.dlg__msg--assistant {
  align-self: flex-start;
  background: rgba(231, 238, 248, 0.07);
  border: 1px solid var(--line);
  color: var(--ice);
  border-bottom-left-radius: 4px;
}

.dlg__msg--user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--blue), #2f7fe6);
  color: #03060b;
  border-bottom-right-radius: 4px;
}

.dlg__typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: var(--muted);
  animation: dlg-pulse 1.2s infinite;
}

.dlg__typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.dlg__typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dlg-pulse {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.dlg__bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
}

.dlg__bar input {
  flex: 1;
  min-width: 0;
  background: rgba(4, 7, 12, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  color: var(--ice);
  font-family: var(--font-body);
  font-size: 1rem; /* 16px floor prevents iOS focus zoom */
}

.dlg__bar input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 16px rgba(77, 159, 255, 0.25);
}

.dlg__send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--blue);
  background: linear-gradient(180deg, var(--blue), #2f7fe6);
  color: #03060b;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .dlg__panel {
    right: 1rem;
    left: 1rem;
    width: auto;
    bottom: 5.4rem;
    height: min(540px, 70vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dlg__typing span {
    animation: none;
    opacity: 0.6;
  }

  .dlg__fab {
    transition: none;
  }
}

/* ---------- utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- motion states ---------- */

[data-hero-stagger] {
  opacity: 0;
  transform: translateY(28px);
}

/* Reduced motion / no-JS fallback: everything readable, statically stacked */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-hero-stagger] {
    opacity: 1;
    transform: none;
  }
}

body.static-layout [data-hero-stagger] {
  opacity: 1;
  transform: none;
}

body.static-layout .chapters__stage {
  height: auto;
  display: block;
  overflow: visible;
}

body.static-layout .chapters__canvas {
  display: none;
}

body.static-layout .chapter {
  position: static;
  opacity: 1;
  pointer-events: auto;
  min-height: 0;
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .nav__name {
    display: none;
  }

  .hero__scrollcue {
    display: none;
  }

  .chapter {
    justify-content: flex-end;
    padding-bottom: 4rem;
    background: linear-gradient(to top, rgba(4, 7, 12, 0.94) 58%, rgba(4, 7, 12, 0) 82%);
  }

  .chapter__list li {
    font-size: 0.92rem;
  }
}
