/* ── Design tokens ── */
:root {
  --green-900:  #1a3a15;
  --green-800:  #2d5a27;
  --green-700:  #3d7035;
  --green-600:  #4e8a44;
  --green-500:  #62a356;
  --green-400:  #85bc7a;
  --green-100:  #edf7e9;
  --green-50:   #f5fbf3;

  --earth-900:  #3b2009;
  --earth-700:  #7a4a22;
  --earth-500:  #b07840;
  --earth-300:  #d4a97a;
  --earth-100:  #f5ede2;
  --earth-50:   #faf5ef;

  --neutral-900: #111814;
  --neutral-700: #2d3829;
  --neutral-500: #5c6b56;
  --neutral-400: #7d8f77;
  --neutral-200: #d4dcd0;
  --neutral-100: #edf1eb;
  --neutral-50:  #f7f9f6;
  --white:       #ffffff;

  --font-sans:   'DM Sans', system-ui, -apple-system, sans-serif;
  --font-serif:  'DM Serif Display', Georgia, serif;

  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-xs:  0 1px 2px rgba(17,24,20,.06);
  --shadow-sm:  0 2px 8px rgba(17,24,20,.08);
  --shadow-md:  0 4px 20px rgba(17,24,20,.10);
  --shadow-lg:  0 12px 40px rgba(17,24,20,.14);
  --shadow-xl:  0 24px 64px rgba(17,24,20,.18);

  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--neutral-50);
  color: var(--neutral-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--neutral-200);
}
.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}
.brand-paw {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--green-800);
  letter-spacing: -.01em;
}
.brand-sub {
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--neutral-400);
}

/* ── Hero ── */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(98,163,86,.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(176,120,64,.12) 0%, transparent 60%),
    linear-gradient(160deg, var(--green-900) 0%, #1e3d18 40%, #2a4e22 100%);
  color: var(--white);
  padding: 4rem 1.5rem 3.5rem;
  overflow: hidden;
}
/* Subtle texture overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--green-400);
  margin-bottom: 1.25rem;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--green-400);
  border-radius: 2px;
}
.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--white);
  margin-bottom: 1.25rem;
  max-width: 600px;
}
.hero-headline em {
  font-style: italic;
  color: var(--green-400);
}
.hero-body {
  font-size: 1.05rem;
  color: rgba(255,255,255,.65);
  max-width: 480px;
  line-height: 1.65;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
}
.hero-scroll-hint span {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 12px;
  position: relative;
}
.hero-scroll-hint span::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: rgba(255,255,255,.4);
  border-radius: 2px;
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

/* ── Main ── */
main {
  flex: 1;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem 3rem;
}

/* ── Form section ── */
.form-section {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}
.form-card {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.form-card-header {
  padding: 2rem 2.5rem 0;
  border-bottom: 1px solid var(--neutral-100);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}
.form-card-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--green-800);
  letter-spacing: -.02em;
  margin-bottom: .3rem;
}
.form-card-sub {
  font-size: .9rem;
  color: var(--neutral-500);
}
form {
  padding: 0 2.5rem 2rem;
}

/* ── Fields ── */
.field-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.field-group { display: flex; flex-direction: column; gap: .5rem; }

.field-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.field-label-icon { font-size: .9rem; }

.input-wrap { position: relative; }
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: .8rem 1.1rem;
  background: var(--neutral-50);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  font-size: .975rem;
  font-family: var(--font-sans);
  color: var(--neutral-900);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.input-wrap input::placeholder { color: var(--neutral-400); }
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--green-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(98,163,86,.12);
}
.input-wrap input.invalid {
  border-color: #e53e3e;
  box-shadow: 0 0 0 4px rgba(229,62,62,.1);
}

.select-wrap select { padding-right: 2.75rem; cursor: pointer; }
.select-arrow {
  position: absolute;
  right: .9rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--neutral-400);
  display: flex;
  align-items: center;
}
.select-arrow svg { width: 18px; height: 18px; }

.field-error {
  font-size: .8rem;
  color: #e53e3e;
  min-height: 1em;
  font-weight: 500;
}

