/* ============================================================
   EverRest production design system
   Dignified, calm, mobile-first. Deep greens + warm stone
   grays + soft gold. Big type, big touch targets (48px+).
   Plain HTML/CSS/JS — works from file:// too.
   ============================================================ */

:root {
  --green-deep: #1e3a2a;
  --green-moss: #2f5340;
  --green-soft: #e9f0e9;
  --stone-dark: #5c564a;
  --stone: #d9d2c2;
  --stone-light: #efe9dc;
  --cream: #faf8f2;
  --paper: #ffffff;
  --gold: #c9a25e;
  --gold-soft: #f4e9d2;
  --gold-dark: #9a7434;
  --ink: #2b2924;
  --ink-soft: #4a463d;
  --line: #e2dccb;
  --danger: #8a3b2e;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Noto Serif", serif;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 58, 42, 0.10);
  --shadow-lift: 0 6px 24px rgba(30, 58, 42, 0.14);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;          /* 18px base — easy reading */
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--green-deep);
  margin: 0 0 0.6em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1em; }

a { color: var(--green-moss); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: 48px 0; }
.section--tint { background: var(--stone-light); }
.center { text-align: center; }
.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 44rem;
}

/* Views: the router toggles .active; home is active on first paint */
.view { display: none; }
.view.active { display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--green-deep);
  color: var(--cream);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 8px 4px;
  white-space: nowrap;
}
.wordmark .dove { margin-right: 6px; }
.main-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 48px;              /* touch target */
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
}
.main-nav a:hover,
.main-nav a:active { background: rgba(255, 255, 255, 0.12); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-deep);
  color: #d8d2c2;
  padding: 36px 0 44px;
  font-size: 1rem;
}
.site-footer a { color: var(--gold-soft); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.footer-links a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.site-footer .fine { font-size: 0.95rem; color: #b9b29f; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--green-deep) 0%, var(--green-moss) 100%);
  color: var(--cream);
  padding: 64px 0 72px;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.hero h1 {
  color: var(--cream);
  font-size: 2.2rem;
  max-width: 40rem;
  margin: 0 auto 20px;
}
.hero .lede { color: #e6e0cf; margin: 0 auto 32px; }
.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  max-width: 26rem;
  margin: 0 auto;
}
.tour-again {
  margin-top: 20px;
  display: inline-block;
  color: var(--gold-soft);
  font-size: 1.05rem;
  min-height: 48px;
  line-height: 48px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;              /* roomy touch target */
  padding: 14px 28px;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-body);
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #241c0c;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: #d8b26f; }

.btn-secondary {
  background: transparent;
  border-color: var(--cream);
  color: var(--cream);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

.btn-green {
  background: var(--green-moss);
  border-color: var(--green-moss);
  color: #fff;
}
.btn-green:hover { background: var(--green-deep); }

.btn-outline {
  background: transparent;
  border-color: var(--green-moss);
  color: var(--green-moss);
}
.btn-outline:hover { background: var(--green-soft); }

/* Coming-soon: clearly disabled, never clickable */
.btn-coming,
.btn[disabled] {
  background: #e6e0d1;
  border: 2px dashed var(--stone-dark);
  color: var(--stone-dark);
  cursor: not-allowed;
  opacity: 0.85;
  box-shadow: none;
}
.btn-coming:active { transform: none; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 28px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
}
.card h3 { margin-bottom: 8px; }
.card .price {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--green-deep);
  margin: 4px 0 12px;
}
.card .price small {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-soft);
  font-weight: 400;
}
.card .btn { margin-top: auto; }
.card ul {
  margin: 0 0 20px;
  padding-left: 1.3em;
  color: var(--ink-soft);
}
.card li { margin-bottom: 8px; }
.badge {
  position: absolute;
  top: -14px;
  right: 18px;
  background: var(--gold);
  color: #241c0c;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.card--highlight { border: 2px solid var(--gold); }

/* Steps (How it works) */
.step-num {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-moss);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* ---------- Store tabs ---------- */
.store-tabs {
  display: flex;
  gap: 8px;
  margin: 24px 0 8px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
}
.store-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 4px solid transparent;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 14px 18px 12px;
  min-height: 52px;
  cursor: pointer;
  white-space: nowrap;
}
.store-tab[aria-selected="true"] {
  color: var(--green-deep);
  border-bottom-color: var(--gold);
}
.store-panel { display: none; padding-top: 8px; }
.store-panel.active { display: block; }

.stone-fig {
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 16px;
}
.stone-fig svg { height: 120px; width: auto; }

.launch-note {
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.launch-note strong { color: var(--ink); }

/* ---------- Forms ---------- */
.form { max-width: 34rem; }
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--green-deep);
}
.field .hint {
  display: block;
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 52px;
  font-size: 1.1rem;
  font-family: var(--font-body);
  padding: 12px 16px;
  border: 2px solid var(--stone);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--green-moss);
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

