@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=DM+Sans:wght@400;500&display=swap');

:root {
    --bg: #f6f9ea;
    --accent: #97c75d;
    --accent-2: #6A7A56;
    --text: #222222;
    --muted: #666666;
    --card: #fffaf2;
    --border: #d0dac4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
  filter: blur(2px);
  
  /* Default: landscape (wider than tall) */
  background-image: url('assets/bg.jpeg');
}

/* Portrait (taller than wide) */
@media (max-aspect-ratio: 1/1) {
  body::before {
    background-image: url('assets/bg-tall.jpeg');
  }
}

/* HERO */

.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 2rem;
}

.hero-inner {
    max-width: 900px;
    text-align: center;
}

.hero-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #e9ffce;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-gifs {
    display: inline-block;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.2rem;
}

.hero-gifs img {
    width: 80px;
    height: auto;
}

h1 {
    font-family: "Fraunces", system-ui, sans-serif;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    margin: 0 0 1rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    max-width: 36rem;
    margin: 0 auto 1.5rem;
    color: var(--muted);
}

.hero-note {
    font-size: 0.9rem;
    color: var(--muted);
}

.hero-button {
    margin-top: 1.75rem;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--accent);
    color: #1b1b1b;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease, box-shadow 0.1s ease,
    background 0.1s ease;
}

.hero-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
    background: var(--accent-2);
}

.hero-doodles {
    margin-top: 1.5rem;
    font-family: "Fraunces";
    font-size: 0.95rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--accent-2);
}

.hero-doodles span::before {
    content: "✶ ";
}

/* PAGE LAYOUT */

.page {
    max-width: 900px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem 4rem;
}

.form-shell {
    background: var(--card);
    border-radius: 1.3rem 1.3rem 1.6rem 1.6rem;
    border: 8px dashed var(--border);
    padding: 2rem 1.25rem 2.5rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    position: relative;
}

@media (min-width: 640px) {
    .form-shell {
    padding: 2.5rem 2.5rem 3rem;
    }
}

.form-shell::before,
.form-shell::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    z-index: -1;
    opacity: 0.4;
}

.form-shell::before {
    width: 110px;
    height: 110px;
    background: rgba(36, 200, 3, 0.25);
    top: -30px;
    left: -20px;
    filter: blur(5px);
}

.form-shell::after {
    width: 90px;
    height: 90px;
    background: rgba(36, 200, 3, 0.25);
    bottom: -20px;
    right: -10px;
    filter: blur(2px);
}

.form-heading {
    font-family: "Fraunces";
    font-size: 1.4rem;
    margin: 0 0 0.75rem;
}

.form-intro {
    margin: 0 0 1.5rem;
    font-size: 0.98rem;
    color: var(--muted);
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.field-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.field-optional {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

.field-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 46rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    font: inherit;
    padding: 0.65rem 0.75rem;
    border-radius: 0.7rem;
    border: 1.5px solid #d1c6b7;
    background: #fffaf4;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 2px rgba(43, 122, 120, 0.18);
    background: #ffffff;
}

input[type="number"] {
    width: 80px;
}

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

.story-textarea {
    min-height: 220px;
}

.small-note {
    font-size: 0.78rem;
    color: var(--muted);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
}

.checkbox-row input[type="checkbox"] {
    margin-top: 0.15rem;
}

.form-footer {
    margin-top: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
}

.submit-btn {
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    border: none;
    background: var(--accent-2);
    color: #f5f5f5;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
    transition: transform 0.1s ease, box-shadow 0.1s ease,
    background 0.1s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    background: var(--accent);
}

.demo-note {
    font-size: 0.78rem;
    color: var(--muted);
}

.status-message {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.status-message.success {
    color: var(--accent-2);
}

.status-message.error {
    color: #b00020;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0 1.5rem 2rem;
}

.footer-logo {
    margin-top: 0.5rem;
    display: block;
}

.footer-logo img {
    padding: 10px;
    margin: 0.5rem auto 0;
    width: auto;
    height: 70px;
}

@media (prefers-reduced-motion: no-preference) {
    .hero,
    .form-shell {
    animation: fadeUp 0.6s ease-out both;
    }

    .form-shell {
    animation-delay: 0.12s;
    }

    @keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
    }
}

/* Page border wrapper */
/* .page-border {
  min-height: 100vh;
  border: 12px double var(--accent-2);
  box-sizing: border-box;
} */

/* Hero buttons row */
.hero-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: center;
}

