:root {
  color-scheme: only light;
  --bg: #f3ede3;
  --bg-2: #fdf8ef;
  --ink: #1a1612;
  --muted: #5e564e;
  --accent: #ff6f3c;
  --accent-2: #1f7a7a;
  --card: #ffffff;
  --ring: rgba(255, 111, 60, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--ink);
  font-family: "Trebuchet MS", "Verdana", "Tahoma", sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.hero {
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.hero.minimal::before,
.hero.minimal::after {
  display: none;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: auto auto 0 0;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 111, 60, 0.22), rgba(255, 111, 60, 0));
  transform: translate(-30%, 40%);
  pointer-events: none;
}

.hero::after {
  inset: 0 0 auto auto;
  background: radial-gradient(circle, rgba(31, 122, 122, 0.2), rgba(31, 122, 122, 0));
  transform: translate(35%, -35%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 640px;
}

.badge {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(31, 122, 122, 0.12);
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 5vw, 72px);
  font-family: "Garamond", "Palatino Linotype", "Book Antiqua", "Georgia", serif;
  letter-spacing: 0.04em;
}

.lead {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.status {
  font-size: 14px;
  color: var(--muted);
}

button {
  font-size: 16px;
  padding: 12px 24px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.primary {
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  font-size: 24px;
  padding: 20px 40px;
  border-radius: 20px;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.ghost {
  background: #fff;
  border: 1px solid rgba(26, 22, 18, 0.12);
  color: var(--ink);
}

.ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(26, 22, 18, 0.08);
}

.text-input {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

#textInput {
  padding: 12px 14px;
  font-size: 16px;
  width: min(320px, 70vw);
  border-radius: 12px;
  border: 1px solid rgba(26, 22, 18, 0.15);
  background: var(--bg-2);
}

.hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.logo-frame {
  background: transparent;
  border-radius: 28px;
  padding: 0;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  position: relative;
  --anger: 0;
}

.logo-frame.eddy-pokeable {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'><path d='M17 8c-2 0-4 2-4 4v24l-3-6c-1-2-4-3-6-2-2 1-3 4-2 6l8 16c2 4 6 6 10 6h18c5 0 9-4 9-9V30c0-2-2-4-4-4s-4 2-4 4v8h-2V14c0-2-2-4-4-4s-4 2-4 4v20h-2V12c0-2-2-4-4-4s-4 2-4 4v22h-2V12c0-2-2-4-4-4z' fill='%23ffffff' stroke='%23000000' stroke-width='3' stroke-linejoin='round'/></svg>") 10 10, pointer;
  touch-action: none;
}

.logo-frame.is-poked {
  animation: eddy-wiggle 0.35s ease;
}

.eddy-svg {
  width: min(700px, 90vw);
  height: auto;
  max-height: 86vh;
  display: block;
  filter:
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.14))
    drop-shadow(0 0 24px rgba(255, 45, 45, calc(0.6 * var(--anger))));
  animation: float 6s ease-in-out infinite;
}

.talk-control {
  position: absolute;
  left: max(20px, 6vw);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.mood-meter {
  position: absolute;
  right: 24px;
  top: 62%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 140px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #000000;
  border-radius: 18px;
  padding: 12px 10px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.mood-meter__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.mood-meter__body {
  display: grid;
  grid-template-columns: auto 28px;
  column-gap: 12px;
  align-items: center;
}

.mood-meter__scale {
  position: relative;
  width: 16px;
  height: 160px;
  border-radius: 999px;
  border: 2px solid #000000;
  background: linear-gradient(180deg, #16c758, #f7b500 48%, #ff6f3c 70%, #ff2d2d 100%);
  overflow: hidden;
}

.mood-meter__fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8%;
  background: rgba(255, 255, 255, 0.75);
  transition: height 0.25s ease;
}

.mood-meter__bar {
  position: relative;
  width: 28px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-meter__ticks {
  position: relative;
  height: 160px;
  width: 10px;
  margin: 0;
  position: absolute;
  left: -10px;
  top: 0;
}

.mood-meter__ticks span {
  position: absolute;
  left: 0;
  width: 10px;
  height: 4px;
  background: #000000;
  border-radius: 999px;
}

.mood-meter__ticks span:nth-child(1) {
  top: 2px;
}

.mood-meter__ticks span:nth-child(2) {
  top: 54px;
}

.mood-meter__ticks span:nth-child(3) {
  top: 106px;
}

.mood-meter__ticks span:nth-child(4) {
  bottom: 2px;
}

.mood-meter__levels {
  display: grid;
  gap: 6px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  padding-right: 6px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  height: 160px;
}

.mood-meter__levels span.is-active {
  color: var(--ink);
  font-weight: 700;
}

.eddy-brows {
  transition: opacity 0.25s ease;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 320px;
  max-width: 80vw;
}

.auth-dock {
  position: absolute;
  top: 24px;
  right: 24px;
  align-items: flex-end;
  text-align: right;
}

.tokens-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 4;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.auth-links {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.link-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--ink);
  text-decoration: underline;
}

.reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-status {
  font-size: 12px;
  color: var(--muted);
}

.auth-hint {
  font-size: 12px;
  color: #c62828;
}

.auth-hint.shake {
  animation: shake 0.35s ease;
}

.is-hidden {
  display: none;
}

.talk-top,
.talk-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-dot {
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border-radius: 50%;
  background: #ff2d2d;
  box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.6);
  display: inline-block;
}

.listening .rec-dot {
  animation: rec-pulse 0.9s ease-out infinite;
  box-shadow: 0 0 0 4px rgba(255, 45, 45, 0.5);
}

.listening #micBtn {
  box-shadow:
    0 0 0 8px rgba(255, 45, 45, 0.35),
    0 0 28px 10px rgba(255, 45, 45, 0.6);
}

