/* terminal.css — full-site styles for the warm-terminal direction. */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Soft terminal palette */
  --bg-0: #1a1d23;
  --bg-1: #20242c;
  --bg-2: #252a33;
  --bg-3: #2c323d;
  --bg-4: #313844;
  --line: #353c47;
  --line-soft: #2b313b;

  --fg-0: #e6e6e6;
  --fg-1: #c6cad1;
  --fg-2: #8a93a0;
  --fg-3: #5d6571;
  --fg-4: #3f4753;

  --accent: #7dd3c0;
  --accent-dim: #59a89a;
  --accent-soft: rgba(125,211,192,0.16);

  --warn: #e0b15a;
  --err:  #e07a7a;
  --info: #6aa7d6;
  --magenta: #c187c6;

  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Geist Mono", Menlo, Monaco, monospace;

  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
::selection { background: var(--accent-soft); color: var(--fg-0); }

/* ----- top nav ----- */
.tx-nav {
  display: grid; grid-template-columns: auto 1fr auto;
  height: 44px; align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  background: var(--bg-1);
  position: sticky; top: 0; z-index: 30;
}
.tx-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-0); }
.tx-brand::before { content: "$"; color: var(--accent); }
.tx-nav-links { display: flex; gap: 0; justify-self: center; }
.tx-nav-links a {
  padding: 0 16px; height: 44px; display: inline-flex; align-items: center;
  font-size: 12px; color: var(--fg-2);
  border-left: 1px solid var(--line);
  transition: color 120ms;
}
.tx-nav-links a:last-child { border-right: 1px solid var(--line); }
.tx-nav-links a.active { color: var(--accent); background: var(--bg-2); }
.tx-nav-links a:hover { color: var(--fg-0); }
.tx-nav-right { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--fg-2); }
.tx-nav-right .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 3px rgba(125,211,192,.18); }
.tx-nav-right .sep { color: var(--line); margin: 0 6px; }

/* ----- shell (sidebar + main) ----- */
.tx-shell {
  max-width: 1320px; margin: 0 auto; padding: 32px 20px 64px;
  display: grid; grid-template-columns: 220px 1fr; gap: 0;
  background: var(--bg-1);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  min-height: calc(100vh - 44px);
}
@media (max-width: 900px) { .tx-shell { grid-template-columns: 1fr; padding: 20px; } .tx-sidebar { display: none; } }

.tx-sidebar { border-right: 1px solid var(--line); padding: 16px 20px; }
.tx-side-block { margin-bottom: 28px; }
.tx-side-h { color: var(--fg-3); font-size: 11px; margin-bottom: 10px; letter-spacing: 0.05em; }
.tx-side-item { display: block; color: var(--fg-2); padding: 4px 0; font-size: 12px; cursor: pointer; }
.tx-side-item.on { color: var(--accent); }
.tx-side-item::before { content: "» "; opacity: 0.5; }
.tx-side-item:hover { color: var(--fg-0); }
.tx-side-stats { color: var(--fg-2); font-size: 11px; line-height: 1.8; }
.tx-side-stats .v { color: var(--fg-0); }
.tx-side-stats .cy { color: var(--accent); }

.tx-main { padding: 24px 28px; background: var(--bg-1); }
@media (max-width: 900px) { .tx-main { padding: 12px 0; } }

