/* =============================================================
   SUPRALABS: HARD BRUTALISM (dark)
   Near-black canvas, off-white ink, one glowing lime-gold accent.
   Heavy outer border, hard grid rules, uppercase mono labels,
   invert-on-hover. DM Sans display (700/800) + JetBrains Mono.
   ============================================================= */

:root {
  --radius-sm: 0;

  --bg: #080808;
  --surface: #0f0f0f;
  --surface-2: #161616;

  --accent: #dcde8d;        /* lime-gold: solid blocks + marks   */
  --accent-2: #cacd6a;
  --interactive: #8aa2ff;   /* bright blue: text links only      */

  --text-strong: #f4f4ef;
  --text-base: #a2a29a;
  --text-weak: #7c7c74;
  --text-weaker: #565650;

  --line: #242424;          /* quiet hairlines inside cells        */
  --line-2: #3a3a3a;
  --line-strong: #4c4c4c;   /* the structural grid rules           */
  --line-max: #6f6f6f;      /* outer shell + heavy dividers        */

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "DM Sans", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

/* Motion hooks are intentionally small; GSAP owns transforms at runtime.
   Scrolling is native: the smooth-scroll library and all scroll-driven
   animation were removed, so only entrance animations remain. */
[data-animate] { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- base -------------------------------------------------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* Prefer a browser-native overlay. The stable gutter is the no-shift fallback. */
  overflow-y: scroll;
  overflow-y: overlay;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: transparent transparent;
}
html.scrollbar-visible {
  scrollbar-color: auto;
}
html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-strong);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint structural texture behind the sheet */
  background-image:
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(255,255,255,0.014) 63px 64px),
    repeating-linear-gradient(0deg, transparent 0 63px, rgba(255,255,255,0.014) 63px 64px);
}

::selection { background: var(--accent); color: #080808; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
  font-family: var(--sans); font-weight: 700; line-height: 1.05;
  letter-spacing: -0.03em; margin: 0; color: var(--text-strong);
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.mono, .num { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--text-base); }
[data-hf-loading] {
  color: var(--text-weaker) !important;
  font-size: .42em !important;
  letter-spacing: .06em !important;
}

/* quiet labels: MONO, uppercase, wide-tracked (terminal signal) */
.label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em;
  color: var(--text-weak); font-weight: 500;
}
.label b { color: var(--accent); font-weight: 600; }

.tlink {
  color: var(--interactive);
  border-bottom: 1px solid color-mix(in srgb, var(--interactive) 50%, transparent);
}
.tlink:hover { color: #fff; background: var(--interactive); border-bottom-color: var(--interactive); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  font-weight: 500; color: var(--text-base);
  transition: gap .12s ease, color .12s ease;
}
.arrow-link:hover { color: var(--accent); gap: 0.85rem; }

.btn-x {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em;
  color: #080808; background: var(--accent); border: 2px solid var(--accent);
  cursor: pointer; border-radius: 0;
  transition: background .12s ease, color .12s ease;
}
.btn-x:hover { background: transparent; color: var(--accent); }

/* ============================================================
   SHEET: the bordered modular grid (heavy outer shell)
   ============================================================ */
.sheet {
  max-width: 1180px; margin: 0 auto;
  background: var(--bg);
  border-left: 2px solid var(--line-max);
  border-right: 2px solid var(--line-max);
}
.brow { border-top: 2px solid var(--line-strong); }
.sheet > .brow:first-child { border-top: 0; }

.pad { padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.2rem, 3vw, 2rem); }
.pad-lg { padding: clamp(2.4rem, 6vw, 5rem) clamp(1.2rem, 3vw, 2rem); }

