:root {
  --bg: #0c0b0a;
  --glow: rgba(193, 122, 90, 0.07);
  --text-primary: #d8d3c9;
  --text-muted: #8b8f96;
  --text-name: #9a8f82;
  --accent: #c17a5a;
  --pill-bg: rgba(255,255,255,0.03);
  --pill-border: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.02);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--text-primary);
  overflow: hidden;
}

::selection {
  background: rgba(161, 95, 167, 0.4);
  color: var(--text-primary);
}

.bg-wrap {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, var(--glow) 0%, transparent 80%),
    radial-gradient(circle at 100% 100%, rgba(255,255,255,0.02) 0%, transparent 50%);
}

.grain {
  position: absolute; inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC44NSIgbnVtT2N0YXZlcz0iMiIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxIDAiLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbikiLz48L3N2Zz4=");
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 40px 28px;
}

.name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  letter-spacing: 6px;
  color: var(--text-name);
  text-transform: uppercase;
  margin-bottom: 48px;
}

.name h1 {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.name #status {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.bio {
  flex: 1;
  overflow-y: auto;
  padding-right: 12px;
}

.bio::-webkit-scrollbar {
  width: 4px;
}

.bio::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}

.bio p {
  font-size: 21px;
  line-height: 1.65;
  color: var(--text-primary);
  margin: 0 0 26px 0;
  font-weight: 400;
}

.bio a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(193,122,90,0.35);
}

.bio a:hover {
  border-bottom-color: var(--accent);
}

.footer {
  padding-top: 20px;
}

.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.pill {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: normal;
  word-break: break-word;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1.4;
  text-align: left;
}

.pill:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.16);
}

.input-row {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--pill-border);
  border-radius: 24px;
  padding: 14px 18px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(193, 122, 90, 0.15);
}

.input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
}

.input-row input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 0 0 10px;
  transition: color 0.2s ease;
}

.send-btn:hover {
  color: var(--text-primary);
}

.toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 320px;
  background: rgba(10, 13, 18, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--pill-border);
  color: var(--text-primary);
  padding: 24px 20px 20px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@keyframes snakeWalk {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.thinking-text span {
  display: inline-block;
  animation: snakeWalk 1.2s infinite ease-in-out;
}

.toast-close {
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-muted);
  background: none;
  border: none;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--text-primary);
}

#response-area {
  min-height: 1.5em;
  transition: opacity 0.3s;
  color: var(--accent);
  margin-top: 5px;
}

.social-sidebar {
  position: fixed;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 34px;
  z-index: 50;
}

.social-icon {
  color: var(--text-muted);
  transition: color 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon:hover {
  color: var(--accent);
  transform: translateY(-3px) scale(1.1);
}

.social-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

@media (max-width: 1024px) {
  .page {
    padding: 40px 80px 24px 30px;
  }
  .bio {
    padding-left: 50px;
  }
  .footer {
    margin-right: -50px;
  }
  .social-sidebar {
    right: 20px;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 30px 60px 20px 24px;
  }
  .bio {
    padding-left: 36px;
  }
  .footer {
    margin-right: -36px;
  }
  .social-sidebar {
    right: 15px;
    gap: 20px;
  }
  .social-icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow: auto;
  }

  .page {
    height: auto;
    min-height: 100vh;
    padding: 30px 45px 20px 20px;
  }

  .footer {
    margin-right: -25px;
  }

  .bio {
    overflow-y: visible;
    padding-right: 0;
    padding-left: 25px;
  }

  .name {
    margin-bottom: 24px;
    margin-right: -25px;
  }
  .name h1 {
    font-size: 16px;
    letter-spacing: 4px;
  }
  .name #status {
    font-size: 11px;
  }

  .bio p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .suggestions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pill {
    font-size: 13px;
    padding: 10px 14px;
    text-align: center;
  }

  .toast {
    left: 5%;
    right: 5%;
    width: 90%;
    bottom: 20px;
  }

  .social-sidebar {
    right: 12px;
    gap: 16px;
    top: 45%;
    top: 45svh;
  }
  .social-icon svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 400px) {
  .page { padding: 20px 40px 16px 16px; }
  .bio { padding-left: 24px; }
  .footer, .name { margin-right: -24px; }
  .bio p { font-size: 16px; }
  .input-row { padding: 12px 14px; }
  .input-row input { font-size: 13px; }
  .social-sidebar { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
  .social-icon { transition: none; }
}
