/* GridShift - carbon & cost-aware scheduling for flexible AI compute */

:root {
  --bg: #0b0f17;
  --bg-raised: #111726;
  --bg-inset: #0e1420;
  --line: #1e2637;
  --line-soft: #182031;
  --text: #e8edf6;
  --text-muted: #98a4bb;
  --text-dim: #6b7891;
  --accent: #4b8bff;
  --accent-soft: rgba(75, 139, 255, 0.14);
  --carbon: #34d399;
  --cost: #f0a840;
  --oracle: #a78bfa;
  --danger: #f4696b;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 15, 23, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(140deg, var(--accent), var(--carbon));
  display: inline-block;
}
.topnav { display: flex; gap: 20px; margin-left: auto; font-size: 13.5px; }
.topnav a { color: var(--text-muted); }
.topnav a:hover { color: var(--text); text-decoration: none; }

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

.hero { padding: 72px 0 44px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(900px 340px at 12% -10%, rgba(75,139,255,0.14), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
h1 {
  font-size: clamp(34px, 5.2vw, 54px); line-height: 1.08; margin: 0 0 14px;
  letter-spacing: -0.028em; font-weight: 680;
}
.hero-sub { font-size: clamp(17px, 2.2vw, 21px); color: var(--text); max-width: 720px; margin: 0 0 14px; font-weight: 500; }
.hero-copy { color: var(--text-muted); max-width: 680px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 550;
  border: 1px solid var(--line); background: var(--bg-raised); color: var(--text); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: #33405a; background: #141b2b; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04101f; }
.btn-primary:hover { background: #5d98ff; border-color: #5d98ff; }

/* ---------- metric cards ---------- */

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.metric {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px;
}
.metric-value { font-size: 27px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-label { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.metric-note { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; font-family: var(--mono); }
.metric.good .metric-value { color: var(--carbon); }
.metric.bad .metric-value { color: var(--danger); }
.metric.neutral .metric-value { color: var(--text); }

/* ---------- sections ---------- */

section { padding: 64px 0; border-bottom: 1px solid var(--line-soft); }
.section-head { margin-bottom: 28px; max-width: 760px; }
.section-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 10px;
}
h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 10px; letter-spacing: -0.02em; font-weight: 640; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.lede { color: var(--text-muted); margin: 0; }

.card {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-dim); font-weight: 550; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
td { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
td:first-child { font-family: var(--sans); font-size: 13.5px; white-space: normal; }
tr.is-winner td { background: rgba(52, 211, 153, 0.07); }
tr.is-winner td:first-child { font-weight: 600; color: var(--carbon); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  font-family: var(--mono); border: 1px solid var(--line); color: var(--text-muted);
}
.badge.win { border-color: rgba(52,211,153,.4); color: var(--carbon); background: rgba(52,211,153,.08); }

/* ---------- controls ---------- */

.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.control label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 7px; }
select, input[type="range"] {
  width: 100%; background: var(--bg-inset); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13.5px; font-family: var(--sans);
}
input[type="range"] { padding: 0; height: 26px; accent-color: var(--accent); }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  flex: 1; background: var(--bg-inset); border: 0; color: var(--text-muted); padding: 8px 6px;
  font-size: 13px; cursor: pointer; font-family: var(--sans); transition: background .15s ease;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); font-weight: 570; }
.slider-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-dim); margin-top: 4px; font-family: var(--mono); }

/* ---------- charts ---------- */

.chart { width: 100%; display: block; }
.chart-wrap { background: var(--bg-inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch.box { height: 10px; width: 10px; border-radius: 2px; }

/* ---------- result panel ---------- */

.result { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.result-item { background: var(--bg-inset); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 14px; }
.result-item .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.result-item .v { font-size: 20px; font-weight: 620; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.result-item .s { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; font-family: var(--mono); }
.v.up { color: var(--danger); }
.v.down { color: var(--carbon); }

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

.pipe { display: grid; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.pipe-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.node {
  border: 1px solid var(--line); background: var(--bg-inset); border-radius: var(--radius-sm);
  padding: 9px 13px; color: var(--text-muted); text-align: center;
}
.node.hi { border-color: rgba(75,139,255,.45); color: var(--text); background: var(--accent-soft); }
.node.green { border-color: rgba(52,211,153,.35); color: var(--carbon); }
.arrow { text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1; }

/* ---------- misc ---------- */

.note {
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px; color: var(--text-muted);
}
.note.warn { border-left-color: var(--cost); background: rgba(240,168,64,.08); }
ul.clean { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; }
ul.clean li { margin-bottom: 7px; }
.kv { font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); }
.kv b { color: var(--text); font-weight: 550; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-inset); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }

footer { padding: 40px 0 60px; color: var(--text-dim); font-size: 13px; }
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }

.loading { color: var(--text-dim); font-family: var(--mono); font-size: 13px; }

@media (max-width: 640px) {
  .topnav { display: none; }
  section { padding: 44px 0; }
  .hero { padding: 48px 0 32px; }
  th, td { padding: 8px 9px; }
}
