/* ============================================================
   TEE-LLMs page supplement
   Builds on top of brainbot global.css — only defines what is
   not already there. All values reference brainbot tokens.
   ============================================================ */

/* ── Token aliases for inline styles in the React components ──
   The JSX uses color: "var(--ink-2)" etc. in inline styles.
   These map to brainbot tokens so nothing is hardcoded here. */
:root {
  /* Body-text greys: match main site's section copy (not full black, not too light) */
  --ink:        color-mix(in srgb, var(--bb-slate) 85%, transparent);
  --ink-2:      color-mix(in srgb, var(--bb-slate) 68%, transparent);
  --ink-3:      color-mix(in srgb, var(--bb-slate) 48%, transparent);
  --ink-4:      color-mix(in srgb, var(--bb-slate) 30%, transparent);
  --line:       var(--border);
  --line-2:     var(--border-strong);
  --line-3:     color-mix(in srgb, var(--bb-slate) 28%, transparent);
  --paper:      var(--bb-white);
  --accent:     var(--bb-orange);
  --accent-2:   #E05500;
  --accent-bg:  color-mix(in srgb, var(--bb-orange) 10%, white);
  --dark:       var(--bb-petrol);
  --dark-2:     #152E38;
  --dark-3:     #1D3A47;
  --on-dark:    var(--bb-sky);
  --on-dark-2:  #B0BCC5;
  --on-dark-3:  var(--bb-darker-grey);

  /* Semantic state colors — comparison table (green=safe, red=exposed, navy=cipher) */
  --trusted:    #2d7a4d;
  --trusted-2:  #1f5a37;
  --trusted-bg: #d6ecdf;
  --exposed:    #cf4b3a;
  --exposed-2:  #a23829;
  --exposed-bg: #f7d8d2;
  --cipher:     #2f4a6b;
  --cipher-2:   #1f3450;
  --cipher-bg:  #d6dde6;

  --maxw: 1240px;
  --pad: clamp(20px, 4vw, 56px);
}

/* ── Base overrides (counteract global.css rules that clash) ── */

/* Links in this page default to inherit, not orange */
main a { color: inherit; text-decoration: none; }
main a.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-3);
}
main a.link:hover { text-decoration-color: var(--bb-slate); color: var(--accent-2); }

button { font: inherit; color: inherit; background: none; border: 0; cursor: default; padding: 0; }

/* Sections: add dividers + tighter padding */
main section {
  padding: clamp(60px, 8vw, 120px) 0;
  border-top: 1px solid var(--border);
}
main section:first-of-type { border-top: 0; }

/* Eyebrow: TEE version — no square bullet, tighter margin */
main .eyebrow { margin: 0; font-size: 12.5px; letter-spacing: 0.10em; }
main .eyebrow::before { display: none; }

/* ── Heading overrides — global.css .hero h1 adds uppercase + 121px ──
   Use higher specificity (element + class) to restore TEE mixed-case style. */
main h1.h-display {
  text-transform: none;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.028em;
  font-weight: 900;
  text-wrap: unset;
}
/* Remove the orange underline-bar that .hero h1 .accent::after adds */
main h1.h-display .accent::after { display: none; }

/* Section headings: also mixed-case (not uppercase) */
main h2.h1 {
  text-transform: none;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 700;
  text-wrap: unset;
}
main h2.h1 .accent::after { display: none; }

/* ── Layout ── */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: clamp(36px, 5vw, 60px);
  max-width: 900px;
}

/* ── Typography for TEE page (mixed-case, not uppercase) ── */

.h-display {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.028em;
  color: var(--bb-slate);
  margin: 0;
}
.h-display .accent { color: var(--bb-orange); }

.h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--bb-slate);
  margin: 0;
}
.h1 .accent { color: var(--bb-orange); }

.h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.14;
  letter-spacing: -0.016em;
  margin: 0;
}

.h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; margin: 0; }

.lede {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0;
}

/* 17px / 1.62 line-height: compensates for DM Sans's tighter x-height vs Geist */
.body { font-size: 17px; line-height: 1.62; color: var(--ink-2); }
.body p { margin: 0 0 1em; }
.body p:last-child { margin: 0; }

