/* Human Architecture v2 — Light Utility Aesthetic
   Inspired by ChatGPT / Claude.ai interface language.
   Clean, white, data-dense. Utility-first, not decorative. */

:root {
  --bg:       #ffffff;
  --bg1:      #f9f9f9;
  --bg2:      #f3f4f6;
  --bg3:      #e9eaec;
  --t1:       #111111;
  --t2:       #6b7280;
  --t3:       #9ca3af;
  --bd:       #e5e7eb;
  --bd2:      #d1d5db;
  --bd3:      #9ca3af;

  /* Semantic colors */
  --live:     #10b981;   /* AI active / live sync */
  --live-dim: rgba(16,185,129,.1);
  --purple:   #6366f1;   /* identity / DNA */
  --purple-dim: rgba(99,102,241,.08);
  --amber:    #f59e0b;   /* source / pending */
  --amber-dim: rgba(245,158,11,.08);
  --red:      #f06060;
  --red-dim:  rgba(240,96,96,.1);
  --blue:     #60a0f0;
  --blue-dim: rgba(96,160,240,.1);

  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 6px;
  --radius-sm: 4px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--t1);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--t1); }
code, .mono { font-family: var(--mono); }

/* ── Layout ── */
.wrap    { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 560px; margin: 0 auto; padding: 0 20px; }
.wrap-xs { max-width: 420px; margin: 0 auto; padding: 0 20px; }

/* ── Nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--bd);
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--t1);
  letter-spacing: .03em;
}
.nav-brand .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 8px var(--live);
  animation: livepulse 2.4s ease-in-out infinite;
}
@keyframes livepulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.nav-right { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--t3); }
.nav-right a { color: var(--t3); }
.nav-right a:hover { color: var(--t1); }

/* ── Utility Panel (the base card type) ── */
.panel {
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel + .panel { margin-top: 10px; }
.panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg2);
}
.panel-label {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--t3); font-family: var(--mono);
}
.panel-body { padding: 14px; }
.panel-body-dense { padding: 10px 14px; }

/* ── Status dot ── */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-live   { background: var(--live);   box-shadow: 0 0 6px var(--live); }
.dot-idle   { background: var(--t3); }
.dot-amber  { background: var(--amber);  box-shadow: 0 0 6px var(--amber); }
.dot-purple { background: var(--purple); box-shadow: 0 0 6px var(--purple); }

/* ── Timestamp / meta ── */
.ts {
  font-family: var(--mono); font-size: 10px; color: var(--t3);
  letter-spacing: .04em;
}
.ts-live { color: var(--live); }

/* ── Source row ── */
.source-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--bd);
  font-size: 13px;
}
.source-row:last-child { border-bottom: 0; padding-bottom: 0; }
.source-name { flex: 1; color: var(--t1); font-weight: 500; }
.source-handle { font-family: var(--mono); font-size: 11px; color: var(--t3); }
.source-status { font-size: 10px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.source-status.live   { color: var(--live); }
.source-status.idle   { color: var(--t3); }
.source-status.pending{ color: var(--amber); }
.source-icon { width: 22px; height: 22px; border-radius: 4px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }

/* ── DNA trait chips ── */
.trait-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.trait-chip {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .06em; padding: 3px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--bd3); background: var(--bg2); color: var(--t2);
}

/* ── Archetype badge ── */
.archetype-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  background: var(--arc-dim, var(--purple-dim));
  color: var(--arc, var(--purple));
  border: 1px solid var(--arc-border, rgba(139,124,246,.25));
}

/* ── Synthesis block ── */
.synthesis-text {
  font-size: 14px; line-height: 1.75; color: var(--t1);
  font-style: italic; letter-spacing: .01em;
}
.synthesis-meta {
  margin-top: 10px; display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; color: var(--t3);
}
.synthesis-agent {
  background: var(--live-dim); color: var(--live);
  border: 1px solid rgba(0,229,160,.2);
  padding: 2px 7px; border-radius: 3px; font-size: 9px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* ── Connected app grid ── */
.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media(max-width:480px) { .connect-grid { grid-template-columns: 1fr; } }
.connect-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--bd); background: var(--bg2);
  cursor: pointer; transition: border-color .15s;
}
.connect-tile:hover { border-color: var(--bd3); }
.connect-tile.active { border-color: rgba(0,229,160,.3); background: var(--live-dim); }
.connect-tile.active .ct-status { color: var(--live); }
.connect-tile-icon { width: 28px; height: 28px; border-radius: 5px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.ct-name { font-size: 12px; font-weight: 600; color: var(--t1); }
.ct-handle { font-size: 10px; font-family: var(--mono); color: var(--t3); margin-top: 1px; }
.ct-status { font-size: 9px; font-family: var(--mono); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); margin-left: auto; }

