/* Base styles */
:root {
  --cranberry: #8B1E3F;
  --evergreen: #0F3D2E;
  --frost: #F7F7F7;
  --lantern-gold: #E8C26A;
  --winter-sky: #A9CDEB;
}

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

body {
  margin: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  background: var(--frost);
  color: #222;
}

/* Header */
.site-header {
  position: relative;
  background: linear-gradient(to bottom, var(--winter-sky), #ffffff);
  overflow: hidden;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.logo-wrap {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.site-logo {
  width: 70px;
  height: auto;
  margin-right: 0.75rem;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
  animation: logoGlow 3s ease-in-out infinite alternate;
}

.site-title-wrap {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  margin: 0;
  color: var(--evergreen);
}

.site-tagline {
  margin: 0;
  font-size: 0.8rem;
  color: var(--cranberry);
}

/* Navigation */
.main-nav,
.footer-nav {
  display: flex;
  gap: 0.75rem;
}

.nav-link,
.footer-nav a {
  text-decoration: none;
  color: var(--evergreen);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover,
.footer-nav a:hover {
  background: var(--cranberry);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.nav-link.active {
  background: var(--evergreen);
  color: #fff;
}

/* Snow animation in header */
.snow-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(255,255,255,0.8), transparent),
    radial-gradient(3px 3px at 70% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(255,255,255,0.7), transparent);
  background-size: 200px 200px;
  animation: snowFall 12s linear infinite;
  opacity: 0.8;
}

/* Hero sections */
.hero {
  padding: 3rem 1rem 2rem;
}

.hero-home {
  background: radial-gradient(circle at top, #ffffff, var(--winter-sky));
}

.hero-inner {
  background: radial-gradient(circle at top, #ffffff, #e9f3ff);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--evergreen);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.hero-content p {
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  background: var(--cranberry);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.primary-btn:hover {
  background: #a52a4f;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* Family Portal Button */
.family-portal-btn {
  display: inline-block;
  background: var(--evergreen);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 0.3rem;
  box-shadow: 0 0 12px rgba(232,194,106,0.6);
  border: 2px solid var(--lantern-gold);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.family-portal-btn:hover {
  background: var(--cranberry);
  box-shadow: 0 0 18px rgba(232,194,106,0.9), 0 0 8px rgba(139,30,63,0.6);
  transform: translateY(-3px) scale(1.03);
}

/* Content sections */
.content-section {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 1.5rem 1rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.content-section h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--evergreen);
  margin-top: 0;
}

.content-section p {
  line-height: 1.6;
}

/* Explore section map */
.explore-section .map-figure {
  margin: 1rem 0 0;
  text-align: center;
}

.map-figure img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.map-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

/* Founders grid */
.founders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.founder-card {
  background: #fdf9ff;
  border-radius: 10px;
  padding: 0.75rem;
  border: 1px solid rgba(15,61,46,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.founder-card h4 {
  margin: 0 0 0.25rem;
  color: var(--cranberry);
}

.founder-card p {
  margin: 0.1rem 0;
}

.founder-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* Poem */
.poem-container {
  background: #fffaf0;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(232,194,106,0.6);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  font-family: Georgia, "Times New Roman", serif;
  white-space: pre-wrap;
}

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.contact-details p {
  margin: 0.4rem 0;
}

.contact-details a {
  color: var(--cranberry);
  text-decoration: none;
}

.contact-details a:hover {
  text-decoration: underline;
}

/* Lantern illustration */
.contact-illustration {
  text-align: center;
}

.lantern-post {
  position: relative;
  width: 80px;
  height: 160px;
  margin: 0 auto 0.5rem;
}

.lantern-body {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 60px;
  background: var(--evergreen);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.lantern-glow {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(232,194,106,0.9), transparent);
  opacity: 0.8;
}

/* Lantern Flicker Animation */
@keyframes lanternFlicker {
  0% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  20% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  40% { opacity: 0.6; transform: translateX(-50%) scale(0.97); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.08); }
  80% { opacity: 0.8; transform: translateX(-50%) scale(1.02); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.flicker {
  animation: lanternFlicker 2.8s infinite ease-in-out;
}

.lantern-caption {
  font-size: 0.85rem;
  color: #555;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-row {
  display: flex;
  flex-direction: column;
}

.form-row label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row textarea {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--lantern-gold);
  box-shadow: 0 0 0 3px rgba(232,194,106,0.4);
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
}

/* Footer */
.site-footer {
  background: #f0f4f8;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* Animations */
@keyframes snowFall {
  0% {
    background-position: 0 0, 50px 50px, 100px 0, 150px 50px;
  }
  100% {
    background-position: 0 200px, 50px 250px, 100px 200px, 150px 250px;
  }
}

@keyframes logoGlow {
  0% {
    box-shadow: 0 0 8px rgba(232,194,106,0.4);
  }
  100% {
    box-shadow: 0 0 18px rgba(232,194,106,0.9);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(12px);
  }
  to {
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s ease-out both;
}

.slide-up {
  animation: slideUp 0.8s ease-out both;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