.fine { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

/* ── Nav links color fix: TEE anchor links use inherit, not orange ── */
#tee-nav .nav__links a { color: var(--bb-slate); }
#tee-nav .nav__links a:hover { color: var(--bb-orange); text-decoration: none; }

/* ── Language toggle: matches .nav__lang from global.css ── */
.lang-btn {
  font: inherit;      /* inherits .nav__lang mono 12px */
  color: inherit;     /* muted grey by default */
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.lang-btn--active { color: var(--bb-slate); font-weight: 500; }
.lang-btn:not(.lang-btn--active):hover { color: var(--bb-slate); }

/* ── Detail level segmented control ── */
.level-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bb-white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 3px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  gap: 2px;
}
.level-switch button {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.level-switch button:hover { color: var(--bb-slate); }
.level-switch button.active { color: var(--bb-white); background: var(--bb-slate); }
.level-switch .ico { display: inline-block; width: 14px; height: 14px; margin-right: 7px; }

.level-switch-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: clamp(36px, 5vw, 60px) 0 0;
  padding-top: clamp(36px, 5vw, 56px);
  border-top: 1px solid var(--border);
}
.level-switch-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.level-switch-band .level-switch { padding: 5px; gap: 3px; }
.level-switch-band .level-switch button { padding: 13px 28px; font-size: 14.5px; font-weight: 700; }

/* ── Hero — override global.css .hero completely ── */

main .hero {
  background: none;
  padding: clamp(80px, 11vw, 150px) 0 clamp(40px, 6vw, 80px);
  overflow: visible;
  border-top: 0;
}
/* Hide the dot-grid overlay that global.css injects */
main .hero__grid { display: none; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; align-items: stretch; }
}

.hero-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-meta .acc { color: var(--bb-orange); }

