/* ===========================================================
   TOKENS
=========================================================== */
:root {
  --bg: #0b0b10;
  --bg-alt: #131319;
  --card: #16161d;
  --card-border: #26262f;

  --pink: #ff2e92;
  --blue: #29e7ff;
  --yellow: #f5ff3d;

  --text: #ededf2;
  --text-muted: #9a9aae;

  --font-display: "Archivo Black", sans-serif;
  --font-tag: "Bebas Neue", sans-serif;
  --font-body: "Space Grotesk", sans-serif;

  --radius: 14px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 2.2rem;
  letter-spacing: 0.01em;
}

.section-title span {
  font-family: var(--font-tag);
  font-size: 1.1rem;
  color: var(--bg);
  background: var(--yellow);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  transform: rotate(-4deg);
}

/* ===========================================================
   NAV
=========================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
  background: rgba(11, 11, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav__dagger { color: var(--pink); }

.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
}

.nav__links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav__links a:hover,
.nav__links a:focus-visible { color: var(--yellow); }

/* ===========================================================
   MARQUEE
=========================================================== */
.marquee {
  background: var(--pink);
  color: var(--bg);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 3px solid var(--bg);
}

.marquee__track {
  display: inline-flex;
  gap: 1rem;
  padding: 0.55rem 0;
  font-family: var(--font-tag);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  animation: scroll-left 22s linear infinite;
}

.marquee__track span { flex: 0 0 auto; }

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===========================================================
   HERO
=========================================================== */
.hero {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6.5rem) clamp(1.25rem, 5vw, 3rem) clamp(4rem, 8vw, 6rem);
}

.hero__scribble {
  position: absolute;
  top: clamp(1rem, 4vw, 2rem);
  right: clamp(1.25rem, 5vw, 3rem);
  font-family: var(--font-tag);
  font-size: 0.95rem;
  color: var(--blue);
  border: 1.5px dashed var(--blue);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  transform: rotate(6deg);
}

.hero__title {
  margin: 0 0 1.8rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 5.2rem);
  line-height: 1.02;
  text-transform: uppercase;
}

.hero__line {
  display: block;
  width: fit-content;
}

.hero__line--pink   { color: var(--pink);   transform: rotate(-2deg); }
.hero__line--blue   { color: var(--blue);   transform: rotate(1.2deg); margin-left: clamp(0px, 4vw, 3rem); }
.hero__line--yellow { color: var(--yellow); transform: rotate(-1deg); }

.hero__sub {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 2.4rem;
}

.hero__sub strong { color: var(--text); }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  display: inline-block;
}

.btn:hover, .btn:focus-visible { transform: translateY(-2px); }

.btn--primary {
  background: var(--yellow);
  color: var(--bg);
}

.btn--primary:hover { background: var(--pink); color: var(--bg); }

.btn--ghost {
  border-color: var(--card-border);
  color: var(--text);
}

.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ===========================================================
   LEGACY
=========================================================== */
.legacy {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 5rem;
}

.legacy__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.legacy__card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.legacy__card:hover {
  border-color: var(--pink);
  transform: translateY(-3px);
}

.legacy__card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
  color: var(--yellow);
}

.legacy__card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.legacy__card em { color: var(--blue); font-style: normal; }

/* ===========================================================
   ERAS
=========================================================== */
.eras {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 5rem;
}

.eras__strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.era-card {
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  color: var(--bg);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.2s ease;
}

.era-card:hover { transform: rotate(-1.5deg) translateY(-4px); }

.era-card--pink   { background: var(--pink); }
.era-card--blue   { background: var(--blue); }
.era-card--yellow { background: var(--yellow); }

.era-card__tag {
  font-family: var(--font-tag);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: auto;
}

.era-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0.6rem 0 0.35rem;
}

.era-card p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
}

/* ===========================================================
   CHAT
=========================================================== */
.chat-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 6rem;
}

.chat-section__disclaimer {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: -1.2rem 0 2rem;
  border-left: 3px solid var(--blue);
  padding-left: 0.9rem;
}

.chat-section__disclaimer strong { color: var(--text); }

.chat-window {
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(255, 46, 146, 0.08);
}

.chat-window__header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-alt);
}

.chat-window__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--bg);
  flex-shrink: 0;
}

.chat-window__name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-window__badge {
  font-family: var(--font-tag);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  background: var(--yellow);
  color: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.chat-window__status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-setup {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(41, 231, 255, 0.06);
}

.chat-setup__text {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: 0.9rem;
}

.chat-setup__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.chat-setup__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-setup select,
.chat-setup button {
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.65rem 0.95rem;
}

.chat-setup select {
  min-width: 210px;
}

.chat-setup button {
  cursor: pointer;
}

.chat-setup button:hover,
.chat-setup button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.chat-setup__secondary {
  background: transparent !important;
}

.chat-setup__progress {
  margin-top: 0.95rem;
}

.chat-setup__progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.chat-setup__progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  transition: width 0.2s ease;
}

.chat-setup__progress-text {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chat-window__clear {
  margin-left: auto;
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.chat-window__clear:hover,
.chat-window__clear:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
}

.chat-window__messages {
  flex: 1;
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.msg {
  max-width: 80%;
  padding: 0.65rem 0.95rem;
  border-radius: 16px;
  font-size: 0.94rem;
  animation: msg-in 0.25s ease;
  white-space: pre-wrap;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg--bot {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 4px;
}

.msg--bot-wrap {
  align-self: flex-start;
  max-width: 80%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.msg--bot-wrap .msg--bot {
  max-width: 100%;
}

.msg-votes {
  display: flex;
  gap: 0.4rem;
  padding-left: 0.3rem;
}

.msg-votes button {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-votes button:hover,
.msg-votes button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.msg-votes button.is-active-up {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--bg);
}

.msg-votes button.is-active-down {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--bg);
}

.msg-votes button:disabled {
  cursor: default;
}

.msg--user {
  align-self: flex-end;
  background: var(--pink);
  color: var(--bg);
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

.msg--typing {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  padding: 0.85rem 1rem;
}

.msg--typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite ease-in-out;
}

.msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.msg--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-window__input {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem;
  border-top: 1px solid var(--card-border);
  background: var(--bg-alt);
}

.chat-window__input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.chat-window__input input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.chat-window__input button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--yellow);
  color: var(--bg);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.2s ease;
}

.chat-window__input button:hover { background: var(--pink); transform: scale(1.06); }
.chat-window__input button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chat-window__input input:disabled,
.chat-window__input button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===========================================================
   FOOTER
=========================================================== */
.footer {
  text-align: center;
  padding: 2.5rem 1.25rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
}

.footer p { margin: 0.3rem 0; }
.footer__small { color: #5f5f70; }

/* ===========================================================
   RESPONSIVE
=========================================================== */
@media (max-width: 860px) {
  .legacy__grid { grid-template-columns: 1fr; }
  .eras__strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .nav__links { gap: 0.9rem; }
  .nav__links a { font-size: 0.85rem; }
  .eras__strip { grid-template-columns: 1fr; }
  .hero__line--blue { margin-left: 0; }
}
