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

:root {
  --bg: #080b12;
  --surface: #111622;
  --elevated: #171e2e;
  --border: #263147;
  --text: #e9eef8;
  --muted: #9aa7c0;
  --crypt: #f59e0b;
  --crypt-teal: #2dd4bf;
  --bastion: #22d3ee;
  --kiro: #8b5cf6;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 0%, rgba(139, 92, 246, 0.14), transparent 42%),
              radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.12), transparent 42%),
              var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--bastion);
  outline-offset: 2px;
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

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

.hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 22, 34, 0.9), rgba(8, 11, 18, 0.6));
  padding: 28px 0 24px;
}

.hero-inner { display: flex; flex-direction: column; gap: 14px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.pill-accent { border-color: rgba(139, 92, 246, 0.65); background: rgba(139, 92, 246, 0.18); color: #ddd6fe; }
.pill-repo { text-decoration: none; color: #e9eef8; border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.12); }
.pill-repo:hover { background: rgba(34, 211, 238, 0.22); }

.title-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mascot {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: 0 0 auto;
}
.mascot-crypt { filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.45)); }
.mascot-bastion { filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.45)); }

.title-cluster h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  max-width: 78ch;
  color: var(--muted);
  font-size: 15px;
}

.arch-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.arch-node {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}
.arch-node strong {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: #f8fafc;
}
.arch-node span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.arch-arrow {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  color: var(--kiro);
}

/* ---------- world cards ---------- */

.worlds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 24px 0;
}

.world-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .world-card { transition: transform 0.2s ease, border-color 0.2s ease; }
  .world-card:hover { transform: translateY(-2px); }
}

.world-crypt { border-top: 3px solid var(--crypt); }
.world-crypt:hover { border-color: rgba(245, 158, 11, 0.7); }
.world-bastion { border-top: 3px solid var(--bastion); }
.world-bastion:hover { border-color: rgba(34, 211, 238, 0.7); }

.card-head { display: flex; align-items: center; gap: 12px; }
.card-head img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.world-kicker {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.world-crypt .world-kicker { color: var(--crypt); }
.world-bastion .world-kicker { color: var(--bastion); }
.card-head h2 { margin: 2px 0 0; font-size: 21px; line-height: 1.2; }

.shot-link { display: block; text-decoration: none; color: inherit; }
.shot-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--elevated);
  display: grid;
  place-items: center;
}
.shot-frame img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shot-fallback {
  position: absolute;
  z-index: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.world-desc { margin: 0; font-size: 13.5px; color: var(--muted); }

.feature-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #cbd5e1;
}

.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #080b12;
}
.cta-crypt { background: var(--crypt); }
.cta-bastion { background: var(--bastion); }
.cta-boss {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
}
.cta-boss-crypt { color: #fcd34d; border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.12); }
.cta-boss-crypt:hover { background: rgba(245, 158, 11, 0.22); }
.cta-boss-bastion { color: #f9a8d4; border-color: rgba(236, 72, 153, 0.6); background: rgba(236, 72, 153, 0.12); }
.cta-boss-bastion:hover { background: rgba(236, 72, 153, 0.22); }

.cta-sub {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cta-sub:hover { color: var(--text); border-color: #475569; }

/* ---------- skeleton crew reuse comparison ---------- */

.reuse {
  padding: 18px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.reuse-head h2 { margin: 2px 0 4px; font-size: 20px; }
.reuse-head p { margin: 0; font-size: 13px; color: var(--muted); max-width: 80ch; }
.reuse-head .world-kicker { color: #c4b5fd; }

.reuse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.reuse-col {
  min-width: 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--elevated);
  border: 1px solid var(--border);
}
.reuse-crypt { border-top: 3px solid var(--crypt); }
.reuse-bastion { border-top: 3px solid var(--bastion); }
.reuse-col h3 { margin: 0 0 8px; font-size: 16px; }
.reuse-col h3 small {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 6px;
}
.reuse-col h4 {
  margin: 12px 0 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.reuse-crypt h4 code { color: var(--crypt); }
.reuse-bastion h4 code { color: var(--bastion); }

.code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #060910;
  border: 1px solid var(--border);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  overflow-x: auto;
}
.code code { background: none; padding: 0; font-size: inherit; color: inherit; }
.code.json { color: #a5f3fc; }
.reuse-crypt .code.json { color: #fde68a; }

.field-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  margin: 0;
  font-size: 12.5px;
}
.field-table dt { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #f8fafc; }
.field-table dd { margin: 0; color: var(--muted); }

.kiro-chain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.chain-step {
  display: block;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: inherit;
  text-decoration: none;
}
a.chain-step:hover { border-color: rgba(139, 92, 246, 0.85); background: rgba(139, 92, 246, 0.1); }
.chain-step strong { display: block; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: #ddd6fe; }
.chain-step span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.reuse-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.reuse-note a, .footer a { color: var(--bastion); }

/* ---------- summon box ---------- */

.summon-box {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(139, 92, 246, 0.45);
  margin-bottom: 20px;
}

.summon-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.summon-head h2 { margin: 0; font-size: 16px; color: #ddd6fe; }
.summon-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.copy-prompt {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.16);
  color: #ede9fe;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

.prompt-code {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #060910;
  border: 1px solid var(--border);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: #cbd5e1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 0 26px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.asset-stats { flex-basis: 100%; order: -1; }

@media (max-width: 960px) {
  .arch-strip { grid-template-columns: 1fr; }
  .reuse-grid { grid-template-columns: 1fr; }
  .kiro-chain { grid-template-columns: 1fr; }
  .arch-arrow { display: none; }
  .worlds { grid-template-columns: 1fr; }
  .title-cluster { flex-wrap: wrap; }
}
