/* ───────────── Chat Interface ───────────── */
.chat {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat--center {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.chat--top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 17, 31, 0.95);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Input row */
.chat__input-row {
  width: 100%;
  max-width: 640px;
  padding: 16px 24px;
}

.chat--top .chat__input-row {
  max-width: 1560px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 12px 32px;
}

.chat__input-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 0;
}

.chat__input {
  width: 100%;
  padding: 16px 56px 16px 24px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  caret-color: var(--cyan-400);
}

.chat__input::placeholder {
  color: var(--slate-500);
}

.chat__input:focus {
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 3px rgba(94, 220, 255, 0.12);
}

.chat__send {
  position: absolute;
  right: 6px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: var(--cyan-400);
  color: var(--navy-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}

.chat__send:hover {
  background: var(--cyan-500);
  transform: scale(1.05);
}

.chat__send:active,
.chat__send.is-pressed {
  background: var(--cyan-600);
  transform: scale(0.95);
}

.chat__send svg {
  width: 18px;
  height: 18px;
}

/* Suggestions — Google-style dropdown list */
.chat__suggestions {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-top: none;
  border-radius: 0 0 22px 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  max-height: 0;
  opacity: 0;
  padding: 0;
  transition: max-height 0.3s var(--ease), opacity 0.2s var(--ease), padding 0.3s var(--ease);
  pointer-events: none;
}

.chat__suggestions.is-open {
  max-height: 280px;
  opacity: 1;
  padding: 8px 0 6px;
  pointer-events: auto;
}

.chat__input-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
}

/* When dropdown is open, merge input bottom edge into it */
.chat__input.suggestions-open {
  border-radius: 22px 22px 0 0;
  border-bottom-color: transparent;
}

.chat__suggestions button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 20px;
  border: none;
  background: transparent;
  color: var(--slate-400);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.chat__suggestions button::before {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: var(--slate-500);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: background-color 0.15s;
}

.chat__suggestions button:hover {
  background: rgba(94, 220, 255, 0.06);
  color: var(--ink);
}

.chat__suggestions button:hover::before {
  background-color: var(--cyan-400);
}

.chat__suggestions button:focus-visible {
  outline: none;
  background: rgba(94, 220, 255, 0.08);
  color: var(--ink);
}

.chat__suggestions button.is-hint {
  animation: hint-blink 0.6s ease-in-out 2;
}

@keyframes hint-blink {
  0%, 100% { background: transparent; }
  50% { background: rgba(94, 220, 255, 0.10); }
}

/* Thinking dots */
.chat__thinking {
  display: flex;
  gap: 6px;
  padding: 16px 0;
  justify-content: center;
}

.chat__thinking[hidden] {
  display: none;
}

.chat__thinking span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cyan-400);
  opacity: 0.4;
  animation: thinking-bounce 1.4s ease-in-out infinite;
}

.chat__thinking span:nth-child(2) { animation-delay: 0.16s; }
.chat__thinking span:nth-child(3) { animation-delay: 0.32s; }

@keyframes thinking-bounce {
  0%, 80%, 100% { opacity: 0.4; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-6px); }
}

/* ───────────── Fake Cursor ───────────── */
.fake-cursor {
  position: fixed;
  z-index: 200;
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fake-cursor::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 16px 0 0 10px;
  border-color: transparent transparent transparent var(--ink);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* ───────────── Sections Container ───────────── */
.sections {
  position: relative;
  min-height: calc(100vh - 80px);
  overflow: hidden;
}

.section-panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  padding-bottom: 60px;
}

.section-panel--active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

.section-panel--exit {
  opacity: 0;
  transform: translateX(60px);
}

.section-panel--enter {
  opacity: 0;
  transform: translateX(-60px);
  transition: none;
}

/* ───────────── Brand Mark (in chat bar) ───────────── */
.ff-mark {
  display: none;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.chat--top .ff-mark {
  display: flex;
}

.ff-mark svg {
  width: 24px;
  height: 24px;
}

.ff-mark .ff-mark__text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.92;
  color: var(--ink);
}

.ff-mark .ff-mark__text span:last-child {
  color: var(--slate-400);
}

/* ───────────── Classic View Button (in chat bar) ───────────── */
.classic-link {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--slate-400);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
  flex-shrink: 0;
}

.chat--top .classic-link {
  display: flex;
}

.classic-link:hover {
  color: var(--cyan-400);
  border-color: rgba(94, 220, 255, 0.35);
}

.classic-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .classic-link span {
    display: none;
  }
}

/* ───────────── Chat Footer (Legal) ───────────── */
.chat-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 12px 24px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  color: var(--slate-500);
  background: rgba(7, 17, 31, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}

.chat-footer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chat-footer a {
  color: var(--slate-500);
  transition: color 0.18s var(--ease);
}

.chat-footer a:hover {
  color: var(--cyan-400);
}

/* ───────────── Accessibility ───────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ───────────── Mobile ───────────── */
@media (max-width: 720px) {
  .chat__input-row {
    padding: 12px 16px;
  }

  .chat__input {
    padding: 14px 50px 14px 20px;
    font-size: 15px;
  }

  .chat__send {
    width: 38px;
    height: 38px;
  }

  .chat__suggestions button {
    font-size: 13px;
    padding: 10px 16px;
  }

  .sections {
    margin-top: 0;
  }

  .section-panel--active {
    transform: translateY(0);
  }

  .section-panel--exit {
    transform: translateY(-40px);
  }

  .section-panel--enter {
    transform: translateY(40px);
  }

  .fake-cursor {
    display: none !important;
  }

  .ff-mark .ff-mark__text {
    display: none;
  }
}

/* ───────────── Reduced motion ───────────── */
@media (prefers-reduced-motion: reduce) {
  .chat,
  .section-panel,
  .fake-cursor,
  .chat__suggestions,
  .chat--top .chat__suggestions {
    transition: none !important;
    animation: none !important;
  }

  .chat__thinking span {
    animation: none;
    opacity: 0.7;
  }
}
