@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(assets/bricolage-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(assets/bricolage-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --page: #f3f6f8;
  --surface: #ffffff;
  --ink: #15212b;
  --muted: #5b6b78;
  --line: #d9e2e8;
  --avax: #e84142;
  --glacier: #2a6a8f;
  --ice: #e3ecf1;
  --deep: #0c2233;

  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --col: 46rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1820;
    --surface: #16232d;
    --ink: #e6edf2;
    --muted: #93a6b4;
    --line: #263744;
    --glacier: #7fbbdc;
    --ice: #1d2e3a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

a { color: var(--glacier); text-underline-offset: 0.18em; }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--glacier);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  font-weight: 700;
}
.brand img { border-radius: 50%; background: var(--ice); }

.top-links { display: flex; align-items: center; gap: 4px; }

.top-links a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink);
}
.top-links a:hover { background: var(--ice); }
.top-links svg { width: 18px; height: 18px; fill: currentColor; }

.new-btn {
  margin-left: 6px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
}
.is-empty .new-btn { display: none; }

/* Stage: the composer sits centered until the first message, then docks */

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding: 0 16px;
}

.welcome {
  margin-top: auto;
  padding-bottom: 28px;
  text-align: center;
}
.is-chatting .welcome { display: none; }

.welcome-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--ice);
  margin-bottom: 20px;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5.5vw, 2.75rem);
  font-weight: 800;
  font-variation-settings: "wdth" 85;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.log {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 24px;
  scrollbar-gutter: stable;
}
.is-chatting .log { display: block; }

.composer-wrap {
  flex: none;
  padding-bottom: 12px;
  background: var(--page);
}
.is-empty .composer-wrap { margin-bottom: auto; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 6px 24px -12px rgba(21, 33, 43, 0.25);
}
.composer:focus-within { border-color: var(--glacier); }

.composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  padding: 7px 0;
  max-height: 160px;
}
.composer textarea::placeholder { color: var(--muted); }

.composer button {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--avax);
  display: grid;
  place-items: center;
}
.composer button:disabled { background: var(--line); cursor: default; }
.composer button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.is-chatting .suggestions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  margin-top: 10px;
  scrollbar-width: none;
}

.chip {
  flex: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.92rem;
  color: var(--ink);
}
.chip:hover { background: var(--surface); border-color: var(--muted); }
.chip:disabled { opacity: 0.45; cursor: default; }

.note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Messages */

.msg { margin: 0 0 24px; }

.msg.user {
  display: flex;
  justify-content: flex-end;
}
.msg.user p {
  margin: 0;
  max-width: 80%;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--page);
  border-radius: 20px 20px 6px 20px;
  overflow-wrap: anywhere;
}

.msg.bot {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
}
.msg.bot > img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ice);
}
.msg.bot .body { min-width: 0; padding-top: 3px; }
.msg.bot .body p { margin: 0 0 0.75em; }
.msg.bot .body > :last-child { margin-bottom: 0; }

.typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Cards inside answers */

.card {
  display: block;
  margin: 4px 0 12px;
  border-radius: 18px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  animation: rise 0.35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.card-title { display: block; font-weight: 700; font-size: 1.1rem; }
.card-sub { display: block; color: var(--muted); font-size: 0.95rem; }

.card.l1beat { background: var(--deep); color: #fff; }
.l1beat .mark {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.l1beat .card-sub { color: rgba(255, 255, 255, 0.75); }
.l1beat .stat { display: block; margin-top: 14px; }
.l1beat .stat strong { font-size: 1.8rem; color: #ff8a8b; margin-right: 6px; }
.pill {
  display: inline-block;
  margin-top: 14px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  color: var(--deep);
  font-weight: 600;
  font-size: 0.9rem;
}

.card.chain { background: var(--avax); color: #fff; }
.chain .blocks {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  height: 20px;
  margin: 0 -18px 16px 0;
  overflow: hidden;
}
.block {
  flex: 0 0 20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.28);
  transition: background-color 1.4s ease;
}
.block.is-new { background: #fff; animation: drop 0.45s cubic-bezier(.2, .8, .2, 1); }
@keyframes drop { from { transform: translateY(-26px); opacity: 0; } }
.chain .height {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  font-variation-settings: "wdth" 80;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.chain .card-sub { color: rgba(255, 255, 255, 0.85); }

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}
.list .card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.list a.card:hover { border-color: var(--muted); }

.card.timeline { background: var(--surface); border: 1px solid var(--line); }
.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline li:last-child { padding-bottom: 0; }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chips-row span {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--ice);
  font-size: 0.92rem;
}

.card.contact { background: var(--surface); border: 1px solid var(--line); }
.contact .address { display: block; font-size: 1.35rem; font-weight: 700; overflow-wrap: anywhere; }
.contact .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.contact .actions a,
.contact .actions button {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.contact .actions a:first-child { background: var(--ink); color: var(--page); }

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand span { display: none; }
  .list { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .block, .block.is-new, .typing span { animation: none; transition: none; }
}

.noscript {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 16px;
}

/* "/" shortcut hint: only for keyboards, hidden once the box is in use */

.kbd {
  flex: none;
  align-self: center;
  min-width: 26px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted);
}
.composer:focus-within .kbd { display: none; }
@media (pointer: coarse) { .kbd { display: none; } }

/* Share under each answer */

.msg-actions { margin-top: 10px; }

.share {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.85rem;
  color: var(--muted);
}
.share:hover { color: var(--ink); border-color: var(--muted); }
