/* ================== Base ================== */
:root {
  --bg: #000;
  --fg: #e9fbff;
  --neon: #00ffee;
  --neon2: #00ffaa;
  --system: #00ff90;
  --amee: #00e6ff;
  --muted: #8abec4;
  --panel: #06141a;
  --panel2: #0b2027;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Source Sans Pro", system-ui, sans-serif;
  overflow-x: hidden;
}

/* ================== Header ================== */
#header {
  text-align: center;
  padding: 64px 16px 16px;
}

.logo {
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--neon);
  text-shadow: 0 0 18px var(--neon);
  animation: pulse 2.8s ease-in-out infinite alternate;
}

#header h1 {
  margin: 8px 0 6px;
  color: var(--neon);
  text-shadow: 0 0 12px var(--neon);
  letter-spacing: 0.06em;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

#header p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

/* ================== Navigation ================== */
nav ul {
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--neon);
  border-radius: 8px;
  max-width: 90%;
}

nav li {
  border-left: 1px solid var(--neon);
}

nav li:first-child {
  border-left: none;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  text-decoration: none;
  color: var(--neon);
  transition: 0.25s;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

nav a i {
  color: var(--neon);
  font-size: 1rem;
  transition: 0.25s;
}

nav a:hover {
  background: rgba(0, 255, 255, 0.14);
  color: #021923;
}

nav a:hover i {
  color: var(--neon2);
  transform: scale(1.2);
}

/* Responsive Nav (vertical stack on mobile) */
@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    border: none;
    gap: 6px;
  }

  nav li {
    border: none;
  }

  nav a {
    justify-content: center;
    border: 1px solid var(--neon);
    border-radius: 6px;
  }
}

/* ================== Content ================== */
#main {
  max-width: 880px;
  margin: 40px auto;
  padding: 0 16px;
}

.section {
  background: linear-gradient(180deg, rgba(11, 32, 39, 0.75), rgba(6, 20, 26, 0.75));
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 12px;
  padding: clamp(1.2rem, 4vw, 2rem);
  margin-bottom: 22px;
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
}

.section p,
.section li {
  font-size: clamp(0.9rem, 2.6vw, 1rem);
  line-height: 1.6;
}

/* ================== Form ================== */
form {
  display: grid;
  gap: 10px;
  max-width: 460px;
  margin: 10px auto 0;
}

input,
textarea {
  background: #000;
  color: var(--fg);
  border: 1px solid var(--neon);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.25);
}

button.primary {
  background: var(--neon);
  color: #001a1d;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}

button.primary:hover {
  background: var(--neon2);
}

/* ================== Footer ================== */
#footer {
  text-align: center;
  color: #74a9b0;
  padding: 26px 12px;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

/* ================== Awakening Dialogue ================== */
#awakening {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vw;
}

.awake-inner {
  width: 100%;
  max-width: 720px;
}

.lines {
  font-family: "Share Tech Mono", monospace;
  line-height: 1.5;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  word-wrap: break-word;
}

.line {
  opacity: 0.9;
  margin: 0 0 6px;
}

.sys {
  color: var(--system);
}

.amee {
  color: var(--amee);
}

.cursor {
  display: inline-block;
  width: 10px;
  margin-left: 2px;
  background: currentColor;
  animation: blink 1s steps(1, end) infinite;
}

.ghost-btn {
  margin-top: 16px;
  background: transparent;
  color: #8ad9e0;
  border: 1px solid #64c9d2;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

.ghost-btn:hover {
  box-shadow: 0 0 14px rgba(100, 201, 210, 0.5);
}

body.intro-done #awakening {
  display: none;
}

/* ================== Chat Widget ================== */
#chat-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--neon);
  color: #002326;
  border: 0;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 255, 255, 0.28);
  font-size: 1.1rem;
}

#chat-toggle:hover {
  background: var(--neon2);
}

#chat-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 20;
  width: min(360px, 94vw);
  background: var(--panel);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 255, 255, 0.18);
  overflow: hidden;
}

@media (max-width: 480px) {
  #chat-panel {
    width: 90%;
    right: 5%;
    bottom: 100px;
  }
}

.chat-body {
  max-height: 46vh;
  overflow-y: auto;
  padding: 12px;
  font-size: clamp(0.85rem, 2.4vw, 1rem);
}

/* ================== Animations ================== */
@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    text-shadow: 0 0 10px var(--neon), 0 0 20px var(--neon);
  }
  100% {
    text-shadow: 0 0 24px var(--neon), 0 0 46px #00ffff;
  }
}
