:root {
  --brand: #ff6600;
  --brand-hover: #e65c00;
  --brand-soft: #fabd6e;
  --bg: #0e0e10;
  --surface: #141416;
  --elev: #1a1a1e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e7e7ea;
  --text-muted: #8f8f96;
  --font: "Play", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  overflow-x: hidden;
}

/* Atmospheric orb — soft glow, placed via transform only */
.orb-plane {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  width: min(78vw, 640px);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 179, 128, 0.55) 0%,
    rgba(255, 102, 0, 0.28) 26%,
    rgba(255, 102, 0, 0.1) 48%,
    transparent 70%
  );
  opacity: 0.5;
  will-change: transform;
  transform: translate(-46%, -6%);
  animation: orb-drift 12s ease-in-out infinite alternate;
}

body.is-consulting .orb {
  opacity: 0.78;
  animation: orb-consult 1.8s ease-in-out infinite alternate;
}

@keyframes orb-drift {
  from {
    transform: translate(-46%, -6%) scale(1);
  }
  to {
    transform: translate(-38%, 6%) scale(1.06);
  }
}

@keyframes orb-consult {
  from {
    transform: translate(-46%, -6%) scale(1);
    opacity: 0.62;
  }
  to {
    transform: translate(-36%, 4%) scale(1.1);
    opacity: 0.88;
  }
}

body.is-consulting .below-prompt {
  display: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.75rem, 6vh, 4rem) 0 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  animation: rise 0.7s ease both;
}

.lang-switch {
  display: inline-flex;
  gap: 0.15rem;
}

.lang-btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.35rem 0.55rem;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.lang-btn.is-active {
  color: var(--brand);
}

.lang-btn:hover:not(:disabled):not(.is-active) {
  color: var(--brand-soft);
}

.lang-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}

.brand-block {
  animation: rise 0.75s ease 0.04s both;
}

.brand {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  max-width: 11ch;
  color: var(--text);
}

.lede {
  margin: 1rem 0 0;
  max-width: 32ch;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.oracle-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: rise 0.75s ease 0.1s both;
}

.below-prompt {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

textarea:disabled {
  opacity: 0.65;
  cursor: wait;
  color: var(--text-muted);
}

.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;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 6rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(20, 20, 22, 0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

textarea::placeholder {
  color: rgba(143, 143, 150, 0.8);
}

textarea:focus {
  border-color: rgba(255, 102, 0, 0.65);
  background: var(--elev);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0.85rem 1.2rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn.primary {
  background: var(--brand);
  color: #0a0a0c;
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-hover);
}

/* Waiting: quieter than the answer */
.consulting {
  min-height: 2.5rem;
  animation: rise 0.35s ease both;
}

.consulting-line {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  animation: line-swap 0.35s ease;
}

/* Answer */
.omen {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  animation: omen-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.omen-text {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 26ch;
  color: var(--text);
}

.harm {
  display: grid;
  grid-template-columns: auto minmax(0, 11rem) auto;
  gap: 0.65rem 0.85rem;
  align-items: center;
  max-width: 22rem;
}

.harm-label,
.harm-value {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.harm-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.harm-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  transition: width 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

@keyframes line-swap {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes omen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .orb {
    width: min(92vw, 460px);
    opacity: 0.38;
    transform: translate(-52%, 2%);
    animation-name: orb-drift-mobile;
  }

  body.is-consulting .orb {
    opacity: 0.58;
    animation-name: orb-consult-mobile;
  }

  @keyframes orb-drift-mobile {
    from {
      transform: translate(-52%, 2%) scale(1);
    }
    to {
      transform: translate(-42%, 10%) scale(1.05);
    }
  }

  @keyframes orb-consult-mobile {
    from {
      transform: translate(-52%, 2%) scale(1);
      opacity: 0.48;
    }
    to {
      transform: translate(-40%, 8%) scale(1.08);
      opacity: 0.7;
    }
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .harm {
    grid-template-columns: 1fr auto;
    max-width: none;
  }

  .harm-label {
    grid-column: 1 / -1;
  }
}

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