/* Cards for Droid Companions, Tribe Tools, and Sharing is Caring.
   Colors match the Village: forest, teal for Tek, copper for the tool kicker. */

@font-face {
  font-family: 'Jokerman';
  src: url('/fonts/Jokerman-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #4A7C59;
  --secondary: #8B6F47;
  --bg: #F5F1E6;
  --bg-alt: #E8E4D8;
  --text: #2D2D2D;
  --text-light: #4A4A4A;
  --text-muted: #888888;
  --gold: #B8860B;
  --border: #D4D0C4;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --card-bg: rgba(255,255,255,0.9);
}

[data-theme="dark"] {
  --bg: #1A1A1A;
  --bg-alt: #242424;
  --text: #E0E0E0;
  --text-light: #B0B0B0;
  --text-muted: #888888;
  --border: #404040;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --card-bg: rgba(36,36,36,0.9);
}

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

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

.section-header { text-align: center; margin: 36px 0 24px; }
.section-header h2 {
  font-family: 'Jokerman', Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--primary);
  margin: 0 0 10px;
}
.section-header p { color: var(--text-light); margin: 0 0 8px; }
.section-header a { color: var(--primary); font-weight: 600; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.role, .scope { color: var(--text-light); margin: 8px 0 0; }

.outbound {
  display: inline-block;
  margin-top: 14px;
  margin-right: 16px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.template-grid, .wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.template-card, .wallet-card { height: 100%; }

.network-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  background: var(--primary);
  color: #F5F1E6;
  border-radius: 999px;
  padding: 3px 10px;
  margin: 0 0 10px;
}
.wallet-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-all;
  background: #F5F1E6;
  color: #2D2D2D;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 12px;
}
.copy-address {
  background: var(--secondary);
  color: #F5F1E6;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}
.copy-address:hover { background: var(--gold); }
.wallet-card:hover { transform: none; }
.wallet-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  list-style: none;
  margin: 10px 0 12px;
  padding: 0;
}
.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px 3px 4px;
  background: var(--bg-alt);
  line-height: 1.2;
}
.asset-chip img { width: 20px; height: 20px; display: block; flex: 0 0 auto; }
.asset-chip span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}
.wallet-qr-desktop { margin-top: 14px; }
.wallet-qr-mobile { display: none; }
.wallet-qr-frame {
  display: inline-block;
  box-sizing: border-box;
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #1A1A1A;
  line-height: 0;
  max-width: 100%;
}
.wallet-qr-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.wallet-qr-caption { color: var(--text-light); font-size: 0.85rem; margin-top: 8px; }
.wallet-qr-mobile summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  padding: 10px 0;
  min-height: 44px;
}
.wallet-qr-mobile summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
[data-theme="dark"] .wallet-qr-mobile summary { color: #9ED4AC; }
[data-theme="dark"] .wallet-qr-mobile summary:focus-visible { outline-color: #9ED4AC; }

.tools-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: stretch;
}
.tool-card {
  --tool-heading: var(--primary);
  --tool-link: #2F6F4E;
  --tool-kicker: #6E5430;
  border-top: 4px solid #0E7C86;
}
[data-theme="dark"] .tool-card {
  --tool-heading: #8FCB9E;
  --tool-link: #9ED4AC;
  --tool-kicker: #E0C48A;
}
.tool-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tool-kicker);
  font-weight: 700;
  margin: 0 0 8px;
}
.tool-card h3 {
  font-family: 'Jokerman', Georgia, 'Times New Roman', serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--tool-heading);
  margin: 0 0 8px;
}
.tool-shot { margin: 16px 0 4px; }
.tool-shot img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #10241A;
}
.tool-card .outbound {
  color: var(--tool-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  max-width: 100%;
}
.tool-card .outbound:hover { color: var(--tool-kicker); }
.tool-card a:focus-visible {
  outline: 2px solid var(--tool-link);
  outline-offset: 3px;
  border-radius: 2px;
}
.tool-note { color: var(--text-light); margin-top: 10px; font-size: 0.95rem; }

footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
}
footer p { color: var(--text-muted); font-size: 0.95rem; margin: 8px 0; }

@media (max-width: 768px) {
  .wallet-qr-desktop { display: none; }
  .wallet-qr-mobile { display: block; margin-top: 12px; }
}
