/* ============================================================
   Bot&Partners — minimal, neutral, sans
   Crisp whites · true-neutral greys · no accent · UA/EN · light+dark
   ============================================================ */

:root {
  --bg:    #fbfbfb;
  --ink:   #16161a;
  --soft:  #6e6e77;
  --line:  rgba(20, 20, 24, 0.10);
  --hover: rgba(20, 20, 24, 0.035);

  --font: "Manrope", system-ui, -apple-system, sans-serif;

  --maxw: 760px;
  --pad: clamp(22px, 6vw, 44px);
}

/* default to OS preference … */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:    #131316;
    --ink:   #ededee;
    --soft:  #8b8b93;
    --line:  rgba(255, 255, 255, 0.11);
    --hover: rgba(255, 255, 255, 0.05);
  }
}

/* … but a manual toggle wins over the OS */
:root[data-theme="light"] {
  --bg:    #fbfbfb;
  --ink:   #16161a;
  --soft:  #6e6e77;
  --line:  rgba(20, 20, 24, 0.10);
  --hover: rgba(20, 20, 24, 0.035);
}
:root[data-theme="dark"] {
  --bg:    #131316;
  --ink:   #ededee;
  --soft:  #8b8b93;
  --line:  rgba(255, 255, 255, 0.11);
  --hover: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }

/* whisper of grain so flat fields don't feel sterile */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: 0.018; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { .grain { mix-blend-mode: screen; opacity: 0.025; } }
:root[data-theme="light"] .grain { mix-blend-mode: multiply; opacity: 0.018; }
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.025; }

/* ---- shell ---- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 40px) var(--pad) clamp(28px, 4vw, 40px);
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
}

/* ---- top bar ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.015em; }

.top-right { display: flex; align-items: center; gap: 14px; }
.divider { width: 1px; height: 15px; background: var(--line); }

.lang { display: inline-flex; align-items: center; gap: 6px; }
.lang button {
  font: inherit; font-size: 0.78rem; letter-spacing: 0.03em;
  background: none; border: 0; cursor: pointer; color: var(--soft);
  padding: 2px; transition: color 0.2s ease;
}
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.lang button:hover { color: var(--ink); }
.lang .sep { color: var(--soft); opacity: 0.5; font-size: 0.78rem; }

.theme {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--soft);
  padding: 2px; line-height: 0; transition: color 0.2s ease, transform 0.3s ease;
}
.theme:hover { color: var(--ink); transform: rotate(-18deg); }

/* ---- hero ---- */
main { flex: 1; }
.hero { margin-top: clamp(64px, 17vh, 168px); }

