:root {
  --bg: #fdf7ed;
  --bg-2: #f3e2cb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #2c1f18;
  --text-soft: #725a4d;
  --line: rgba(114, 90, 77, 0.24);
  --accent: #d24a1f;
  --accent-2: #8d2f16;
  --accent-3: #f8bb5b;
  --ok: #1f7a55;
  --error: #9f2f2f;
  --shadow: 0 14px 36px rgba(66, 34, 16, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, #ffe9bb 0%, transparent 28%),
    radial-gradient(circle at 92% 22%, #ffc9b8 0%, transparent 30%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(44, 31, 24, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 31, 24, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.orb-one {
  width: 280px;
  height: 280px;
  background: #ffd89b;
  top: -80px;
  left: -80px;
  animation: floaty 8s ease-in-out infinite;
}

.orb-two {
  width: 360px;
  height: 360px;
  background: #ffb7a3;
  right: -120px;
  bottom: -100px;
  animation: floaty 10s ease-in-out infinite reverse;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 30px 20px 42px;
  position: relative;
  z-index: 1;
}

.hero {
  animation: rise 0.65s ease-out both;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 244, 228, 0.82)
  );
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  padding: 8px;
  box-shadow: 0 8px 22px rgba(66, 34, 16, 0.16);
}

.brand-logo-fallback {
  width: 72px;
  height: 72px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #5e1c0f);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 22px rgba(66, 34, 16, 0.16);
}

.kicker {
  letter-spacing: 0.18em;
  font-weight: 800;
  font-size: 0.72rem;
  margin: 0;
  color: var(--accent-2);
}

h1 {
  margin: 6px 0 0;
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(1.8rem, 4.3vw, 3rem);
  line-height: 1.1;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--text-soft);
  max-width: 840px;
  line-height: 1.7;
}

.meta-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row span {
  font-size: 0.83rem;
  font-weight: 700;
  color: #5f4337;
  border: 1px solid rgba(95, 67, 55, 0.22);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 7px 12px;
}

.api-panel,
.status-card,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.api-panel {
  margin-top: 22px;
  padding: 16px;
  animation: rise 0.75s ease-out both;
}

.api-panel label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

.api-row {
  display: flex;
  gap: 10px;
}

.api-row input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}

.api-row button {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.api-row button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.hint {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.status-card {
  margin-top: 16px;
  padding: 13px 16px;
  animation: rise 0.9s ease-out both;
  background: linear-gradient(135deg, #fff7ea, #fffdf9);
}

#statusText {
  margin: 0;
  font-weight: 700;
}

#statusText.ok {
  color: var(--ok);
}

#statusText.error {
  color: var(--error);
}

.cards {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  padding: 18px;
  animation: rise 1s ease-out both;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
}

.card h2 {
  margin: 0 0 12px;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.5rem;
  color: #2f1f16;
}

.content {
  color: #36271f;
  line-height: 1.75;
  white-space: pre-wrap;
  min-height: 220px;
  max-height: 60vh;
  overflow: auto;
  padding-right: 4px;
}

.footer-note {
  margin-top: 18px;
  text-align: center;
  color: #654f42;
  font-size: 0.86rem;
}

.footer-note p {
  margin: 0;
}

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

@media (max-width: 640px) {
  .container {
    padding: 20px 14px 30px;
  }

  .hero {
    padding: 14px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .brand-logo-fallback {
    width: 58px;
    height: 58px;
  }

  .api-row {
    flex-direction: column;
  }

  .api-row button {
    width: 100%;
  }

  .content {
    min-height: 150px;
  }
}

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

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