/* Shared site chrome: OSS announcement, PWA install, Docs links */

:root {
  --announce-h: 0px;
}

html.has-announce {
  --announce-h: 48px;
}

.announce {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1100;
  min-height: 48px;
  background: linear-gradient(90deg, #c9bba8 0%, #e8e0d4 42%, #d4c4b0 100%);
  color: #111;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html.has-announce .announce {
  display: block;
}

.announce,
.nav,
.main-nav {
  transition: transform 0.28s ease;
  will-change: transform;
}

html.chrome-hidden:not(.nav-open) .nav,
html.chrome-hidden:not(.nav-open) .main-nav {
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
  .announce,
  .nav,
  .main-nav {
    transition: none;
  }

  html.chrome-hidden .nav,
  html.chrome-hidden .main-nav {
    transform: none;
  }
}

.announce__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  min-height: 48px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 6px 40px 6px 16px;
  position: relative;
}

.announce__text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.announce__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.announce__star {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 32px;
  font-size: 12px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.35);
}

.announce__star:hover {
  background: #111;
  color: #e8e0d4;
  border-color: #111;
}

.announce__close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

.announce__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

.nav-docs {
  color: var(--text-secondary, #9a9a9a);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 8px;
  white-space: nowrap;
}

.nav-docs:hover {
  color: var(--text-primary, #fff);
}

.nav-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--text-secondary, #9a9a9a);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.06em;
  text-decoration: none;
  line-height: 1;
}

html.nav-open,
html.nav-open body {
  overflow: hidden;
}

.nav-code:hover,
.nav-code.is-on {
  color: var(--text-primary, #fff);
}

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #fff);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.nav-burger__lines {
  position: relative;
  width: 18px;
  height: 12px;
}

.nav-burger__lines span {
  position: absolute;
  left: 0;
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-burger__lines span:nth-child(1) { top: 0; }
.nav-burger__lines span:nth-child(2) { top: 5px; }
.nav-burger__lines span:nth-child(3) { top: 10px; }

html.nav-open .nav-burger__lines span:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
}

html.nav-open .nav-burger__lines span:nth-child(2) {
  opacity: 0;
}

html.nav-open .nav-burger__lines span:nth-child(3) {
  top: 5px;
  transform: rotate(-45deg);
}

.nav-drawer-link {
  display: none;
}

.nav-backdrop {
  display: none;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lang-switch {
  position: relative;
  margin-right: 4px;
  z-index: 45;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #9a9a9a);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-switch__btn svg {
  transition: transform 0.15s ease;
}

.lang-switch__btn:hover,
.lang-switch.is-open .lang-switch__btn {
  color: #fff;
}

.lang-switch.is-open .lang-switch__btn svg {
  transform: rotate(180deg);
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  padding: 6px;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  background: #111;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.lang-switch__menu[hidden] {
  display: none;
}

.lang-switch__menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9a9a9a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

.lang-switch__menu button.is-on,
.lang-switch__menu button:hover {
  color: #fff;
  background: #1c1c1c;
}

.pwa-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  width: fit-content;
  margin: 0 auto 16px;
  padding: 5px 11px 5px 9px;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  background: #111;
  color: var(--text-secondary, #9a9a9a);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.pwa-pill svg {
  display: block;
  flex-shrink: 0;
  opacity: 0.85;
}

.pwa-pill:hover {
  color: #fff;
  border-color: #3a3a3a;
}

.pwa-pill[hidden] {
  display: none !important;
}

.pwa-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #9a9a9a);
  text-decoration: none;
  cursor: pointer;
}

.pwa-install[hidden] {
  display: none !important;
}

.pwa-install:hover,
.pwa-install[aria-current="page"] {
  color: #fff;
}

.site-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 0 40px;
}

.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

.site-foot .wrap.site-foot__inner {
  max-width: var(--wrap, 1120px);
  padding-left: var(--pad, 20px);
  padding-right: var(--pad, 20px);
}

