/* =============================================================================
   iflow — public site
   ---------------------------------------------------------------------------
   Design language: "BLUEPRINT".
   Pepla's house style — paper white, DM Sans, black headings, flat brand
   colour, the tri-colour rule — applied to a product that draws diagrams.
   The page behaves like a technical drawing that has been switched on:
   white ground, hairline construction lines, and colour used only as signal.

   Palette is the iFlow brand pack (assets/brand/), whose mark is itself a
   node graph in these three colours:

     green   #28a745   an execution path                     (AUTOMATE)
     blue    #2580ed   a typed value moving between nodes    (EVOLVE)
     orange  #e74c3c   needs a human: AI drafts, and faults  (CONNECT)
     gray    #8b8f97   dormant nodes and quiet labels
     navy    #111827   type

   Nothing is tinted for decoration. If it has colour, it means something.
   The brand has no fourth accent, so orange carries both "awaiting approval"
   and "failed" — in each case, something a person has to look at.
   ============================================================================= */

/* ---------------------------------------------------------------- tokens --- */
:root {
  /* iFlow brand pack — see assets/brand/README.md */
  --green: #28a745;
  --green-600: #1f8a38;
  --green-700: #177230;
  --blue: #2580ed;
  --blue-600: #1c6fd0;
  --orange: #e74c3c;
  --orange-600: #cf3a2a;
  --gray: #8b8f97;
  /* faults share the brand orange — there is no separate red in the pack */
  --red: #e74c3c;
  --red-600: #cf3a2a;

  /* signal roles */
  --exec: var(--green);
  --data: var(--blue);
  --agent: var(--orange);
  --fault: var(--red);

  /* paper */
  --paper: #ffffff;
  --paper-2: #f5f8fb;
  --paper-3: #eaf0f6;
  --ink: #111827;
  --ink-2: #3f4a57;
  --ink-3: #6b7683;
  --ink-4: #8b8f97;
  --line: #e3e9f0;
  --line-2: #cfd8e2;
  --line-3: #b0bdcb;

  --tri: linear-gradient(90deg, var(--orange) 0 33.33%, var(--green) 33.33% 66.66%, var(--blue) 66.66% 100%);

  --font-sans: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', ui-monospace, 'SF Mono', monospace;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 46px);
  --r-sm: 5px;
  --r: 8px;
  --r-lg: 14px;

  --shadow-sm: 0 2px 6px rgba(14, 19, 25, 0.05), 0 10px 24px -18px rgba(14, 19, 25, 0.28);
  --shadow: 0 3px 10px rgba(14, 19, 25, 0.05), 0 22px 48px -30px rgba(14, 19, 25, 0.4);
  --shadow-lg: 0 4px 14px rgba(14, 19, 25, 0.06), 0 40px 80px -44px rgba(14, 19, 25, 0.45);

  --ease: cubic-bezier(0.16, 0.84, 0.24, 1);
  --ease-snap: cubic-bezier(0.2, 1.35, 0.4, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(40, 167, 69, 0.2); }

a { color: inherit; text-decoration: none; }
p { margin: 0; }
img { max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.028em;
}
h2 { font-size: clamp(28px, 4vw, 50px); }
h3 { font-size: 18.5px; letter-spacing: -0.015em; }

.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- blueprint field --- */
/* Twelve construction rules run the whole document — the grid the drawing is
   set out on, the same one the designer canvas uses. */
.blueprint {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}
.blueprint span { border-left: 1px solid rgba(14, 19, 25, 0.032); }
.blueprint span:last-child { border-right: 1px solid rgba(14, 19, 25, 0.032); }

.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(820px 560px at 82% -10%, rgba(37, 128, 237, 0.1), transparent 70%),
    radial-gradient(680px 460px at 4% 2%, rgba(40, 167, 69, 0.07), transparent 68%);
}