/* Secondary hero button */
.hero-button-secondary {
  background: transparent;
  color: var(--accent-2);
  border: 2px solid var(--accent-2);
  box-shadow: none;
}

.hero-button-secondary:hover {
  background: var(--accent-2);
  color: #fdf6ea;
}
/* Modal / popup */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;

  /* gives the modal some breathing room on small screens + notches */
  padding: max(1rem, env(safe-area-inset-top)) 1rem
           max(1rem, env(safe-area-inset-bottom));
}

.modal[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.modal-inner {
  max-width: 520px;
  width: 100%;
  margin: 0; /* padding on .modal handles outer spacing now */
  background: #fffaf2;
  border-radius: 1.2rem;
  border: 2px solid #e1d3c6;
  padding: 1.25rem 1.25rem 1.25rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  font-size: 0.95rem;

  /* ✅ make the panel scroll if content is tall */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

  /* viewport-safe max height (with fallback) */
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
}

/* keep headings readable even with close button in-flow */
.modal-inner h2 {
  margin-top: 0.25rem;
  font-family: "Fraunces", system-ui, sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.modal-inner p {
  margin: 0 0 0.7rem;
}

/* ✅ keep close button always reachable while scrolling */
.modal-close {
  position: sticky;     /* instead of absolute */
  top: 0;               /* sticks to top of scroll container */
  align-self: flex-end; /* right side */
  z-index: 2;

  border: none;
  background: rgba(255, 250, 242, 0.9);
  backdrop-filter: blur(2px);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;

  /* comfy tap target on mobile */
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile/small screens: start near the top, full width, tighter padding */
@media (max-width: 520px) {
  .modal {
    align-items: flex-start;
  }

  .modal-inner {
    max-width: none;
    border-radius: 1rem;
    padding: 1rem 1rem 1rem;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
  }
}

/* Optional (recommended): prevent page behind from scrolling when modal is open
   Toggle this class in JS when you open/close the modal.
*/

body.modal-open {
  overflow: hidden;
  touch-action: none;
}


.thank-you {
  max-width: 700px;
  margin: 3rem auto 4rem;
  padding: 2rem 1.5rem;
  border-radius: 1.2rem;
  border: 2px solid #e1d3c6;
  background: #fffaf2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-align: center;
  align-items: center;
  justify-content: center;
}

.thank-you h2 {
  margin-top: 0;
}

.thank-you-actions {
  margin-top: 1rem;
  display: inline-block;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.thank-you-actions button {
  border-radius: 999px;
  border: 1.5px dashed var(--accent-2);
  background: var(--accent);
  color: var(--text);
  padding: 0.6rem 1.3rem;
  font-size: 0.9rem;
  cursor: pointer;
  align-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.thank-you-actions button:nth-child(2) {
  background: transparent;
  color: #111;
}

.copy-feedback {
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

button {
    font: inherit;
}

button:hover {
    transform: translateY(-1px);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    background: var(--accent);
}

.hero {
  position: relative; /* ensure we can position things inside */
  overflow: hidden;
}

/* Wrapper for the canvas at the bottom of the hero */
.hero-garden-wrap {
  position: relative;
  width: 100%;
  max-width: 900px; /* or whatever matches your hero-inner max width */
  margin: 1.5rem auto 0;
  height: 180px; /* height of the garden strip */
}

/* Make canvas fill the wrapper */
#garden-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#garden-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

#tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(38, 70, 83, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #264653;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    max-width: 220px;
}

#tooltip.visible {
    opacity: 1;
}

#tooltip .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5a7c65;
    margin-bottom: 0.15rem;
}

#tooltip .value {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#tooltip .value:last-child {
    margin-bottom: 0;
}

/* Make the garden wrapper a positioning context */
.hero-garden-wrap {
  position: relative;
}

/* Info icon container (top-right of the canvas area) */
.garden-info {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20; /* above canvas + other overlays */
}

/* Circular "i" button */
.garden-info-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.garden-info-btn:focus {
  outline: 2px solid rgba(0, 0, 0, 0.65);
  outline-offset: 2px;
}

/* Tooltip box */
.garden-info-tooltip {
  position: absolute;
  top: 40px;  /* drops below the button */
  right: 0;
  width: min(320px, 80vw);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  font-size: 0.95rem;

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

/* Show on hover or keyboard focus */
.garden-info:hover .garden-info-tooltip,
.garden-info:focus-within .garden-info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Optional: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .garden-info-tooltip {
    transition: none;
  }
}