/* ----- prompt ----- */
.tx-prompt { color: var(--fg-3); margin-bottom: 16px; font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tx-prompt .p { color: var(--accent); }
.tx-prompt .arg { color: var(--fg-1); }
@keyframes tx-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.tx-caret { display: inline-block; width: 7px; height: 14px; background: var(--accent); vertical-align: -2px; margin-left: 4px; animation: tx-blink 1.1s steps(1) infinite; }

/* ----- headlines (sans, like 03b) ----- */
.tx-h1 {
  font-family: var(--font-sans); font-size: 64px; line-height: 1.0;
  letter-spacing: -0.04em; font-weight: 600; color: var(--fg-0);
  margin: 12px 0 24px; max-width: 920px;
}
.tx-h1 .accent { color: var(--accent); }
.tx-h2 {
  font-family: var(--font-sans); font-size: 40px; line-height: 1.05;
  letter-spacing: -0.03em; font-weight: 600; color: var(--fg-0);
  margin: 0 0 16px; max-width: 820px;
}
.tx-h3 {
  font-family: var(--font-sans); font-size: 22px; line-height: 1.15;
  letter-spacing: -0.02em; font-weight: 600; color: var(--fg-0);
  margin: 0 0 8px;
}
.tx-lede { color: var(--fg-1); font-family: var(--font-sans); font-size: 17px; line-height: 1.55; letter-spacing: -0.011em; max-width: 640px; margin-bottom: 28px; }
.tx-body { color: var(--fg-1); font-family: var(--font-sans); font-size: 15px; line-height: 1.6; letter-spacing: -0.005em; max-width: 640px; margin: 0 0 16px; }
.tx-sub { color: var(--fg-2); font-family: var(--font-sans); font-size: 16px; line-height: 1.55; max-width: 600px; margin: 0; letter-spacing: -0.005em; }

/* ----- buttons ----- */
.tx-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--bg-0); background: var(--accent); border: 0; border-radius: var(--radius);
  transition: background 120ms;
}
.tx-cta:hover { background: var(--accent-dim); }
.tx-cta.ghost { background: transparent; color: var(--fg-0); border: 1px solid var(--line); }
.tx-cta.ghost:hover { border-color: var(--fg-2); color: var(--fg-0); }
.tx-cta::before { content: ">"; opacity: 0.7; }
.tx-cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }

/* ----- card primitives ----- */
.tx-card {
  border: 1px solid var(--line);
  background: var(--bg-2);
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
}
.tx-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  color: var(--fg-2); font-size: 11px;
  background: var(--bg-3);
}
.tx-card-head .right { color: var(--accent); }
.tx-card-head .right.muted { color: var(--fg-2); }
.tx-card-body { padding: 14px 16px; }
.tx-card-body.tight { padding: 0; }
.tx-card-body.wide { padding: 20px 22px; }

/* ----- log feed ----- */
.tx-log-row { display: grid; grid-template-columns: 88px 80px 1fr; gap: 14px; padding: 4px 0; font-size: 12px; color: var(--fg-1); }
.tx-log-time { color: var(--fg-3); }
.tx-log-tag { color: var(--accent); }
.tx-log-tag.warn { color: var(--warn); }
.tx-log-tag.err  { color: var(--err); }
.tx-log-tag.info { color: var(--info); }
.tx-log-tag.scada{ color: var(--magenta); }

/* ----- 3-col stack ----- */
.tx-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 800px) { .tx-stack { grid-template-columns: 1fr; } }
.tx-stack-cell {
  border-right: 1px solid var(--line-soft); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.tx-stack-cell:last-child { border-right: 0; }
@media (max-width: 800px) { .tx-stack-cell { border-right: 0; border-bottom: 1px solid var(--line-soft); } .tx-stack-cell:last-child { border-bottom: 0; } }
.tx-stack-n { color: var(--accent); font-size: 11px; }
.tx-stack-title { font-family: var(--font-sans); font-size: 17px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-0); }
.tx-stack-body { color: var(--fg-2); font-family: var(--font-sans); font-size: 13px; line-height: 1.55; letter-spacing: -0.005em; }

/* ----- KPI strip ----- */
.tx-kpi { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .tx-kpi { grid-template-columns: 1fr 1fr; } }
.tx-kpi > div { padding: 14px 18px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.tx-kpi > div:last-child { border-right: 0; }
@media (max-width: 800px) {
  .tx-kpi > div:nth-child(2) { border-right: 0; }
  .tx-kpi > div:nth-last-child(-n+2) { border-bottom: 0; }
}
.tx-kpi .v { font-family: var(--font-sans); font-size: 28px; font-weight: 600; letter-spacing: -0.025em; color: var(--fg-0); line-height: 1; }
.tx-kpi .l { color: var(--fg-3); font-size: 11px; margin-top: 6px; }
.tx-kpi .v.cyan { color: var(--accent); }

/* ----- sensor / generic data list ----- */
.tx-sensor-grid { padding: 0; }
.tx-sensor-row {
  display: grid; grid-template-columns: 30px 1fr 90px 80px;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.tx-sensor-row:last-child { border-bottom: 0; }
.tx-sensor-row .id { color: var(--fg-3); }
.tx-sensor-row .name { color: var(--fg-1); }
.tx-sensor-row .count { color: var(--accent); text-align: right; }
.tx-sensor-row .state { color: var(--fg-2); text-align: right; }

/* ----- pipeline (vertical timeline) ----- */
.tx-pipe { padding: 8px 0; }
.tx-pipe-row {
  display: grid; grid-template-columns: 80px 24px 1fr auto; gap: 14px;
  padding: 12px 16px; align-items: start;
}
.tx-pipe-row + .tx-pipe-row { border-top: 1px solid var(--line-soft); }
.tx-pipe-t { color: var(--accent); font-size: 11px; padding-top: 3px; }
.tx-pipe-axis { display: flex; flex-direction: column; align-items: center; padding-top: 5px; }
.tx-pipe-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 99px; }
.tx-pipe-v { width: 1px; flex: 1; background: var(--line); min-height: 28px; margin-top: 4px; }
.tx-pipe-title { font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg-0); margin: 0 0 4px; }
.tx-pipe-body { color: var(--fg-2); font-family: var(--font-sans); font-size: 13px; line-height: 1.5; }
.tx-pipe-val { color: var(--accent); font-size: 11px; }

