/* Regularly smoke page. One accent, DM Sans for text, Pacifico for the wordmark only. */

:root {
  --green: #2f6b3f;
  --green-deep: #25552f;
  --green-soft: #e4eee6;
  --tint: #e9f0e4;
  --bg: #f7f4ec;
  --ink: #1b211c;
  --muted: #5f6a61;
  --line: #8f8b7e; /* 3.3:1 on white, meets the 3:1 rule for control borders */
  --card: #ffffff;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Pacifico", "Brush Script MT", cursive;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Skip link: visible only when focused */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Hero: tinted band, giant faint wordmark behind, content on top */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--tint);
}
.watermark {
  position: absolute;
  top: -0.05em;
  left: -0.12em;
  z-index: 0;
  font-family: var(--script);
  font-size: clamp(11rem, 42vw, 34rem);
  line-height: 1;
  color: var(--green);
  opacity: 0.09;
  white-space: nowrap;
  transform: rotate(-6deg);
  transform-origin: left top;
  pointer-events: none;
  user-select: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  display: grid;
  gap: 26px;
}

/* Brand: mark plus Pacifico wordmark, tilted a touch */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--green);
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 40px;
  display: block;
}
.wordmark {
  display: inline-block;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1.15;
  transform: rotate(-2deg);
  transform-origin: left center;
}

h1 {
  margin: 18px 0 10px;
  font-size: clamp(1.65rem, 6.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.sub {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--muted);
}

/* Form card */
.card {
  padding: 20px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 24px 50px -32px rgba(27, 33, 28, 0.4);
}

/* Root page before a side is chosen: just the question and two outlined buttons.
   On the first choice the question collapses, the buttons morph into the
   slider track, and the form slides down (see .reveal). */
.pick {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}
.reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}
.reveal > div {
  min-height: 0;
  overflow: hidden;
  /* room for focus rings and the button shadow while clipped */
  padding: 6px;
  margin: -6px;
}
.reveal.open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.card-unchosen .toggle {
  margin-bottom: 0;
  padding: 0;
  gap: 12px;
  background: transparent;
}
.toggle.is-settling .toggle-thumb,
.card-unchosen .toggle-thumb { opacity: 0 !important; }
.card-unchosen .toggle button {
  min-height: 52px;
  border-width: 2px;
  border-style: solid;
  border-color: var(--green);
  border-radius: 12px;
  background: var(--card);
  color: var(--green);
  font-size: 0.95rem;
}
.card-unchosen .toggle button:hover {
  background: var(--green);
  color: #fff;
}
@media (max-width: 479px) {
  .card-unchosen .toggle button { font-size: 0.875rem; padding: 6px 6px; }
}
[hidden] { display: none !important; }

/* Audience toggle with a sliding thumb */
.toggle {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  background: #ebe8de;
  border-radius: 999px;
  transition: background-color 0.35s ease, padding 0.35s ease, gap 0.35s ease, margin 0.35s ease;
}
/* The thumb is sized and placed by script.js to match the pressed button,
   so labels of different lengths each get the room they need. */
.toggle-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 2px 6px rgba(27, 33, 28, 0.18);
  will-change: transform, width;
}
.toggle.is-ready .toggle-thumb {
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), width 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease;
}
/* Root page: no side chosen yet, so no thumb until the visitor picks one. */
.toggle[data-selected=""] .toggle-thumb { opacity: 0; }
.toggle button {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 6px 10px;
  border: 0 solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.2s ease, background-color 0.3s ease, border-color 0.3s ease, border-width 0.3s ease, border-radius 0.35s ease, min-height 0.35s ease, font-size 0.3s ease;
}
.toggle button[aria-pressed="true"] { color: #fff; }
.toggle button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Copy that swaps when the toggle flips */
[data-copy] { transition: opacity 0.18s ease; }
.is-swapping [data-copy] { opacity: 0; }

/* Fields */
.field {
  display: block;
  margin: 0 0 12px;
}
.field > span {
  display: block;
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: max(16px, 1rem); /* 16px+ stops iOS from zooming the page on focus */
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: #6f7870; opacity: 1; }
input:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}
input[aria-invalid="true"] { border-color: #b3261e; }
.error {
  display: block;
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #b3261e;
}
.error:empty { display: none; }
.btn {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { background: var(--green-deep); }
.btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* About: short description under the hero */
.about {
  background: var(--bg);
}
.about-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 8px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.about h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.about-lead {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--muted);
}
.about-cols {
  display: grid;
  gap: 20px;
}
.about-col {
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--green-soft);
}
.about-col h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
}
.about-col ul {
  margin: 0;
  padding-left: 1.1em;
}
.about-col li { margin: 0 0 6px; }
.about-col li:last-child { margin-bottom: 0; }

/* Thanks page */
.line {
  margin: 14px 0 0;
  font-size: 1rem;
}
.line a {
  color: var(--green);
  font-weight: 600;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  font-size: 0.9rem;
  color: var(--muted);
}
footer p { margin: 0 0 6px; }
footer a {
  color: var(--green);
  font-weight: 600;
}

/* Utilities */
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 900px) {
  body { font-size: 18px; }
  .hero-inner {
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: 64px;
    min-height: min(78vh, 680px);
    padding: 64px 40px 80px;
  }
  .brand img { width: 56px; height: 56px; }
  h1 { margin-top: 26px; }
  .card { padding: 28px; }
  .toggle button { font-size: 0.95rem; }
  .about-inner { padding: 56px 40px 16px; }
  .about h2 { font-size: 1.6rem; }
  .about-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .about-col { padding: 22px 24px; }
  footer { padding: 36px 40px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .toggle-thumb, .toggle button, [data-copy] { transition: none; }
}
