:root {
  --bg-start: #cfe9ff;
  --bg-mid: #e6dcff;
  --bg-end: #ffe5f1;
  --white: #ffffff;
  --ink: #1a2340;
  --teal: #2cc7a0;
  --coral: #f26b6b;
  --shadow: 0 18px 40px rgba(25, 40, 70, 0.15);
  --soft-shadow: 0 12px 24px rgba(28, 48, 92, 0.12);
  --glass: rgba(255, 255, 255, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(120deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-anim {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.45), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(120deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  background-size: 200% 200%;
  animation: gradientShift 16s ease-in-out infinite;
  z-index: -3;
}

.floating-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -2;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(1px);
  animation: float 12s ease-in-out infinite;
}

.s1 {
  width: 180px;
  height: 180px;
  top: 10%;
  left: 6%;
}

.s2 {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 12%;
  animation-delay: -3s;
}

.s3 {
  width: 220px;
  height: 220px;
  top: 18%;
  right: 12%;
  animation-delay: -6s;
}

.s4 {
  width: 140px;
  height: 140px;
  bottom: 16%;
  right: 24%;
  animation-delay: -2s;
}

.s5 {
  width: 90px;
  height: 90px;
  bottom: 10%;
  left: 45%;
  animation-delay: -4s;
}

.hero {
  padding: 90px 8vw 40px;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 40px;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero-visual {
  position: relative;
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.robot {
  width: 150px;
  height: 150px;
  fill: rgba(255, 255, 255, 0.8);
  stroke: rgba(26, 35, 64, 0.35);
  stroke-width: 3;
  filter: drop-shadow(0 12px 24px rgba(20, 40, 90, 0.25));
  animation: hoverBob 6s ease-in-out infinite;
}

.robot.r2 {
  animation-delay: -2s;
  transform: translateY(12px);
}

.robot .eye {
  fill: rgba(26, 35, 64, 0.55);
  animation: blink 5s infinite;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  opacity: 0.7;
}

.headline {
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin: 0;
  line-height: 1.05;
  opacity: 0;
  transform: translateY(20px);
}

.subtext {
  font-size: 1.1rem;
  opacity: 0.85;
  margin: 0;
  margin-bottom: 6px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 6px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  align-items: center;
}

.hero-loader {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: rgba(26, 35, 64, 0.75);
  margin-top: 6px;
}

.hero-loader .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(26, 35, 64, 0.6);
  animation: pulse 1s ease-in-out infinite;
}

.hero-loader .dot:nth-child(2) {
  animation-delay: 0.15s;
}

.hero-loader .dot:nth-child(3) {
  animation-delay: 0.3s;
}

.robot-toast {
  margin-top: 6px;
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(26, 35, 64, 0.8);
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.robot-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.vote-status {
  margin: 6px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(26, 35, 64, 0.7);
}

.counter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 0;
}

.counter-card {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: var(--soft-shadow);
  min-width: 150px;
}

.counter-card .label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.counter-card .value {
  font-size: 1.8rem;
  font-weight: 700;
}

.counter-card.safe .value {
  color: #0b3b2c;
}

.counter-card.not-safe .value {
  color: #4a1b1b;
}

.btn {
  border: none;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  color: #102030;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2) brightness(0.95);
  opacity: 0.85;
  box-shadow: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

.btn-yes {
  background: var(--teal);
  color: #083323;
}

.btn-no {
  background: var(--coral);
  color: #4a1b1b;
}

.btn-coffee {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffdd5e;
  color: #2b2100;
  font-weight: 700;
  text-transform: none;
  text-decoration: none;
  margin-top: 0;
  min-height: 54px;
}

.btn-submit {
  background: #1a2340;
  color: #fff;
}

.btn-message {
  background: rgba(26, 35, 64, 0.1);
  color: #1a2340;
  min-height: 54px;
}


.btn-message:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 32px rgba(20, 40, 80, 0.25);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.status-card {
  margin-top: 16px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  padding: 18px 22px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
  gap: 12px;
}

.status-card.show {
  display: flex;
  flex-direction: column;
  animation: popIn 0.4s ease;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  transform: translateX(110%);
  transition: transform 0.4s ease;
  z-index: 10;
  box-shadow: -12px 0 30px rgba(10, 20, 40, 0.18);
  overflow: hidden;
}

.panel-close {
  align-self: flex-end;
  border: none;
  background: rgba(26, 35, 64, 0.1);
  color: #1a2340;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.panel-close:hover {
  transform: scale(1.05);
  background: rgba(26, 35, 64, 0.18);
}

.form-panel.open {
  transform: translateX(0);
}

.form-inner {
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.form-inner h2 {
  margin: 0;
}

.form-inner form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.field-note {
  margin: -6px 0 0;
  font-size: 0.85rem;
  color: rgba(26, 35, 64, 0.7);
}

.field-error {
  margin: -6px 0 0;
  font-size: 0.85rem;
  color: #b42318;
  min-height: 1.1em;
}

textarea,
input {
  border-radius: 14px;
  border: 1px solid rgba(26, 35, 64, 0.18);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1a2340;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.wall {
  padding: 40px 8vw 100px;
}

.wall-header {
  max-width: 1100px;
  margin: 0 auto 24px;
  text-align: left;
}

.wall-grid {
  display: flex;
  gap: 20px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 10px;
  max-width: 1100px;
  margin: 0 auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wall-grid::-webkit-scrollbar {
  display: none;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(26, 35, 64, 0.08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--soft-shadow);
  width: calc((100% - 40px) / 3);
  min-width: 220px;
  max-width: 320px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.card.show {
  opacity: 1;
  transform: translateY(0);
}

.card span {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
}

.card-meta {
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-safe {
  background: rgba(46, 204, 113, 0.2);
  color: #0f5132;
}

.badge-not-safe {
  background: rgba(231, 76, 60, 0.2);
  color: #7a1f1f;
}

.empty-state {
  max-width: 700px;
  margin: 20px auto 0;
  text-align: left;
  opacity: 0.7;
}


#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.footer {
  padding: 24px 8vw 50px;
  font-size: 0.95rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-text {
  margin: 0;
  max-width: 720px;
}

.footer-link {
  color: #2b2100;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffdd5e;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(20, 40, 80, 0.2);
}

.coffee-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: #fff2b0;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.coffee-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  width: 10px;
  height: 8px;
  border-radius: 0 0 4px 4px;
  background: #2b2100;
}

.coffee-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 7px;
  width: 6px;
  height: 6px;
  border: 2px solid #2b2100;
  border-left: none;
  border-radius: 0 4px 4px 0;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

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

@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  94% {
    transform: scaleY(0.1);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 70px;
  }

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

  .form-panel {
    width: 100%;
  }

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