.hero-vis {
  aspect-ratio: 1 / 1;
  background: var(--bb-petrol);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ── Containers & panels ── */

.card {
  background: var(--bb-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.card.flush { padding: 0; overflow: hidden; }

.panel {
  background: var(--bb-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Dark section variant */
section.dark {
  background: var(--bb-petrol);
  color: var(--bb-white);
  border-top: 0;
  margin: clamp(40px, 6vw, 80px) 0;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
section.dark::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top, rgba(255,99,20,0.06), transparent 60%);
  pointer-events: none;
}
section.dark .lede { color: var(--on-dark-2); }
section.dark .body { color: var(--on-dark-2); }
.on-dark .h1 { color: var(--bb-white); }

/* ── Pill badges (state labels in comparison table) ── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bb-darker-grey);
  background: transparent;
}
.pill.trusted { color: var(--trusted-2); border-color: var(--trusted); background: var(--trusted-bg); }
.pill.exposed  { color: var(--exposed-2); border-color: var(--exposed); background: var(--exposed-bg); }
.pill.cipher   { color: var(--cipher-2);  border-color: var(--cipher);  background: var(--cipher-bg); }
.pill.accent   { color: var(--accent-2);  border-color: var(--bb-orange); background: var(--accent-bg); }
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ── Comparison table (3-column trust boundary overview) ── */

.compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bb-white);
}
.compare > .col { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.compare > .col:last-child { border-right: 0; }
.compare .col-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.compare .col-head .label {
  font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px;
}
.compare .col-head .name { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.compare .col-body { padding: 0; flex: 1; }
.compare .col-foot {
  padding: 18px 24px; border-top: 1px solid var(--border);
  font-size: 14px; color: var(--ink-2); line-height: 1.55;
}
@media (max-width: 880px) {
  .compare { grid-template-columns: 1fr; }
  .compare > .col { border-right: 0; border-bottom: 1px solid var(--border); }
  .compare > .col:last-child { border-bottom: 0; }
}

/* ── Feature list (bullets in what-is-a-tee section) ── */
ul.tee-list { list-style: none; padding: 0; margin: 0; }
ul.tee-list li {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--bb-darker-grey);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
ul.tee-list li:first-child { border-top: 0; }
ul.tee-list .marker {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}
ul.tee-list .marker.no  { color: var(--exposed); }
ul.tee-list .marker.yes { color: var(--trusted); }
ul.tee-list .marker.mid { color: var(--ink-3); }
ul.tee-list .marker.acc { color: var(--bb-orange); }

/* ── Tech ecosystem cards ── */
.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 880px) { .tech-grid { grid-template-columns: 1fr; } }

.tech-card {
  background: var(--bb-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 240px;
  transition: border-color var(--dur-base) var(--ease-standard);
}
.tech-card:hover { border-color: var(--border-strong); }
.tech-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tech-card .logo {
  width: 38px; height: 38px;
  border-radius: var(--radius-xs);
  background: var(--bb-sky);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  color: var(--bb-slate);
  letter-spacing: 0.02em;
}
.tech-card h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.tech-card .desc { font-size: 15px; color: var(--ink-2); line-height: 1.55; flex: 1; }
.tech-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tech-card .meta .pill { font-size: 9.5px; padding: 3px 8px; }

/* ── Challenges grid ── */
.challenges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
@media (max-width: 720px) { .challenges { grid-template-columns: 1fr; } }
.challenge {
  background: var(--bb-white);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 8px;
}
.challenge .num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--bb-orange); letter-spacing: 0.08em; font-weight: 600;
}
.challenge h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.005em; }
.challenge p  { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.55; }

/* ── Technical deep-dive (expandable) ── */
.nerd-block {
  background: var(--bb-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0; overflow: hidden;
}
.nerd-toggle {
  display: flex; width: 100%;
  padding: 22px 28px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  outline: none;
  transition: background var(--dur-fast) var(--ease-standard);
}
.nerd-toggle:hover { background: color-mix(in srgb, var(--bb-slate) 5%, white); }
.nerd-toggle:focus-visible { box-shadow: inset 0 0 0 2px var(--bb-orange); }
.nerd-toggle .chev {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 14px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nerd-toggle.open .chev { transform: rotate(45deg); }
.nerd-body {
  padding: 0 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.nerd-body h5 {
  font-size: 13px; margin: 0 0 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--bb-orange); font-weight: 500;
}
.nerd-body p { font-size: 14.5px; line-height: 1.6; margin: 0; color: var(--ink-2); }
.nerd-body code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bb-sky); padding: 2px 6px;
  border-radius: var(--radius-xs); color: var(--bb-slate);
}

/* ── Pull quote (uses .pull-quote from global.css, kept as .pull alias) ── */
.pull {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(24px, 3.0vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--bb-slate);
  border-left: 4px solid var(--bb-orange);
  padding-left: 28px;
  max-width: 40ch;
  margin: 0 auto;
}
.on-dark .pull { color: var(--bb-white); }

/* ── TEE footer ── */
.tee-footer {
  padding: 60px 0 50px;
  border-top: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 13px;
  background: var(--bb-sky);
}
.tee-footer .sig {
  font-weight: 700; font-size: 20px;
  color: var(--bb-slate); letter-spacing: -0.01em;
}
.tee-footer .accent-dot { color: var(--bb-orange); }

/* ── Level stack: render both, show one, height = taller of the two ── */
.lvl-stack { display: grid; }
.lvl-stack > * { grid-area: 1 / 1; transition: opacity 0.25s ease; }

/* ── SVG diagram defaults ── */
.diagram { display: block; width: 100%; height: auto; }
.diagram text { font-family: var(--font-mono); font-size: 10.5px; fill: var(--bb-darker-grey); letter-spacing: 0.04em; }
.diagram .label { font-family: var(--font-sans); font-size: 12px; fill: var(--bb-slate); font-weight: 500; letter-spacing: 0; }
.diagram .layer { stroke: var(--border-strong); fill: var(--bb-white); }
.diagram .enclave-fill { fill: var(--trusted-bg); stroke: var(--trusted); stroke-width: 1.2; }
.diagram .danger-fill  { fill: var(--exposed-bg); stroke: var(--exposed); stroke-width: 1.2; }
.diagram .cipher-fill  { fill: var(--cipher-bg);  stroke: var(--cipher);  stroke-width: 1.2; }
.diagram .dim { fill: var(--ink-3); }
.diagram.on-dark text  { fill: var(--on-dark-2); }
.diagram.on-dark .label { fill: var(--on-dark); }

/* ── Utilities ── */
.gap-sm { display: flex; gap: 10px; }
.gap-md { display: flex; gap: 18px; }
.hr-soft { height: 1px; background: var(--border); border: 0; margin: 0; }
