/* ==========================================================================
   Last Page Candles: theme
   Change the colour tokens below to re-skin the whole site.
   ========================================================================== */

:root {
  --parchment: #F5EBDC;
  --parchment-deep: #EADBC4;
  --espresso: #3B2418;
  --espresso-soft: #5A3A28;
  --pumpkin: #C8642A;
  --pumpkin-dark: #B4531C; /* button background: passes AA with light text */
  --sienna: #8B3A1A;
  --mustard: #D9A42B;
  --moss: #5B6B2F;
  --sage: #A3A86B;

  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;

  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(59, 36, 24, 0.35);
  --header-h: 72px;
  --container: 1160px;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--sienna);
  margin: 0 0 0.5em;
}

a { color: var(--sienna); }
a:hover { color: var(--pumpkin-dark); }

:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container { padding: 0 32px; }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--espresso);
  color: var(--parchment);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; color: var(--parchment); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.6em 1.3em;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--pumpkin-dark);
  color: #FFF8EE;
}
.btn-primary:hover { background: var(--sienna); color: #FFF8EE; }

.btn-ghost {
  border-color: var(--mustard);
  color: var(--parchment);
}
.btn-ghost:hover { background: var(--mustard); color: var(--espresso); }

.btn-lg { padding: 0.8em 1.7em; font-size: 1.05rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 235, 220, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(163, 168, 107, 0.45);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--espresso);
}
.logo-mark { width: 32px; height: 32px; }

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--espresso);
  margin: 0;
  letter-spacing: 0.01em;
}
.logo-text em { color: var(--pumpkin-dark); font-style: italic; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav ul a {
  position: relative;
  color: var(--espresso);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
}
.site-nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--pumpkin);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.site-nav ul a:hover::after,
.site-nav ul a.active::after { transform: scaleX(1); }
.site-nav ul a.active { color: var(--sienna); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: var(--espresso);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 16px 28px;
    background: var(--parchment);
    border-bottom: 1px solid rgba(163, 168, 107, 0.45);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .site-nav ul a { display: block; padding: 10px 0; font-size: 1.1rem; }
  .site-nav ul a::after { bottom: 6px; right: auto; width: 40px; }
  .site-nav .btn { align-self: flex-start; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--parchment);
  background:
    radial-gradient(ellipse at 75% 45%, rgba(217, 164, 43, 0.28), transparent 55%),
    linear-gradient(135deg, var(--espresso) 0%, #4E2A1A 45%, var(--sienna) 100%);
}

/* falling-leaf texture */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(200, 100, 42, 0.18) 0 6px, transparent 7px),
    radial-gradient(circle at 85% 80%, rgba(91, 107, 47, 0.25) 0 5px, transparent 6px),
    radial-gradient(circle at 40% 90%, rgba(217, 164, 43, 0.18) 0 4px, transparent 5px);
  background-size: 220px 220px, 260px 260px, 180px 180px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: min(680px, calc(100vh - var(--header-h)));
  padding-top: 64px;
  padding-bottom: 64px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mustard);
  margin: 0 0 1rem;
}

.hero h1 {
  color: var(--parchment);
  font-size: clamp(2.3rem, 5.5vw, 4rem);
}
.hero h1 em { color: var(--mustard); }

