/* =========================================================
   diesel.rocks — custom styles
   Industrial / combustion aesthetic: graphite + rust + amber.
   ========================================================= */

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* --- Background layers ----------------------------------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(212, 75, 22, 0.18), transparent 60%),
    radial-gradient(50rem 30rem at 95% 10%,  rgba(245, 165, 36, 0.10), transparent 60%),
    radial-gradient(40rem 30rem at 50% 110%, rgba(212, 75, 22, 0.08), transparent 60%);
}

/* --- Reveal on scroll ------------------------------------ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Shared bits ----------------------------------------- */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; letter-spacing: .2em;
  text-transform: uppercase; color: #F5A524;
}
.code-inline {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(245,165,36,0.08);
  color: #F5A524;
  border: 1px solid rgba(245,165,36,0.2);
  padding: 1px 6px; border-radius: 3px;
  font-size: 0.85em;
}

/* =========================================================
   HERO — engine block illustration
   ========================================================= */
.engine-block {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 480px;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% 50%, rgba(212,75,22,0.10), transparent 60%),
    linear-gradient(135deg, #17191D 0%, #0B0C0E 100%);
  border: 1px solid #2C2F36;
  border-radius: 1rem;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 40px 80px -30px rgba(0,0,0,0.8);
  overflow: hidden;
}
.engine-block::before,
.engine-block::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 14px);
  pointer-events: none; opacity: .6;
}
.cyl {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 34%;
  height: 56%;
  background: linear-gradient(180deg, #1e2127 0%, #0d0f12 100%);
  border: 2px solid #2C2F36;
  border-radius: 10px;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.8),
    inset 0 2px 0 rgba(255,255,255,0.04);
  overflow: hidden;
}
.piston {
  position: absolute; left: 0; right: 0; top: 0;
  animation: pistonStroke 1.8s ease-in-out infinite;
}
.rod {
  width: 10%;
  height: 60%;
  background: linear-gradient(180deg, #3a3d44, #22262b);
  margin: 0 auto;
  border-left: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(0,0,0,0.5);
}
.head {
  height: 30%;
  background: linear-gradient(180deg, #6a6d74 0%, #2f3238 100%);
  border: 1px solid #0B0C0E;
  border-radius: 3px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 3px 0 rgba(0,0,0,0.5);
}
@keyframes pistonStroke {
  0%, 100% { transform: translateY(-10%); }
  50%      { transform: translateY(22%); }
}
.spark {
  position: absolute;
  left: 50%; top: 14%;
  width: 8px; height: 8px;
  transform: translateX(-50%);
  background: #F5A524;
  border-radius: 50%;
  box-shadow: 0 0 20px 6px rgba(245,165,36,0.6);
  animation: sparkFlash 1.8s ease-in-out infinite;
}
@keyframes sparkFlash {
  0%, 40%, 60%, 100% { opacity: 0.1; }
  48%, 52% { opacity: 1; }
}

/* Chips orbiting the engine */
.chip {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(23,25,29,0.9);
  color: #EDE6D6;
  border: 1px solid #2C2F36;
  border-radius: 999px;
  white-space: nowrap;
  animation: chipFloat 6s ease-in-out infinite;
  backdrop-filter: blur(4px);
}
.chip-1 { top: 10%;  left: 8%;  }
.chip-2 { top: 8%;   right: 10%; animation-delay: -1s; }
.chip-3 { top: 42%;  left: 2%;  color: #F5A524; border-color: rgba(245,165,36,0.4); animation-delay: -2s; }
.chip-4 { top: 46%;  right: 3%;  animation-delay: -3s; }
.chip-5 { bottom: 18%; left: 6%; animation-delay: -4s; }
.chip-6 { bottom: 22%; right: 4%; color: #D44B16; border-color: rgba(212,75,22,0.4); animation-delay: -1.5s; }
.chip-7 { bottom: 6%; left: 38%; animation-delay: -3.5s; }
.chip-8 { top: 25%; left: 46%;  animation-delay: -2.5s; }
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* =========================================================
   ARCHITECTURE DIAGRAM
   ========================================================= */
.arch-card {
  background: linear-gradient(135deg, #17191D 0%, #0B0C0E 100%);
  border: 1px solid #2C2F36;
  border-radius: 1rem;
  padding: 1.75rem;
  position: relative;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6);
}
.arch-card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(212,75,22,0.15), transparent 40%);
  pointer-events: none;
}
.arch-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #F5A524;
  margin-bottom: 1rem;
}
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.arch-chip {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  background: rgba(11,12,14,0.7);
  border: 1px solid #2C2F36;
  color: #EDE6D6;
  padding: .55rem .75rem;
  border-radius: .375rem;
  transition: border-color .2s, color .2s;
}
.arch-chip:hover { border-color: #D44B16; color: #F5A524; }
.arch-chip span:first-child { color: #F5A524; font-size: 1rem; }

.arch-in { border-top: 1px dashed #2C2F36; padding-top: 1rem; }
.arch-in-row {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: #6B7280;
  padding: .15rem 0;
}
.arch-ptr { color: #D44B16; font-weight: bold; }

/* =========================================================
   FEATURES
   ========================================================= */
.feat {
  background: rgba(23,25,29,0.6);
  border: 1px solid #2C2F36;
  border-radius: .75rem;
  padding: 1.5rem;
  transition: border-color .2s, transform .2s, background .2s;
  position: relative;
  overflow: hidden;
}
.feat::after {
  content: ""; position: absolute; inset: 0;
  border-top: 2px solid transparent;
  transition: border-color .2s;
  pointer-events: none;
  border-radius: inherit;
}
.feat:hover {
  transform: translateY(-2px);
  border-color: rgba(212,75,22,0.4);
  background: rgba(23,25,29,0.9);
}
.feat:hover::after { border-top-color: #D44B16; }
.feat-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  color: #F5A524;
  background: rgba(245,165,36,0.08);
  border: 1px solid rgba(245,165,36,0.25);
  border-radius: .5rem;
  margin-bottom: 1rem;
}
.feat-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .6rem;
  color: #EDE6D6;
}
.feat-body {
  color: rgba(237,230,214,0.7);
  font-size: .95rem;
  line-height: 1.6;
}

/* =========================================================
   KANBAN DEMO
   ========================================================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  min-height: 480px;
}
@media (max-width: 820px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
.kanban-col {
  background: rgba(11,12,14,0.6);
  border: 1px solid #2C2F36;
  border-radius: .5rem;
  display: flex; flex-direction: column;
  min-height: 300px;
  transition: border-color .2s, background .2s;
}
.kanban-col.drag-over {
  border-color: #D44B16;
  background: rgba(212,75,22,0.08);
  box-shadow: inset 0 0 0 1px rgba(212,75,22,0.4);
}
.kanban-col--live .kanban-col-h { color: #F5A524; }
.kanban-col-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem .75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: rgba(237,230,214,0.8);
  border-bottom: 1px solid #2C2F36;
}
.live-pill {
  display: inline-block;
  margin-left: .35rem;
  font-size: .55rem;
  padding: 1px 6px;
  background: rgba(245,165,36,0.15);
  border: 1px solid rgba(245,165,36,0.4);
  border-radius: 999px;
  color: #F5A524;
  letter-spacing: .1em;
}
.kanban-count {
  min-width: 22px; text-align: center;
  padding: 0 6px;
  background: #2C2F36;
  color: #EDE6D6;
  border-radius: 999px;
  font-size: .7rem;
}
.kanban-col-body {
  padding: .6rem;
  display: flex; flex-direction: column; gap: .5rem;
  flex: 1;
}
.kcard {
  background: linear-gradient(135deg, #1a1d22, #13151a);
  border: 1px solid #2C2F36;
  border-left: 3px solid #6B7280;
  border-radius: .375rem;
  padding: .75rem .8rem;
  cursor: grab;
  user-select: none;
  font-size: .875rem;
  line-height: 1.4;
  transition: transform .2s, border-color .2s, box-shadow .2s, opacity .3s;
  position: relative;
}
.kcard:hover {
  border-left-color: #F5A524;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -10px rgba(212,75,22,0.5);
}
.kcard:active, .kcard.dragging {
  cursor: grabbing;
  transform: scale(1.02) rotate(-1deg);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.8);
  border-left-color: #D44B16;
  z-index: 10;
}
.kcard.ghost { opacity: .3; }
.kcard.running { border-left-color: #F5A524; }
.kcard.running::after {
  content: ""; position: absolute; top: 10px; right: 10px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #F5A524;
  box-shadow: 0 0 0 0 rgba(245,165,36,0.7);
  animation: pulseDot 1.5s ease-out infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(245,165,36,0.7); }
  100% { box-shadow: 0 0 0 14px rgba(245,165,36,0); }
}
.kcard.done { border-left-color: #5c9a2e; opacity: .85; }
.kcard.done::after {
  content: "✓ shipped";
  position: absolute; top: 8px; right: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .6rem;
  color: #7bc74d;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.kcard-title { color: #EDE6D6; font-weight: 500; }
.kcard-meta {
  display: flex; gap: .5rem; margin-top: .5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  color: #6B7280;
}
.kcard-tag {
  padding: 1px 6px; border: 1px solid #2C2F36; border-radius: 3px;
}
.kcard-run {
  display: inline-flex; align-items: center; gap: .35rem;
  color: #F5A524;
  background: rgba(245,165,36,0.1);
  border-color: rgba(245,165,36,0.3);
}

/* Phantom drag pointer for autoplay phase */
.fake-cursor {
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
  z-index: 50;
  transition: transform .6s cubic-bezier(.5,0,.2,1);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.8));
}
.fake-cursor::before {
  content: "";
  position: absolute; left: 0; top: 0;
  width: 0; height: 0;
  border-left: 10px solid #EDE6D6;
  border-top: 4px solid transparent;
  border-bottom: 12px solid transparent;
  transform: rotate(-20deg);
}

/* Kanban wrapper needs relative positioning for the fake cursor */
.kanban-wrap { position: relative; }

.kanban-hint {
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: rgba(237,230,214,0.7);
  padding: .5rem .75rem;
  border: 1px dashed rgba(245,165,36,0.4);
  background: rgba(245,165,36,0.04);
  border-radius: .375rem;
}

/* Agent console */
.agent-console {
  background: #08090B;
  border: 1px solid #2C2F36;
  border-radius: .5rem;
  display: flex; flex-direction: column;
  min-height: 480px;
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
}
.agent-console-h {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .75rem;
  background: #17191D;
  border-bottom: 1px solid #2C2F36;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c841; }
.agent-console-body {
  padding: .9rem 1rem;
  font-size: .78rem;
  line-height: 1.7;
  color: #EDE6D6;
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
}
.agent-line { white-space: pre-wrap; word-break: break-word; }
.agent-line.cmd   { color: #EDE6D6; }
.agent-line.tool  { color: #F5A524; }
.agent-line.arg   { color: #6B7280; }
.agent-line.ok    { color: #7bc74d; }
.agent-line.info  { color: #6B7280; }
.agent-line.warn  { color: #D44B16; }
.agent-cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: #F5A524;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
  vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   COMPARE TABLE
   ========================================================= */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
}
.compare-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6B7280;
  padding: 1rem .75rem;
  text-align: center;
  border-bottom: 1px solid #2C2F36;
  white-space: nowrap;
}
.compare-table thead th:first-child { text-align: left; color: #EDE6D6; }
.compare-table thead th.compare-us {
  color: #F5A524;
  position: relative;
}
.compare-table thead th.compare-us::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 10%; right: 10%;
  height: 2px; background: #D44B16;
}
.compare-table td {
  padding: .85rem .75rem;
  text-align: center;
  border-bottom: 1px solid rgba(44,47,54,0.5);
  font-size: 1.1rem;
  color: #6B7280;
}
.compare-table td:first-child {
  text-align: left;
  color: rgba(237,230,214,0.85);
  font-size: .9rem;
}
.compare-table td.compare-us {
  background: rgba(212,75,22,0.05);
  color: #D44B16;
  font-weight: 700;
  font-size: 1.25rem;
}
.compare-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}
.compare-table tbody tr:hover td.compare-us {
  background: rgba(212,75,22,0.1);
}
.compare-legend {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: #6B7280;
}

/* Callouts */
.callout {
  background: rgba(23,25,29,0.6);
  border: 1px solid #2C2F36;
  border-left: 3px solid #D44B16;
  border-radius: .5rem;
  padding: 1.25rem 1.35rem;
  color: rgba(237,230,214,0.8);
  font-size: .95rem;
  line-height: 1.6;
}
.callout-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: #F5A524;
  margin-bottom: .5rem;
}

/* =========================================================
   CODE TABS
   ========================================================= */
.code-tabs {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 1px solid #2C2F36;
  margin-bottom: -1px;
}
.code-tab {
  background: transparent;
  border: 1px solid #2C2F36;
  border-bottom: none;
  color: rgba(237,230,214,0.6);
  padding: .65rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  cursor: pointer;
  border-top-left-radius: .375rem;
  border-top-right-radius: .375rem;
  margin-right: 2px;
  transition: color .2s, background .2s;
}
.code-tab:hover { color: #EDE6D6; }
.code-tab.active {
  background: #08090B;
  color: #F5A524;
  border-color: #2C2F36;
  position: relative;
}
.code-tab.active::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: #D44B16;
}
.code-pane {
  background: #08090B;
  border: 1px solid #2C2F36;
  border-radius: 0 .375rem .375rem .375rem;
  overflow: hidden;
}
.code-pane-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .9rem;
  border-bottom: 1px solid #2C2F36;
  background: #0d0f12;
}
.copy-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: #6B7280;
  background: transparent;
  border: 1px solid #2C2F36;
  padding: .2rem .5rem;
  border-radius: 3px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: #F5A524; border-color: #D44B16; }
.copy-btn.copied { color: #7bc74d; border-color: #7bc74d; }
.code-pane pre {
  padding: 1.25rem 1.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  line-height: 1.7;
  color: #EDE6D6;
  overflow-x: auto;
}
.tk-kw   { color: #D44B16; }
.tk-str  { color: #a7d18f; }
.tk-num  { color: #F5A524; }
.tk-key  { color: #8ab4f8; }
.tk-fn   { color: #F5A524; }
.tk-cmt  { color: #6B7280; font-style: italic; }
.tk-punc { color: #EDE6D6; }

/* =========================================================
   REQUEST FORM
   ========================================================= */
.request-card {
  background:
    radial-gradient(60rem 30rem at 10% 0%, rgba(212,75,22,0.08), transparent 60%),
    linear-gradient(135deg, #17191D 0%, #0B0C0E 100%);
  border: 1px solid #2C2F36;
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
}
.request-card::before {
  content: "";
  position: absolute; top: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D44B16, transparent);
}
.f-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(237,230,214,0.75);
}
.f-label > span { display: block; margin-bottom: .35rem; }
.f-input {
  width: 100%;
  background: rgba(11,12,14,0.7);
  border: 1px solid #2C2F36;
  border-radius: .375rem;
  color: #EDE6D6;
  padding: .65rem .8rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .95rem;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color .2s, box-shadow .2s;
}
.f-input::placeholder { color: #4a4f58; }
.f-input:focus {
  outline: none;
  border-color: #D44B16;
  box-shadow: 0 0 0 3px rgba(212,75,22,0.2);
}
.f-check {
  accent-color: #D44B16;
  width: 16px; height: 16px;
}
#formStatus.ok    { color: #7bc74d; }
#formStatus.err   { color: #ff5f57; }

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .piston, .spark, .chip { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