/* ---------------------------------------------------------------- layout --- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.band {
  position: relative;
  padding: clamp(70px, 8.5vw, 132px) 0;
  z-index: 2;
}
.band.tint { background: var(--paper-2); }

/* Pepla's signature: a full-width tri-colour rule between sections */
.rule {
  position: relative;
  z-index: 2;
  height: 3px;
  background: var(--tri);
}
.rule.thin { height: 2px; opacity: 0.85; }

/* ------------------------------------------------------------- eyebrows --- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}
.kicker::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--tri);
  border-radius: 2px;
}
.kicker b { color: var(--green); font-weight: 500; }

.head { max-width: 730px; margin-bottom: 54px; }
.head .lead { margin-top: 18px; }
.head.center { margin-left: auto; margin-right: auto; text-align: center; }
.head.center .kicker { justify-content: center; }

.lead {
  color: var(--ink-2);
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.66;
  max-width: 64ch;
}

/* the highlighted word: brand green with an orange rule beneath it */
.hl {
  color: var(--green);
  position: relative;
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.11em;
  background: var(--orange);
  border-radius: 2px;
}

/* ------------------------------------------------------------- controls --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.28s, background 0.22s, border-color 0.22s, color 0.22s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(40, 167, 69, 0.95);
}
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); box-shadow: 0 16px 30px -14px rgba(40, 167, 69, 0.95); }
/* a packet crosses the control on hover */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36%;
  left: -40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
}
.btn-primary:hover::after { animation: btn-sweep 0.7s var(--ease); }
@keyframes btn-sweep { to { left: 105%; } }

.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-600); border-color: var(--blue-600); }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-ghost:hover { border-color: var(--line-3); }
.btn-lg { padding: 15px 26px; font-size: 13.5px; }

/* ------------------------------------------------------------------ nav --- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(255, 255, 255, 0.86);
  transition: box-shadow 0.3s, background 0.3s;
}
header.nav.scrolled { background: rgba(255, 255, 255, 0.96); box-shadow: 0 6px 22px -14px rgba(14, 19, 25, 0.4); }

.nav-inner { display: flex; align-items: center; gap: 34px; height: 68px; }

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--ink);
}
/* the wordmark is solid navy in the brand pack — the colour lives in the mark */
.brand .mark { flex: none; }

nav.links { display: flex; gap: 2px; }
nav.links a {
  position: relative;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
}
nav.links a:hover { color: var(--ink); background: var(--paper-2); }
/* the hovered link grows a port dot, like a node input */
nav.links a::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
nav.links a:hover::before { opacity: 1; transform: translate(-50%, 0); }

.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-signin { color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.nav-signin:hover { color: var(--ink); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.nav-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.6s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* the nav's underline is a wire that fills as you read the page */
.scrollwire { position: relative; height: 3px; background: var(--line); }
.scrollwire .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--tri); background-size: 100vw 100%; }

/* ----------------------------------------------------------------- hero --- */
.hero {
  position: relative;
  padding: clamp(46px, 6vw, 84px) 0 clamp(50px, 6vw, 88px);
  overflow: hidden;
  z-index: 2;
}
/* The graph is a column of the hero grid — never a layer floating over the
   copy — so it cannot overlap the headline or the ask field at any width. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  column-gap: clamp(24px, 3vw, 56px);
  align-items: center;
}
.hero-inner { grid-column: 1; }
.hero-stage {
  grid-column: 2;
  position: relative;
  height: clamp(300px, 27vw, 400px);
  /* bleeds to the viewport edge for room to draw, but only ever rightwards */
  width: calc(100% + max(0px, (100vw - var(--maxw)) / 2) + var(--gutter));
}
.readouts { grid-column: 1 / -1; }

#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the static poster only appears when WebGL is unavailable. `hidden` does not
   work on SVG elements — they are not HTMLElements — so this is class-driven. */
#hero-fallback { display: none; }
.no-webgl #hero-fallback { display: block; width: 100%; height: 100%; opacity: 0.75; }
.no-webgl #hero-canvas { display: none; }

