/* syamx.com: a software and AI company's page. Black, white and translucent white only; system font. */

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

html { background: #000; color: #fff; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: #fff; color: #000; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { list-style: none; padding: 0; }

.wrap { width: min(1160px, 100% - 64px); margin: 0 auto; }
.caps { font-size: 12px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; }
.label { color: rgb(255 255 255 / .56); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: 999px; background: #fff; color: #000; text-decoration: none; }
.skip:focus { top: 12px; }
a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Dock: the nav as a chip floating at the bottom ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content; /* left: 50% would otherwise give it only half the screen to fit into */
  max-width: calc(100vw - 24px);
  height: 56px;
  padding: 0 6px 0 20px;
  border-radius: 999px;
  /* plain transparent chip: a light tint, a soft blur, a hairline edge */
  background: rgb(255 255 255 / .06);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgb(255 255 255 / .12);
  transform: translateX(-50%);
  animation: dock-in 1s .5s cubic-bezier(.22, 1, .36, 1) both;
}
.dock > * { flex: none; }
.dock-logo { display: flex; align-items: center; height: 44px; padding-right: 4px; }
.dock-logo img { width: 70px; max-width: none; height: auto; }
.dock-rule { width: 1px; height: 20px; margin: 0 8px 0 10px; background: rgb(255 255 255 / .16); }
.dock-link {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: rgb(255 255 255 / .78);
  text-decoration: none;
  transition: color .25s, background-color .25s;
}
.dock-link:hover { color: #fff; background: rgb(255 255 255 / .1); }
/* the section you are in */
.dock-link[aria-current] { color: #fff; background: rgb(255 255 255 / .12); }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 24px); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 64px 24px 128px;
  text-align: center;
}
.hero-in { display: grid; justify-items: center; animation: rise 1.2s cubic-bezier(.22, 1, .36, 1) both; }
.eyebrow { color: rgb(255 255 255 / .6); }
.hero h1 { margin-top: clamp(28px, 4vh, 44px); line-height: 0; }
.hero h1 img { width: min(78vw, 760px); height: auto; }
.hero-line {
  margin-top: clamp(28px, 4.5vh, 48px);
  font-size: clamp(19px, 1.2vw + 12px, 28px);
  line-height: 1.35;
  letter-spacing: -.01em;
  color: rgb(255 255 255 / .78);
}

/* ---------- Shared section type ---------- */
.big {
  margin-top: 20px;
  font-size: clamp(36px, 5.2vw, 76px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -.03em;
}
.big span, .statement span { color: rgb(255 255 255 / .42); }

.rows { margin-top: clamp(48px, 7vh, 72px); border-top: 1px solid rgb(255 255 255 / .12); }
.rows li {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px 40px;
  padding: 28px 0;
  border-bottom: 1px solid rgb(255 255 255 / .12);
}
.rows h3 { font-size: clamp(20px, 1.6vw, 24px); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.rows p { font-size: 17px; line-height: 1.55; color: rgb(255 255 255 / .64); }

/* ---------- Company ---------- */
.company { padding: clamp(120px, 18vh, 200px) 0 clamp(96px, 14vh, 160px); }
.statement {
  margin-top: 24px;
  max-width: 26ch;
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.03em;
}
.facts {
  margin-top: clamp(56px, 8vh, 88px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.facts li { padding-top: 22px; border-top: 1px solid rgb(255 255 255 / .16); }
.facts h3 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.facts p { margin-top: 10px; font-size: 17px; line-height: 1.55; color: rgb(255 255 255 / .64); max-width: 30ch; }

/* ---------- AI ---------- */
.ai { padding: clamp(64px, 10vh, 120px) 0 clamp(120px, 18vh, 200px); }
.shots { margin-top: clamp(48px, 7vh, 72px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.shot { display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: #0f0f0f; border: 1px solid rgb(255 255 255 / .08); }
/* The renders sit on #0f0f0f, so the island hangs from the top of the card like it does from the notch. */
.shot-img { display: flex; justify-content: center; }
.shot-img img { width: min(100%, 520px); height: auto; }
.shot figcaption { padding: 8px 32px 30px; font-size: 16px; line-height: 1.55; color: rgb(255 255 255 / .64); }
.shot figcaption b { font-weight: 600; color: #fff; }

/* ---------- Software: a card that grows to fill the screen ---------- */
.software-head { padding-top: clamp(24px, 4vh, 48px); }
.stage {
  --s: .42; --r: 66px; --head: 1; --end: 0; --bo: 1;
  --cy: 50%;
  position: relative;
  height: 260vh;
  height: 260svh;
}
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.media {
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: 100vw;
  height: 100vh;
  height: 100svh;
  transform: translate(-50%, -50%) scale(var(--s));
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  will-change: transform;
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.s-icay .media img { object-fit: contain; object-position: 50% 24%; }
/* the card's hairline edge, gone once it fills the screen */
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 calc(1px / var(--s)) rgb(255 255 255 / calc(.16 * var(--bo)));
  pointer-events: none;
}
/* darkens the bottom of the picture under the closing text */
.media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 52%, rgb(0 0 0 / .82));
  opacity: var(--end);
  pointer-events: none;
}
.head {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--cy) - var(--half, 21svh) - 32px);
  padding: 0 24px;
  text-align: center;
  opacity: var(--head);
  transform: translateY(-100%) translateY(calc((1 - var(--head)) * -28px));
}
.tag { display: inline-flex; align-items: center; gap: 12px; color: rgb(255 255 255 / .62); }
.tag img { width: 28px; height: 28px; border-radius: 7px; outline: 1px solid rgb(255 255 255 / .14); outline-offset: -1px; }
.head h3 { margin-top: 16px; font-size: clamp(32px, 4.4vw, 64px); line-height: 1.06; font-weight: 600; letter-spacing: -.025em; }
.end {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(clamp(32px, 7vh, 72px) + 84px + env(safe-area-inset-bottom));
  width: min(1160px, 100% - 64px);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  opacity: var(--end);
  transform: translateY(calc((1 - var(--end)) * 18px));
  visibility: hidden;
}
.stage.show .end { visibility: visible; }
.end .name { margin-bottom: 6px; font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: rgb(255 255 255 / .62); }
.end .one { max-width: 30ch; font-size: clamp(20px, 1.7vw, 26px); line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
.end .status { margin-top: 10px; font-size: 15px; color: rgb(255 255 255 / .62); }

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), background-color .25s;
}
.pill:hover { transform: translateY(-1px); background: rgb(255 255 255 / .86); }
.pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- How we build ---------- */
.how { padding: clamp(120px, 18vh, 200px) 0 clamp(120px, 18vh, 200px); }

/* ---------- Closing ---------- */
.closing {
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: clamp(80px, 14vh, 144px) 24px clamp(48px, 8vh, 80px);
  border-top: 1px solid rgb(255 255 255 / .1);
  text-align: center;
}
.closing img { width: min(52vw, 300px); height: auto; }
.closing p { color: rgb(255 255 255 / .62); }
footer {
  padding: 0 24px calc(104px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 13px;
  color: rgb(255 255 255 / .52);
}
footer a, footer span { display: inline-flex; align-items: center; min-height: 44px; }
footer a { text-decoration: none; transition: color .25s; }
footer a:hover { color: #fff; }

/* ---------- Reveal: only once the script has marked the page, so nothing hides without it ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .9s cubic-bezier(.22, 1, .36, 1), transform .9s cubic-bezier(.22, 1, .36, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- 404 ---------- */
.intro { padding-top: clamp(120px, 24vh, 240px); text-align: center; }
.intro h1 { line-height: 0; }
.intro h1 img { width: min(64vw, 440px); height: auto; margin: 0 auto; }
.line { margin-top: 28px; font-size: clamp(15px, .6vw + 12px, 19px); line-height: 1.55; color: rgb(255 255 255 / .64); }
.line a { color: #fff; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- Phones ---------- */
@media (max-width: 900px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts li { padding: 22px 0 26px; }
  .shots { grid-template-columns: minmax(0, 1fr); }
  .rows li { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px), (max-aspect-ratio: 21/20) {
  /* A portrait phone can't be filled by a wide picture without cutting it, so the picture grows to the
     full width (at the height it can carry) and the headline and text stay above and below it; the
     script centres the three as one group. */
  .stage { --cy: 46%; height: 150vh; height: 150svh; }
  .s-icay .media { height: 64vw; }
  .s-cine .media { height: 104vw; }
  .head { top: var(--headtop, 12svh); padding: 0 20px; opacity: 1; transform: none; }
  .head h3 { margin-top: 14px; font-size: clamp(28px, 8.2vw, 34px); }
  .end {
    top: var(--endtop, 70svh);
    bottom: auto;
    width: auto;
    padding: 0 20px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    opacity: 1;
    transform: none;
    visibility: visible;
  }
  .end .name, .media::before { display: none; }
  .end .one { margin: 0 auto; font-size: 18px; line-height: 1.4; }
  .end .status { font-size: 14px; }
}

@media (max-width: 600px) {
  .wrap { width: auto; margin: 0 20px; }
  .dock { height: 52px; padding: 0 4px 0 16px; }
  .dock-logo img { width: 60px; }
  .dock-rule { margin: 0 4px 0 6px; }
  .dock-link { padding: 0 12px; font-size: 13px; }
  .caps { font-size: 11px; letter-spacing: .22em; }
  .big { font-size: clamp(32px, 9.6vw, 44px); }
  .statement { font-size: clamp(28px, 8.4vw, 38px); }
  .rows li { padding: 22px 0; gap: 8px; }
  .rows p, .facts p { font-size: 16px; }
  .shot { border-radius: 22px; }
  .shot figcaption { padding: 4px 22px 24px; font-size: 15px; }
}

/* ---------- Reduced motion: every picture full size, every line shown ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-in { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .stage { height: auto; }
  .pin { position: relative; height: auto; overflow: visible; display: flex; flex-direction: column; gap: 32px; padding: clamp(80px, 12vh, 128px) 0 0; }
  .head { position: static; transform: none; opacity: 1; }
  .media { position: relative; left: auto; top: auto; transform: none; border-radius: 0; width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .s-icay .media { aspect-ratio: 2400 / 1180; }
  .media::before, .media::after { display: none; }
  .end { position: static; opacity: 1; visibility: visible; transform: none; }
  .pill, footer a, .dock-link { transition: none; }
  .dock { animation: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 767px), (prefers-reduced-motion: reduce) and (max-aspect-ratio: 21/20) {
  .s-cine .media { aspect-ratio: 4 / 5; }
  .s-icay .media { height: auto; }
  .end { padding: 0 20px; }
}

/* ---------- Hero effect: React Bits HoloMosaic (holo.js), or the silk shader (main.js) ---------- */
.hero { overflow: hidden; isolation: isolate; }
.hero-in { position: relative; z-index: 1; }
.hero-line span { color: rgb(255 255 255 / .5); }
.fx { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fx > * { position: absolute; inset: 0; }
/* a dark pool behind the logo and line so they read over the bright tiles, and a fade into the page */
.fx::before, .fx::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fx::before { background: radial-gradient(ellipse 50% 40% at 50% 48%, rgb(0 0 0 / .9), rgb(0 0 0 / .7) 45%, rgb(0 0 0 / .25) 80%, transparent 100%); }
@media (max-width: 767px) {
  /* phones: tiles to the edges, only a light shade at the top and a short fade at the very bottom */
  .fx::before { background: radial-gradient(ellipse 78% 24% at 50% 46%, rgb(0 0 0 / .88), rgb(0 0 0 / .62) 50%, transparent 100%); }
  .fx::after { background: linear-gradient(180deg, rgb(0 0 0 / .3), transparent 10%, transparent 88%, #000); }
}
.eyebrow, .hero-line { text-shadow: 0 1px 16px rgb(0 0 0 / .9), 0 0 2px rgb(0 0 0 / .8); }
.fx::after { background: linear-gradient(180deg, rgb(0 0 0 / .55), transparent 22%, transparent 70%, #000); }

.holo-mosaic-container { position: absolute; width: 100%; height: 100%; overflow: hidden; }
.holo-mosaic-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.fx-shader { background: radial-gradient(70% 50% at 50% 80%, rgb(31 79 216 / .35), transparent 70%); }
.fx canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s ease; }
.fx canvas.on, .fx .holo-mosaic-canvas { opacity: 1; }
/* the orb sits behind the logo, so only a light shade there */
.fx-orb::before { opacity: .45; }
.fx-shader::before { display: none; }

/* The picker, only off syamx.com while the effect is being chosen */
.fxpick {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100vw - 32px);
  position: fixed;
  right: 16px;
  top: calc(16px + env(safe-area-inset-top));
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgb(20 20 20 / .82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgb(255 255 255 / .12);
}
.fxpick button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgb(255 255 255 / .7);
  font: 500 13px/1 ui-sans-serif, system-ui, -apple-system, sans-serif;
  cursor: pointer;
}
.fxpick button[aria-pressed="true"] { background: #fff; color: #000; }
.fxpick button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fxcolors { top: calc(68px + env(safe-area-inset-top)); flex-direction: column; align-items: stretch; border-radius: 20px; }
.fxcolors[hidden] { display: none; }
.fxcolors button { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 14px 0 8px; text-align: left; }
.fxcolors i { width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1px rgb(255 255 255 / .25); }
@media (max-width: 600px) { .fxcolors span { display: none; } .fxcolors button { padding: 0 8px; } }

/* ---------- Ask syamx AI (chat.js) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the Ask button at the end of the chip */
.dock-ask {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  margin-left: 6px;
  padding: 0 16px 0 13px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font: 600 14px/1 ui-sans-serif, system-ui, -apple-system, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), background-color .25s;
}
.dock-ask svg { width: 16px; height: 16px; fill: currentColor; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.dock-ask:hover { background: rgb(255 255 255 / .88); }
.dock-ask:hover svg { transform: rotate(90deg) scale(1.08); }
.dock-ask:active { transform: scale(.96); }
.dock-ask:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.dock-ask[aria-expanded="true"] { background: rgb(255 255 255 / .16); color: #fff; }

/* the orb: violet, lilac and teal light turning inside a sphere */
.orb {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1440;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), 0 0 18px rgb(122 92 255 / .25);
}
.orb::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 0deg, #7a5cff, #3fc7d9, #c4b5ff, #5b3df5, #7a5cff);
  filter: blur(5px);
  animation: orb-turn 6s linear infinite;
}
.orb i {
  position: absolute;
  inset: 22% 26% 34% 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgb(255 255 255 / .95), rgb(255 255 255 / 0) 70%);
  filter: blur(1.5px);
  animation: orb-drift 5s ease-in-out infinite alternate;
}
.orb.big { width: 64px; height: 64px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), 0 0 48px rgb(122 92 255 / .35); }
.orb.big::before { filter: blur(10px); }
.chat.busy .chat-head .orb::before, .thinking .orb::before { animation-duration: 1.6s; }
.chat.busy .chat-head .orb { animation: orb-pulse 1.4s ease-in-out infinite; }
@keyframes orb-turn { to { transform: rotate(360deg); } }
@keyframes orb-drift { to { transform: translate(18%, 14%) scale(.85); } }
@keyframes orb-pulse { 50% { transform: scale(1.08); } }

/* the panel rises out of the chip */
.chat {
  --kb: 0px;
  position: fixed;
  left: 50%;
  bottom: calc(20px + 56px + 12px + env(safe-area-inset-bottom) + var(--kb));
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(420px, 100vw - 24px);
  height: min(600px, 100svh - 120px - var(--kb));
  border-radius: 26px;
  background: #0c0c0e;
  border: 1px solid rgb(255 255 255 / .1);
  box-shadow: 0 30px 80px rgb(0 0 0 / .6), 0 0 0 1px rgb(0 0 0 / .4);
  color: #fff;
  transform-origin: 50% 100%;
  transform: translateX(-50%) translateY(18px) scale(.94);
  opacity: 0;
  filter: blur(6px);
  transition: transform .26s cubic-bezier(.4, 0, 1, 1), opacity .2s ease, filter .26s ease;
}
.chat.open {
  transform: translateX(-50%);
  opacity: 1;
  filter: none;
  transition: transform .55s cubic-bezier(.2, .9, .25, 1.06), opacity .3s ease, filter .45s ease;
}
.chat[hidden] { display: none; }
/* the parts arrive one after another */
.chat > * { opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1); }
.chat.open > * { opacity: 1; transform: none; }
.chat.open > :nth-child(1) { transition-delay: .06s; }
.chat.open > :nth-child(2) { transition-delay: .12s; }
.chat.open > :nth-child(3) { transition-delay: .18s; }
.chat.open > :nth-child(4) { transition-delay: .22s; }

.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 14px 18px; border-bottom: 1px solid rgb(255 255 255 / .07); }
.chat-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.chat-title b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.chat-title span { font-size: 12.5px; color: rgb(255 255 255 / .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: rgb(255 255 255 / .7); cursor: pointer; transition: background-color .2s, color .2s; }
.chat-icon:hover { background: rgb(255 255 255 / .08); color: #fff; }
.chat-icon:focus-visible, .chip:focus-visible, .chat-send:focus-visible, .retry:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.chat-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.chat-log { overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .15) transparent; }
.chat-empty { margin: auto 0; display: grid; justify-items: center; gap: 16px; padding: 12px 0 8px; text-align: center; }
.chat-hello { margin: 4px 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.chips { display: grid; gap: 8px; width: 100%; }
.chip {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: 14px;
  background: rgb(255 255 255 / .04);
  color: rgb(255 255 255 / .85);
  font: 400 14.5px/1.3 inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  animation: chip-in .5s cubic-bezier(.22, 1, .36, 1) forwards;
  animation-delay: calc(.25s + var(--i) * .07s);
  transition: background-color .2s, border-color .2s;
}
.chip:hover { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .18); }
@keyframes chip-in { to { opacity: 1; transform: none; } }

.msg { animation: msg-in .45s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg.user { align-self: flex-end; max-width: 84%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: rgb(255 255 255 / .1); }
.msg.user p { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { align-self: stretch; }
/* answers are Markdown, styled by /md.css (loaded by chat.js) */
.bot-body { font-size: 15px; line-height: 1.6; color: rgb(255 255 255 / .88); }
.bot-body .err { margin-top: 10px; }
.thinking { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.thinking .orb { width: 22px; height: 22px; }
.thinking span {
  background: linear-gradient(90deg, rgb(255 255 255 / .35) 0%, #fff 50%, rgb(255 255 255 / .35) 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.err { color: rgb(255 255 255 / .7); }
.retry { border: 0; padding: 0; background: none; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 8px 12px 0; padding: 6px 6px 6px 16px; border-radius: 22px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); transition: border-color .2s, background-color .2s; }
.chat-form:focus-within { border-color: rgb(196 181 255 / .45); background: rgb(255 255 255 / .08); }
.chat-form textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: #fff; font: 400 16px/1.4 ui-sans-serif, system-ui, -apple-system, sans-serif; padding: 8px 0; max-height: 132px; }
.chat-form textarea::placeholder { color: rgb(255 255 255 / .42); }
.chat-send { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: #000; cursor: pointer; transition: opacity .2s, transform .2s; }
.chat-send:disabled { opacity: .25; cursor: default; }
.chat-send:not(:disabled):active { transform: scale(.92); }
.chat-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat.busy .chat-send svg { fill: currentColor; stroke: none; }
.chat-note { margin: 0; padding: 8px 16px 12px; text-align: center; font-size: 11.5px; color: rgb(255 255 255 / .4); }

@media (max-width: 600px) {
  .dock-ask { width: 40px; padding: 0; justify-content: center; margin-left: 4px; }
  .dock-ask span { display: none; }
  .chat { width: calc(100vw - 16px); bottom: calc(16px + 52px + 10px + env(safe-area-inset-bottom) + var(--kb)); height: min(640px, 100svh - 110px - var(--kb)); border-radius: 22px; }
}

@media (max-width: 360px) {
  .dock { padding-left: 14px; }
  .dock-logo img { width: 48px; }
  .dock-rule { display: none; }
  .dock-link { padding: 0 7px; font-size: 12.5px; }
  .dock-ask { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat, .chat.open, .chat > *, .chat.open > * { transition: none; filter: none; }
  .orb::before, .orb i, .chat.busy .chat-head .orb, .thinking span { animation: none; }
  .chip, .msg { animation: none; opacity: 1; transform: none; }
  .dock-ask, .dock-ask svg { transition: none; }
}