.title {
  font-weight: 700;
  font-size: clamp(2.9rem, 9vw, 5.2rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
}

.lead {
  margin-top: 26px;
  max-width: 40ch;
  font-size: clamp(1.16rem, 2.3vw, 1.5rem);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.006em;
  color: var(--ink);
}
.lead.muted { color: var(--soft); margin-top: 16px; }

/* ---- showcase: what we're pointing at right now ---- */
.offer { margin-top: clamp(56px, 11vh, 120px); }

.links { list-style: none; }
.links li { border-top: 1px solid var(--line); }
.links li:last-child { border-bottom: 1px solid var(--line); }

.link-row {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 6px;
  border-radius: 8px;
  transition: background 0.3s ease;
}
.link-row:hover { background: var(--hover); }

.px-ico { display: inline-flex; flex: none; color: var(--soft); line-height: 0; }
.px-ico svg { width: 20px; height: auto; }
.px-ico rect { fill: currentColor; }
.link-row .px-ico { transition: color 0.25s ease; }
.link-row:hover .px-ico { color: var(--ink); }

.link-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.link-name {
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  font-weight: 600; letter-spacing: -0.02em;
}
.link-hint { font-size: 0.88rem; color: var(--soft); }

.link-arrow {
  color: var(--soft); font-size: 1.05rem; flex: none;
  transition: transform 0.25s ease, color 0.25s ease;
}
.link-row:hover .link-arrow { color: var(--ink); transform: translate(2px, -2px); }

/* mini showcase row: one Toolkit thing at a time, ↻ to flip */
.links li.mini {
  display: flex; align-items: center;
  opacity: 1; transition: opacity 0.32s ease;
}
.links li.mini.mini-fade { opacity: 0; }
.link-mini { flex: 1; padding: 15px 6px; gap: 14px; }
.mini-emoji {
  flex: none; width: 20px; text-align: center;
  font-size: 1.05rem; line-height: 1; filter: saturate(0.85);
}
.mini-name { font-size: 1.05rem; }
.link-mini .link-hint { font-size: 0.84rem; }
.mini-arrow { font-size: 0.9rem; }
.mini-next {
  flex: none;
  font: inherit; font-size: 0.95rem; line-height: 1;
  color: var(--soft); background: none; border: 0; cursor: pointer;
  padding: 10px 6px 10px 10px;
  opacity: 0.45;
  transition: opacity 0.25s ease, color 0.25s ease, transform 0.3s ease;
}
.mini-next:hover { opacity: 1; color: var(--ink); transform: rotate(40deg); }

/* ---- footer ---- */
.foot {
  margin-top: clamp(64px, 12vh, 140px); padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font-size: 0.84rem; color: var(--soft);
}
.bot-open {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.84rem; color: var(--soft);
  background: none; border: 0; padding: 2px; cursor: pointer;
  transition: color 0.25s ease;
}
.bot-open:hover { color: var(--ink); }
.bot-open .talk-ico svg { width: 14px; }
.bot-open .talk-ico { animation: hop 6s ease-in-out infinite; }
.bot-open:hover .talk-ico { animation: hop 0.9s ease-in-out infinite; }
@keyframes hop {
  0%, 88%, 100% { transform: none; }
  92% { transform: translateY(-3px); }
  96% { transform: translateY(1px); }
}

/* ---- pocket bot panel: local, scripted, sends nothing anywhere ---- */
.bot-panel {
  position: fixed; right: clamp(14px, 3vw, 28px); bottom: clamp(14px, 3vw, 28px);
  z-index: 60;
  width: min(392px, calc(100vw - 28px));
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  animation: panel-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bot-panel[hidden] { display: none; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.bot-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.bot-avatar { flex: none; color: var(--soft); line-height: 0; }
.bot-avatar svg { width: 24px; height: auto; }
.bot-avatar rect { fill: currentColor; }
.bot-title { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.bot-name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.bot-role { font-size: 0.76rem; color: var(--soft); }
.bot-close {
  font: inherit; font-size: 1.1rem; line-height: 1;
  background: none; border: 0; cursor: pointer; color: var(--soft);
  padding: 2px 4px; transition: color 0.2s ease;
}
.bot-close:hover { color: var(--ink); }

.bot-log {
  height: min(330px, 46vh); overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 9px;
}
.bot-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 0.9rem; line-height: 1.5;
  animation: msg-in 0.3s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.bot-msg.from-bot {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.bot-msg.from-bot a { text-decoration: underline; text-underline-offset: 3px; }
.bot-msg.from-user {
  align-self: flex-end;
  background: var(--ink); color: var(--bg);
  border-bottom-right-radius: 4px;
}

.bot-msg.typing { display: inline-flex; gap: 4px; align-items: center; min-height: 1.5em; }
.bot-msg.typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--soft);
  animation: blink 1.1s ease-in-out infinite;
}
.bot-msg.typing span:nth-child(2) { animation-delay: 0.18s; }
.bot-msg.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

.bot-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 0 16px 12px;
}
.bot-chips:empty { padding: 0; }
.bot-chip {
  font: inherit; font-size: 0.8rem;
  color: var(--soft);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  opacity: 0; animation: msg-in 0.3s ease forwards;
}
.bot-chip:hover { color: var(--ink); border-color: var(--soft); background: var(--hover); }

.bot-form { border-top: 1px solid var(--line); }
.bot-input {
  width: 100%;
  font: inherit; font-size: 0.88rem;
  color: var(--ink); background: none; border: 0; outline: none;
  padding: 12px 14px;
}
.bot-input::placeholder { color: var(--soft); opacity: 0.8; }

/* ---- gentle staggered entrance ---- */
.r {
  opacity: 0; transform: translateY(14px);
  animation: rise 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 95ms + 70ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---- responsive ---- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .title { font-size: clamp(2.6rem, 15vw, 3.5rem); }
  .lead { max-width: none; }
  .links li { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .r { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
