/* =====================================================
   BADA.CAFE STYLES
   Pastoral digital meadow — botanical folio in web form
   ===================================================== */

/* =====================================================
   ROOT & TYPOGRAPHY SETUP
   ===================================================== */

:root {
  /* Palette */
  --color-parchment: #FAF6F0;
  --color-cocoa: #3B2F2F;
  --color-sienna: #8B5E3C;
  --color-wheat: #C4956A;
  --color-sage: #5B7B5E;
  --color-linen: #E8DDD0;
  --color-apricot: #D4A574;
  --color-ash: #2E2421;

  /* Typography */
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Lora", serif;
  --font-script: "Tangerine", cursive;

  /* Spacing */
  --margin-wide: 3rem;
  --margin-narrow: 1.5rem;

  /* Animation */
  --transition-fade: 800ms ease-in-out;
  --transition-fade-long: 1200ms ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-parchment);
  color: var(--color-cocoa);
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* Selection color */
::selection {
  background-color: rgba(196, 149, 106, 0.2);
  color: var(--color-cocoa);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-parchment);
}

::-webkit-scrollbar-thumb {
  background: var(--color-wheat);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-sienna);
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--color-cocoa);
}

h1 {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 600;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.4rem;
}

p {
  margin-bottom: 1.2rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-sienna);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color 200ms ease-in-out, text-decoration-color 200ms ease-in-out;
}

a:hover {
  color: var(--color-apricot);
  text-decoration-color: var(--color-apricot);
}

a:visited {
  color: var(--color-sage);
}

/* Drop cap styling */
.drop-cap {
  font-family: var(--font-script);
  font-size: 5rem;
  float: left;
  line-height: 1;
  margin-right: 0.3rem;
  margin-top: -0.2rem;
  color: var(--color-sienna);
}

/* =====================================================
   NAVIGATION
   ===================================================== */

#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: transparent;
  font-family: var(--font-body);
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-sienna);
  letter-spacing: 0.05em;
}

.nav-chapters-btn {
  background: none;
  border: none;
  color: var(--color-sienna);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  transition: color 200ms ease-in-out;
}

.nav-chapters-btn:hover {
  color: var(--color-apricot);
}

/* =====================================================
   CHAPTERS OVERLAY
   ===================================================== */

.chapters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(46, 36, 33, 0.92);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 300ms ease-in-out;
}

.chapters-overlay.active {
  display: flex;
  opacity: 1;
}

.chapters-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-parchment);
  cursor: pointer;
  padding: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms ease-in-out;
}

.chapters-close:hover {
  color: var(--color-wheat);
}

.chapters-content {
  text-align: center;
  color: var(--color-parchment);
  max-width: 500px;
}

.chapters-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--color-parchment);
}

.chapters-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chapters-list li {
  font-size: 1.1rem;
}

.chapters-list a {
  color: var(--color-parchment);
  text-decoration: none;
  transition: color 200ms ease-in-out;
  font-family: var(--font-body);
}

.chapters-list a:hover {
  color: var(--color-apricot);
}

.chapters-list [data-numeral]::before {
  content: attr(data-numeral);
  font-family: var(--font-body);
  font-style: italic;
  margin-right: 1rem;
  color: var(--color-wheat);
}

/* =====================================================
   SECTIONS & LAYOUT
   ===================================================== */

.section {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
}

.section-content {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

/* Hero section */
.section-hero {
  min-height: 100vh;
  justify-content: flex-end;
  position: relative;
  background-color: var(--color-parchment);
  overflow: hidden;
}

.hero-botanicals {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.botanical {
  position: absolute;
  opacity: 0;
}

.botanical-lavender-bg {
  width: 40vw;
  max-width: 400px;
  height: auto;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  animation: fadeRevealBotanical 1200ms ease-in-out forwards;
}

.botanical-fig-left {
  width: 35vw;
  max-width: 350px;
  height: auto;
  top: 15%;
  left: 5%;
  animation: fadeRevealBotanical 1200ms ease-in-out 200ms forwards;
}

.botanical-fig-right {
  width: 35vw;
  max-width: 350px;
  height: auto;
  top: 15%;
  right: 5%;
  animation: fadeRevealBotanical 1200ms ease-in-out 200ms forwards;
}

.botanical-pressed-1,
.botanical-pressed-2 {
  width: 50vw;
  max-width: 300px;
  height: auto;
  bottom: 10%;
  opacity: 0.08;
}

.botanical-pressed-1 {
  left: 10%;
  animation: fadeRevealBotanical 1200ms ease-in-out 400ms forwards;
}

.botanical-pressed-2 {
  right: 10%;
  animation: fadeRevealBotanical 1200ms ease-in-out 400ms forwards;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  animation: fadeRevealContent 800ms ease-in-out 600ms forwards;
  opacity: 0;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6.5rem);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--color-sienna);
  font-style: italic;
}

/* Text primary sections */
.section-text-primary {
  background-color: var(--color-parchment);
}

/* Illustration primary sections */
.section-illustration-primary {
  background-color: var(--color-linen);
  position: relative;
}

/* =====================================================
   BOTANICAL DIVIDERS
   ===================================================== */

.botanical-divider {
  height: 48px;
  display: flex;
  align-items: center;
  background-color: var(--color-parchment);
  padding: 0;
}

.botanical-divider svg {
  width: 100%;
  height: 100%;
}

/* =====================================================
   SEED PACKET FRAME
   ===================================================== */

.seed-packet-frame {
  position: relative;
  border: 1px solid var(--color-sienna);
  padding: 3rem 2rem;
  background-color: var(--color-parchment);
}