/* ── Compatibility CTA ── */
.compat-cta {
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  border: 1px solid var(--bd3); border-radius: var(--radius); padding: 20px;
  text-align: center;
}
.compat-cta p { font-size: 13px; color: var(--t2); margin-bottom: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--bd3);
  font: 600 12px/1 var(--sans); letter-spacing: .03em; cursor: pointer;
  transition: all .12s; white-space: nowrap; text-decoration: none;
  background: var(--bg2); color: var(--t2);
}
.btn:hover { border-color: var(--bd3); color: var(--t1); background: var(--bg3); }
.btn-primary { background: var(--purple); color: #fff; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.12); color: #fff; }
.btn-live { background: var(--live-dim); color: var(--live); border-color: rgba(0,229,160,.25); }
.btn-live:hover { background: rgba(0,229,160,.2); color: var(--live); }
.btn-full { width: 100%; justify-content: center; padding: 11px 16px; font-size: 13px; }
.btn-sm { padding: 5px 11px; font-size: 11px; }

/* ── Input ── */
.input {
  width: 100%; background: var(--bg);
  border: 1px solid var(--bd2); color: var(--t1);
  padding: 10px 13px; border-radius: var(--radius-sm);
  font: 14px var(--sans);
}
.input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple-dim); }
.input::placeholder { color: var(--t3); }
.label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--t3); display: block; margin-bottom: 6px; font-family: var(--mono); }
.field { margin-bottom: 14px; }
.err { color: var(--red); font-size: 12px; margin-top: 6px; min-height: 16px; font-family: var(--mono); }

/* ── Owner profile identity block ── */
.identity-block {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--bd3);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.identity-name { font-size: 20px; font-weight: 700; color: var(--t1); line-height: 1.2; margin-bottom: 4px; }
.identity-location { font-family: var(--mono); font-size: 10px; color: var(--t3); margin-bottom: 8px; letter-spacing: .04em; }
.identity-bio { font-size: 13px; color: var(--t2); line-height: 1.6; }

/* ── Stage system ── */
.stage { display: none; }
.stage.active { display: block; animation: fadeUp .2s ease; }
@keyframes fadeUp { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: none; } }

/* ── Scan animation ── */
.scan-bg { height: 2px; background: var(--bg3); border-radius: 1px; overflow: hidden; margin: 12px 0 6px; }
.scan-fill { height: 100%; background: var(--live); border-radius: 1px; width: 0%; transition: width 1.8s ease; }
.scan-lbl { font-family: var(--mono); font-size: 10px; color: var(--t3); }
.scan-lbl span { color: var(--live); }

/* ── Log entries ── */
.log-entry { padding: 10px 0; border-bottom: 1px solid var(--bd); }
.log-entry:last-child { border-bottom: 0; }
.log-date { font-family: var(--mono); font-size: 10px; color: var(--t3); margin-bottom: 4px; }
.log-text { font-size: 13px; color: var(--t2); line-height: 1.6; }

/* ── Share row ── */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Trait reveal sections ── */
.dna-section { margin-bottom: 16px; }
.dna-section-label { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); margin-bottom: 8px; }

/* ── Privacy toggle ── */
.privacy-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--t3); }
.toggle { position: relative; width: 32px; height: 18px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--bg3); border-radius: 9px; border: 1px solid var(--bd3); cursor: pointer; transition: background .15s; }
.toggle input:checked + .toggle-track { background: var(--live-dim); border-color: rgba(0,229,160,.3); }
.toggle-thumb { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--t3); top: 2px; left: 2px; transition: all .15s; pointer-events: none; }
.toggle input:checked ~ .toggle-thumb { left: 16px; background: var(--live); }

/* ── Footer ── */
footer { padding: 28px 0; border-top: 1px solid var(--bd); margin-top: 40px; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-brand { font-size: 11px; color: var(--t3); font-family: var(--mono); }

@media(max-width:600px) {
  .identity-block { flex-direction: column; }
  .connect-grid { grid-template-columns: 1fr; }
}