.gcols { display: grid; }
.gcols > * { border-left: 2px solid var(--line-strong); }
.gcols > *:first-child { border-left: 0; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* clickable grid cells invert hard on hover */
a.pad { transition: background .1s ease, color .1s ease; }
a.pad:hover { background: var(--accent); }
a.pad:hover .tab, a.pad:hover .tab b { color: #080808; }
.table-reveal {
  width: 100%; border: 0; border-radius: 0; text-align: left;
  color: inherit; background: transparent; cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.table-reveal:hover { background: var(--accent); color: #080808; }
.table-reveal:hover .tab,
.table-reveal:hover .tab b { color: #080808; }

@media (max-width: 760px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .g3 { grid-template-columns: 1fr; }
  .g4 > *, .g3 > * { border-left: 0; border-top: 2px solid var(--line-strong); }
  .g4 > *:first-child, .g3 > *:first-child { border-top: 0; }
  .g4 > *:nth-child(-n+2) { border-top: 0; }
  .g4 > *:nth-child(even) { border-left: 2px solid var(--line-strong); }
}
@media (max-width: 480px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .g2 > *, .g4 > * { border-left: 0; border-top: 2px solid var(--line-strong); }
  .g2 > *:first-child, .g4 > *:first-child { border-top: 0; }
}

/* ============================================================
   TOP BAR: brand + nav, inside the sheet
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  width: 100%; max-width: 1180px; margin: 0 auto;
  display: flex; align-items: stretch;
  background: transparent;
  isolation: isolate;
  overflow: hidden;
}
.sheet:has(> .topbar) { padding-top: 3.05rem; }
.brandmark {
  display: flex; flex-direction: column; justify-content: center;
  padding: 0.85rem clamp(1.2rem, 3vw, 2rem); gap: 0.2rem;
}
.brandmark b { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.04em; line-height: 1; }
.brandmark span {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em;
  color: var(--text-weak);
}

.topnav { margin-left: auto; display: flex; align-items: stretch; border-left: 2px solid var(--line-strong); }
.topnav a {
  position: relative; z-index: 0; overflow: hidden;
  display: inline-flex; align-items: center;
  padding: 0 clamp(0.75rem, 1.6vw, 1.25rem);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; color: var(--text-base);
  border-left: 1px solid var(--line-2);
  transition: color .18s ease;
}
.topnav a::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform .24s cubic-bezier(.22,1,.36,1);
}
.topnav a:first-child { border-left: 0; }
.topnav a:hover { color: #080808; }
.topnav a:hover::before,
.topnav a[aria-current="page"]::before { transform: scaleY(1); }
.topnav a[aria-current="page"] { color: #080808; font-weight: 600; }

/* ---- mobile nav: Bootstrap's collapse drives the dropdown ---- */
.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center; justify-content: center;
  width: 3.05rem; padding: 0;
  background: transparent; color: var(--text-strong);
  border: 0; border-left: 2px solid var(--line-strong); border-radius: 0;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--accent); color: #080808; }
.nav-toggle__bars { position: relative; display: block; width: 18px; height: 2px; background: currentColor; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: ""; position: absolute; left: 0;
  width: 18px; height: 2px; background: currentColor;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.nav-collapse { margin-left: auto; }

/* Bootstrap sets .collapse:not(.show){display:none}. Above the breakpoint the
   nav is always open, so override rather than rely on .navbar-expand-*, which
   would drag in navbar layout this design does not use. */
@media (min-width: 721px) {
  .nav-collapse.collapse {
    display: flex !important;
    height: auto !important;
    overflow: visible !important;
  }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  /* One bar-height row; the expanded menu overlays the page below it. */
  .topbar { flex-wrap: wrap; overflow: visible; }
  .sheet:has(> .topbar) { padding-top: 3.05rem; }
  .nav-collapse { flex-basis: 100%; width: 100%; margin-left: 0; background: var(--bg); }
  .nav-collapse .topnav {
    flex-direction: column; align-items: stretch;
    margin-left: 0; border-left: 0; border-top: 2px solid var(--line-strong);
  }
  .nav-collapse .topnav a {
    border-left: 0; border-top: 1px solid var(--line-2);
    padding: 0.95rem clamp(1.2rem, 3vw, 2rem);
  }
  .nav-collapse .topnav a:first-child { border-top: 0; }
}

/* ============================================================
   HOMEPAGE HERO: full-bleed background image, overlaid nav,
   staggered headline + lede + call-to-action
   ============================================================ */
.hero {
  position: relative; width: 100%;
  min-height: 100svh;
  display: flex; flex-direction: column;
  overflow: clip; background: #000;
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
  filter: grayscale(1) contrast(1.14); opacity: 0.55;
}
.hero__veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.12) 40%, rgba(0,0,0,.88)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,0.14) 3px 4px);
}

/* the image stays full-bleed; the nav + text sit in a centered column */
.hero > .hero__bar,
.hero > .hero__content,
.hero > .hero__strip {
  width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto;
}

/* overlaid top bar */
.hero__bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: stretch;
  border-bottom: 0;
  background: transparent;
  isolation: isolate;
  overflow: hidden;
}
.hero__bar-backdrop {
  position: fixed; top: 0; left: 0; right: 0; z-index: 19;
  height: 3.05rem;
  border-bottom: 1px solid rgba(255,255,255,.22);
  pointer-events: none;
  isolation: isolate;
}
.topbar::before,
.hero__bar-backdrop::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  opacity: var(--nav-scroll-progress, 0);
  background:
    radial-gradient(circle, rgba(244,244,239,.13) .6px, transparent .8px) 0 0 / 5px 5px,
    linear-gradient(100deg, rgba(220,222,141,.09), transparent 31%, rgba(138,162,255,.07) 69%, transparent),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.08)),
    rgba(19,19,18,.74);
  box-shadow:
    inset 0 1px rgba(255,255,255,.08),
    inset 0 -1px rgba(255,255,255,.04),
    0 8px 28px rgba(0,0,0,.14);
  backdrop-filter: blur(5.5px) saturate(.88);
  -webkit-backdrop-filter: blur(5.5px) saturate(.88);
}
.topbar > *,
.hero__bar > * { position: relative; z-index: 1; }
.hero__bar .brandmark b { color: #fff; }
.hero__bar .brandmark span { color: rgba(255,255,255,0.6); }
.hero__bar .topnav { border-left: 1px solid rgba(255,255,255,0.22); }
.hero__bar .topnav a { color: rgba(255,255,255,0.82); border-left: 1px solid rgba(255,255,255,0.14); }
.hero__bar .topnav a:first-child { border-left: 0; }
.hero__bar .topnav a:hover,
.hero__bar .topnav a[aria-current="page"] { background: transparent; color: #080808; }

/* centered hero content */
.hero__content {
  position: relative; z-index: 2; flex: 1 1 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.8rem, 5vw, 4rem) clamp(1.2rem, 5vw, 4rem);
}
.tlop { display: block; }
.tlop .l {
  display: block; color: #fff;
  font-weight: 800; font-size: clamp(2.3rem, 8vw, 5.4rem);
  line-height: 0.88; letter-spacing: -0.045em;
}
.tlop .l1 { margin-left: 0%; }
.tlop .l2 { margin-left: 12%; }
.tlop .l3 { margin-left: 4%; }
.tlop .l4 { margin-left: 16%; }
.tlop .l5 { margin-left: 6%; }
.hero-token { display: inline-block; }
html.motion-pending .hero-token { opacity: 0; }
.tlop mark { background: var(--accent); color: #080808; padding: 0 0.1em; box-decoration-break: clone; }
@media (max-width: 720px) { .tlop .l { margin-left: 0 !important; } }

.hero__lede {
  margin: clamp(1.5rem, 3vw, 2.4rem) 0 0;
  max-width: 34ch; color: rgba(255,255,255,0.92);
  font-size: clamp(1.05rem, 1.9vw, 1.45rem); font-weight: 500;
  line-height: 1.35; letter-spacing: -0.01em;
}
.hero__cta {
  margin-top: clamp(1.5rem, 3vw, 2.2rem);
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center;
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em;
  color: #fff; background: transparent; border: 2px solid rgba(255,255,255,0.55);
  cursor: pointer; border-radius: 0;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn-ghost:hover { background: #fff; color: #080808; border-color: #fff; }

/* bottom caption strip */
.hero__strip {
  position: relative; z-index: 2;
  display: flex; justify-content: flex-end; gap: 1rem; flex-wrap: wrap;
  padding: 0.65rem clamp(1.2rem, 5vw, 4rem);
  border-top: 1px solid rgba(255,255,255,0.28);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em;
  color: rgba(255,255,255,.7);
}

@media (max-width: 720px) {
  .hero__bar { flex-wrap: wrap; overflow: visible; }
  .hero__bar-backdrop { height: 3.05rem; }
  /* Opaque so the dropdown stays legible over the hero image. */
  .hero__bar .nav-collapse { background: rgba(8,8,8,.94); }
  .hero__bar .topnav { border-top: 1px solid rgba(255,255,255,0.22); }
}

/* ============================================================
   INTERIOR MASTHEAD: square image | wide title | spec
   ============================================================ */
.masthead2 { display: grid; grid-template-columns: clamp(200px, 24%, 300px) 1fr minmax(200px, 260px); }
.masthead2 > * { border-left: 2px solid var(--line-strong); }
.masthead2 > *:first-child { border-left: 0; }
.mh-img { position: relative; overflow: hidden; margin: 0; background: #000; }
.mh-img img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(0.9); }
.mh-img figcaption {
  position: absolute; left: 0.6rem; bottom: 0.5rem; right: 0.6rem;
  font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.06em;
  color: #fff; mix-blend-mode: difference;
}
.mh-title { display: flex; flex-direction: column; justify-content: center; }
.mh-spec { display: flex; flex-direction: column; justify-content: center; }

.mast { font-size: clamp(2.8rem, 6.5vw, 4.6rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.92; }
.mast-sub {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--text-base); margin-top: 0.9rem;
}

.spec-list { display: grid; gap: 0.55rem; }
.spec-list div {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
  color: var(--text-weak);
  border-top: 1px solid var(--line-2); padding-top: 0.55rem;
}
.spec-list div:first-child { border-top: 0; padding-top: 0; }
.spec-list b { color: var(--accent); font-weight: 600; }

@media (max-width: 860px) {
  .masthead2 { grid-template-columns: 220px 1fr; }
  .mh-spec { grid-column: 1 / -1; border-left: 0; border-top: 2px solid var(--line-strong); }
}
@media (max-width: 560px) {
  .masthead2 { grid-template-columns: 1fr; }
  .mh-img { border-left: 0; }
  .mh-title, .mh-spec { border-left: 0; border-top: 2px solid var(--line-strong); }
  .mh-img img { height: clamp(200px, 40vh, 300px); min-height: 0; }
}

/* ============================================================
   INDEX STATS / SELECTED ROWS
   ============================================================ */
.icell .n { font-family: var(--mono); font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--text-strong); }
.icell .k { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--text-weak); margin-top: 0.7rem; }

.brow-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem;
  padding: 1.05rem clamp(1.2rem, 3vw, 2rem); border-top: 1px solid var(--line);
  transition: background .1s ease;
}
.brow-item:first-child { border-top: 0; }
.brow-item .bi-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--text-strong); }
.brow-item .bi-meta { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-weak); white-space: nowrap; }
a.brow-item:hover { background: var(--accent); }
a.brow-item:hover .bi-name, a.brow-item:hover .bi-meta { color: #080808; }

.tab { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; color: var(--text-weak); }
.tab b { color: var(--accent); font-weight: 600; }
.capbar { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; color: var(--text-weak); }

.intro { max-width: 62ch; color: var(--text-base); }
.intro strong { color: var(--text-strong); font-weight: 600; }

/* ============================================================
   DATA TABLE: accent header, hard column rules
   ============================================================ */
.dtable-wrap { overflow-x: auto; background: var(--surface); }
table.dtable { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 720px; }
table.dtable:has(th:nth-child(6)) { min-width: 880px; }
table.dtable thead th {
  text-align: left; font-family: var(--mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.12em;
  color: #080808; padding: 0.85rem 1.1rem; background: var(--accent); white-space: nowrap;
  border-right: 1px solid rgba(0,0,0,0.25);
}
table.dtable thead th:last-child { border-right: 0; }
table.dtable td { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: middle; color: var(--text-base); }
table.dtable td:last-child { border-right: 0; }
table.dtable tbody tr:last-child td { border-bottom: 0; }
table.dtable tbody tr:hover { background: var(--surface-2); }
table.dtable .name { color: var(--text-strong); font-weight: 700; letter-spacing: -0.015em; }
table.dtable a.name:hover { color: var(--accent); }
table.dtable .num { font-family: var(--mono); font-size: 0.82rem; color: var(--text-strong); white-space: nowrap; }
table.dtable .type,
table.dtable .state { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-weak); white-space: nowrap; }

/* Prevent saved fallback rows flashing before live Hub data is ready. */
html.hf-data [data-hf-models-body],
html.hf-data [data-hf-datasets-body] {
  visibility: hidden;
  opacity: 0;
  animation: hf-fallback-reveal 0s 5s forwards;
}
html.hf-data.hf-models-ready [data-hf-models-body],
html.hf-data.hf-datasets-ready [data-hf-datasets-body] {
  visibility: visible;
  opacity: 1;
  animation: none;
}
@keyframes hf-fallback-reveal {
  to { visibility: visible; opacity: 1; }
}

/* ============================================================
   CODE BLOCK (JetBrains Mono)
   ============================================================ */
.code {
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7;
  background: #000; color: #e0e0d8; border-top: 2px solid var(--accent);
  padding: clamp(1.1rem, 2.5vw, 1.6rem); overflow-x: auto; margin: 0;
}
.code .c { color: var(--text-weak); }
.code .k { color: var(--accent); }

/* ============================================================
   TEAM
   ============================================================ */
.team-grid {
  border-top: 0;
}
.tmember {
  padding: clamp(1.2rem, 2.5vw, 1.75rem);
}
.tmember__ph {
  aspect-ratio: 1 / 1; margin-bottom: 1.1rem;
  border: 2px solid var(--line-strong);
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 9px, var(--bg) 9px 18px);
  display: grid; place-items: center; position: relative;
}
.tmember__ph span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--text-weaker); }
.tmember h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.tmember .role { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--accent); margin-top: 0.5rem; font-weight: 500; }
.tmember p { margin-top: 0.7rem; font-size: 0.85rem; color: var(--text-base); }