.seed-packet-frame h2 {
  margin-top: 0;
  margin-bottom: 2rem;
}

.corner-ornament {
  position: absolute;
  width: 24px;
  height: 24px;
}

.corner-tl {
  top: 0.5rem;
  left: 0.5rem;
}

.corner-tr {
  top: 0.5rem;
  right: 0.5rem;
}

.corner-bl {
  bottom: 0.5rem;
  left: 0.5rem;
}

.corner-br {
  bottom: 0.5rem;
  right: 0.5rem;
}

/* =====================================================
   SPECIMEN GALLERY
   ===================================================== */

.section-heading-light {
  color: var(--color-cocoa);
}

.gallery-intro {
  text-align: center;
  margin-bottom: 3rem;
}

.specimens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.specimen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.specimen-illustration {
  width: 100%;
  max-width: 200px;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.specimen-illustration svg {
  width: 100%;
  height: auto;
}

.specimen-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.specimen-latin {
  font-style: italic;
  color: var(--color-sienna);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.specimen-common {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-cocoa);
}

/* =====================================================
   FIELD NOTES SECTION
   ===================================================== */

.field-entry {
  margin-bottom: 2rem;
  position: relative;
}

.field-entry .body-text {
  margin-bottom: 0;
}

.margin-note-container {
  position: relative;
}

.margin-note {
  display: block;
  float: right;
  width: 40%;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: rgba(212, 165, 116, 0.08);
  border-left: 2px solid var(--color-wheat);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--color-sienna);
  line-height: 1.6;
}

.pull-quote {
  margin: 3rem 0;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--color-wheat);
  border-bottom: 1px solid var(--color-wheat);
  font-family: var(--font-script);
  font-size: 2rem;
  line-height: 1.6;
  color: var(--color-sienna);
}

.pull-quote p {
  margin: 0;
}

/* =====================================================
   MARGIN BOTANICALS
   ===================================================== */

.margin-botanical {
  position: absolute;
  opacity: 0;
}

.margin-right {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 120px;
  height: auto;
  animation: fadeRevealBotanical var(--transition-fade) 600ms forwards;
}

.margin-left {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 120px;
  height: auto;
  animation: fadeRevealBotanical var(--transition-fade) 600ms forwards;
}

/* =====================================================
   PRESSED COLLECTION
   ===================================================== */

.section-closing {
  background-color: var(--color-linen);
}

.pressed-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 3rem auto 0;
  width: 100%;
}

.pressed-item {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
}

.pressed-item svg {
  width: 100%;
  max-width: 160px;
  height: auto;
}

.pressed-item-1 {
  animation: fadeRevealBotanical 800ms ease-in-out 200ms forwards;
}

.pressed-item-2 {
  animation: fadeRevealBotanical 800ms ease-in-out 300ms forwards;
}

.pressed-item-3 {
  animation: fadeRevealBotanical 800ms ease-in-out 400ms forwards;
}

.pressed-item-4 {
  animation: fadeRevealBotanical 800ms ease-in-out 500ms forwards;
}

.pressed-item-5 {
  animation: fadeRevealBotanical 800ms ease-in-out 600ms forwards;
}

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
  position: relative;
  padding: 4rem 2rem 2rem;
  text-align: center;
  margin-top: 3rem;
}

.footer-wheat {
  max-width: 800px;
  margin: 0 auto 2rem;
  height: 200px;
}

.footer-botanical {
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: fadeRevealBotanical 1200ms ease-in-out forwards;
}

.footer-text {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  animation: fadeRevealContent 800ms ease-in-out 600ms forwards;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-sienna);
  letter-spacing: 0.05em;
}

.footer-year {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-wheat);
  letter-spacing: 0.1em;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

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

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

/* Fade reveal on intersection */
.fade-reveal {
  opacity: 0;
  animation: fadeRevealContent var(--transition-fade) ease-in-out forwards;
}

.fade-reveal.in-view {
  animation-play-state: running;
}

/* =====================================================
   BODY TEXT VARIANTS
   ===================================================== */

.body-text {
  font-family: var(--font-body);
  color: var(--color-cocoa);
}

.body-text-light {
  color: var(--color-cocoa);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
  :root {
    --margin-wide: 1.5rem;
    --margin-narrow: 1rem;
  }

  #site-nav {
    padding: 1rem 1.5rem;
  }

  .nav-wordmark {
    font-size: 1rem;
  }

  .nav-chapters-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .section {
    padding: 2rem 1.5rem;
  }

  .seed-packet-frame {
    padding: 2rem 1.5rem;
    border-width: 1px;
  }

  .margin-note {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 1.5rem;
  }

  .specimens-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
  }

  .margin-right,
  .margin-left {
    display: none;
  }

  .pull-quote {
    font-size: 1.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
  }
}

@media (max-width: 640px) {
  .botanical-fig-left,
  .botanical-fig-right {
    display: none;
  }

  .botanical-lavender-bg {
    width: 60vw;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section {
    min-height: auto;
    padding: 3rem 1.5rem;
  }

  .chapters-list {
    gap: 1rem;
  }

  .chapters-list li {
    font-size: 1rem;
  }

  .specimens-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .specimen-illustration {
    max-width: 140px;
  }

  .pressed-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-wheat {
    height: 120px;
    margin-bottom: 1.5rem;
  }

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

/* =====================================================
   ACCESSIBILITY
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--color-linen);
    color: var(--color-cocoa);
  }

  .section-text-primary {
    background-color: var(--color-linen);
  }

  .section-illustration-primary {
    background-color: var(--color-parchment);
  }
}