@keyframes rec-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 45, 45, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 45, 45, 0);
  }
}

.text-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.talk-input {
  width: 280px;
  max-width: 70vw;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #000000;
  font-size: 15px;
  font-family: inherit;
  background: #ffffff;
  color: #000000;
}

.send-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.send-btn:hover {
  box-shadow: 0 12px 24px rgba(26, 22, 18, 0.08);
  transform: translateY(-1px);
}

.chat-log {
  width: 320px;
  max-width: 80vw;
  max-height: 180px;
  overflow: auto;
  border: 2px solid #000000;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.4;
}

.chat-line {
  margin: 0 0 6px 0;
}

.chat-line strong {
  font-weight: 700;
}

.mouth-shape {
  display: none;
}

.mouth-shape.is-active {
  display: inline;
}

.toast {
  position: absolute;
  top: -20px;
  right: -10px;
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.token-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}

.token-modal.is-hidden {
  display: none;
}

.token-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 22, 0.45);
}

.token-modal__panel {
  position: relative;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 16px;
  padding: 22px 20px;
  width: min(92vw, 420px);
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  z-index: 1;
}

.token-modal__icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 999px;
  border: 2px solid #000000;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.token-modal__message {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.token-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.token-modal__buy {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-copy > * {
  animation: rise 0.8s ease forwards;
  opacity: 0;
}

.hero-copy > *:nth-child(1) {
  animation-delay: 0.1s;
}

.hero-copy > *:nth-child(2) {
  animation-delay: 0.2s;
}

.hero-copy > *:nth-child(3) {
  animation-delay: 0.3s;
}

.hero-copy > *:nth-child(4) {
  animation-delay: 0.4s;
}

.hero-copy > *:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes rise {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes eddy-wiggle {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
  75% {
    transform: rotate(-1deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-3px);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 32px 24px 44px;
  }

  .text-input {
    flex-direction: column;
    align-items: stretch;
  }

  #textInput {
    width: 100%;
  }

  .talk-bubble {
    position: static;
    margin-top: 18px;
    text-align: center;
  }

  .talk-bubble::after {
    display: none;
  }

  .talk-control {
    position: static;
    transform: none;
    margin-bottom: 12px;
  }
}

@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 14px;
    align-content: start;
    padding-top: 8px;
    overflow: visible;
  }

  .talk-control {
    position: static;
    transform: none;
    align-items: center;
    width: min(92vw, 360px);
    display: contents;
  }

  .talk-top,
  .talk-bottom {
    width: min(92vw, 360px);
    justify-self: center;
    align-items: center;
    text-align: center;
  }

  .talk-top {
    position: absolute;
    left: 6px;
    top: 52%;
    transform: translateY(-50%);
    width: auto;
    order: 2;
    margin-top: 0;
    align-items: flex-start;
    z-index: 3;
  }

  .text-row {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .talk-input,
  .send-btn,
  .chat-log,
  .auth-panel {
    width: 100%;
  }

  .auth-dock {
    position: static;
    align-items: center;
    text-align: center;
    width: min(92vw, 360px);
  }

  .hero-art {
    width: 100%;
    order: 1;
    margin-top: 24px;
  }

  .eddy-svg {
    width: min(860px, 96vw);
    max-height: 70vh;
    transform: scale(1.5);
    transform-origin: center top;
  }

  #textInput {
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
  }

  #micBtn {
    align-self: flex-start;
    margin: 0;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 14px;
  }

  .talk-bottom {
    order: 3;
    margin-top: -6px;
  }

  .mood-meter {
    display: none;
  }

  .mood-meter__body {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .mood-meter__scale {
    width: 100%;
    height: 12px;
    border-radius: 999px;
  }

  .mood-meter__fill {
    height: 100%;
    width: 12%;
    transition: width 0.25s ease;
  }

  .mood-meter__ticks {
    height: 12px;
    width: 100%;
    margin-top: 8px;
    position: static;
  }

  .mood-meter__ticks span {
    width: 4px;
    height: 12px;
  }

  .mood-meter__ticks span:nth-child(1) {
    left: 0;
    top: 0;
  }

  .mood-meter__ticks span:nth-child(2) {
    left: 33%;
    top: 0;
  }

  .mood-meter__ticks span:nth-child(3) {
    left: 66%;
    top: 0;
  }

  .mood-meter__ticks span:nth-child(4) {
    right: 0;
    top: 0;
  }

  .mood-meter__levels {
    flex-direction: row;
    justify-content: space-between;
    height: auto;
    text-align: center;
    padding-right: 0;
  }

  .site-footer {
    left: 16px;
    top: 16px;
    transform: scale(0.75);
    transform-origin: top left;
  }

  .tokens-btn {
    display: none;
    top: 12px;
    left: 12px;
  }

  .toast {
    right: 28px;
    top: -34px;
    transform: translateY(0) scale(0.75);
    transform-origin: top right;
  }

  .toast.hidden {
    transform: translateY(-6px) scale(0.75);
  }
}

.talk-bubble {
  position: absolute;
  right: 12px;
  top: 12%;
  max-width: 220px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(30, 24, 16, 0.16);
  text-align: left;
}

.talk-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 22px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: -6px 6px 14px rgba(30, 24, 16, 0.08);
}

.site-footer {
  position: absolute;
  left: 24px;
  bottom: 24px;
  margin-top: 0;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-divider {
  color: #c9c2b8;
}

.footer-note {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}


@media (max-width: 700px) {
  .auth-links {
    justify-content: center;
  }

  .reset-actions .send-btn {
    width: 100%;
  }
}