@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-inner, .hero-stage, .readouts { grid-column: 1; }
  /* full-bleed and tall: the scene frames itself vertically at this aspect and
     pans along the flow, so height is what buys legible cards here */
  .hero-stage {
    width: calc(100% + var(--gutter) * 2);
    margin-left: calc(var(--gutter) * -1);
    height: clamp(330px, 58vw, 460px);
    margin-top: 20px;
  }
}

.hero h1 {
  font-size: clamp(35px, 4.5vw, 64px);
  text-wrap: balance;
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
}
.hero .lead { margin-bottom: 28px; max-width: 54ch; }
.hero-actions { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; }

/* The ask field: the product's own input, typing itself. Finishing the
   sentence is what assembles the graph alongside it. */
.askbox {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 10px 9px 15px;
  margin-bottom: 28px;
  max-width: 610px;
  /* holds its height as the examples cycle through one- and two-line asks */
  min-height: 68px;
  box-shadow: var(--shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.askbox.done { border-color: rgba(40, 167, 69, 0.5); }
.ask-glyph { width: 19px; height: 19px; flex: none; }
.askbox .typed {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.4;
}
.askbox .caret {
  flex: none;
  width: 2px;
  height: 17px;
  background: var(--orange);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.askbox.done .caret { animation: none; opacity: 0; width: 0; }
.ask-go {
  flex: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: var(--r-sm);
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.25s;
}
.ask-go:hover { background: var(--green-600); }
.askbox.done .ask-go {
  background: rgba(40, 167, 69, 0.1);
  color: var(--green-700);
  box-shadow: inset 0 0 0 1px rgba(40, 167, 69, 0.35);
}
@media (max-width: 560px) {
  .askbox { align-items: flex-start; flex-wrap: wrap; }
  .askbox .typed { flex-basis: 100%; }
  .ask-go { margin-left: auto; }
}

/* instrument readouts under the hero */
.readouts {
  position: relative;
  z-index: 2;
  margin-top: clamp(40px, 5vw, 66px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.readouts .cell {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 18px 17px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.readouts .ico { flex: none; color: var(--rc); line-height: 0; }
.readouts .ico svg { width: 27px; height: 27px; }
.readouts .txt { min-width: 0; display: block; }
.readouts .cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rc, var(--green));
}
.readouts .num {
  display: block;
  font-size: clamp(18px, 1.6vw, 23px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.readouts .num em { font-style: normal; color: var(--rc); }
.readouts .lbl { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.4; margin-top: 3px; }
@media (max-width: 820px) { .readouts { grid-template-columns: repeat(2, 1fr); } }

/* --------------------------------------------------------------- panels --- */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.panel-bar .dots { display: flex; gap: 5px; }
.panel-bar .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.panel-bar .t { color: var(--ink-2); font-weight: 500; }
.panel-bar .right { margin-left: auto; color: var(--ink-4); }
.panel-body { padding: 18px; }

.split {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: clamp(30px, 5vw, 66px);
  align-items: center;
}
.split.rev .copy { order: 2; }
@media (max-width: 940px) {
  .split { grid-template-columns: 1fr; }
  .split.rev .copy { order: 0; }
}

/* port-dot feature list — the same glyphs the canvas uses */
.featlist { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.featlist li { display: flex; align-items: flex-start; gap: 14px; font-size: 15.5px; color: var(--ink-2); }
.featlist .port {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 7px;
  border-radius: 50%;
  border: 2.5px solid var(--pc, var(--green));
  background: var(--paper);
  position: relative;
}
.featlist .port.filled { background: var(--pc); border-color: var(--pc); }
.featlist .port::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 8px;
  height: 2px;
  background: var(--pc);
  opacity: 0.45;
}

/* ------------------------------------------------------- 03 · flow rail --- */
.rail { position: relative; margin-top: 10px; }
.rail-line { position: absolute; left: 0; right: 0; top: 28px; height: 3px; background: var(--line); border-radius: 2px; }
.rail-line .lit { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--tri); background-size: 60vw 100%; border-radius: 2px; }
.stations { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.station .knob {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-4);
  position: relative;
  z-index: 2;
  transition: color 0.35s, border-color 0.35s, box-shadow 0.45s, transform 0.45s var(--ease-snap);
}
.station.on .knob {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 12px 26px -14px rgba(40, 167, 69, 0.95);
  transform: scale(1.05);
}
.station h3 { margin: 20px 0 7px; }
.station p { color: var(--ink-3); font-size: 14.5px; line-height: 1.55; }
@media (max-width: 900px) {
  .stations { grid-template-columns: repeat(2, 1fr); gap: 30px 20px; }
  .rail-line { display: none; }
}
@media (max-width: 520px) { .stations { grid-template-columns: 1fr; } }

/* ------------------------------------------------------ 04 · ai builder --- */
.chat { display: grid; gap: 14px; }
.chat-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.chat-who {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding-top: 10px;
}
.bubble {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 14.5px;
  color: var(--ink-2);
  background: var(--paper-2);
  line-height: 1.55;
  min-height: 20px;
}
.bubble.me { background: rgba(37, 128, 237, 0.08); border-color: rgba(37, 128, 237, 0.3); color: var(--ink); }
.bubble.ai { background: var(--paper); border-left: 3px solid var(--orange); }

.tools { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.toolchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 3px;
  border: 1px solid rgba(231, 76, 60, 0.35);
  background: rgba(231, 76, 60, 0.07);
  color: var(--orange-600);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.toolchip.in { opacity: 1; transform: none; }
.toolchip .spin {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.6px solid rgba(231, 76, 60, 0.35);
  border-top-color: var(--orange);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
.toolchip.ok .spin { border: 0; background: var(--green); animation: none; }

/* the approval card — the product's whole promise in one component */
.approval {
  margin-top: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s, transform 0.5s var(--ease);
}
.approval.in { opacity: 1; transform: none; }
.approval-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.approval-head .pending {
  margin-left: auto;
  color: var(--orange-600);
  border: 1px solid rgba(231, 76, 60, 0.4);
  background: rgba(231, 76, 60, 0.09);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.diff { font-family: var(--font-mono); font-size: 12.5px; padding: 12px 14px; display: grid; gap: 4px; }
.diff div { display: flex; gap: 9px; color: var(--ink-3); }
.diff .add { color: var(--green-700); }
.diff .add::before { content: "+"; color: var(--green); font-weight: 500; }
.diff .ctx::before { content: "·"; color: var(--ink-4); }
.approval-foot { display: flex; gap: 9px; padding: 12px 14px; border-top: 1px solid var(--line); }
.approval-foot .btn { padding: 9px 15px; font-size: 12px; }
.btn-reject { border-color: rgba(231, 76, 60, 0.4); color: var(--red-600); }
.btn-reject:hover { background: rgba(231, 76, 60, 0.07); border-color: var(--red); }

/* --------------------------------------------------- 05 · live designer --- */
/* The canvas gets the full column width — it is the product, and it needs the
   room to lay a six-node flow out with proper spacing. */
.designer-head {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 70px);
  align-items: end;
  margin-bottom: 40px;
}
.designer-head .featlist { margin-top: 0; }
@media (max-width: 900px) { .designer-head { grid-template-columns: 1fr; align-items: start; } }

.dz {
  position: relative;
  height: 420px;
  background:
    radial-gradient(circle at 24% 16%, rgba(37, 128, 237, 0.07), transparent 60%),
    radial-gradient(rgba(14, 19, 25, 0.13) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper);
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}
.dz.dragging { cursor: grabbing; }
.dz svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dz .wire { fill: none; stroke-width: 2; stroke-linecap: round; }
.dz .wire.exec { stroke: rgba(40, 167, 69, 0.5); }
.dz .wire.data { stroke: rgba(37, 128, 237, 0.55); stroke-dasharray: 5 5; }
.dz .wire.hot { stroke: var(--green); stroke-width: 2.4; }
.dz .wire.hot.data { stroke: var(--blue); }
.dz .pkt { fill: var(--green); }

.dnode {
  position: absolute;
  width: 154px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  user-select: none;
  cursor: grab;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.14s var(--ease);
}
.dnode::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 3px;
  border-radius: 7px 7px 0 0;
  background: var(--acc);
}
.dnode:active { cursor: grabbing; }
.dnode.lift { transform: scale(1.03); box-shadow: var(--shadow-lg); z-index: 5; }
.dnode-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 8px;
  border-bottom: 1px solid var(--line);
}
.dnode-head img, .dnode-head svg { width: 15px; height: 15px; flex: none; }
.dnode-head span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dnode-body { padding: 7px 10px 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.dnode-body .method { color: var(--ink-3); }
.dnode-body .dur { color: var(--green-700); opacity: 0; transition: opacity 0.3s; float: right; }
.dnode.done .dnode-body .dur { opacity: 1; }
.dnode.active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.16), var(--shadow); }
.dnode.done { border-color: rgba(40, 167, 69, 0.55); }
.dnode.failed { border-color: var(--red); box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.14), var(--shadow); }
.dnode.failed .dnode-body .dur { color: var(--red-600); opacity: 1; }

.dport {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--green);
  background: var(--paper);
  transition: transform 0.2s var(--ease-snap), box-shadow 0.2s;
}
.dport.data { border-color: var(--blue); background: var(--blue); width: 9px; height: 9px; }
.dport.live { box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.18); transform: scale(1.2); }

.dz-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.dz-toolbar .btn { padding: 8px 14px; font-size: 12px; }
.dz-toolbar .hint { margin-left: auto; letter-spacing: 0.03em; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-3); }
.switch input {
  appearance: none;
  margin: 0;
  width: 32px;
  height: 17px;
  border-radius: 9px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink-4);
  transition: transform 0.25s var(--ease), background 0.25s;
}
.switch input:checked { background: rgba(231, 76, 60, 0.16); border-color: rgba(231, 76, 60, 0.5); }
.switch input:checked::after { transform: translateX(15px); background: var(--red); }

