/* Homeowner Insights Brain — hub chrome, Dark Waters Ledger v3.
   Tokens from Brand/homeowner-insights/brand-kit.md. Pitch on Foam for text;
   Aqua Deep-Text for readable accents; Team Aqua + Orange for graphics and
   large numerals only. Source Serif 4 display, system sans body, 16px radii,
   hairlines over shadows, translucent sticky nav, Title Case labels. */

:root {
  --foam: #F5F9FA;
  --white: #FFFFFF;
  --pitch: #0B1F2A;
  --slate: #48606B;
  --aqua-text: #00727C;
  --aqua: #008E97;
  --harbor: #00525A;
  --orange: #FC4C02;
  --aqua-light: #7FD3DA;
  --aqua-wash: #E6F3F4;
  --mist: #EDF3F5;
  --hairline: #D8E4E8;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 16px;
}

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

body {
  font-family: var(--sans);
  color: var(--pitch);
  background: var(--foam);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--aqua-text); text-decoration: none; }
a:hover { color: var(--harbor); }

/* ---------- Sticky header + portal nav (byte-identical on every page) ---------- */
header.brainbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--pitch) 0%, #10303f 70%, var(--harbor) 100%);
  color: var(--foam);
  padding: 14px 28px 0;
  backdrop-filter: saturate(1.2);
}
.brainbar-top { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; }
.brainbar-top svg { display: block; flex: none; }
.brainbar-name { font-family: var(--serif); font-weight: 650; font-size: 1.3rem; letter-spacing: 0.01em; color: var(--white); }
.brainbar-name a { color: var(--white); }
.brainbar-tag { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--aqua-light); margin-left: auto; text-align: right; }
nav.portal {
  display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(127, 211, 218, 0.25); padding: 6px 0 0; scrollbar-width: none;
}
nav.portal::-webkit-scrollbar { display: none; }
nav.portal a {
  flex: none; color: rgba(245, 249, 250, 0.82); font-size: 0.8rem; font-weight: 500;
  padding: 8px 12px 10px; border-bottom: 3px solid transparent; white-space: nowrap;
}
nav.portal a:hover { color: var(--white); border-bottom-color: var(--aqua-light); }
body.p-home    nav.portal a[href="./index.html"],
body.p-oph     nav.portal a[href="./operating-hub.html"],
body.p-gallery nav.portal a[href="./prompt-gallery.html"],
body.p-tqs     nav.portal a[href="./templates-quick-start.html"],
body.p-brand   nav.portal a[href="./brand-os-hi.html"],
body.p-tools   nav.portal a[href="./tools.html"],
body.p-assets  nav.portal a[href="./asset-directory.html"],
body.p-addons  nav.portal a[href="./skills-and-addons.html"],
body.p-setup   nav.portal a[href="./setup-guide.html"],
body.p-log     nav.portal a[href="./changelog.html"]
{ color: var(--white); border-bottom-color: var(--orange); }

/* ---------- Layout ---------- */
main { max-width: 1560px; margin: 0 auto; padding: 44px 28px 90px; }
section { margin-top: 52px; }

.kicker {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--aqua-text);
}
h1 { font-family: var(--serif); font-weight: 650; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.12; margin-top: 10px; }
h2 { font-family: var(--serif); font-weight: 650; font-size: 1.5rem; margin: 8px 0 4px; }
h3 { font-family: var(--serif); font-weight: 650; font-size: 1.1rem; }
.lede { margin-top: 12px; max-width: 64ch; color: var(--slate); font-size: 1.04rem; }

/* Hero band (dark) */
.heroband {
  background: var(--pitch); color: var(--foam);
  border-radius: var(--radius); padding: 40px 36px; margin-top: 8px;
  position: relative; overflow: hidden;
}
.heroband .kicker { color: var(--aqua-light); }
.heroband h1 { color: var(--white); }
.heroband .lede { color: rgba(245, 249, 250, 0.8); }
.heroband .spark { color: var(--orange); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 20px; }
.card {
  display: block; background: var(--white); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 20px; color: var(--pitch);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--aqua); transform: translateY(-2px); color: var(--pitch); }
