:root {
  /* Tina's Lab visual palette: warm white, charcoal, yellow, coral, blue and green. */
  --ink: #1f1f1f;
  --ink-soft: #5f5a53;
  --paper: #fffdf8;
  --cream: #fff1bd;
  --white: #ffffff;
  --mint: #74c69d;
  --mint-dark: #2f7f5f;
  --yellow: #f7cf46;
  --coral: #ef6454;
  --blue: #57a9d6;
  --purple: #8b6fb3;
  --line: #202020;
  --shadow: 0 9px 0 rgba(31, 31, 31, 0.10);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(247, 207, 70, 0.26) 0 70px, transparent 72px),
    radial-gradient(circle at 88% 12%, rgba(116, 198, 157, 0.25) 0 95px, transparent 97px),
    radial-gradient(circle at 84% 88%, rgba(87, 169, 214, 0.18) 0 115px, transparent 117px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-bubbles {
  width: 46px;
  height: 42px;
  position: relative;
  display: inline-block;
}

.brand-bubbles span {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-radius: 50%;
}

.brand-bubbles span:nth-child(1) {
  background: var(--yellow);
  left: 0;
  top: 10px;
}

.brand-bubbles span:nth-child(2) {
  background: var(--coral);
  right: 0;
  top: 0;
}

.brand-bubbles span:nth-child(3) {
  background: var(--mint);
  right: 4px;
  bottom: 0;
  width: 19px;
  height: 19px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.brand-copy small {
  margin-top: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint-dark);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(31, 31, 31, 0.08);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
}

.status.connected .status-dot {
  background: var(--mint-dark);
}

.status.connecting .status-dot {
  background: var(--yellow);
}

main {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.auth-section,
.session-end-section,
.app-section {
  width: 100%;
}

.auth-section {
  display: grid;
  gap: 22px;
  align-content: center;
  padding: 18px 0 44px;
}

.welcome-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 36px;
  align-items: center;
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(32px, 6vw, 68px);
}

.welcome-card::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 70px;
  left: 45%;
  bottom: -42px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--blue);
  transform: rotate(-8deg);
}

.kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--mint-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
strong {
  font-family: var(--font-display);
}

.welcome-copy h1 {
  max-width: 720px;
  margin: 0 0 18px;
  font-size: clamp(2.45rem, 6.2vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.welcome-copy p {
  max-width: 710px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.65;
  font-weight: 700;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 26px 0 30px;
}

.topic-pills span {
  padding: 9px 13px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(31, 31, 31, 0.08);
}

.btn {
  border: 0;
  cursor: pointer;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 22px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--coral);
  color: var(--white);
  font-weight: 900;
  box-shadow: 0 6px 0 var(--line);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--line);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--line);
}

.btn-spark {
  font-size: 1.15rem;
}

.lab-illustration {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.robot-face {
  position: relative;
  z-index: 2;
  width: 220px;
  height: 190px;
  border: 4px solid var(--line);
  border-radius: 44% 44% 38% 38%;
  background: var(--mint);
  box-shadow: 12px 14px 0 rgba(31, 31, 31, 0.12);
  transform: rotate(2deg);
}

.antenna {
  position: absolute;
  width: 5px;
  height: 48px;
  left: 50%;
  top: -47px;
  background: var(--line);
  transform: translateX(-50%);
}

.antenna::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -13px;
  width: 24px;
  height: 24px;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  transform: translateX(-50%);
}

.robot-eyes {
  display: flex;
  justify-content: center;
  gap: 42px;
  padding-top: 62px;
}

.robot-eyes span {
  width: 24px;
  height: 32px;
  border-radius: 50%;
  background: var(--line);
}

.robot-smile {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 72px;
  height: 32px;
  border-bottom: 5px solid var(--line);
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.orbit {
  position: absolute;
  border: 3px dashed rgba(31, 31, 31, 0.24);
  border-radius: 50%;
}

.orbit-one {
  width: 300px;
  height: 300px;
}

.orbit-two {
  width: 250px;
  height: 340px;
  transform: rotate(55deg);
}

.atom {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 3px solid var(--line);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 900;
}

.atom-one {
  left: 2%;
  top: 16%;
  background: var(--yellow);
  transform: rotate(-9deg);
}

.atom-two {
  right: 1%;
  top: 20%;
  background: var(--coral);
  color: var(--white);
  transform: rotate(8deg);
}

.atom-three {
  right: 12%;
  bottom: 8%;
  background: var(--blue);
  color: var(--white);
}

.discovery-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.discovery-strip article {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.discovery-strip article:nth-child(1) {
  background: #eef8f1;
}

.discovery-strip article:nth-child(2) {
  background: #fff2bd;
}

.discovery-strip article:nth-child(3) {
  background: #eef7fb;
}

.step-number {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--coral);
}

.discovery-strip strong {
  display: block;
  margin-bottom: 4px;
}

.discovery-strip small {
  display: block;
  color: var(--ink-soft);
  line-height: 1.4;
  font-weight: 700;
}

.session-end-section {
  display: grid;
  place-items: center;
  padding: 50px 0;
}

.end-card {
  width: min(600px, 100%);
  padding: 50px;
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--cream);
  box-shadow: var(--shadow);
  text-align: center;
}