.logstream {
  height: 96px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.8;
  background: var(--paper);
  color: var(--ink-3);
}
.logstream div { animation: log-in 0.3s var(--ease); }
.logstream .ts { color: var(--ink-4); }
.logstream .ok { color: var(--green-700); font-weight: 500; }
.logstream .info { color: var(--blue-600); font-weight: 500; }
.logstream .bad { color: var(--red-600); font-weight: 500; }
@keyframes log-in { from { opacity: 0; transform: translateY(4px); } }

/* -------------------------------------------------------- 06 · terminal --- */
.term-body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2;
  padding: 16px 18px;
  min-height: 268px;
  background: var(--paper-2);
  color: var(--ink-2);
}
.term-body .call { color: var(--orange-600); font-weight: 500; }
.term-body .ret { color: var(--ink-3); }
.term-body .ok { color: var(--green-700); font-weight: 500; }
.term-body .wait { color: var(--orange-600); }
.term-body .cursor { display: inline-block; width: 7px; height: 14px; background: var(--orange); translate: 0 2px; animation: blink 1.05s steps(1) infinite; }

/* --------------------------------------------------- 07 · observability --- */
.waterfall { display: grid; gap: 10px; padding: 2px 0; }
.wf-row { display: grid; grid-template-columns: 168px 1fr 62px; gap: 14px; align-items: center; }
.wf-name { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.wf-name i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.wf-track { height: 22px; border-radius: 3px; background: var(--paper-3); position: relative; overflow: hidden; }
.wf-bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--green); width: 0; transition: width 0.9s var(--ease), left 0.9s var(--ease); }
.wf-bar.data { background: var(--blue); }
.wf-bar.bad { background: var(--red); }
.wf-bar.pending { background: repeating-linear-gradient(115deg, var(--line-2) 0 6px, transparent 6px 12px); }
.wf-ms { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-4); text-align: right; font-variant-numeric: tabular-nums; }
.wf-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); border-top: 1px solid var(--line); margin-top: 12px; padding-top: 7px; }
@media (max-width: 640px) { .wf-row { grid-template-columns: 112px 1fr 48px; } }

