/* Kohu Labs — digital cartography
   Tokens → base → header → hero → sections → motion → responsive */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../assets/fonts/dm-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../assets/fonts/dm-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---- tokens ------------------------------------------------------------ */
:root {
  color-scheme: light;
  --bg: #f4f1e8;            /* warm off-white */
  --bg-2: #ebe7da;
  --surface: #faf8f2;
  --ink: #0c0e14;           /* near-black */
  --muted: #566073;         /* muted blue-grey */
  --line: rgba(12, 14, 20, 0.17);
  --accent: #1c3dff;        /* electric cobalt */
  --accent-ink: #ffffff;
  --accent-hover: #0c0e14;
  --acid: #c6ee00;          /* acid yellow-green, tiny highlights only */
  --highlight: var(--accent);

  --field-accent: #1c3dff;  /* read by the canvas */
  --field-strong: #0c0e14;
  --field-acid: #c6ee00;

  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 56px);
  --header-h: 76px;
  --max: 1280px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b11;            /* deep ink */
  --bg-2: #0f121b;
  --surface: #0f131d;
  --ink: #eeeae0;
  --muted: #98a3b8;
  --line: rgba(238, 234, 224, 0.17);
  --accent: #5b7bff;
  --accent-ink: #090b11;
  --accent-hover: #eeeae0;
  --acid: #d4ff3a;
  --highlight: var(--acid);

  --field-accent: #6d8aff;
  --field-strong: #eeeae0;
  --field-acid: #d4ff3a;
}

/* ---- base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: clip;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 0.8rem; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;   /* never blocks links, text selection or scrolling */
}
main, .site-footer { position: relative; z-index: 1; }
.field-label { text-transform: none; position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; color: var(--field-strong); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.04em; white-space: nowrap; will-change: transform, opacity; }

/* ---- header ------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled { background: var(--bg); border-bottom-color: var(--line); }
.header-inner {
  max-width: var(--max);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: block; flex: none; width: 136px; margin-left: -13px; border-radius: 4px; }
.logo { width: 100%; height: auto; aspect-ratio: 4800 / 2520; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

.header-meta { display: flex; gap: 18px; color: var(--muted); margin-left: 6px; }
.header-meta span + span { padding-left: 18px; border-left: 1px solid var(--line); }

.site-nav { display: flex; gap: clamp(20px, 3vw, 44px); margin-left: auto; }
.site-nav a {
  position: relative;
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }

.header-controls { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 99px;
  background: transparent; color: var(--ink); cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -4px 0 0 0 var(--bg);   /* half-moon: reads as a light/dark switch */
  border: 1px solid var(--accent);
}
:root[data-theme="dark"] .theme-dot { box-shadow: inset 4px 0 0 0 var(--bg); }

.nav-toggle { display: none; }

