:root {
  --ink: #1a1a1a;
  --btn-bg: #1a1a1a;
  --btn-bg-hover: #333;
  --btn-fg: #ffffff;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow-x: hidden;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 5vh, 40px);
  padding: 32px 20px;
  width: 100%;
}

/* ---------- Hero row (flanking text + portrait) ---------- */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.5vw, 32px);
  width: 100%;
  max-width: 900px;
}

.hero__word {
  flex: 0 0 auto;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
  font-size: clamp(15px, 5.6vw, 52px);
  white-space: nowrap;
  user-select: none;
}

/* ---------- Portrait ---------- */

.portrait {
  position: relative;
  flex: 0 0 auto;
  width: min(48vw, 380px);
  aspect-ratio: 1 / 1;
  user-select: none;
  animation: breathe 6s ease-in-out infinite;
}

@media (min-width: 640px) {
  .portrait { width: min(34vw, 440px); }
  .hero__word { font-size: clamp(28px, 3.6vw, 52px); }
}

.portrait__base,
.portrait__mouth {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portrait__base {
  position: relative;
  display: block;
}

/* Mouth overlay is positioned to sit exactly over the drawn mouth region
   of assets/man.png (percentages derived from the source artwork,
   1254x1254px, mouth box = 495,383 -> 665,465). It's hidden by default
   so the original illustrated (closed, smiling) mouth shows through. */
.portrait__mouth {
  top: 30.542%;
  left: 39.474%;
  width: 13.557%;
  height: 6.539%;
  opacity: 0;
  transition: opacity 55ms linear;
  will-change: opacity;
}

.portrait__mouth.is-visible {
  opacity: 1;
}

.portrait.is-talking {
  animation: none;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.004); }
}

/* ---------- Button ---------- */

.say-btn {
  appearance: none;
  border: none;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms var(--ease), background 160ms var(--ease),
    opacity 160ms var(--ease), box-shadow 160ms var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.say-btn:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
}

.say-btn:active {
  transform: translateY(0) scale(0.97);
}

.say-btn:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 3px;
}

.say-btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.say-btn.is-speaking .say-btn__label {
  opacity: 0.85;
}
