:root {
  --bg: #f2f0e9;
  --bg-deep: #dedacd;
  --ink: #101014;
  --ink-soft: #43424a;
  --accent: #0a7b83;
  --accent-2: #d95f02;
  --card: rgba(255, 255, 255, 0.72);
  --stroke: rgba(16, 16, 20, 0.12);
  --shadow: 0 16px 40px rgba(16, 16, 20, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 30%, #fdfaf3, var(--bg) 30%, var(--bg-deep) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}

.orb-1 {
  width: 340px;
  height: 340px;
  background: #ffe27a;
  top: -120px;
  right: -60px;
}

.orb-2 {
  width: 280px;
  height: 280px;
  background: #84d9ff;
  bottom: -100px;
  left: -60px;
}

.shell {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.hero {
  animation: fade-up 650ms ease-out;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent-2);
  margin: 0;
}

h1 {
  margin: 0.3rem 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.subtitle {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  max-width: 64ch;
}

.inline-link {
  color: var(--accent-2);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

.status {
  margin: 0.7rem 0 0;
  min-height: 1.2rem;
  color: var(--ink-soft);
}

.controls {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 1rem;
  animation: fade-up 800ms ease-out;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
}

select,
input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.76);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

input[type="email"],
input[type="url"],
input[type="datetime-local"],
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.76);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

textarea {
  resize: vertical;
}

.section-copy {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  max-width: 64ch;
}

.contact-status[data-state="error"] {
  color: #9f2d2d;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
}

.mode-switcher {
  display: grid;
  gap: 0.7rem;
}

.mode-switcher-label {
  margin: 0;
  font-size: 0.95rem;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.03em;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.mode-tab {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  padding: 0.9rem;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.mode-tab-title,
.mode-tab-copy {
  display: block;
}

.mode-tab-title {
  color: var(--ink);
  font-weight: 700;
}

.mode-tab-copy {
  margin-top: 0.32rem;
  font-size: 0.88rem;
  line-height: 1.35;
}

.mode-tab[data-active="true"] {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(16, 16, 20, 0.08);
  transform: translateY(-1px);
}

.mode-guidance {
  margin: 0;
  color: var(--ink-soft);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal-shell[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 20, 0.45);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  background: rgba(242, 240, 233, 0.95);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: 0 30px 80px rgba(16, 16, 20, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.contact-success {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
}

.contact-success[hidden] {
  display: none;
}

.contact-success-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(10, 123, 131, 0.28);
}

.contact-success h3 {
  margin: 0;
  font-size: 1.4rem;
}

.contact-success p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 44ch;
}

.icon-button {
  white-space: nowrap;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-subsection {
  display: grid;
  gap: 0.9rem;
  border-top: 1px solid var(--stroke);
  padding-top: 1rem;
}

.contact-subsection[hidden] {
  display: none;
}

.subsection-head-compact {
  align-items: start;
}

.subsection-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.subsection-head h3,
.manual-event-header h4 {
  margin: 0;
}

.subsection-head p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

.manual-events {
  display: grid;
  gap: 1rem;
}

.manual-event-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1rem;
}

.manual-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.manual-event-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notes-field {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

/* Honeypot: invisible to humans, bots fill it and get silently rejected */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  pointer-events: none;
}

.primary-button,
.secondary-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 123, 131, 0.18);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: var(--stroke);
}

.primary-button:hover,
.secondary-button:hover,
.watch-link:hover,
.inline-link:hover {
  filter: brightness(0.97);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 2rem;
}

h2 {
  margin: 0;
}

#result-count {
  color: var(--ink-soft);
  margin: 0;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 0.9rem;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
  animation: card-in 450ms ease both;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.promotion {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.ruleset {
  margin: 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.name {
  margin: 0.55rem 0;
  font-size: 1.1rem;
}

.meta {
  margin: 0.18rem 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.card-bottom {
  margin-top: auto;
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

mark {
  background: rgba(10, 123, 131, 0.18);
  color: inherit;
  border-radius: 4px;
  padding: 0 0.14em;
}

.platform {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.watch-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.watch-link:hover {
  text-decoration: underline;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 780px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .contact-grid,
  .manual-event-grid {
    grid-template-columns: 1fr;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .subsection-head,
  .manual-event-header,
  .section-head,
  .modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-panel {
    padding: 1rem;
  }

  .shell {
    padding-top: 1.6rem;
  }
}
