/* ============================================================
   TGN — dispatch ticket design system
   ============================================================ */

:root {
  --ink: #0a0d12;
  --panel: #12161d;
  --panel-raised: #171c25;
  --paper: #f0ebdd;
  --paper-dim: #e4ddc9;
  --wire: #2fa8e0;
  --wire-dim: #1f7ba8;
  --signal: #e7a33e;
  --text-high: #ece9df;
  --text-low: #8891a0;
  --line: #232a35;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 3px;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  background: var(--ink);
  color: var(--text-high);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 15% 0%, rgba(47, 168, 224, 0.08), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(231, 163, 62, 0.05), transparent 40%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wire);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--wire);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(47, 168, 224, 0.18);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 38px);
  margin-top: 14px;
}

.section-head p {
  color: var(--text-low);
  font-size: 17px;
  margin-top: 14px;
  max-width: 560px;
}

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

code,
pre {
  font-family: var(--font-mono);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--wire);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--wire);
  color: #051119;
}

.btn--primary:hover {
  background: #48b7ea;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-high);
}

.btn--ghost:hover {
  border-color: var(--wire-dim);
  color: var(--wire);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 13, 18, 0.82);
  border-bottom: 1px solid var(--line);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand .mark {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-low);
}

.nav-links a:hover {
  color: var(--text-high);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links-inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

@media (max-width: 760px) {
  .nav-links-inner {
    display: none;
  }
}

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

.hero {
  padding-top: 84px;
  padding-bottom: 96px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  gap: 20px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  margin-top: 20px;
  max-width: 820px;
}

.hero h1 .accent {
  color: var(--wire);
}

.hero-sub {
  margin-top: 22px;
  font-size: 19px;
  color: var(--text-low);
  max-width: 620px;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.install-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-high);
}

.install-copy .prompt {
  color: var(--signal);
}

.install-copy button {
  background: none;
  border: none;
  color: var(--text-low);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 3px;
  transition: color 0.15s ease, background 0.15s ease;
}

.install-copy button:hover {
  color: var(--wire);
  background: rgba(47, 168, 224, 0.1);
}

.install-copy button:focus-visible {
  outline: 2px solid var(--wire);
  outline-offset: 2px;
}

/* ---------- dispatch flow (hero signature strip) ---------- */

.flow {
  margin-top: 76px;
  display: grid;
  grid-template-columns: 1.15fr auto 0.9fr auto 0.85fr;
  align-items: center;
  gap: 18px;
}

@media (max-width: 900px) {
  .flow {
    grid-template-columns: 1fr;
  }
  .flow-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

.flow-arrow {
  color: var(--text-low);
  font-family: var(--font-mono);
  font-size: 20px;
  opacity: 0;
}

.flow-node {
  opacity: 0;
  transform: translateY(10px);
}

.flow.is-in .flow-node,
.flow.is-in .flow-arrow {
  animation: flow-in 0.5s ease forwards;
}

.flow.is-in .flow-arrow--1 { animation-delay: 0.35s; }
.flow.is-in .flow-node--ticket { animation-delay: 0.5s; }
.flow.is-in .flow-arrow--2 { animation-delay: 0.85s; }
.flow.is-in .flow-node--tg { animation-delay: 1s; }

@keyframes flow-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.terminal-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.terminal-body {
  padding: 18px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  min-height: 74px;
}

.terminal-body .prompt {
  color: var(--signal);
}

.terminal-body .caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--wire);
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}

.typed-line::after {
  content: "";
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.tg-bubble {
  background: linear-gradient(180deg, #1a2531, #131b24);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.tg-bubble-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-low);
  margin-bottom: 10px;
}

.tg-bubble-head .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wire);
}

.tg-message {
  background: var(--wire);
  color: #051119;
  border-radius: 12px 12px 12px 2px;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
}

.tg-time {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-low);
}

/* ---------- dispatch ticket component ---------- */

.ticket {
  --hole: var(--ink);
  position: relative;
  background: var(--paper);
  color: #1c1a14;
  border-radius: var(--radius);
  overflow: visible;
}

.ticket-stub {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6450;
  border-bottom: 1px dashed #c9c1a8;
}

.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--hole);
}

.ticket-stub::before {
  left: -8px;
}

.ticket-stub::after {
  right: -8px;
}

.ticket-body {
  padding: 20px;
}

/* tickets sitting on the ink page background need ink-colored holes;
   tickets on panel surfaces override --hole to match */
section.on-panel .ticket {
  --hole: var(--panel);
}

/* ---------- integrations (tabs) ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 9px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-low);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-high);
}

.tab-btn.is-active {
  color: var(--wire);
  border-color: var(--wire-dim);
  background: rgba(47, 168, 224, 0.08);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--wire);
  outline-offset: 2px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.code-ticket .ticket-body {
  padding: 0;
}

.code-ticket pre {
  padding: 22px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  color: #241f13;
}

.code-ticket .ticket-stub {
  color: #6b6450;
}

/* minimal syntax accents inside code tickets */
.tok-kw { color: #a6431e; }
.tok-str { color: #2f6f4a; }
.tok-fn { color: #1f6fa8; }
.tok-com { color: #928a6d; font-style: italic; }

/* ---------- value props ---------- */

.props-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.prop-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.prop-card .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
}

.prop-card h3 {
  font-size: 19px;
  margin-top: 12px;
}

.prop-card p {
  margin-top: 10px;
  color: var(--text-low);
  font-size: 14.5px;
}

/* ---------- features ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.feature-ticket.is-highlight {
  grid-column: span 2;
}

@media (max-width: 820px) {
  .feature-ticket.is-highlight {
    grid-column: span 1;
  }
}

.feature-ticket .ticket-body h3 {
  font-size: 18px;
  color: #17140d;
}

.feature-ticket .ticket-body p {
  margin-top: 8px;
  font-size: 14px;
  color: #514a38;
  max-width: 480px;
}

.feature-ticket .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8a8168;
}

/* ---------- stack section ---------- */

.stack-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 900px) {
  .stack-wrap {
    grid-template-columns: 1fr;
  }
}

.channel-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-low);
  transition: transform 0.2s ease;
}

.channel-chip .status {
  font-size: 11px;
  color: var(--text-low);
}

.channel-chip.is-tgn {
  background: linear-gradient(90deg, rgba(47, 168, 224, 0.14), rgba(47, 168, 224, 0.03));
  border-color: var(--wire-dim);
  color: var(--text-high);
  transform: translateX(10px);
}

.channel-chip.is-tgn .status {
  color: var(--wire);
}

/* ---------- architecture ---------- */

.arch {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

@media (max-width: 820px) {
  .arch {
    grid-template-columns: 1fr;
  }
  .arch-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

.arch-node {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}

.arch-node .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-low);
}

.arch-node h3 {
  margin-top: 10px;
  font-size: 17px;
}

.arch-node p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-low);
}

.arch-arrow {
  color: var(--wire);
  font-family: var(--font-mono);
  font-size: 20px;
}

/* ---------- quickstart ---------- */

.steps {
  display: grid;
  gap: 14px;
}

.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.step:first-child {
  border-top: none;
}

.step .idx {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--wire);
  padding-top: 3px;
}

.step h3 {
  font-size: 16px;
  font-weight: 600;
}

.step pre {
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-high);
  overflow-x: auto;
}

.step p {
  color: var(--text-low);
  font-size: 14.5px;
  margin-top: 6px;
}

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

footer {
  padding: 56px 0 42px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-low);
}

.footer-links a:hover {
  color: var(--wire);
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-low);
}

/* ---------- reveal-on-scroll ---------- */

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

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