/* ----- horizontal flow ----- */
.tx-flow { display: grid; grid-template-columns: repeat(5, 1fr); padding: 16px; gap: 0; }
@media (max-width: 900px) { .tx-flow { grid-template-columns: 1fr 1fr; } }
.tx-flow-cell {
  padding: 12px 14px; border-right: 1px solid var(--line-soft); position: relative;
}
.tx-flow-cell:last-child { border-right: 0; }
.tx-flow-cell::after {
  content: "▶"; color: var(--accent); font-size: 9px;
  position: absolute; right: -7px; top: 18px; background: var(--bg-2); padding: 0 2px;
}
.tx-flow-cell:last-child::after { display: none; }
.tx-flow-n { color: var(--accent); font-size: 10px; }
.tx-flow-s { font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg-0); margin-top: 4px; }
.tx-flow-v { color: var(--fg-2); font-size: 11px; margin-top: 4px; }

/* ----- table ----- */
.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th, .tx-table td { text-align: left; padding: 10px 14px; font-size: 12px; }
.tx-table thead th {
  background: var(--bg-3); color: var(--fg-3);
  border-bottom: 1px solid var(--line);
  font-weight: 500; letter-spacing: 0.05em; font-size: 10px;
}
.tx-table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
.tx-table td.id { color: var(--accent); width: 80px; }
.tx-table td.name { color: var(--fg-0); font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.005em; font-size: 13px; }
.tx-table td.val { color: var(--fg-1); }
.tx-table td.note { color: var(--fg-3); }

/* ----- two-col layout (split) ----- */
.tx-split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .tx-split { grid-template-columns: 1fr; } }
.tx-split .tx-card { margin-bottom: 0; }

/* ----- vertical layers (technology) ----- */
.tx-layers { padding: 0; }
.tx-layer {
  display: grid; grid-template-columns: 70px 1fr;
  padding: 22px 18px; gap: 24px; border-bottom: 1px solid var(--line-soft);
  align-items: start;
}
.tx-layer:last-child { border-bottom: 0; }
.tx-layer-n {
  font-family: var(--font-sans); font-size: 28px; font-weight: 600;
  letter-spacing: -0.03em; color: var(--accent); line-height: 1;
}
.tx-layer-title { font-family: var(--font-sans); font-size: 20px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-0); margin: 0 0 6px; }
.tx-layer-body { color: var(--fg-2); font-family: var(--font-sans); font-size: 14px; line-height: 1.55; max-width: 620px; margin: 0 0 12px; }
.tx-layer-specs { display: flex; flex-wrap: wrap; gap: 8px; }
.tx-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 99px;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-1);
  background: var(--bg-1);
}

/* ----- pillars (3-col with phase headers) ----- */
.tx-phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 900px) { .tx-phases { grid-template-columns: 1fr; } }
.tx-phase { padding: 18px 18px; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.tx-phase:last-child { border-right: 0; }
.tx-phase-head { display: flex; align-items: center; gap: 10px; }
.tx-phase-tag { font-size: 10px; color: var(--accent); border: 1px solid var(--accent); padding: 2px 8px; border-radius: 99px; }
.tx-phase-weeks { font-size: 11px; color: var(--fg-3); }
.tx-phase-title { font-family: var(--font-sans); font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-0); margin: 0; }
.tx-phase-body { color: var(--fg-2); font-family: var(--font-sans); font-size: 13px; line-height: 1.55; margin: 0; }