.card p { font-size: 0.9rem; color: var(--slate); margin-top: 6px; }
.card .go { display: inline-block; margin-top: 12px; font-size: 0.8rem; font-weight: 600; color: var(--aqua-text); }
.card .num { font-family: var(--serif); font-size: 1.9rem; font-weight: 650; color: var(--aqua); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; vertical-align: middle;
}
.badge.live { background: var(--aqua-wash); color: var(--aqua-text); }
.badge.soon { background: var(--mist); color: var(--slate); }
.badge.draft { background: #FDE8DE; color: #B23A0A; }
.badge.sibling { background: #EDEDF2; color: #4A4A5A; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.94rem; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
table.list th { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); text-align: left; padding: 12px 16px; background: var(--mist); }
table.list td { padding: 12px 16px; border-top: 1px solid var(--hairline); vertical-align: top; }
table.list td.mono, .mono { font-family: "SF Mono", Menlo, monospace; font-size: 0.8rem; }
table.list tr:hover td { background: var(--foam); }

/* Notes */
.note { margin-top: 20px; padding: 16px 20px; background: var(--aqua-wash); border-radius: var(--radius); font-size: 0.94rem; max-width: 74ch; }
.note.warn { background: #FDE8DE; }

/* Steps (How It Fits Together) */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.step { background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px; }
.step .n { font-family: var(--serif); font-size: 1.6rem; font-weight: 650; color: var(--orange); font-variant-numeric: tabular-nums; }

/* Prompt gallery */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; }
.toolbar input[type="search"] { flex: 1; min-width: 220px; font: inherit; padding: 12px 16px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--white); color: var(--pitch); }
.toolbar input[type="search"]:focus { outline: 2px solid var(--aqua); border-color: var(--aqua); }
.chip { font-size: 0.78rem; font-weight: 600; border: 1px solid var(--hairline); background: var(--white); color: var(--slate); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--aqua); color: var(--pitch); }
.chip.on { background: var(--pitch); border-color: var(--pitch); color: var(--white); }
.prompt-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.prompt-card .tag { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--mist); color: var(--slate); padding: 2px 8px; border-radius: 4px; }
.prompt-card .tag.b-hi { background: var(--pitch); color: var(--aqua-light); }
.prompt-card .tag.b-prp { background: #EDEDF2; color: #4A4A5A; }
.prompt-card .tag.b-both { background: var(--aqua-wash); color: var(--aqua-text); }
.prompt-card pre { font-family: "SF Mono", Menlo, monospace; font-size: 0.78rem; line-height: 1.55; white-space: pre-wrap; color: var(--pitch); background: var(--foam); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--hairline); max-height: 220px; overflow: auto; }
button.copy { margin-top: 10px; font-size: 0.78rem; font-weight: 700; background: var(--aqua-text); color: var(--white); border: 0; padding: 9px 18px; border-radius: 999px; cursor: pointer; }
button.copy:hover { background: var(--harbor); }
button.copy.done { background: var(--aqua); }

/* Buttons */
.btnrow { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
a.btn {
  display: inline-block; font-size: 0.9rem; font-weight: 700; text-align: center;
  background: var(--aqua-text); color: var(--white); padding: 12px 22px; border-radius: 999px;
}
a.btn:hover { background: var(--harbor); color: var(--white); }
a.btn.spark { background: var(--orange); }
a.btn.spark:hover { background: #D63F00; }
a.btn.quiet { background: var(--white); color: var(--aqua-text); border: 1px solid var(--hairline); }
a.btn.quiet:hover { border-color: var(--aqua); color: var(--harbor); }

/* Footer (byte-identical on every page) */
footer.brainfoot {
  background: var(--pitch); color: rgba(245, 249, 250, 0.75);
  margin-top: 80px; padding: 30px 28px 44px;
  font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 12px 44px; justify-content: space-between;
}
footer.brainfoot strong { color: var(--aqua-light); font-weight: 600; }
footer.brainfoot .mono { font-size: 0.72rem; letter-spacing: 0.08em; color: rgba(127, 211, 218, 0.8); }

@media (max-width: 640px) {
  header.brainbar { padding: 12px 16px 0; }
  main { padding: 32px 16px 70px; }
  .heroband { padding: 28px 22px; }
}
