/* ─────────────────────────────────────────────────────────────
   Hollow Fern Studio — Design System
   Old bookshop / candlelit library aesthetic
   ───────────────────────────────────────────────────────────── */

/* ══════════════════════════════════
   COLOR PALETTE
   ══════════════════════════════════ */
:root {
  /* Core palette */
  --forest-deep:    #1a3028;
  --forest-dark:    #233d2f;
  --forest:         #2c5241;
  --moss:           #4a7c59;
  --moss-light:     #6b9e7a;
  --parchment:      #f5ede0;
  --parchment-warm: #ede4d4;
  --parchment-dark: #d9cdb8;
  --gold:           #c9a84c;
  --gold-light:     #e2c988;
  --gold-dim:       rgba(201,168,76,0.3);
  --charcoal:       #1e1e1e;
  --charcoal-soft:  #3a3a3a;
  --plum:           #6b3a6b;
  --plum-light:     #8a5a8a;
  --plum-dim:       rgba(107,58,107,0.25);
  --sepia:          #8b6914;
  --moon-silver:    #a8b4b0;
  --mushroom:       #6b5b4f;
  --mushroom-light: #8a7a6d;

  /* Semantic */
  --text:           var(--charcoal);
  --text-soft:      var(--charcoal-soft);
  --text-muted:     var(--mushroom);
  --bg:             var(--parchment);
  --bg-alt:         var(--parchment-warm);
  --bg-card:        #faf7f1;
  --border:         var(--parchment-dark);
  --border-dark:    rgba(30,30,30,0.12);

  /* Typography */
  --font-display:   'Cormorant Garamond', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-heading:   'Cormorant Garamond', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-body:      'EB Garamond', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-accent:    'Caveat', 'Segoe Script', 'Comic Sans MS', cursive;
}

/* ══════════════════════════════════
   RESET & BASE
   ══════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ══════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { font-size: 1rem; line-height: 1.75; color: var(--text-soft); }

a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--gold); }

::selection { background: var(--gold-dim); color: var(--charcoal); }

/* ══════════════════════════════════
   PARCHMENT TEXTURE
   ══════════════════════════════════ */
.parchment-bg {
  background: var(--parchment);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

.parchment-dark {
  background: var(--parchment-warm);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ══════════════════════════════════
   NAVIGATION
   ══════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--parchment);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--forest);
  text-decoration: none;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-brand:hover { color: var(--gold); }
.nav-brand .brand-icon { font-size: 1.2rem; line-height: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--forest); background: rgba(44,82,65,0.06); }
.nav-links a.active { color: var(--forest); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--forest);
}

.nav-mobile {
  display: none;
  background: var(--parchment);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem 1.5rem;
}

.nav-mobile.open { display: block; }

.nav-mobile a {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--forest); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-toggle svg { width: 24px; height: 24px; stroke: var(--forest); }
}

/* ══════════════════════════════════
   BUTTONS
   ══════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--forest);
  color: var(--parchment);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2.2rem;
  border-radius: 3px;
  border: 1px solid var(--forest);
  transition: background 0.2s, color 0.2s, transform 0.1s;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--forest-deep);
  color: var(--parchment);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  color: var(--forest);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 3px;
  border: 1px solid var(--forest);
  transition: background 0.2s, color 0.2s, transform 0.1s;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--forest);
  color: var(--parchment);
  transform: translateY(-1px);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--gold);
  color: var(--charcoal);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2.2rem;
  border-radius: 3px;
  border: 1px solid var(--gold);
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}
.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

/* ══════════════════════════════════
   CARDS — Vintage paper / bookplate
   ══════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  box-shadow:
    0 1px 3px rgba(30,30,30,0.06),
    0 4px 12px rgba(30,30,30,0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  box-shadow:
    0 2px 6px rgba(30,30,30,0.1),
    0 8px 24px rgba(30,30,30,0.07);
  border-color: var(--parchment-dark);
}

.card-plum {
  border-color: var(--plum-dim);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(107,58,107,0.03) 100%);
}
.card-plum:hover { border-color: var(--plum-light); }

.card-forest {
  border-color: rgba(44,82,65,0.2);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(44,82,65,0.04) 100%);
}
.card-forest:hover { border-color: var(--forest); }

/* ══════════════════════════════════
   BOTANICAL DIVIDER
   ══════════════════════════════════ */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 3rem auto;
  width: 200px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}
.divider-symbol {
  color: var(--moss-light);
  font-size: 1rem;
  opacity: 0.7;
}