/* language switch + the one-time offer for Portuguese-language visitors */
.lang-switch { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none; transition: border-color 0.2s ease, color 0.2s ease; }
.lang-switch:hover, .lang-switch:focus-visible { border-color: var(--accent); color: var(--accent); }
.lang-offer { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; width: min(560px, calc(100vw - 32px)); padding: 12px 14px 12px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--accent); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18); }
.lang-offer p { margin: 0; flex: 1 1 200px; font-size: 0.95rem; }
.lang-offer .btn { min-height: 44px; font-size: 0.95rem; }
.lang-offer-x { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.lang-offer-x:hover { color: var(--ink); }

/* client login: an outlined button at the end of the nav */
.site-nav a.nav-login { padding: 8px 16px; border: 1px solid var(--accent); border-radius: 2px; color: var(--accent); transition: background-color 0.2s ease, color 0.2s ease; }
.site-nav a.nav-login::after { display: none; }
.site-nav a.nav-login:hover, .site-nav a.nav-login:focus-visible { background: var(--accent); color: var(--accent-ink); }

/* ---- hero --------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 24px) var(--gutter) 22px;
  max-width: var(--max);
  margin-inline: auto;
}
.hero-grid { flex: 1; display: flex; align-items: center; }
.hero-copy { position: relative; max-width: 58rem; padding-block: 32px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.eyebrow span:first-child:not(.status-dot) { color: var(--accent); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

h1 {
  margin: 22px 0 28px;
  font-size: clamp(3.9rem, 11.2vw, 10.6rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.05em;
  font-variation-settings: "opsz" 96;
}
.noise-word { display: inline-block; color: var(--accent); }
.noise-word > span[aria-hidden] { display: inline-block; }
.stop { color: var(--accent); }
.hero-lede { max-width: 31rem; font-size: clamp(1.05rem, 1.5vw, 1.28rem); line-height: 1.5; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 30px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 22px;
  min-height: 52px; padding: 0 22px;
  border: 1px solid var(--accent); border-radius: 2px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg); }
.btn-primary:hover .arrow { transform: translate(2px, -2px); }
.btn-large { min-height: 64px; padding: 0 28px; font-size: clamp(1rem, 2.2vw, 1.35rem); }
.arrow { width: 16px; height: 16px; flex: none; transition: transform 0.2s ease; }
.btn-large .arrow { width: 20px; height: 20px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.link-arrow:hover { border-color: var(--accent); color: var(--accent); }
.link-arrow .arrow { color: var(--accent); }

.hero-foot { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); padding-top: 18px; }
.hero-readout { color: var(--accent); white-space: pre; }
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-touch { display: inline; } .hint-mouse { display: none; } }

/* ---- principles strip --------------------------------------------------- */
.principles { background: var(--accent); color: var(--accent-ink); padding: 18px var(--gutter); }
.principles-list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px clamp(16px, 3.4vw, 46px); font-size: 0.8rem; letter-spacing: 0.16em; }
.principles .mark svg { width: 14px; height: 14px; }
.principles .acid { fill: var(--acid); }
:root[data-theme="dark"] .principles .acid { fill: #d4ff3a; }

/* ---- sections ----------------------------------------------------------- */
.section { position: relative; padding-block: clamp(80px, 12vw, 168px); }
.section-head { margin-bottom: clamp(36px, 5vw, 64px); max-width: 52rem; }
.section-head .eyebrow, .approach .eyebrow, .contact .eyebrow { margin-bottom: 18px; }
h2 { font-size: clamp(2.7rem, 7.2vw, 6.4rem); font-weight: 800; line-height: 0.93; letter-spacing: -0.045em; font-variation-settings: "opsz" 96; }
h2 em { font-style: normal; color: var(--accent); }

/* services */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { display: flex; }
.card article {
  display: flex; flex-direction: column; width: 100%;
  padding: 22px 22px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.card:hover article { border-color: var(--accent); transform: translateY(-3px); }
.card-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.card-num { color: var(--accent); }
.ill {
  margin: 20px 0 24px; padding: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  overflow: hidden;           /* illustration is clipped to its own box: it can never reach the text */
}
.ill svg { width: 100%; height: 100%; }
.card h3 { font-size: clamp(1.5rem, 2.2vw, 1.85rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 1rem; line-height: 1.6; max-width: 34ch; }

/* illustration drawing */
.ill-grid path { stroke: var(--line); stroke-width: 1; fill: none; }
.ill-dots line { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0.1 7; }
.ill-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.ill-pts circle { fill: var(--bg-2); stroke: var(--accent); stroke-width: 1.6; }
.ill-pts circle.acid { fill: var(--acid); stroke: var(--ink); stroke-width: 1.2; }
.ill-pts circle.ring { fill: none; stroke: var(--accent); stroke-width: 1; }
.ill-pts.scatter circle { fill: var(--accent); stroke: none; opacity: 0.85; }
.ill-flow { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 3 5; stroke-linecap: round; }
.ill-box { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.ill-ring { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.ill-core { fill: var(--accent); }
.ill-line-set path { stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.ill-human { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 2 4; stroke-linecap: round; }
.ill-pts-fill { fill: var(--acid); stroke: var(--ink); stroke-width: 1.2; }
.ill-halftone circle { fill: var(--accent); }
.ill-prompt-bg { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
.ill-prompt { font: 500 13px var(--mono); fill: var(--ink); }
.cursor { fill: var(--accent); }
.ill-text { font: 400 9px var(--mono); letter-spacing: 0.1em; fill: var(--muted); }

/* approach */
.approach .statement {
  max-width: 17em;
  font-size: clamp(2.3rem, 6.4vw, 5.8rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: clamp(48px, 7vw, 96px);
  text-wrap: balance;
}
.statement mark { background: none; color: var(--highlight); }
.tenets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.tenets li { display: flex; flex-direction: column; gap: 14px; padding: 18px 0 0; border-top: 1px solid var(--ink); }
.tenets .mono { color: var(--accent); }
.tenets p { font-size: clamp(1.3rem, 2.3vw, 1.9rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }

/* contact */
.contact { padding-bottom: clamp(96px, 14vw, 200px); }
.contact h2 { font-size: clamp(3rem, 9.4vw, 8.6rem); margin-bottom: 28px; }
.contact-copy { max-width: 56rem; }
.contact-lede { max-width: 30rem; font-size: clamp(1.1rem, 1.7vw, 1.35rem); margin-bottom: 36px; }

/* footer */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.footer-home { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.footer-home:hover { color: var(--accent); }
.footer-link { color: inherit; text-decoration: none; display: inline-block; padding: 12px 0; }
.footer-link:hover, .footer-link:focus-visible { color: var(--accent); }
.footer-inner { align-items: center; }

/* ---- motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .draw { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 2.4s 0.4s cubic-bezier(.3,.6,.2,1) forwards; }
  .flow { animation: flow 1.6s linear infinite; }
  .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
  .cursor { animation: blink 1.1s steps(1) infinite; }
  .ill-human { animation: flow 3s linear infinite; }
  .status-dot { animation: ping 2.8s ease-out infinite; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -16; } }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1100px) { .header-meta { display: none; } }

@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr; max-width: 640px; }
  .card p { max-width: 48ch; }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .brand { width: 108px; margin-left: -10px; }
  .header-controls { margin-left: auto; }
  .theme-toggle { padding: 0 14px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%;
    background: transparent; color: var(--ink); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before {
    display: block; width: 16px; height: 1.6px; background: currentColor; position: relative; transition: transform 0.25s ease;
  }
  .nav-toggle-bars::before { content: ""; position: absolute; left: 0; top: 5px; }
  .nav-toggle-bars { top: -2.5px; }
  .nav-open .nav-toggle-bars { transform: translateY(2.5px) rotate(45deg); }
  .nav-open .nav-toggle-bars::before { transform: translateY(-5px) rotate(-90deg); }

  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; margin: 0;
    padding: 6px var(--gutter) 14px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .js .nav-open .site-nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .js .site-nav a { padding: 0; min-height: 52px; display: flex; align-items: center; font-size: 1.35rem; font-weight: 600; border-top: 1px solid var(--line); }
  .js .site-nav a:first-child { border-top: 0; }
  .js .site-nav a::after { display: none; }
  .js .site-nav a.nav-login { margin: 10px 0 4px; min-height: 48px; justify-content: center; font-size: 1.1rem; background: var(--accent); color: var(--accent-ink); }
  .site-header.nav-open { background: var(--bg); border-bottom-color: var(--line); }
  html:not(.js) .site-header { height: auto; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 8px; }
  html:not(.js) .site-nav { width: 100%; order: 3; justify-content: space-between; margin: 0; }
  html:not(.js) .nav-toggle { display: none; }

  .hero { padding-top: calc(var(--header-h) + 18px); padding-bottom: 16px; }
  h1 { font-size: clamp(3.2rem, 15.2vw, 7rem); line-height: 0.9; margin: 18px 0 22px; }
  .hero-actions { margin-top: 26px; }
  .hero-foot { flex-wrap: wrap; font-size: 0.66rem; gap: 6px 16px; }
  .hero-readout { display: none; }
  .tenets { grid-template-columns: 1fr; gap: 22px; }
  .tenets li { flex-direction: row; align-items: baseline; gap: 18px; padding-top: 14px; }
  .principles-list { gap: 8px 14px; font-size: 0.7rem; }
}

@media (max-width: 380px) {
  .theme-toggle .theme-state { display: none; }
  .theme-toggle { padding: 0 14px; }
}
button.lang-switch { background: transparent; cursor: pointer; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- the Signal: assistant (js/assistant.js) ----------------------------- */
/* Hero: the mascot sits in the free space beside the headline on wide screens. */
.hero-grid { position: relative; }
.hero-signal { display: none; }
@media (min-width: 1100px) {
  .hero-signal {
    position: absolute; right: 0; top: 58%; transform: translateY(-50%); z-index: 2;
    width: clamp(240px, 22vw, 330px); display: flex; flex-direction: column; align-items: center; gap: 4px;
  }
}
.hero-signal-stage { width: 100%; aspect-ratio: 1; cursor: pointer; border-radius: 50%;
  background: radial-gradient(circle, var(--bg) 0 42%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent 70%); } /* a quiet halo so it reads against the field */
.hero-signal-bubble {
  max-width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 2px; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--ink);
  font-size: 0.72rem; letter-spacing: 0.04em; text-align: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.hero-signal-bubble:hover, .hero-signal-bubble:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }

/* Dock: chat panel, and the mascot button once the hero mascot is out of view (always on phones). */
.sig-dock {
  position: fixed; z-index: 35; right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom) + var(--sig-kb, 0px)); /* --sig-kb: height hidden by an on-screen keyboard */
  display: flex; align-items: flex-end; gap: 12px; pointer-events: none;
}
.sig-dock > * { pointer-events: auto; }
.sig-dock[hidden] { display: none; } /* display: flex above would otherwise override [hidden] (the portal hides it on sign-in) */
.sig-launcher {
  position: relative; flex: none; width: 76px; height: 76px; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.sig-launcher:hover, .sig-launcher:focus-visible { border-color: var(--accent); outline: none; }
.sig-launcher::after { content: "• •"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.1rem; letter-spacing: 0.3em; } /* until the mascot loads */
.sig-dock.ready .sig-launcher::after { content: none; }
.sig-launcher-stage { position: absolute; inset: 0; }
.sig-dock.hero-visible:not(.open) .sig-launcher { opacity: 0; transform: scale(0.6); visibility: hidden; } /* the panel covers the hero mascot, so the button shows while it's open */

.sig-panel {
  display: flex; flex-direction: column; width: min(390px, calc(100vw - 120px)); height: min(540px, calc(100vh - 120px)); height: min(540px, calc(var(--sig-vh, 100svh) - 120px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 2px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.sig-panel[hidden] { display: none; }
.sig-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.sig-head b { font-weight: 700; margin-right: 10px; }
.sig-head .mono { color: var(--muted); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; }
.sig-close { width: 36px; height: 36px; border: 1px solid transparent; border-radius: 2px; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sig-close:hover, .sig-close:focus-visible { color: var(--accent); border-color: var(--line); outline: none; }
.sig-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sig-msg { max-width: 92%; font-size: 0.95rem; line-height: 1.5; }
.sig-msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 2px; }
.sig-msg.bot p { margin: 0 0 6px; } .sig-msg.bot p:last-child { margin: 0; }
.sig-msg.bot ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sig-msg.bot li { border-left: 2px solid var(--accent); padding: 2px 0 2px 10px; }
.sig-msg.bot li b { display: block; font-weight: 700; }
.sig-msg.bot li span { color: var(--muted); font-size: 0.88rem; }
.sig-msg .sig-noise, .sig-msg.bot li .sig-noise { color: var(--accent); } /* unresolved characters, like "noise" in the headline */
.sig-card { display: grid; gap: 3px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); }
.sig-card .mono { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sig-card strong { font-size: 1.05rem; }
.sig-note { color: var(--muted); font-size: 0.8rem; }
.sig-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.sig-chip {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 2px; background: none; color: var(--ink);
  font: inherit; font-size: 0.86rem; text-decoration: none; cursor: pointer;
}
.sig-chip:hover, .sig-chip:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.sig-chip.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sig-chip.primary:hover, .sig-chip.primary:focus-visible { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg); }
.sig-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.sig-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
.sig-form input:focus { outline: none; border-color: var(--accent); }
.sig-form button { padding: 0 16px; border: 0; border-radius: 2px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 620px) {
  .sig-dock { left: 12px; right: 12px; flex-direction: column-reverse; align-items: flex-end; }
  .sig-panel { width: 100%; height: min(520px, calc(var(--sig-vh, 100svh) - 28px)); }
  .sig-dock.open .sig-launcher { display: none; } /* more room for the chat; the panel's × closes it */
  .sig-launcher { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) { .sig-launcher { transition: none; } }
