/* ==========================================================================
   Foundry — site styles
   ========================================================================== */

:root {
  color-scheme: dark;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Forge: charcoal with molten orange */
  --bg: #0b0a09;
  --surface: #161412;
  --line: rgba(255, 238, 220, .08);
  --line-2: rgba(255, 238, 220, .16);
  --text: #f4f0ea;
  --text-2: #bdb5aa;
  --muted: #8a8277;
  --accent: #ff5e1f;
  --accent-2: #ffb347;
  --accent-text: #ff7d47;
  --on-accent: #140803;
  --ok: #62d394;
  --warn: #ffb347;
  --err: #ff6b5b;
  --glow: rgba(255, 94, 31, .22);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Film grain over everything; purely decorative */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}
.skip:focus { top: 12px; }

/* ---------- Logo ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; }
.mark { display: inline-flex; flex: none; width: 24px; height: 24px; color: var(--text); }
.mark svg { width: 100%; height: 100%; }
.mk-fg { fill: currentColor; }
.mk-accent { fill: var(--accent); }
.mk-dim { fill: none; stroke: currentColor; stroke-opacity: .32; stroke-width: 1.4; }
.wordmark { font-weight: 600; font-size: 19px; line-height: 1; letter-spacing: -0.035em; }

/* ---------- Buttons and links ---------- */

.btn {
  --h: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: 500 15px/1 var(--font-sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .3s;
}
.btn-sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -10px var(--glow), 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-2);
  transition: color .2s;
}
.text-link:hover { color: var(--text); }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.nav.scrolled,
.nav.open {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-links { display: flex; gap: 28px; margin-left: auto; margin-right: 12px; }
.nav-links a { font-size: 14.5px; color: var(--text-2); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 8px; }

.nav-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  grid-area: 1 / 1;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform .25s var(--ease);
}
.nav-toggle span:first-child { transform: translateY(-3px); }
.nav-toggle span:last-child { transform: translateY(3px); }
.nav.open .nav-toggle span:first-child { transform: rotate(45deg); }
.nav.open .nav-toggle span:last-child { transform: rotate(-45deg); }

.mobile-menu { border-top: 1px solid var(--line); }
.mobile-menu nav { display: grid; padding: 8px 0 20px; }
.mobile-menu a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
}
@media (max-width: 400px) {
  .nav-cta .btn { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--nav-h) + clamp(64px, 10vw, 136px)) 0 clamp(72px, 9vw, 112px);
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 25% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 25% 0%, #000 20%, transparent 75%);
}
.sparks {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-copy { display: grid; justify-items: start; gap: 28px; }
.hero-copy > * { animation: rise 1s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero h1 {
  max-width: 12em;
  font-size: clamp(2.6rem, 6.6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -0.045em;
}
.lead {
  max-width: 580px;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text-2);
}
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 4px; }

/* ---------- Fleet panel (hero visual) ---------- */

.fleet {
  position: relative;
  margin: clamp(56px, 8vw, 88px) 0 0;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--bg);
  font: 400 12px/1.4 var(--font-mono);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 60px 140px -50px var(--glow),
    0 30px 80px -40px rgba(0, 0, 0, .6);
  animation: rise 1.2s .3s var(--ease) both;
}
/* hot edge along the top of the panel */
.fleet::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-2) 50%, var(--accent) 70%, transparent);
}
/* heat rising off the panel */
.fleet::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -160px;
  left: 18%;
  right: 18%;
  height: 300px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}