.end-card h2 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.end-card p {
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 26px;
}

.app-section {
  padding: 16px 0 36px;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.assistant-sidecard,
.conversation-card {
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.assistant-sidecard {
  padding: 26px;
  background:
    radial-gradient(circle at 86% 8%, rgba(247, 207, 70, 0.72) 0 34px, transparent 35px),
    #f4faf5;
}

.assistant-sidecard h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.04;
}

.assistant-sidecard p {
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.55;
}

.mini-robot {
  width: 74px;
  height: 60px;
  margin-bottom: 22px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: var(--mint);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  transform: rotate(-3deg);
}

.mini-eye {
  width: 10px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
}

.quick-prompts {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.prompt-chip {
  width: 100%;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  transition: transform 100ms ease, background 100ms ease;
}

.prompt-chip:hover {
  transform: translateX(3px);
  background: var(--cream);
}

.movement-chip {
  background: #eef7fb;
}

.conversation-card {
  min-height: 650px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 2px solid #e9e2d3;
  background: var(--cream);
}

.conversation-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.btn-quiet {
  min-height: 42px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
}

.btn-quiet.danger {
  color: #a53c32;
}

.chat-log {
  flex: 1;
  min-height: 390px;
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.84)),
    radial-gradient(circle at 10px 10px, rgba(159, 226, 197, 0.38) 0 3px, transparent 4px);
  background-size: auto, 28px 28px;
}

.message {
  max-width: min(82%, 680px);
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  line-height: 1.55;
  font-weight: 700;
  white-space: pre-wrap;
  box-shadow: 0 3px 0 rgba(31, 31, 31, 0.08);
}

.message.gemini {
  align-self: flex-start;
  background: #eef8f1;
  border-bottom-left-radius: 5px;
}

.message.user {
  align-self: flex-end;
  background: #ffefad;
  border-bottom-right-radius: 5px;
}

.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-top: 2px solid #e9e2d3;
  background: var(--white);
}

.mic-button {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 52px;
  padding: 10px 15px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.mic-button.active {
  background: var(--coral);
  color: var(--white);
}

.mic-button:disabled {
  background: #e8e4dc;
  color: #777168;
  cursor: not-allowed;
  opacity: 0.72;
}

.mic-icon {
  margin-right: 7px;
}

.text-composer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 5px 5px 5px 17px;
}

.text-composer:focus-within {
  box-shadow: 0 0 0 4px rgba(87, 169, 214, 0.22);
}

.text-composer input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.98rem;
}

.text-composer input::placeholder {
  color: #7c766d;
}

.send-button {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px 28px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .welcome-card {
    grid-template-columns: 1fr;
  }

  .lab-illustration {
    min-height: 250px;
  }

  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .assistant-sidecard {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 18px;
  }

  .assistant-sidecard .kicker,
  .assistant-sidecard h2,
  .assistant-sidecard p,
  .assistant-sidecard .quick-prompts {
    grid-column: 2;
  }

  .mini-robot {
    grid-column: 1;
    grid-row: 1 / span 4;
  }

  .quick-prompts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .site-header {
    align-items: flex-start;
  }

  .status {
    padding: 8px 10px;
  }

  .status-label {
    display: none;
  }

  .welcome-card {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .welcome-copy h1 {
    font-size: clamp(2.35rem, 13vw, 4rem);
  }

  .discovery-strip {
    grid-template-columns: 1fr;
  }

  .lab-illustration {
    min-height: 215px;
  }

  .robot-face {
    width: 170px;
    height: 145px;
  }

  .orbit-one {
    width: 230px;
    height: 230px;
  }

  .orbit-two {
    width: 195px;
    height: 260px;
  }

  .assistant-sidecard {
    display: block;
  }

  .assistant-sidecard .quick-prompts {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .prompt-chip {
    min-width: 210px;
  }

  .conversation-card {
    min-height: calc(100vh - 180px);
    border-radius: 24px;
  }

  .conversation-head {
    padding: 18px;
  }

  .conversation-head .kicker {
    display: none;
  }

  .chat-log {
    padding: 16px;
    max-height: none;
  }

  .message {
    max-width: 92%;
  }

  .composer {
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }

  .mic-button {
    min-width: 58px;
    width: 58px;
    padding: 8px;
  }

  .mic-label {
    display: none;
  }

  .text-composer {
    padding-left: 13px;
  }

  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