/* ── Generate button ── */
.btn-generate {
  margin-top: 1.75rem;
  width: 100%;
  padding: 1rem 1.75rem;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 100%);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 16px rgba(62,112,53,.35), 0 1px 3px rgba(0,0,0,.1);
  letter-spacing: .01em;
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(62,112,53,.4), 0 2px 6px rgba(0,0,0,.1);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-arrow {
  font-size: 1.1rem;
  transition: transform var(--transition);
}
.btn-generate:hover .btn-arrow { transform: translateX(3px); }
.btn-generate.loading .btn-arrow { display: none; }

.btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.btn-generate.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error banner ── */
.error-banner[hidden] { display: none; }
.error-banner {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  background: #fff5f5;
  border: 1.5px solid #feb2b2;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 2rem;
  color: #742a2a;
}
.error-banner strong { display: block; margin-bottom: .2rem; font-size: .95rem; }
.error-banner p { font-size: .875rem; opacity: .85; }
.error-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: .1rem; }

/* ── Results ── */
.results-section { animation: fadeUp .45s cubic-bezier(.4,0,.2,1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.results-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--green-800);
  letter-spacing: -.02em;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  background: var(--white);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--neutral-700);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-xs);
}
.btn-copy svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-copy:hover {
  border-color: var(--green-500);
  color: var(--green-700);
  box-shadow: var(--shadow-sm);
}
.btn-copy.copied {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-800);
}

/* ── Stats row ── */
.stats-row {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  text-align: center;
}
.stat-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--neutral-400);
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--green-800);
}
.stat-unit {
  font-size: .75rem;
  color: var(--neutral-500);
}
.stat-divider {
  width: 1px;
  height: 3rem;
  background: var(--neutral-200);
  flex-shrink: 0;
}

/* ── Map ── */
.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
}
#map { height: 500px; display: block; }

/* Leaflet popup tweaks */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: var(--font-sans) !important;
  border: 1px solid var(--neutral-200) !important;
  padding: .1rem !important;
}
.leaflet-popup-content { margin: .75rem 1rem !important; }
.popup-title { font-weight: 700; color: var(--green-800); font-size: .9rem; margin-bottom: .15rem; }
.popup-type  { font-size: .78rem; color: var(--neutral-400); }

/* ── POI section ── */
.poi-section {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}
.poi-section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.1rem;
}
.poi-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--neutral-700);
}
.poi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 .45rem;
  background: var(--green-100);
  color: var(--green-800);
  font-size: .75rem;
  font-weight: 700;
  border-radius: 99px;
}
.poi-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.poi-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .7rem .9rem;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition);
}
.poi-item:hover {
  background: var(--green-50);
  border-color: var(--neutral-200);
}
.poi-item-icon {
  font-size: 1.2rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.poi-item-name { font-size: .9rem; font-weight: 600; color: var(--neutral-900); }
.poi-item-type { font-size: .78rem; color: var(--neutral-400); margin-top: .05rem; }
.poi-empty {
  font-size: .9rem;
  color: var(--neutral-400);
  padding: .5rem 0;
  font-style: italic;
}

/* ── Footer ── */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.75);
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.footer-paw { font-size: 1.4rem; }
.footer-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--white);
}
.footer-cta {
  font-size: 1rem;
  line-height: 1.65;
}
.footer-cta strong {
  color: var(--earth-300);
  font-weight: 600;
}
.footer-legal {
  font-size: .75rem;
  color: rgba(255,255,255,.3);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .form-card-header { padding: 1.5rem 1.5rem 1.25rem; }
  form { padding: 0 1.5rem 1.5rem; }
  .field-row { grid-template-columns: 1fr; }
  .stats-row { padding: 1rem 1.25rem; gap: .5rem; }
  .stat-value { font-size: 1.6rem; }
  #map { height: 340px; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .poi-section { padding: 1.25rem; }
  .hero { padding: 3rem 1.5rem 3rem; }
  .hero-headline { font-size: 2.2rem; }
  .form-section { margin-top: 1.5rem; }
}
