:root {
  color-scheme: dark;
  --bg: #030805;
  --panel: rgba(8, 26, 17, 0.82);
  --panel-strong: rgba(10, 38, 24, 0.96);
  --line: rgba(104, 255, 156, 0.33);
  --line-strong: rgba(126, 255, 176, 0.76);
  --text: #ecfff2;
  --muted: #a8c9b2;
  --green: #5dff9b;
  --cyan: #62f3ff;
  --amber: #ffd36e;
  --rose: #ff8fb3;
  --shadow: 0 0 32px rgba(52, 255, 122, 0.16);
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  text-align: right;
  background:
    radial-gradient(circle at 50% 0%, rgba(87, 255, 135, 0.14), transparent 32rem),
    linear-gradient(135deg, #020403 0%, #06120b 52%, #010402 100%);
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

button:disabled,
textarea:disabled {
  cursor: wait;
  opacity: 0.68;
}

.rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.5;
}

.rain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(93, 255, 155, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 255, 155, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 82%, transparent);
}

.rain span {
  position: absolute;
  top: -30rem;
  right: var(--x);
  width: 1.3rem;
  height: var(--h);
  color: var(--green);
  font-size: 0.9rem;
  line-height: 1.25;
  text-shadow: 0 0 14px var(--green);
  writing-mode: vertical-rl;
  animation: fall 11s linear infinite;
  animation-delay: var(--d);
}

@keyframes fall {
  to {
    transform: translateY(calc(100vh + 34rem));
  }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero {
  min-height: 32vh;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 28px 0 10px;
}

.kicker,
.role,
.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.kicker {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(3.7rem, 18vw, 8rem);
  line-height: 0.95;
  color: var(--text);
  text-shadow:
    0 0 20px rgba(93, 255, 155, 0.68),
    0 0 60px rgba(98, 243, 255, 0.2);
}

.subtitle {
  max-width: 40rem;
  margin: 0;
  color: #d7ffe1;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  line-height: 1.7;
}

.terminal-panel,
.response-card,
.summary-card,
.qr-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(25, 75, 43, 0.5), rgba(6, 16, 11, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.terminal-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

label {
  color: var(--green);
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.42);
  line-height: 1.8;
  outline: none;
}

textarea:focus,
button:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(93, 255, 155, 0.22);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 4px 8px;
  scroll-snap-type: x proximity;
}

.chip,
.primary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.chip {
  flex: 0 0 auto;
  max-width: 78vw;
  padding: 9px 12px;
  color: #dfffe8;
  background: rgba(3, 18, 10, 0.86);
  scroll-snap-align: start;
}

.primary {
  width: 100%;
  padding: 13px 18px;
  color: #021006;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  font-weight: 800;
}

.chip:hover,
.primary:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.responses {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.response-card,
.summary-card {
  padding: 16px;
}

.card-header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.22rem;
}

.answer,
#summary {
  margin: 0;
  line-height: 1.85;
  color: #f4fff6;
}

.professor {
  border-color: rgba(98, 243, 255, 0.42);
}

.professor h2 {
  color: var(--cyan);
}

.empath {
  border-color: rgba(255, 143, 179, 0.44);
}

.empath h2 {
  color: var(--rose);
}

.critic {
  border-color: rgba(255, 211, 110, 0.46);
}

.critic h2 {
  color: var(--amber);
}

.summary-card {
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(93, 255, 155, 0.22), rgba(98, 243, 255, 0.08)),
    var(--panel-strong);
}

.summary-card .role {
  color: var(--green);
  font-weight: 700;
  margin-bottom: 8px;
}

.note {
  margin-top: 18px;
  line-height: 1.7;
}

.status-line {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.is-loading {
  position: relative;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent, rgba(93, 255, 155, 0.12), transparent);
  animation: scan 1.1s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(-100%);
  }
}

.thread {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.thread[hidden] {
  display: none;
}

.thread-messages {
  display: grid;
  gap: 8px;
}

.thread-message {
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  line-height: 1.75;
}

.thread-message.student {
  justify-self: end;
  color: #021006;
  background: var(--green);
}

.thread-message.persona {
  justify-self: start;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
}

.thread textarea {
  min-height: 78px;
  font-size: 0.95rem;
}

.follow-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #dfffe8;
  background: rgba(3, 18, 10, 0.88);
  cursor: pointer;
}

.follow-button:hover {
  border-color: var(--line-strong);
}

.qr-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
}

.qr-panel a {
  color: var(--green);
  overflow-wrap: anywhere;
  text-decoration-color: rgba(93, 255, 155, 0.55);
  text-underline-offset: 4px;
}

.qr-panel img {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

@media (min-width: 760px) {
  .shell {
    padding: 34px 28px 56px;
  }

  .hero {
    min-height: 34vh;
  }

  .terminal-panel {
    padding: 20px;
  }

  .responses {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-card {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rain span {
    animation: none;
  }

  .chip,
  .primary {
    transition: none;
  }
}
