:root {
  --ink: #18202a;
  --muted: #5d6875;
  --paper: #fffdf8;
  --panel: #ffffff;
  --line: #dbe1e8;
  --teal: #0f8b8d;
  --coral: #ef5d50;
  --yellow: #f6bd3a;
  --green: #5b9a54;
  --shadow: 0 18px 50px rgba(24, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 139, 141, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(239, 93, 80, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--yellow);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a {
  padding: 8px 10px;
  border-radius: 8px;
}

.nav a:hover {
  color: var(--ink);
  background: #fff;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: clamp(46px, 7vw, 86px) clamp(18px, 5vw, 72px) 36px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions,
.riddle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button,
.chip {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
}

.button:hover,
.chip:hover {
  transform: translateY(-2px);
}

.primary {
  color: #fff;
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--yellow);
}

.secondary,
.chip {
  color: var(--ink);
  background: #fff;
}

.stage {
  position: relative;
  min-height: 450px;
}

.spotlight {
  position: relative;
  width: min(100%, 520px);
  height: 460px;
  margin-left: auto;
  background:
    radial-gradient(circle at 50% 20%, rgba(246, 189, 58, 0.9), rgba(246, 189, 58, 0.15) 42%, transparent 65%),
    linear-gradient(160deg, #15303c, #0f8b8d);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.spotlight::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -55px;
  width: 240px;
  height: 160px;
  background: var(--coral);
  border: 3px solid var(--ink);
  transform: rotate(-12deg);
}

.mic {
  position: absolute;
  left: 50%;
  bottom: 76px;
  width: 90px;
  height: 180px;
  transform: translateX(-50%);
}

.mic::before {
  content: "";
  position: absolute;
  left: 17px;
  width: 56px;
  height: 92px;
  background: #f5f7fb;
  border: 3px solid var(--ink);
  border-radius: 30px;
}

.mic::after {
  content: "";
  position: absolute;
  left: 41px;
  top: 91px;
  width: 8px;
  height: 88px;
  background: var(--ink);
}

.mic span {
  position: absolute;
  left: 13px;
  bottom: 0;
  width: 64px;
  height: 10px;
  background: var(--ink);
  border-radius: 999px;
}

.speech {
  position: absolute;
  max-width: 190px;
  padding: 13px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 8px;
  font-weight: 900;
  box-shadow: 6px 6px 0 rgba(24, 32, 42, 0.2);
}

.speech.one {
  top: 48px;
  left: 32px;
}

.speech.two {
  top: 128px;
  right: 28px;
}

.speech.three {
  left: 72px;
  bottom: 42px;
}

.control-strip,
.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto clamp(54px, 8vw, 92px);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 8px 8px 0 rgba(15, 139, 141, 0.22);
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #f8fafc;
  border: 2px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.search input:focus {
  border-color: var(--teal);
}

.quick-result {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 14px 16px;
  background: #f9f4e7;
  border: 2px dashed #d3b161;
  border-radius: 8px;
  font-weight: 800;
  line-height: 1.45;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.result-count {
  margin: -4px 0 18px;
  color: var(--muted);
  font-weight: 800;
}

.chip {
  padding: 8px 13px;
}

.chip.active {
  color: #fff;
  background: var(--teal);
}

.joke-grid,
.kid-zone,
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card,
.kid-card,
.video-card,
.random-panel,
.riddle-box {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 6px 6px 0 rgba(24, 32, 42, 0.09);
}

.card,
.kid-card {
  min-height: 132px;
  padding: 18px;
}

.card p,
.kid-card p,
.random-panel p,
.riddle-main p {
  margin: 0;
  line-height: 1.55;
}

.tag {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 8px;
  color: #fff;
  background: var(--coral);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.list-panel {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 15px 16px;
  background: #fff;
  border: 2px solid var(--line);
  border-left: 8px solid var(--green);
  border-radius: 8px;
  line-height: 1.5;
}

.random-panel {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.random-panel h3 {
  margin: 0 0 12px;
  font-size: 1.4rem;
}

.kid-card {
  background: #fff9e9;
}

.video-card {
  overflow: hidden;
}

.video-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #dce3ea;
}

.video-card div {
  padding: 14px;
}

.video-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.video-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.video-card a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  color: #fff;
  background: var(--coral);
  border-radius: 8px;
  font-weight: 900;
}

.riddle-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: clamp(18px, 4vw, 28px);
}

.riddle-main {
  min-height: 210px;
}

.riddle-count {
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.riddle-main h3 {
  margin: 12px 0 16px;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1.08;
}

.hint {
  color: var(--muted);
}

.answer {
  margin-top: 12px;
  color: var(--teal);
  font-size: 1.2rem;
  font-weight: 900;
}

.riddle-actions {
  align-content: start;
  margin-top: 0;
}

.riddle-actions .button {
  width: 100%;
}

.privacy-card {
  max-width: 760px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  line-height: 1.7;
  color: var(--ink);
}

.privacy-card p {
  margin: 0 0 14px;
}

.privacy-card p:last-child {
  margin-bottom: 0;
}

.privacy-card a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--ink);
}

.footer a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer a:hover {
  color: #fff;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero,
  .control-strip,
  .split,
  .riddle-box {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .stage {
    min-height: 360px;
  }

  .spotlight {
    height: 360px;
    margin: 0;
  }

  .joke-grid,
  .kid-zone,
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .random-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar {
    position: static;
  }

  .nav a {
    padding-left: 0;
  }

  .hero h1 {
    font-size: 3.25rem;
  }

  .joke-grid,
  .kid-zone,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .speech.two {
    right: 10px;
  }

  .speech.one,
  .speech.three {
    left: 14px;
  }
}

/* Gate overlay */
#gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

.gate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.5rem 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  max-width: 360px;
  text-align: center;
}

.gate-logo {
  width: 64px;
  height: 64px;
  animation: gate-pulse 1.4s ease-in-out infinite;
}

@keyframes gate-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.gate-card h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.gate-msg {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

#gate-overlay.blocked .gate-logo {
  animation: none;
  opacity: 0.6;
}
