/*
 * theme.css — English Speaking Tutor.
 * A cool mint paper ground with one warm kumkum-red accent: calm enough to
 * read for thirty minutes, with the red reserved for the student's own voice
 * (their bubbles, the mic). Type is Baloo 2 over Mukta, both of which carry
 * Devanagari and Latin, so Marathi and English sit in one voice.
 */

:root {
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #e6eeea;
  --border: #d3dfd9;
  --border-strong: #9fb3aa;
  --ink: #12261f;
  --muted: #51645c;
  --accent: #c8441d;
  --accent-hover: #b23a16;
  --accent-ink: #ffffff;
  --accent-text: #b23a16;
  --accent-strong: #8f2c0e;
  --accent-soft: #fde8df;
  --accent-border: #f3b9a3;
  --success: #1f7a4d;
  --success-ink: #ffffff;
  --success-soft: #dff1e7;
  --success-strong: #17603c;
  --warning: #a85d00;
  --warning-ink: #ffffff;
  --warning-soft: #f7ead6;
  --warning-strong: #8a4c00;
  --danger: #b3261e;
  --danger-ink: #ffffff;
  --danger-soft: #f8e1df;
  --danger-strong: #9a1f18;
  --chart-1: #c8441d;
  --chart-2: #1f7a4d;
  --chart-3: #a85d00;
  --chart-4: #2b6f8f;
  --chart-5: #7a4b8f;
  --chart-6: #51645c;

  --font-display: "Baloo 2", "Mukta", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Mukta", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Mukta", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.04em;

  --radius-btn: 999px;
  --radius-card: 1.25rem;
  --radius-input: 999px;
  --btn-weight: 600;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] {
  --canvas: #0f1a16;
  --surface: #17251f;
  --surface-2: #1f3029;
  --border: #2c4138;
  --border-strong: #4a6458;
  --ink: #eef5f1;
  --muted: #a3b5ad;
  --accent: #ff7a50;
  --accent-hover: #ff8d68;
  --accent-ink: #2a0d03;
  --accent-text: #ff8f6b;
  --accent-strong: #ffb59c;
  --accent-soft: #3a1c12;
  --accent-border: #6b2f1c;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #172f22;
  --success-strong: #58a474;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #3a2517;
  --warning-strong: #ca854f;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #3b191b;
  --danger-strong: #d57575;
  --chart-1: #ff7a50;
  --chart-2: #58a474;
  --chart-3: #ca854f;
  --chart-4: #5fa8c9;
  --chart-5: #b48acb;
  --chart-6: #a3b5ad;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

/*
 * app.css — the conversation: the ground it sits on, the two voices, the
 * tutor's Marathi coaching with its better sentence, and the microphone.
 * Tokens only; the values are in theme.css.
 */

.talk-ground {
  background-image: radial-gradient(
    48rem 24rem at 100% -8%,
    color-mix(in srgb, var(--accent) 9%, transparent),
    transparent 70%
  );
  background-repeat: no-repeat;
}

/* ---- The two voices ------------------------------------------------------ */
.bubble {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: fit-content;
  max-width: 88%;
  padding: 0.75rem 1rem;
  border-radius: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.bubble-tutor {
  align-self: flex-start;
  align-items: flex-start;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.375rem;
  box-shadow: var(--shadow-card);
}
.bubble-student {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 0.375rem;
}

/* ---- The tutor coaching in Marathi ----------------------------------------
   Still the tutor's voice, so it sits on the tutor's side; a tinted edge sets
   it apart from the English conversation that follows it. */
.bubble-coach {
  background: var(--surface-2);
  border-color: var(--border-strong);
  box-shadow: none;
}
.better-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.better-line .icon {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

/* ---- The tutor is thinking ------------------------------------------------ */
.typing {
  flex-direction: row;
  align-items: center;
  gap: 0.375rem;
  padding-block: 1rem;
}
.typing span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--muted);
  animation: typing-bounce 1s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-0.25rem); opacity: 1; }
}

/* ---- The microphone -------------------------------------------------------- */
.mic-btn {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background-color 150ms, transform 150ms;
}
.mic-btn:hover { background: var(--accent-hover); }
.mic-btn:active { transform: scale(0.96); }
.mic-btn:focus-visible { outline: 3px solid var(--accent-border); outline-offset: 2px; }
.mic-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.mic-btn.is-listening { animation: mic-pulse 1.4s ease-out infinite; }
@keyframes mic-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 1.25rem color-mix(in srgb, var(--accent) 0%, transparent); }
}

html.reduced-motion .typing span,
html.reduced-motion .mic-btn.is-listening {
  animation: none;
}
html.reduced-motion .mic-btn.is-listening {
  outline: 3px solid var(--accent-border);
  outline-offset: 2px;
}
