:root {
  --toyota-red: #EB0A1E;
  --toyota-dark: #1a1a1a;
  --toyota-gray: #58595B;
  --bg: #f5f5f6;
  --card: #ffffff;
  --line: #e3e4e6;
  --ok: #1c8a4c;
  --amber: #b57d00;
  --blue: #0f6cbd;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--toyota-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  background: #fff;
  border-bottom: 3px solid var(--toyota-red);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 16px; }
/* The wordmark asset is tightly cropped (no baked-in margin), so it is sized by
   its own height rather than a padded box. 19px matches the TRIBE hub nav. */
.logo { height: 19px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.brand-sub { font-size: 12px; color: var(--toyota-gray); }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--toyota-gray);
  background: #f0f0f1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.step .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #d9d9db; color: #555;
  font-size: 11px; font-weight: 700;
}
.step.active { background: var(--toyota-dark); color: #fff; }
.step.active .step-num { background: var(--toyota-red); color: #fff; }
.step.done { color: var(--ok); background: #eaf6ef; }
.step.done .step-num { background: var(--ok); color: #fff; }

/* ---------- Stage ---------- */
/* No bottom padding for the fixed control bar here; .sitefoot below carries it,
   because it is the last thing in the document. */
.stage-wrap { flex: 1; display: flex; justify-content: center; padding: 28px 24px 8px; }
.stage { width: 100%; max-width: 1060px; animation: fadeIn .35s ease; }

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

.slide-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.slide-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--toyota-red); margin-bottom: 10px;
}
.slide-sub { font-size: 15px; color: var(--toyota-gray); margin-bottom: 24px; max-width: 760px; line-height: 1.55; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h3 { font-size: 15px; margin-bottom: 10px; }
.card p { font-size: 14px; line-height: 1.6; color: #333; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.phase-card { border-top: 4px solid var(--toyota-gray); }
.phase-card.inception { border-top-color: var(--blue); }
.phase-card.construction { border-top-color: var(--ok); }
.phase-card.operations { border-top-color: var(--amber); }
.phase-card .phase-tag { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; display: block; }
.phase-card.inception .phase-tag { color: var(--blue); }
.phase-card.construction .phase-tag { color: var(--ok); }
.phase-card.operations .phase-tag { color: var(--amber); }
.phase-card ul { margin: 8px 0 0 18px; font-size: 13.5px; line-height: 1.7; color: #444; }

/* ---------- Chat mock ---------- */
.chat {
  background: #1e1f22;
  border-radius: 12px;
  padding: 18px;
  font-size: 13.5px;
  color: #e8e8ea;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.chat-header {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid #35363a;
  color: #9a9ba1; font-size: 12px; font-weight: 600;
}
.chat-dot { width: 10px; height: 10px; border-radius: 50%; }
.chat-dot.r { background: #ff5f57; } .chat-dot.y { background: #febc2e; } .chat-dot.g { background: #28c840; }
.chat-title { margin-left: 8px; }

.msg { display: flex; gap: 12px; margin-bottom: 16px; opacity: 0; transform: translateY(8px); animation: msgIn .4s ease forwards; }
.msg:nth-child(2) { animation-delay: .15s; }
.msg:nth-child(3) { animation-delay: .45s; }
.msg:nth-child(4) { animation-delay: .8s; }
.msg:nth-child(5) { animation-delay: 1.1s; }
.msg:nth-child(6) { animation-delay: 1.4s; }
@keyframes msgIn { to { opacity: 1; transform: none; } }

.avatar {
  flex: 0 0 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.avatar.user { background: var(--toyota-red); color: #fff; }
.avatar.ai { background: #3b3d42; color: #7fd1ff; }
.msg-body { flex: 1; line-height: 1.6; }
.msg-name { font-size: 11px; font-weight: 700; color: #8b8c92; margin-bottom: 4px; }
.msg-text code { font-family: var(--mono); background: #2c2d31; padding: 1px 6px; border-radius: 4px; font-size: 12px; color: #ffd479; }
.msg-text strong { color: #fff; }
.msg-text ul { margin: 6px 0 0 18px; }
.msg-text li { margin-bottom: 3px; }

/* ---------- File tree / code ---------- */
.filetree {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #1e1f22;
  color: #d6d7dc;
  border-radius: 12px;
  padding: 18px 20px;
  line-height: 1.85;
  overflow-x: auto;
  white-space: pre;
}
.filetree .dir { color: #7fd1ff; font-weight: 700; }
.filetree .new { color: #7ee08a; }
.filetree .cm { color: #6e6f76; }

.doc {
  font-size: 13.5px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--toyota-red);
  border-radius: 10px;
  padding: 18px 20px;
  line-height: 1.65;
}
.doc h4 { font-size: 14px; margin: 0 0 8px; }
.doc h5 { font-size: 12.5px; margin: 12px 0 4px; color: var(--toyota-gray); text-transform: uppercase; letter-spacing: .06em; }
.doc ul, .doc ol { margin: 4px 0 8px 20px; }
.doc li { margin-bottom: 3px; }
.doc .ears { font-family: var(--mono); font-size: 12px; background: #f6f6f7; border-radius: 6px; padding: 8px 10px; display: block; margin: 6px 0; }
.doc .ears b { color: var(--toyota-red); }

/* ---------- Decision gate ---------- */
.gate {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 14px;
}
.gate-q {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14px;
  background: #fafafa;
  border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center;
}
.gate-q .qnum {
  background: var(--toyota-dark); color: #fff;
  border-radius: 6px; padding: 2px 8px; font-size: 11px;
}
.gate-opts { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13.5px;
  transition: all .15s ease;
  background: #fff;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.opt:hover { border-color: #bbb; }
.opt.selected { border-color: var(--toyota-red); background: #fff5f6; }
.opt .radio {
  flex: 0 0 16px; height: 16px; margin-top: 2px;
  border: 2px solid #c6c7c9; border-radius: 50%;
  transition: all .15s ease;
}
.opt.selected .radio { border-color: var(--toyota-red); box-shadow: inset 0 0 0 4px var(--toyota-red); }
.opt .opt-label b { display: block; margin-bottom: 2px; }
.opt .opt-label span { color: var(--toyota-gray); font-size: 12.5px; }
.opt .rec {
  margin-left: auto; align-self: center; flex-shrink: 0;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  color: var(--ok); background: #eaf6ef; border-radius: 999px; padding: 3px 9px;
}

.gate-hint { font-size: 12.5px; color: var(--toyota-gray); margin: 6px 2px 14px; }

/* ---------- Plan / checklist ---------- */
.plan { list-style: none; }
.plan li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.plan li:last-child { border-bottom: none; }
.plan .tick {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  background: #ececee; color: #999;
}
.plan li.done .tick { background: var(--ok); color: #fff; }
.plan li.active-item .tick { background: var(--toyota-red); color: #fff; animation: pulse 1.4s infinite; }
.plan li.skipped { opacity: .5; }
.plan li.skipped .tick { background: #f2f2f3; }
.plan .why { margin-left: auto; font-size: 11.5px; color: var(--toyota-gray); font-style: italic; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(235,10,30,.35); }
  50% { box-shadow: 0 0 0 7px rgba(235,10,30,0); }
}

/* ---------- Badges & misc ---------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 3px 10px; letter-spacing: .04em;
}
.badge.blue { background: #e7f1fb; color: var(--blue); }
.badge.green { background: #eaf6ef; color: var(--ok); }
.badge.amber { background: #fbf3df; color: var(--amber); }
.badge.red { background: #fdecee; color: var(--toyota-red); }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--toyota-gray); font-weight: 600; }
.kv dd { color: #222; }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff8f8;
  border: 1px solid #f5c9cd;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.callout .ico { font-size: 18px; }

.progressbar {
  height: 8px; background: #ececee; border-radius: 999px; overflow: hidden; margin: 10px 0 4px;
}
.progressbar > div {
  height: 100%; background: linear-gradient(90deg, var(--toyota-red), #ff5b6b);
  border-radius: 999px; transition: width 1.2s ease;
}
.progress-label { font-size: 12px; color: var(--toyota-gray); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 44px 20px 26px; }
.hero .logo-big { height: 44px; width: auto; margin-bottom: 26px; }
.hero h1 { font-size: 38px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 12px; }
.hero h1 .accent { color: var(--toyota-red); }
.hero p { font-size: 16px; color: var(--toyota-gray); max-width: 640px; margin: 0 auto 26px; line-height: 1.6; }
.hero .meta {
  display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}

/* ---------- Site footer ---------- */
/* The bottom padding clears the fixed control bar, so the last line of the
   disclaimer is readable once scrolled to the end. */
.sitefoot { padding: 0 24px 108px; }
.sitefoot p {
  max-width: 1060px;
  margin: 0 auto;
  font-size: 11.5px;
  line-height: 1.6;
  color: #8b8c92;
}

/* ---------- Footer controls ---------- */
.controls {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 30;
}

.btn {
  font-family: inherit;
  font-size: 14px; font-weight: 700;
  border-radius: 10px;
  padding: 11px 22px;
  cursor: pointer;
  border: none;
  transition: all .15s ease;
}
.btn-primary { background: var(--toyota-red); color: #fff; }
.btn-primary:hover { background: #c70918; }
.btn-primary:disabled { background: #e9a4ab; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--toyota-gray); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: #bbb; color: #222; }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d6d7d9; transition: all .2s; cursor: pointer; }
.dot.on { background: var(--toyota-red); transform: scale(1.25); }

/* ---------- Terminal ---------- */
.terminal {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #0f1012;
  color: #c9cacf;
  border-radius: 12px;
  padding: 16px 18px;
  line-height: 1.8;
  overflow-x: auto;
}
.terminal .prompt { color: #7ee08a; }
.terminal .cmd { color: #fff; }
.terminal .out { color: #9a9ba1; }
.terminal .hl { color: #ffd479; }

.footnote { font-size: 11.5px; color: #9a9ba1; margin-top: 18px; text-align: center; }
.footnote a { color: var(--toyota-gray); }

/* ---------- Kiro IDE frame ---------- */
.ide {
  background: #17181b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  font-size: 12.5px;
  color: #d6d7dc;
  border: 1px solid #2a2b30;
}
.ide-titlebar {
  display: flex; align-items: center; gap: 10px;
  background: #202126;
  padding: 8px 14px;
  border-bottom: 1px solid #2a2b30;
  font-size: 11.5px; color: #9a9ba1; font-weight: 600;
}
.ide-titlebar .navarr { color: #6e6f76; letter-spacing: 4px; margin-left: 8px; }
.ide-titlebar .searchbox {
  flex: 1; max-width: 420px; margin: 0 auto;
  background: #2a2b31; border: 1px solid #35363c; border-radius: 6px;
  text-align: center; padding: 4px 12px; color: #9a9ba1; font-weight: 500;
}
.ide-titlebar .agent-focus { display: flex; align-items: center; gap: 6px; color: #b9bac0; font-size: 11px; }
.ide-body { display: flex; min-height: 500px; align-items: stretch; }
.ide-activity {
  flex: 0 0 44px;
  background: #1c1d21;
  border-right: 1px solid #2a2b30;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; gap: 15px;
  font-size: 16px;
}
.ide-activity .k-logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #7b5cff, #b18cff);
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans);
}
.ide-activity span { opacity: .45; }
.ide-activity span.on { opacity: 1; border-left: 2px solid #fff; padding-left: 7px; margin-left: -9px; }
.ide-activity .spacer { flex: 1; }
.ide-explorer {
  flex: 0 0 205px;
  background: #1a1b1f;
  border-right: 1px solid #2a2b30;
  padding: 10px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.95;
  white-space: pre;
  overflow-x: auto;
}
.ide-explorer .hd {
  font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .1em;
  color: #8b8c92; margin-bottom: 6px;
}
.ide-explorer .dir { color: #7fd1ff; }
.ide-explorer .new { color: #7ee08a; }
.ide-explorer .sel { background: #2c2d33; border-radius: 4px; padding: 1px 4px; margin-left: -4px; }
.ide-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ide-tabs {
  display: flex; background: #1c1d21; border-bottom: 1px solid #2a2b30;
}
.ide-tab {
  font-family: var(--mono); font-size: 11px;
  padding: 9px 16px; color: #8b8c92;
  border-right: 1px solid #2a2b30;
}
.ide-tab.on { background: #17181b; color: #e8e8ea; border-top: 2px solid #b18cff; padding-top: 7px; }
.ide-editor {
  flex: 1; padding: 16px 18px;
  font-family: var(--mono); font-size: 12px; line-height: 1.8;
  overflow: auto;
}
.ide-editor .cm { color: #6e6f76; }
.ide-editor .kw { color: #c792ea; }
.ide-editor .st { color: #a5d6a7; }
.ide-editor .fn { color: #82aaff; }
.ide-editor .h { color: #ffd479; font-weight: 700; }
.ide-editor pre { font-family: inherit; white-space: pre; }

/* Kiro chat panel */
.ide-chat {
  flex: 0 0 340px;
  background: #1e1f24;
  border-left: 1px solid #2a2b30;
  display: flex; flex-direction: column;
}
.ide-chat-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid #2a2b30;
  font-size: 11px; font-weight: 600; color: #c9cacf;
}
.ide-chat-hd .tab-title { border-bottom: 1px solid #b18cff; padding-bottom: 6px; margin-bottom: -10px; }
.ide-chat-hd .x { color: #6e6f76; }
.ide-chat-body { flex: 1; padding: 14px; overflow: auto; }

.kchat-user {
  background: #2c2d33; color: #e8e8ea;
  border-radius: 10px; padding: 9px 13px;
  font-size: 12px; line-height: 1.55;
  margin: 0 0 14px 34px;
}
.kchat-kiro { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kchat-kiro .k-av {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #7b5cff, #b18cff);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 800;
}
.kchat-kiro b { font-size: 12.5px; color: #fff; }
.kchat-text { font-size: 12px; line-height: 1.65; color: #c9cacf; margin-bottom: 12px; }
.kchat-text code { font-family: var(--mono); background: #2c2d31; padding: 1px 6px; border-radius: 4px; font-size: 11px; color: #ffd479; }
.kchat-text strong { color: #fff; }
.ktool {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #9a9ba1; font-weight: 600;
  margin: 10px 0; cursor: default;
}
.ktool::before { content: "›"; color: #6e6f76; font-size: 14px; }
.kmeta {
  display: flex; gap: 16px; font-size: 11px; color: #8b8c92;
  padding: 8px 0; margin-bottom: 6px;
}
.kcheckpoint {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; color: #8b8c92;
  margin: 10px 0;
}
.kcheckpoint::after { content: ""; flex: 1; border-top: 1px dashed #35363c; }
.kcheckpoint .restore { color: #b9bac0; }
.kfiles {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid #35363c; border-radius: 8px;
  padding: 8px 12px; margin: 6px 14px;
  font-size: 11px; color: #c9cacf;
}
.kfiles .view { margin-left: auto; color: #8ab4ff; }
.kfiles .revert { color: #ff8a94; }
.ide-chat-input {
  margin: 8px 14px 12px;
  border: 1px solid #35363c; border-radius: 10px;
  background: #23242a;
  padding: 10px 12px 8px;
  font-size: 11.5px; color: #6e6f76;
}
.ide-chat-input .input-row2 {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; font-size: 10.5px; color: #8b8c92;
}
.ide-chat-input .autopilot { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: #b9bac0; }
.ide-chat-input .toggle {
  width: 26px; height: 14px; border-radius: 999px; background: #7b5cff; position: relative; display: inline-block;
}
.ide-chat-input .toggle::after {
  content: ""; position: absolute; right: 2px; top: 2px;
  width: 10px; height: 10px; border-radius: 50%; background: #fff;
}
.ide-status {
  display: flex; align-items: center; gap: 16px;
  background: #202126;
  border-top: 1px solid #2a2b30;
  padding: 6px 14px;
  font-size: 10.5px; color: #8b8c92;
}
.ide-status .red-item { color: #ff8a94; }
.ide-status .ok-item { color: #7ee08a; }
.ide-status .right { margin-left: auto; display: flex; gap: 14px; }

/* interactive question lines inside IDE editor */
.gate.ide-gate { border: none; background: transparent; margin: 0 0 14px; }
.gate.ide-gate .gate-q {
  background: transparent; border: none; padding: 0 0 6px;
  color: #ffd479; font-family: var(--mono); font-size: 12px;
}
.gate.ide-gate .gate-q .qnum { background: #35363c; color: #ffd479; }
.gate.ide-gate .gate-opts { padding: 0; gap: 3px; }
.opt.qline {
  border: 1px solid transparent; background: transparent;
  border-radius: 6px; padding: 5px 8px;
  font-family: var(--mono); font-size: 12px; color: #c9cacf;
  gap: 8px; align-items: flex-start;
}
.opt.qline:hover { background: #23242a; border-color: #35363c; }
.opt.qline.selected { background: #2b1d20; border-color: var(--toyota-red); color: #fff; }
.opt.qline .box { color: #6e6f76; flex-shrink: 0; white-space: nowrap; }
.opt.qline .box::before { content: "[ ]"; }
.opt.qline.selected .box::before { content: "[x]"; }
.opt.qline.selected .box { color: #ff5b6b; font-weight: 700; }
.opt.qline .rec { background: #1e3327; color: #7ee08a; }