.hero-lede {
  font-size: 1.15rem;
  max-width: 34em;
  color: #EBDCC6;
  margin: 0 0 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* CSS candle illustration */
.hero-candle {
  position: relative;
  height: 380px;
  display: flex;
  justify-content: center;
}
.candle-jar {
  position: absolute;
  bottom: 40px;
  width: 170px;
  height: 200px;
  border-radius: 18px 18px 26px 26px;
  background: linear-gradient(90deg, #E9C79A 0%, #F6E3C4 35%, #E2B983 100%);
  box-shadow: inset 0 -30px 0 rgba(139, 58, 26, 0.18), 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.candle-label {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parchment);
  background: var(--moss);
  padding: 14px 18px;
  border-radius: 6px;
  border: 2px solid var(--mustard);
}
.wick {
  position: absolute;
  bottom: 240px;
  width: 4px;
  height: 22px;
  background: #2A1810;
  border-radius: 2px;
}
.flame {
  position: absolute;
  bottom: 256px;
  width: 30px;
  height: 64px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 80%, #FFF6D6 0%, #FFD36B 35%, #F08A2C 70%, rgba(200, 100, 42, 0) 100%);
  transform-origin: 50% 100%;
  animation: flicker 2.6s ease-in-out infinite;
  filter: blur(0.4px);
}
.glow {
  position: absolute;
  bottom: 200px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 92, 0.45) 0%, rgba(255, 196, 92, 0) 65%);
  animation: glow 2.6s ease-in-out infinite;
}
.book {
  position: absolute;
  bottom: 18px;
  height: 26px;
  border-radius: 3px;
  box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.5);
}
.book-1 { width: 300px; background: var(--moss); }
.book-2 { width: 260px; bottom: 0; background: var(--pumpkin-dark); }

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  25%      { transform: scale(0.94, 1.06) rotate(1.5deg); }
  50%      { transform: scale(1.04, 0.95) rotate(-2deg); }
  75%      { transform: scale(0.97, 1.03) rotate(1deg); }
}
@keyframes glow {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

@media (max-width: 820px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 48px;
  }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-candle { height: 320px; transform: scale(0.85); transform-origin: top center; margin-bottom: -40px; }
}

/* ---------- Sections ---------- */

.section { padding: 96px 0; }
.section-alt {
  background:
    linear-gradient(180deg, rgba(163, 168, 107, 0.16), rgba(163, 168, 107, 0.08)),
    var(--parchment-deep);
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}
.chapter {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  color: var(--moss);
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
  letter-spacing: 0.04em;
}
.section-heading h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 0.1em; }
.ornament {
  color: var(--pumpkin);
  font-size: 1.6rem;
  margin: 0 0 0.6rem;
  line-height: 1;
}
.section-intro { margin: 0; color: var(--espresso-soft); font-size: 1.1rem; }

.section-cta { text-align: center; margin: 56px 0 0; }

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .section-heading { margin-bottom: 40px; }
}

/* ---------- Product cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  background: #FFFAF2;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(139, 58, 26, 0.12);
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -14px rgba(59, 36, 24, 0.45);
}

.card-media { position: relative; aspect-ratio: 1 / 1; background: var(--parchment-deep); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--mustard);
  color: var(--espresso);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 24px;
  flex: 1;
}
.card-title { font-size: 1.4rem; margin: 0; }
.card-blurb { margin: 0; color: var(--espresso-soft); font-style: italic; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tags li {
  background: var(--moss);
  color: var(--parchment);
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.card-meta {
  margin: auto 0 0;
  padding-top: 8px;
  font-weight: 600;
  color: var(--sienna);
  border-top: 1px dashed rgba(139, 58, 26, 0.3);
}

.card-link {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 600;
  text-decoration: none;
  color: var(--pumpkin-dark);
}
.card-link:hover { color: var(--sienna); text-decoration: underline; }

/* ---------- Our Story ---------- */

.story {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.story-image { margin: 0; }
.story-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  border: 10px solid #FFFAF2;
}

.dropcap::first-letter {
  float: left;
  font-family: var(--font-heading);
  font-size: 3.8rem;
  line-height: 0.85;
  padding: 6px 10px 0 0;
  color: var(--pumpkin-dark);
}

.pull-quote {
  margin: 2rem 0 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--mustard);
  background: rgba(217, 164, 43, 0.12);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.pull-quote p {
  margin: 0;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--sienna);
}

@media (max-width: 820px) {
  .story { grid-template-columns: 1fr; gap: 40px; }
  .story-image { max-width: 420px; margin: 0 auto; }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--espresso);
  color: #E6D6BF;
  padding: 56px 0 40px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 40px;
  align-items: center;
}
.site-footer .logo-text { color: var(--parchment); }
.site-footer .logo-text em { color: var(--mustard); }
.footer-tagline { margin: 0.25rem 0 0; font-style: italic; }

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--parchment);
  text-decoration: none;
  font-weight: 600;
}
.footer-links a:hover { color: var(--mustard); }

.footer-copy {
  grid-column: 1 / -1;
  margin: 16px 0 0;
  padding-top: 24px;
  border-top: 1px solid rgba(163, 168, 107, 0.3);
  font-size: 0.9rem;
  color: #CDB89C;
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }
}

/* ---------- Reduced motion ---------- */

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