:root {
  /* Colors */
  --color-bg: #FDFBF7;
  /* Creamy off-white */
  --color-text: #2C2A29;
  /* Dark charcoal/brown */
  --color-accent: #8C7B6C;
  /* Loaf crust brown */
  --color-primary: #5D5448;
  /* Deep earthy brown */
  --color-secondary-btn: #6A5ACD;
  /* Purple pop from wireframe button, maybe soften heavily to match artisanal? Keeping purple as requested per wireframe visuals but maybe more elegant */
  --color-secondary-btn-hover: #5648A5;
  --color-border: #E0DCD5;

  /* Authenticity Vibe Override - The wireframe had bright purple buttons. 
     I will use a rich, deep royal purple that feels premium, or stick to the wireframe's suggestion.
     Let's go with a sophisticated purple. */
  --color-cta: #7B61FF;
  /* Modern vibrant purple from wireframe */

  /* Typography */
  --font-heading: 'Lora', serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --spacing-container: 1000px;
  --spacing-section: 4rem;
  --spacing-md: 2rem;
  --spacing-sm: 1rem;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

p {
  margin-bottom: 1rem;
  font-weight: 300;
}

/* Utilities */
.container {
  width: 100%;
  max-width: var(--spacing-container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  /* Slightly rounded, modern but soft */
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background-color: #7ca8cd;
  color: white;
}

.btn-primary:hover {
  background-color: #495466;
  color: white;
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 2px solid #7ca8cd;
  outline-offset: 2px;
}

.btn-secondary {
  background-color: #7ca8cd;
  color: white;
}

.btn-secondary:hover {
  background-color: #495466;
  color: white;
  transform: translateY(-1px);
}

.btn-secondary:focus-visible {
  outline: 2px solid #7ca8cd;
  outline-offset: 2px;
}

.text-center {
  text-align: center;
}

/* Header */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Hero */
.hero {
  padding: var(--spacing-section) 0;
}

.hero-image-wrapper {
  position: relative;
  margin: 0 auto;
}

.hero-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 4px;
}

.hero-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  /* Assuming image is dark enough or needs overlay */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  width: 80%;
}

/* Sections */
.section {
  padding: var(--spacing-section) 0;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-section);
  align-items: center;
}

.feature-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border: none;
  border-radius: 4px;
}

.story-section {
  padding-top: 1rem;
}

/* Plans specific */
.justified-text {
  text-align: justify;
  max-width: 800px;
  margin: 0 auto;
}

/* Contact / Newsletter */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Contact section - limited width and centered */
.contact-section .container {
  max-width: 40%;
  margin: 0 auto;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.form-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-body);
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-cta);
}

.form-input:focus-visible {
  outline: 2px solid var(--color-cta);
  outline-offset: 2px;
}

/* GDPR Checkbox */
.checkbox-group {
  margin: 1rem 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
}

.checkbox-input {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--color-cta);
  margin-right: 0;
}

.checkbox-text {
  flex: 1;
  user-select: none;
  text-align: left;
}

.checkbox-label:hover .checkbox-text {
  color: var(--color-primary);
}

.site-footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: #666;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

  /* Hero Mobile: Remove padding to touch menu */
  .hero {
    padding-top: 0;
  }

  /* Reduce spacing between sections on mobile */
  .section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* First section after hero doesn't need top padding reduction */
  .section:first-of-type {
    padding-top: var(--spacing-section);
  }

  /* Hero Mobile: Full Width & Overlay text */
  .hero-image-wrapper {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 0;
    max-width: none;
  }

  .hero-image {
    height: 400px;
    /* Taller for better overlay canvas */
    border-radius: 0;
  }

  .hero-overlay {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    width: 90%;
    margin: 0 auto;
    padding-left: 0;
    text-align: center;
  }

  .hero-overlay h1,
  .hero-overlay .subtitle {
    text-align: center;
  }

  .grid-2-col {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* Show story image on mobile now */
  .mobile-hidden {
    display: block;
  }

  /* Further reduce whitespace on mobile for story section */
  .story-section {
    padding-top: 0;
  }

  /* Reorder Story Section for Mobile: Title -> Text -> Image */
  .story-section .grid-2-col {
    display: flex;
    flex-direction: column;
  }

  /* Ungroup children of image-col (Title and Image) so they become direct flex children of grid-2-col */
  .story-section .image-col {
    display: contents;
  }

  .story-section h2 {
    order: 1;
  }

  .story-section .text-col {
    order: 2;
  }

  .story-section .feature-image {
    order: 3;
    margin-top: 1rem;
    /* Add spacing between text and image */
  }

  /* Waiting section: same mobile layout as story section */
  .waiting-section .grid-2-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .waiting-section .image-col {
    display: contents;
  }

  .waiting-section .grid-2-col h2,
  .waiting-section .image-col h2,
  .waiting-section h2 {
    order: 1;
    text-align: left !important;
    width: 100%;
    align-self: flex-start;
  }

  .waiting-section .text-col {
    order: 2;
    width: 100%;
  }

  .waiting-section .feature-image {
    order: 3;
    margin-top: 1rem;
    width: 100%;
  }

  .reverse-mobile {
    display: flex;
    flex-direction: column;
  }

  /* Philosophy section: image first, then text on mobile */
  .philosophy-section .image-col {
    order: 1;
  }

  .philosophy-section .text-col {
    order: 2;
  }

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

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h1,
  h2,
  h3 {
    text-align: left;
  }

  /* Contact section full width on mobile */
  .contact-section .container {
    max-width: 100%;
  }

  /* Waiting section title left aligned on mobile - must override general h2 rule */
  section.waiting-section h2,
  .waiting-section .grid-2-col h2,
  .waiting-section .image-col h2 {
    text-align: left !important;
  }
}

/* Newsletter Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: var(--color-bg);
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--color-text);
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.3s ease;
}

.popup-close:hover {
  color: var(--color-accent);
}

.popup-close:focus-visible {
  outline: 2px solid var(--color-cta);
  outline-offset: 2px;
  border-radius: 4px;
}