.divider-ornate {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3.5rem auto;
  width: 280px;
}
.divider-ornate::before,
.divider-ornate::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dim), transparent);
}
.divider-ornate .ornament {
  padding: 0 1rem;
  color: var(--gold);
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Fern SVG divider */
.fern-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem 0;
  gap: 1rem;
}
.fern-divider::before,
.fern-divider::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--moss-light), transparent);
  opacity: 0.5;
}
.fern-divider svg {
  width: 32px;
  height: 32px;
  fill: var(--moss-light);
  opacity: 0.6;
}

/* ══════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════ */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 0.6rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: var(--text);
  line-height: 1.15;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.section-header-ornate {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header-ornate .ornament-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-header-ornate .ornament-line::before,
.section-header-ornate .ornament-line::after {
  content: '';
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dim));
}
.section-header-ornate .ornament-line::after {
  background: linear-gradient(to left, transparent, var(--gold-dim));
}
.section-header-ornate .ornament-glyph {
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.8;
}

/* ══════════════════════════════════
   PAGE CONTAINERS
   ══════════════════════════════════ */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-section {
  padding: 4rem 2rem;
}

.page-section--dark {
  background: var(--forest-deep);
  color: var(--parchment);
}
.page-section--dark h1,
.page-section--dark h2,
.page-section--dark h3 {
  color: var(--parchment);
}
.page-section--dark p {
  color: var(--parchment-dark);
}

.page-section--warm {
  background: var(--parchment-warm);
}

/* ══════════════════════════════════
   GRID LAYOUTS
   ══════════════════════════════════ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-container { padding: 2rem 1.25rem; }
  .page-section { padding: 3rem 1.25rem; }
}

/* ══════════════════════════════════
   FOOTER
   ══════════════════════════════════ */
.site-footer {
  background: var(--forest-deep);
  color: var(--parchment-dark);
  padding: 3rem 2rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(245,237,224,0.1);
}
.footer-brand .footer-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--parchment);
  margin-bottom: 0.4rem;
}
.footer-brand .footer-tagline {
  font-size: 0.85rem;
  color: var(--moon-silver);
  font-style: italic;
  line-height: 1.5;
}
.footer-nav-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}
.footer-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-nav-links a {
  font-size: 0.85rem;
  color: var(--moon-silver);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-nav-links a:hover { color: var(--parchment); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy {
  font-size: 0.78rem;
  color: var(--mushroom);
}
.footer-social {
  display: flex;
  gap: 1rem;
}
.footer-social a {
  color: var(--moon-silver);
  font-size: 1.2rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-social a:hover { color: var(--gold); }

@media (max-width: 768px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════ */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-forest { color: var(--forest); }
.text-muted { color: var(--text-muted); }
.font-display { font-family: var(--font-display); }
.font-accent { font-family: var(--font-accent); }
.uppercase {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ══════════════════════════════════
   MOBILE POLISH & TOUCH TARGETS
   ══════════════════════════════════ */

/* Touch targets min 44px */
button, a, [role="button"] { min-height: 44px; min-width: 44px; }

/* Fine-tune interactive elements that need smaller inline sizing */
.nav-toggle { min-width: 44px; min-height: 44px; }
.filter-btn { min-height: 44px; padding: 0.6rem 1.25rem; }

/* Mobile refinements */
@media (max-width: 480px) {
  .btn-primary, .btn-secondary, .btn-gold {
    padding: 0.85rem 1.5rem;
    font-size: 0.78rem;
    width: 100%;
    justify-content: center;
  }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions a { text-align: center; }
  .hero-moth { display: none; }
  .hero-title { font-size: clamp(1.8rem, 6vw, 3rem); }
  .product-card .btn-primary { width: 100%; justify-content: center; }
}

/* Section dividers with botanical flavor */
.divider-moon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem auto;
  gap: 0.5rem;
  color: var(--moss-light);
  font-size: 0.85rem;
  opacity: 0.6;
  letter-spacing: 0.4rem;
}

/* Gold-plum hover for buttons */
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }
.btn-secondary:hover { background: var(--plum); border-color: var(--plum); color: var(--parchment); }

/* Botanical corner accents on cards */
.card-botanical {
  position: relative;
  overflow: hidden;
}
.card-botanical::after {
  content: '🌿';
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  font-size: 0.85rem;
  opacity: 0.25;
  pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--parchment-dark); }
::-webkit-scrollbar-thumb { background: var(--moss-light); border-radius: 4px; }

/* Focus states */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Footer shop link buttons ── */
.footer-shop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.footer-shop-btn {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  border: 1px solid;
  transition: background 0.2s, color 0.2s;
  min-width: unset;
  min-height: unset;
}
.footer-shop-btn--etsy {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--charcoal);
}
.footer-shop-btn--etsy:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}
.footer-shop-btn {
  background: transparent;
  border-color: var(--moon-silver);
  color: var(--moon-silver);
}
.footer-shop-btn:hover {
  background: var(--moon-silver);
  color: var(--charcoal);
}