/* ---------- Tribute buttons (memorial drawer) ---------- */
.tribute-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.tribute-btn {
  flex: 1 1 140px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--paper);
  border: 2px solid var(--stone);
  border-radius: 12px;
  color: var(--green-deep);
  cursor: pointer;
  padding: 12px 16px;
}
.tribute-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.tribute-btn .emoji { font-size: 1.5rem; }

/* ---------- Visit view / drawer ---------- */
#cemetery-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 64px);
  min-height: 420px;
  background: var(--green-deep);
  overflow: hidden;
}
#cemetery-container canvas { display: block; width: 100% !important; height: 100% !important; }

#memorial-drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 300;
  background: var(--cream);
  border-top: 3px solid var(--gold);
  border-radius: 20px 20px 0 0;
  max-height: 82vh;
  overflow-y: auto;
  padding: 20px 20px 32px;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(105%);
  transition: transform 0.3s ease;
}
#memorial-drawer.open { transform: translateY(0); }
.drawer-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: flex;
  width: 52px; height: 52px;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--stone-light);
  border: 2px solid var(--stone);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Tour overlay ---------- */
#tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 32, 25, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#tour-overlay.open { display: flex; }
.tour-card {
  background: var(--cream);
  border-radius: 20px;
  border: 2px solid var(--gold);
  max-width: 26rem;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-lift);
}
.tour-card .kicker {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 8px;
}
.tour-card h2 { margin-bottom: 12px; }
.tour-card p { color: var(--ink-soft); font-size: 1.12rem; }
.tour-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0 24px;
}
.tour-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--stone);
}
.tour-dots span.on { background: var(--gold); }
.tour-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tour-skip {
  background: none;
  border: none;
  color: var(--stone-dark);
  font-size: 1.05rem;
  min-height: 48px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Legal / admin pages ---------- */
.page-narrow { max-width: 46rem; margin: 0 auto; }
.spirit-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}
.spirit-list li { margin-bottom: 10px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--green-deep);
}
.stat .lbl { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Partners band ---------- */
.partners {
  background: var(--green-deep);
  color: var(--cream);
  border-radius: 20px;
  padding: 36px 28px;
  margin: 48px 0 8px;
}
.partners h2 { color: var(--gold); }
.partners p { color: #e6e0cf; }
.partners a { color: var(--gold-soft); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  h1 { font-size: 2.5rem; }
  .hero h1 { font-size: 2.6rem; }
  .hero-ctas { flex-direction: row; justify-content: center; max-width: none; }
  .hero-ctas .btn { min-width: 240px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .tour-actions { flex-direction: row; justify-content: space-between; }
  .tour-actions .btn { flex: 1; }
}

@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 64px 0; }
  #memorial-drawer {
    left: auto;
    right: 24px;
    top: 88px;
    bottom: 24px;
    width: 400px;
    border-radius: 20px;
    border: 2px solid var(--gold);
    transform: translateX(110%);
  }
  #memorial-drawer.open { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