/* -------------------------------------------------------- 08 · vendors --- */
.marquee { position: relative; display: flex; gap: 12px; overflow: hidden; padding: 6px 0; width: 100%; }
.marquee::before, .marquee::after { content: ""; position: absolute; top: 0; bottom: 0; width: 12%; z-index: 2; pointer-events: none; }
.marquee::before { left: 0; background: linear-gradient(90deg, var(--paper), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--paper), transparent); }
.marquee-track { display: flex; gap: 12px; flex: none; animation: slide 58s linear infinite; }
.marquee.rev .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-100%); } }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.chip img { width: 16px; height: 16px; }
.chip:hover { border-color: var(--line-3); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* ------------------------------------------------------ 09 · governance --- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 940px) { .grid3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid3 { grid-template-columns: 1fr; } }

/* Pepla's service card: white, a coloured top rule, a centred line-art mark,
   an uppercase title and quiet grey copy. */
.card {
  --acc: var(--green);
  position: relative;
  padding: 36px 26px 34px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--acc); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .ico { color: var(--acc); margin: 0 auto 20px; line-height: 0; }
.card .ico svg { width: 46px; height: 46px; }
/* older cards still pass a fixed-size icon — normalise those too */
.card .ico svg[width] { width: 46px; height: 46px; stroke-width: 1.5; }
.card h3 {
  margin-bottom: 12px;
  font-size: 15.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.card p { color: var(--ink-3); font-size: 14.5px; line-height: 1.65; max-width: 34ch; margin: 0 auto; }

/* ----------------------------------------------------------- 11 · quote --- */
.quote { max-width: 960px; }
.quote blockquote {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.9vw, 38px);
  line-height: 1.26;
  letter-spacing: -0.028em;
  font-weight: 700;
}
.quote .mark { color: var(--green); }
.quote .who { margin-top: 24px; color: var(--ink-4); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; }
.quote .who b { color: var(--ink-2); font-weight: 500; }