.fleet-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.fleet-title { display: flex; align-items: center; gap: 8px; color: var(--text); }
.fleet-title .mark { width: 15px; height: 15px; }
.fleet-title .sep { color: var(--muted); }
.fleet-stats { display: flex; gap: 20px; }
.fleet-stats b { color: var(--text); font-weight: 500; }
.fleet-meta { justify-self: end; display: flex; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 7px; }
.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}
.fleet-pause {
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 500 11px/1 var(--font-mono);
  cursor: pointer;
}
.fleet-pause:hover { color: var(--text); }

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
}
.vm {
  --tone: var(--muted);
  --p: 0%;
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .5s, box-shadow .5s;
}
.vm[data-tone="text"] { --tone: var(--text); }
.vm[data-tone="accent"] { --tone: var(--accent); box-shadow: 0 0 24px -12px var(--accent); }
.vm[data-tone="accent2"] { --tone: var(--accent-2); }
.vm[data-tone="warn"] { --tone: var(--warn); }
.vm[data-tone="err"] { --tone: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.vm[data-tone="ok"] { --tone: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

.vm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vm-id { color: var(--muted); white-space: nowrap; }
.vm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--tone);
  white-space: nowrap;
}
.vm-status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.vm-task {
  overflow: hidden;
  font: 500 13px/1.35 var(--font-sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.vm-task .num:empty { display: none; }
.vm-task .num { margin-right: 6px; font: 400 12px var(--font-mono); color: var(--muted); }
.vm-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.vm-bar i {
  display: block;
  width: var(--p);
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
  transition: width .9s var(--ease), background-color .4s;
}
.vm-meta { overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

.fleet-log {
  display: grid;
  gap: 5px;
  height: calc(4 * 1.4em + 3 * 5px + 26px);
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  overflow: hidden;
  color: var(--text-2);
}
.log-line {
  display: flex;
  gap: 14px;
  white-space: nowrap;
  animation: log-in .5s var(--ease) both;
}
.log-line .t { color: var(--muted); }
.log-line .who { color: var(--accent-2); }
.log-line .msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.log-line.ok .msg { color: var(--ok); }
.log-line.err .msg { color: var(--err); }
@keyframes log-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .fleet-grid { grid-template-columns: repeat(2, 1fr); }
  .fleet-bar { grid-template-columns: 1fr auto; }
  .fleet-stats { display: none; }
}
@media (max-width: 560px) {
  .vm:nth-child(n + 5) { display: none; }
  .fleet-grid { gap: 8px; padding: 10px; }
  .vm { padding: 10px; }
  .fleet-log { height: calc(3 * 1.4em + 2 * 5px + 26px); }
  .fleet-log .log-line:nth-last-child(n + 4) { display: none; }
  .log-line .t { display: none; }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(80px, 10vw, 128px) 0;
  border-top: 1px solid var(--line);
}
.section h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.08; }

.section-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px 64px;
  margin-bottom: clamp(64px, 8vw, 96px);
}
.section-top p { max-width: 420px; font-size: clamp(1.02rem, 1.3vw, 1.1rem); color: var(--text-2); }

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 40px clamp(40px, 7vw, 112px);
  align-items: start;
}
.intro { display: grid; gap: 18px; position: sticky; top: calc(var(--nav-h) + 40px); }
.intro p { max-width: 420px; font-size: clamp(1.02rem, 1.3vw, 1.1rem); color: var(--text-2); }

@media (max-width: 900px) {
  .section-grid { grid-template-columns: 1fr; }
  .intro { position: static; }
}

/* ---------- How it works: flow ---------- */

.flow {
  --gap: 32px;
  --col: calc((100% - 4 * var(--gap)) / 5);
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* the line joining the steps, with a pulse of heat moving along it */
.flow::before,
.flow::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: calc(var(--col) - 6px);
  height: 1px;
  background: var(--line-2);
}
.flow::after {
  top: 5px;
  height: 3px;
  background: linear-gradient(90deg, transparent 40%, var(--accent) 48%, var(--accent-2) 50%, transparent 58%);
  background-size: 300% 100%;
  animation: travel 6s linear infinite;
}
@keyframes travel {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.flow li { position: relative; display: grid; align-content: start; gap: 10px; padding-top: 40px; }
.flow li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--text-2);
  border-radius: 50%;
  background: var(--bg);
}
.flow h3 { font-size: 19px; letter-spacing: -0.02em; }
.flow p { max-width: 26ch; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* dashed arc from Test back to Build: failed work goes round again */
.flow-test::after {
  content: "";
  position: absolute;
  top: -22px;
  left: calc(-100% - var(--gap) + 6px);
  width: calc(100% + var(--gap));
  height: 22px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 75%, transparent);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}
.flow li.flow-team::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--glow);
}

@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow::after,
  .flow-test::after { display: none; }
  .flow::before { top: 6px; bottom: 0; left: 6px; right: auto; width: 1px; height: auto; }
  .flow li { padding: 0 0 36px 40px; }
  /* the last step covers the line below its dot */
  .flow li:last-child { padding-bottom: 0; background: var(--bg); }
  .flow p { max-width: 44ch; }
}

/* ---------- Comparison ---------- */

.compare { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.compare th,
.compare td {
  padding: 18px 20px 18px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th { padding-top: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.compare thead th.f { color: var(--accent-text); }
.compare tbody th { width: 26%; font-weight: 500; color: var(--text-2); }
.compare td { color: var(--muted); }
.compare td.f { color: var(--text); }
@media (max-width: 560px) {
  .compare { font-size: 14px; }
  .compare th, .compare td { padding: 14px 12px 14px 0; }
}

/* ---------- Use cases ---------- */

.items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.items li {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.items li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: .5em;
  border-radius: 2px;
  background: var(--accent);
}
.items li:nth-child(-n + 2) { padding-top: 0; }
@media (max-width: 600px) {
  .items { grid-template-columns: 1fr; }
  .items li:nth-child(2) { padding-top: 18px; }
}

/* ---------- Security ---------- */

.rows { margin: 0; }
.rows > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 6px 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.rows > div:first-child { padding-top: 0; }
.rows dt { font-weight: 600; letter-spacing: -0.01em; }
.rows dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) {
  .rows > div { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */

.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: 400 15px/1.5 var(--font-sans);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form .btn { justify-self: start; margin-top: 4px; }
.hp { position: absolute; left: -9999px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-left: auto; font-size: 14px; color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-legal { width: 100%; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .footer-links { margin-left: 0; } }

/* ---------- Simple pages (thanks, 404) ---------- */

.simple { display: grid; min-height: 100svh; place-items: center; padding: var(--gutter); }
.simple-inner { display: grid; justify-items: start; gap: 24px; max-width: 520px; }
.simple h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.simple p { color: var(--text-2); }

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