/* ===== Reset ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;

  /* Critical: dynamic viewport sizing */
  min-height: 100vh;
  min-height: 100dvh;

  font-family: "DM Sans", system-ui, sans-serif;
  color: #2d1f0f;

  /* Bulletproof background */
  background-color: #3d2914;
  background-image:
    linear-gradient(
      to bottom,
      rgba(45, 31, 15, 0.5),
      rgba(45, 31, 15, 0.3) 25%,
      rgba(45, 31, 15, 0.4) 70%,
      rgba(45, 31, 15, 0.75)
    ),
    url("images/background.png");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* Prevent background jump on mobile */
  background-attachment: scroll;
}

/* Page container */
.page {
  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* Content */
.content {
  width: 100%;
  max-width: 42rem;
  padding: 2rem 1.5rem;

  margin-top: calc(-18vh - 1.5in);
}

/* Short viewport fix */
@media (max-height: 600px) {
  .content {
    margin-top: calc(-12vh - 0.75rem);
  }
}

.title {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.15;
  text-align: center;
  margin: 0 0 0.5rem;
  color: #fff;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 4px 20px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.tagline {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  text-align: center;
  margin: 0 0 2.5rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

/* ===== CTA block ===== */
.cta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.btn-primary {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.9rem 1.75rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #e8b923;
  color: #2d1f0f;
  box-shadow:
    0 4px 0 #b88b0f,
    0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 #b88b0f,
    0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow:
    0 2px 0 #b88b0f,
    0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ===== Email form (revealed on click) ===== */
.email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 22rem;
}

.email-form.hidden {
  display: none;
}

.email-form input {
  flex: 1;
  min-width: 12rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #2d1f0f;
}

.email-form input::placeholder {
  color: #6b5b4a;
}

.email-form input:focus {
  outline: none;
  border-color: #e8b923;
  box-shadow: 0 0 0 3px rgba(232, 185, 35, 0.35);
}

.btn-submit {
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #5c4a32;
  color: #fff;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-submit:hover {
  background: #4a3c28;
  transform: translateY(-1px);
}

.form-message {
  font-size: 0.95rem;
  text-align: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.form-message.hidden {
  display: none;
}

.form-message.success {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.form-message.error {
  color: #f5a623;
}

/* ===== Share button (after signup) ===== */
.btn-share {
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-share:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.btn-share.hidden {
  display: none;
}

/* ===== Social footer (bottom right) ===== */
.social-footer {
  position: absolute;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-right: 0.25rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.2s ease, transform 0.15s ease;
}

.social-link:hover {
  color: #fff;
  transform: scale(1.1);
}

.social-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