/* --------------------------------------------------------- 12 · pricing --- */
.plangrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 1080px) { .plangrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .plangrid { grid-template-columns: 1fr; } }

.plan {
  --acc: var(--green);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.plan::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--acc); }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan.pop { box-shadow: var(--shadow-lg); border-color: rgba(40, 167, 69, 0.4); }
.plan .pname { font-weight: 700; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan .badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  color: #fff;
  background: var(--acc);
  font-weight: 500;
}
.plan .pprice {
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.035em;
  margin: 16px 0 2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.plan .pprice small { font-size: 12px; color: var(--ink-4); letter-spacing: 0; }
.plan .plist { list-style: none; margin: 18px 0 22px; padding: 18px 0 0; display: grid; gap: 9px; border-top: 1px solid var(--line); }
.plan .plist li { font-size: 13.5px; color: var(--ink-3); display: flex; gap: 10px; }
.plan .plist li::before { content: ""; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--acc); flex: none; }
.plan .btn { margin-top: auto; justify-content: center; }

.pricefeats { list-style: none; margin: 32px 0 0; padding: 24px 0 0; display: flex; flex-wrap: wrap; gap: 12px 30px; border-top: 1px solid var(--line); }
.pricefeats li { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 14px; }

/* ------------------------------------------------------------ 13 · cta --- */
.cta { text-align: center; }
.cta .wrap > div { max-width: 720px; margin: 0 auto; }
.cta h2 { margin-bottom: 14px; }
.cta p { color: var(--ink-2); margin-bottom: 30px; }
.cta .hero-actions { justify-content: center; }
/* Pepla's green blob, used once, as the mark's ground */
.cta-mark { display: inline-grid; place-items: center; margin-bottom: 28px; position: relative; }
.cta-mark::after {
  content: "";
  position: absolute;
  width: 128px;
  height: 128px;
  background: var(--green);
  border-radius: 50% 50% 50% 12%;
  opacity: 0.12;
  animation: breathe 6s var(--ease) infinite;
}
@keyframes breathe { 50% { transform: scale(1.12) rotate(8deg); } }
.cta-mark svg { position: relative; z-index: 1; }