/* ============================================================
   FORM
   ============================================================ */
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.12em; color: var(--text-weak); margin-bottom: 0.5rem; }
.field input, .field textarea {
  width: 100%; background: var(--surface); border: 2px solid var(--line-strong); color: var(--text-strong);
  font-family: var(--sans); font-size: 1rem; padding: 0.75rem 0.9rem; outline: none; border-radius: 0;
  transition: border-color .12s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 8rem; }
.field ::placeholder { color: var(--text-weaker); }

/* ============================================================
   CONTACT KV
   ============================================================ */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line-2); }
.kv:first-child { border-top: 0; }
.kv dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--text-weak); margin: 0; }
.kv dd { margin: 0; color: var(--text-strong); }
@media (max-width: 520px){ .kv { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ============================================================
   FOOTER helpers
   ============================================================ */
footer .sheet { border-top: 2px solid var(--line-max) !important; border-bottom: 2px solid var(--line-max) !important; }
.sheet-fig { margin: 0; }
.sheet-fig img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); }

@media (max-width: 600px) {
  .brow-item { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .brow-item .bi-meta { white-space: normal; }
}

/* ============================================================
   IN-BROWSER CHAT: loader bar + minimal transcript
   ============================================================ */
.loadbar {
  margin-top: 0.9rem; height: 6px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.loadbar__fill { height: 100%; width: 0; background: var(--accent); transition: width .18s linear; }

.btn-ghost-hard {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em;
  color: var(--text-strong); background: transparent; border: 2px solid var(--line-strong);
  cursor: pointer; border-radius: 0;
  transition: border-color .12s ease, color .12s ease;
}
.btn-ghost-hard:hover { border-color: var(--accent); color: var(--accent); }

.chat__log {
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.2rem, 3vw, 2rem);
  min-height: 16rem; max-height: 30rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.4rem;
}
.chat__empty { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-weaker); }