/* ----- vertical / use-case grid ----- */
.tx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 800px) { .tx-grid-2 { grid-template-columns: 1fr; } }
.tx-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 800px) { .tx-grid-3 { grid-template-columns: 1fr; } }
.tx-tile {
  padding: 18px 18px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 8px;
  transition: background 120ms;
  text-decoration: none; color: inherit;
}
.tx-tile:hover { background: var(--bg-3); }
.tx-grid-3 .tx-tile:nth-child(3n) { border-right: 0; }
.tx-grid-3 .tx-tile:nth-last-child(-n+3) { border-bottom: 0; }
.tx-grid-2 .tx-tile:nth-child(2n) { border-right: 0; }
.tx-grid-2 .tx-tile:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 800px) {
  .tx-tile { border-right: 0 !important; }
  .tx-tile:last-child { border-bottom: 0 !important; }
}
.tx-tile-i { color: var(--accent); font-size: 10px; letter-spacing: 0.06em; }
.tx-tile-title { font-family: var(--font-sans); font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-0); margin: 2px 0; }
.tx-tile-body { color: var(--fg-2); font-family: var(--font-sans); font-size: 13px; line-height: 1.55; margin: 0; flex: 1; }
.tx-tile-cta { color: var(--accent); font-size: 11px; padding-top: 8px; }

/* ----- form ----- */
.tx-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  padding: 4px 0 0;
}
.tx-field { display: flex; flex-direction: column; gap: 6px; }
.tx-field.full { grid-column: 1 / -1; }
.tx-field-label { font-size: 11px; color: var(--fg-3); letter-spacing: 0.05em; }
.tx-field-label::before { content: "$ "; color: var(--accent); }
.tx-input {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px; color: var(--fg-0);
  transition: border-color 120ms, box-shadow 120ms;
  outline: none;
}
.tx-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tx-input::placeholder { color: var(--fg-3); }
textarea.tx-input { min-height: 100px; resize: vertical; font-family: var(--font-mono); }

/* ----- channels list ----- */
.tx-channels { padding: 0; }
.tx-channel-row {
  display: grid; grid-template-columns: 160px 1fr;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.tx-channel-row:last-child { border-bottom: 0; }
.tx-channel-row .l { color: var(--fg-3); font-size: 11px; letter-spacing: 0.05em; padding-top: 2px; }
.tx-channel-row .v { color: var(--accent); font-family: var(--font-mono); }

/* ----- pill / chip ----- */
.tx-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-2);
  background: var(--bg-1);
}
.tx-pill .dot { width: 5px; height: 5px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 2px rgba(125,211,192,.18); }

/* ----- footer ----- */
.tx-footer {
  max-width: 1320px; margin: 0 auto; padding: 0 20px 32px;
  background: var(--bg-0);
}
.tx-footer-frame {
  border: 1px solid var(--line); background: var(--bg-1);
  border-radius: var(--radius);
}
.tx-footer-cols {
  display: grid; grid-template-columns: 1.6fr 1fr 1.4fr 1fr;
  gap: 0;
}
@media (max-width: 800px) { .tx-footer-cols { grid-template-columns: 1fr 1fr; } }
.tx-footer-col {
  padding: 20px 18px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.tx-footer-col:last-child { border-right: 0; }
.tx-foot-h { font-size: 10px; color: var(--fg-3); letter-spacing: 0.08em; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px dashed var(--line-soft); }
.tx-foot-big { font-family: var(--font-sans); font-weight: 600; font-size: 18px; letter-spacing: -0.015em; color: var(--fg-0); }
.tx-foot-tag { font-family: var(--font-sans); font-size: 13px; color: var(--fg-2); margin-top: 4px; max-width: 240px; line-height: 1.5; }
.tx-foot-link { font-size: 12px; color: var(--fg-2); padding: 3px 0; }
.tx-foot-link:hover { color: var(--accent); }
.tx-footer-legal {
  border-top: 1px solid var(--line); padding: 10px 18px;
  display: flex; justify-content: space-between;
  background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius);
  font-size: 10px; color: var(--fg-3); letter-spacing: 0.05em;
}
@media (max-width: 700px) { .tx-footer-legal { flex-direction: column; gap: 4px; } }

/* ----- breadcrumb ----- */
.tx-crumb {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-3);
  margin-bottom: 12px;
}
.tx-crumb a { color: var(--fg-2); }
.tx-crumb a:hover { color: var(--accent); }
.tx-crumb .sep { color: var(--line); margin: 0 8px; }