/* --------------------------------------------------------------- footer --- */
footer { position: relative; z-index: 2; background: var(--paper-2); padding: clamp(52px, 6vw, 84px) 0 32px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 840px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 34px; } }
.foot-brand p { color: var(--ink-3); font-size: 14.5px; margin-top: 14px; max-width: 38ch; }
/* the brand's own line, in the brand's own three colours */
.foot-tag {
  margin-top: 14px !important;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot-col h4 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 14px; font-weight: 500; }
.foot-col a { display: block; color: var(--ink-3); font-size: 14.5px; padding: 5px 0; transition: color 0.2s, padding-left 0.25s var(--ease); }
.foot-col a:hover { color: var(--ink); padding-left: 5px; }

.foot-wordmark {
  margin: clamp(44px, 5.5vw, 76px) 0 20px;
  font-weight: 700;
  font-size: clamp(56px, 15vw, 216px);
  line-height: 0.8;
  letter-spacing: -0.055em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line-2);
  user-select: none;
}
.foot-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-4);
}

/* --------------------------------------------------------------- reveal --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.75s var(--ease), transform 0.85s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.09s; }
.reveal.d2 { transition-delay: 0.18s; }
.reveal.d3 { transition-delay: 0.27s; }

.rise { opacity: 0; transform: translateY(20px); animation: rise 0.95s var(--ease) forwards; }
.rise.d1 { animation-delay: 0.05s; }
.rise.d2 { animation-delay: 0.15s; }
.rise.d3 { animation-delay: 0.26s; }
.rise.d4 { animation-delay: 0.37s; }
.rise.d5 { animation-delay: 0.48s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
  .reveal, .rise { opacity: 1; transform: none; }
}

/* ------------------------------------------------------- signup overlay --- */
.su-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(14, 19, 25, 0.4);
  backdrop-filter: blur(5px);
  padding: 20px;
}
.su-overlay.open { display: flex; }
.su-modal {
  position: relative;
  width: 100%;
  max-width: 452px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 28px 28px;
  box-shadow: 0 40px 100px -30px rgba(14, 19, 25, 0.5);
  animation: su-in 0.22s var(--ease);
  overflow: hidden;
}
.su-modal::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--tri); }
@keyframes su-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.su-close { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 24px; line-height: 1; color: var(--ink-4); cursor: pointer; }
.su-close:hover { color: var(--ink); }
.su-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 16px; }
.su-modal h3 { margin: 0 0 7px; font-size: 21px; }
.su-sub { color: var(--ink-3); font-size: 14px; margin: 0 0 20px; }
.su-step label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 14px; }
.su-step input, .su-step select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
}
.su-step input::placeholder { color: var(--ink-4); }
.su-step input:focus, .su-step select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15); }
.su-submit { width: 100%; justify-content: center; margin-top: 6px; }
.su-link { display: block; width: 100%; margin-top: 12px; background: none; border: 0; color: var(--blue-600); font-size: 13px; cursor: pointer; text-align: center; font-family: var(--font-sans); }
.su-error { color: var(--red-600); font-size: 13px; margin: 0 0 12px; }
.su-hint { color: var(--ink-3); font-family: var(--font-mono); font-size: 11.5px; margin: -8px 0 14px; }
.su-check {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 12px 26px -12px rgba(40, 167, 69, 0.9);
}
#su-step-done { text-align: center; }

/* -------------------------------------------------------- small screens --- */
@media (max-width: 900px) {
  nav.links, .nav-status { display: none; }
  .blueprint { display: none; }
}