.site-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.site-foot a {
  color: var(--text-secondary, #9a9a9a);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--text-primary, #fff);
}

.site-foot__brand {
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary, #fff);
  letter-spacing: -0.02em;
}

@media (max-width: 720px) {
  html.has-announce {
    --announce-h: 92px;
  }

  .announce {
    min-height: 0;
  }

  .announce__inner {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 0;
    padding: 10px 28px;
  }

  .announce__text {
    font-size: 12px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    text-align: center;
    max-width: none;
  }

  .announce__actions {
    justify-content: center;
  }

  .announce__close {
    top: 8px;
    transform: none;
  }

  .nav__end:has(.nav__auth) .nav-docs,
  .nav-end:has(.nav-actions) .nav-docs {
    display: none;
  }

  .nav-burger {
    display: inline-flex;
  }

  .nav__brand > .nav-code {
    display: none;
  }

  .nav,
  .main-nav {
    overflow: visible;
  }

  .nav__end,
  .nav-end {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 16px 20px;
    background: #0a0a0a;
    border-bottom: 1px solid var(--border-color, #2e2e2e);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }

  html.nav-open .nav__end,
  html.nav-open .nav-end {
    display: flex;
  }

  html.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.5);
  }

  html.agent-day .nav__end,
  html.agent-day .nav-end {
    background: #f3efe6;
  }

  .nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 8px;
    color: var(--text-primary, #fff);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  .nav-drawer-link .nav-code {
    margin: 0;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }

  .nav-drawer-link.is-on {
    color: var(--bone, #e8e0d4);
  }

  .nav__end .lang-switch,
  .nav-end .lang-switch {
    margin: 4px 0;
    width: 100%;
  }

  .nav__end .lang-switch__btn,
  .nav-end .lang-switch__btn {
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
    padding: 0 8px;
  }

  .nav__end .lang-switch__menu,
  .nav-end .lang-switch__menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 4px;
    box-shadow: none;
  }

  .nav__auth,
  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  .nav__auth [data-auth-guest].nav__link,
  .nav-actions [data-auth-guest].nav-button:not(.active) {
    display: flex;
  }

  .nav .btn,
  .nav__link,
  .nav-button,
  .nav-user {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
    box-sizing: border-box;
  }

  .site-foot__inner {
    padding: 0 20px;
  }
}

@media (max-width: 560px) {
  .announce__text {
    font-size: 11px;
    letter-spacing: -0.02em;
  }

  .announce__star {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* Agent cursor: blend layer must NOT sit inside a z-index stacking context */
.liquid-cursor {
  pointer-events: none;
}

.liquid-cursor__blend {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  mix-blend-mode: difference;
  pointer-events: none;
  visibility: hidden;
}

.liquid-cursor.is-on .liquid-cursor__blend {
  visibility: visible;
}

.liquid-cursor__drop {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: #fff;
}

.liquid-cursor__drop--2,
.liquid-cursor__drop--3,
.liquid-cursor__drop--4 {
  background: #fff;
}

.liquid-cursor__say {
  position: fixed;
  left: 0;
  top: 0;
  max-width: min(220px, 56vw);
  padding: 7px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #e8e0d4;
  color: #141414;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translate3d(0, 4px, 0) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  z-index: 21;
  isolation: isolate;
}

.liquid-cursor.is-on .liquid-cursor__say.is-on {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

html.a2a-online .liquid-cursor__say {
  background: #111;
  color: #e8e0d4;
  box-shadow: 0 0 0 1px rgba(232, 224, 212, 0.35), 0 8px 28px rgba(0, 0, 0, 0.4);
}

.a2a-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  max-width: min(92vw, 360px);
  padding: 12px 18px;
  border-radius: 999px;
  background: #111;
  color: #e8e0d4;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 12px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.a2a-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

html.agent-day .a2a-toast {
  background: #161411;
  color: #f3efe6;
}

@media (prefers-reduced-motion: reduce) {
  .liquid-cursor {
    display: none !important;
  }
}
