@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #fffaf3;
  --ink: #18232c;
  --muted: #5d6b75;
  --accent: #0f9d6a;
  --accent-2: #f4a261;
  --accent-3: #2a9d8f;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  --radius: 20px;
  --ball-light: #f9d86d;
  --ball-dark: #f4a261;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #151e25;
  --ink: #e6edf3;
  --muted: #9fb0bb;
  --accent: #4cc9f0;
  --accent-2: #f4a261;
  --accent-3: #7bdff2;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --ball-light: #2d3748;
  --ball-dark: #4cc9f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 400px at 10% 10%, rgba(15, 157, 106, 0.15), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(244, 162, 97, 0.18), transparent 55%),
    linear-gradient(180deg, #fdf7f0 0%, #eef5f2 100%);
  background-color: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body[data-theme="dark"] {
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(76, 201, 240, 0.15), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(244, 162, 97, 0.12), transparent 55%),
    linear-gradient(180deg, #0f1419 0%, #111a21 100%);
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  gap: 28px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  font-weight: 600;
}

.top-nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme="dark"] .top-nav a {
  background: rgba(21, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
}

.hero {
  padding: 32px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #f4fff9 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #141c23 0%, #18222a 100%);
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  color: var(--ink);
}

body[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(22, 30, 36, 0.7);
}

.hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -60px;
  background: radial-gradient(circle, rgba(42, 157, 143, 0.25), transparent 70%);
}

.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-3);
}

h1 {
  margin: 12px 0 8px;
  font-size: clamp(30px, 5vw, 46px);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

input,
select {
  font: inherit;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  font: inherit;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
  min-height: 140px;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #0f171d;
  border-color: rgba(255, 255, 255, 0.1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

button {
  font: inherit;
  border-radius: 999px;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 20px rgba(15, 157, 106, 0.25);
}

.primary:hover {
  transform: translateY(-2px);
}

.ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: var(--ink);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.results {
  display: grid;
  gap: 16px;
}

.panel #disqus_thread {
  margin-top: 8px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.content-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body[data-theme="dark"] .content-card {
  background: rgba(15, 23, 29, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

.content-stack {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.content-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.policy-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(0, 0, 0, 0.15);
}

body[data-theme="dark"] .policy-box {
  background: rgba(15, 23, 29, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.faq {
  display: grid;
  gap: 12px;
}

details {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body[data-theme="dark"] details {
  background: rgba(15, 23, 29, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

summary {
  cursor: pointer;
  font-weight: 600;
}

.footer-note {
  font-size: 12px;
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 16px;
}

.field-full {
  grid-column: 1 / -1;
}

.result-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  animation: rise 0.3s ease;
}

body[data-theme="dark"] .result-card {
  background: #0f171d;
  border-color: rgba(255, 255, 255, 0.08);
}

.result-head {
  font-weight: 700;
  margin-bottom: 12px;
}

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--ball-light) 35%, var(--ball-dark) 100%);
  box-shadow: 0 8px 16px rgba(244, 162, 97, 0.25);
}

.ball.rolling {
  color: transparent;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), var(--ball-light), var(--ball-dark));
  background-size: 200% 200%;
  animation: roll 0.6s linear infinite;
}

.ball.reveal {
  animation: pop 0.35s ease;
}

.raw {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

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

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes roll {
  0% {
    background-position: 0% 50%;
    transform: scale(0.9) rotate(0deg);
  }
  100% {
    background-position: 100% 50%;
    transform: scale(1.02) rotate(360deg);
  }
}

@media (max-width: 640px) {
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
  }

  button {
    width: 100%;
    justify-content: center;
  }
}