.chat__msg { display: grid; gap: 0.4rem; }
.chat__role { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; font-weight: 500; color: var(--text-weak); }
.chat__msg--bot .chat__role { color: var(--accent); }
.chat__text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-strong); }
.chat__msg--user .chat__text { color: var(--text-base); }
.chat__text.is-streaming::after {
  content: "▍"; color: var(--accent);
  animation: chat-caret 1s steps(2, start) infinite;
}
@keyframes chat-caret { 50% { opacity: 0; } }

.chat__form {
  display: flex; gap: 0.9rem; align-items: flex-start;
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.2rem, 3vw, 2rem);
  border-top: 2px solid var(--line-strong);
}
.chat__input {
  flex: 1; resize: vertical; min-height: 3.4rem;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--text-strong);
  font-family: var(--sans); font-size: 1rem; padding: 0.75rem 0.9rem;
  outline: none; border-radius: 0; transition: border-color .12s ease;
}
.chat__input:focus { border-color: var(--accent); }
.chat__input::placeholder { color: var(--text-weaker); }
.chat__input:disabled { opacity: .55; }
.chat__actions { display: flex; flex-direction: column; gap: 0.6rem; }
.chat__actions .btn-x:disabled { opacity: .45; cursor: default; }
.chat__note { border-top: 1px solid var(--line-2); }

@media (max-width: 560px) {
  /* align-items on the base rule is flex-start, which once the flow turns
     vertical governs the horizontal axis and shrink-wraps the textarea.
     Stretch it back, and set an explicit width since `flex: 1` only controls
     height in a column. */
  .chat__form { flex-direction: column; align-items: stretch; }
  .chat__input { width: 100%; }
  .chat__actions { flex-direction: row; width: 100%; }
  .chat__actions > * { flex: 1; justify-content: center; }
}
