/* ─── Design Tokens ───────────────────────────────────────────────── */
:root {
  /* Named colours */
  --ink:        #0d1117;
  --parchment:  #f5f0e8;
  --gold:       #c9933a;
  --gold-light: #e8b96a;
  --gold-pale:  #f7e8c8;
  --rust:       #8b3a2a;
  --sage:       #4a5e4a;
  --mid:        #6b5c3e;
  --text:       #2a1f0f;
  --muted:      #6b5840;

  /* Section backgrounds */
  --surface:    #f0e9d8;
  --card:       #ffffff;

  /* Interactive state colours */
  --on-accent:   var(--ink);
  --nav-active:  var(--gold);
  --stat-label:  rgba(var(--ink-rgb), 0.7);

  /* RGB channel triples — allow rgba(var(--X-rgb), alpha) in rules */
  --gold-rgb:      201, 147, 58;
  --ink-rgb:       13, 17, 23;
  --parchment-rgb: 245, 240, 232;
  --rust-rgb:      139, 58, 42;
  --sage-rgb:      74, 94, 74;

  /* Derived tokens */
  --border:     rgba(var(--gold-rgb), 0.25);
  --shadow:     0 4px 32px rgba(var(--ink-rgb), 0.18);
  --focus-ring: 0 0 0 3px rgba(var(--gold-rgb), 0.6);

  --radius:     4px;
  --transition: 0.28s ease;
  --serif:      'Cinzel', Georgia, serif;
  --display:    'Cinzel Decorative', 'Cinzel', serif;
  --body:       'EB Garamond', Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: clamp(16px, 1.2vw + 14px, 19px);
}

body {
  font-family: var(--body);
  background: var(--parchment);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -9999px; left: 0;
  padding: 0.6rem 1.2rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Focus styles */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius); }

/* ─── Typography helpers ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--mid); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p  { font-size: 1rem; }

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

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

/* ─── Layout helpers ─────────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.2rem;
}
.section-pad { padding: 4rem 0; }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ─── Decorative rule ────────────────────────────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.25rem 0;
  color: var(--gold);
  font-size: 1.2rem;
  user-select: none;
  aria-hidden: true;
}
.ornament::before, .ornament::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

/* ─── Header ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--ink);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--gold);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  max-width: 1080px;
  margin: 0 auto;
}
.logo {
  font-family: var(--display);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.logo span { color: var(--parchment); }

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] {
  background: var(--gold);
  color: var(--on-accent);
}

nav ul {
  list-style: none;
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.8rem);
}
nav a {
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--parchment);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
nav a:hover, nav a[aria-current="page"] {
  color: var(--nav-active);
  border-bottom-color: var(--nav-active);
}

/* Mobile nav */
@media (max-width: 680px) {
  .nav-toggle { display: block; min-height: 44px; padding: 0.5rem 0.9rem; }
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink);
    border-top: 1px solid var(--border);
    padding: 1rem 1.4rem 1.4rem;
    gap: 0;
  }
  nav ul.open { display: flex; }
  nav a { padding: 0.75rem 0; min-height: 44px; display: flex; align-items: center; }
  .site-header { position: relative; }
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6rem) 1.2rem clamp(3rem, 7vw, 5.5rem);
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(var(--gold-rgb),0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 20%, rgba(var(--rust-rgb),0.08) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 80% 10%, rgba(var(--sage-rgb),0.07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 780px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--rust), var(--gold));
  color: #fff;
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 2px;
  margin-bottom: 1.4rem;
}

.hero h1 {
  font-family: var(--display);
  color: var(--gold);
  text-shadow: 0 2px 24px rgba(var(--gold-rgb),0.3);
  margin-bottom: 0.4rem;
}
.hero-sub {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--gold-pale);
  letter-spacing: 0.08em;
  margin-bottom: 1.6rem;
}
.hero p {
  color: rgba(var(--parchment-rgb), 0.8);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  max-width: 580px;
  margin: 0 auto 2.2rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.8rem;
  font-family: var(--serif);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--on-accent);
  box-shadow: 0 4px 20px rgba(var(--gold-rgb), 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(var(--gold-rgb), 0.5); color: var(--on-accent); }

.btn-outline {
  background: transparent;
  color: var(--parchment);
  border: 2px solid rgba(var(--gold-rgb), 0.5);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ─── Stats bar ──────────────────────────────────────────────────── */
.stats-bar {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
  padding: 0.9rem 1.2rem;
}
.stats-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}
.stat {
  text-align: center;
}
.stat-num {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--on-accent);
  display: block;
  line-height: 1;
}
.stat-label {
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stat-label);
}

/* ─── About section ──────────────────────────────────────────────── */
.about { background: var(--parchment); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

.about-text h1, .about-text h2 { margin-bottom: 0.5rem; }
.about-text p { color: var(--muted); margin-bottom: 1rem; }
.about-text p:last-child { margin-bottom: 0; }

.about-visual {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.feature-icon {
  width: 2.2rem;
  height: 2.2rem;
  min-width: 2.2rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--on-accent);
  font-weight: bold;
}
.feature-text h4 {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.1rem;
}
.feature-text p {
  font-size: 0.85rem;
  color: rgba(var(--parchment-rgb), 0.65);
  margin: 0;
}

/* ─── Products section ───────────────────────────────────────────── */
.products { background: var(--surface); }

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header h1 { color: var(--mid); margin-bottom: 0.4rem; }
.section-header h2 { margin-bottom: 0.4rem; }
.section-header p { color: var(--muted); max-width: 520px; margin: 0 auto; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-thumb {
  background: var(--ink);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-thumb svg {
  width: 70px;
  height: 70px;
  opacity: 0.9;
}
.product-badge {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  background: var(--gold);
  color: var(--on-accent);
  font-family: var(--serif);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
}

.product-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.product-body h3 { font-size: 1rem; margin-bottom: 0.3rem; color: var(--ink); }
.product-body p { font-size: 0.88rem; color: var(--muted); flex: 1; margin-bottom: 1rem; }
.product-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.size-chip {
  background: var(--gold-pale);
  border: 1px solid var(--border);
  color: var(--mid);
  font-family: var(--serif);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
}
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.product-link:hover { border-bottom-color: var(--gold); color: var(--gold); }
.product-link::after { content: '→'; }

/* ─── Reviews section ────────────────────────────────────────────── */
.reviews { background: var(--ink); }
.reviews .section-header h1, .reviews .section-header h2 { color: var(--gold); }
.reviews .section-header p { color: rgba(var(--parchment-rgb), 0.6); }

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.4rem;
}

.review-card {
  background: rgba(var(--parchment-rgb), 0.05);
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  transition: border-color var(--transition), background var(--transition);
}
.review-card:hover {
  border-color: rgba(var(--gold-rgb), 0.5);
  background: rgba(var(--parchment-rgb), 0.08);
}
.review-card::before {
  content: '"';
  position: absolute;
  top: -0.5rem; left: 1rem;
  font-family: var(--display);
  font-size: 3.5rem;
  color: var(--gold);
  opacity: 0.25;
  line-height: 1;
}

.stars {
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  display: flex;
  gap: 2px;
}
.review-text {
  font-size: 0.95rem;
  color: rgba(var(--parchment-rgb), 0.82);
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.65;
}
.reviewer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.reviewer-avatar {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--rust));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-accent);
  flex-shrink: 0;
}
.reviewer-name {
  font-family: var(--serif);
  font-size: 0.8rem;
  color: var(--gold-light);
  display: block;
}
.reviewer-meta {
  font-size: 0.75rem;
  color: rgba(var(--parchment-rgb), 0.4);
}

.fb-notice {
  text-align: center;
  margin-top: 2.5rem;
  padding: 1rem 1.5rem;
  border: 1px dashed rgba(var(--gold-rgb), 0.3);
  border-radius: var(--radius);
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.fb-notice p {
  color: rgba(var(--parchment-rgb), 0.5);
  font-size: 0.85rem;
}
.fb-notice a {
  color: var(--gold-light);
}

/* ─── Why section ────────────────────────────────────────────────── */
.why { background: var(--parchment); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 1.4rem;
  margin-top: 2.5rem;
}

.why-card {
  text-align: center;
  padding: 1.8rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.why-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(var(--gold-rgb), 0.12);
}
.why-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  display: block;
}
.why-card h3 {
  font-size: 0.95rem;
  color: var(--mid);
  margin-bottom: 0.4rem;
  font-family: var(--serif);
}
.why-card p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── CTA Banner ─────────────────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, var(--rust) 0%, var(--mid) 50%, var(--ink) 100%);
  padding: clamp(2.5rem, 5vw, 4rem) 1.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(var(--gold-rgb), 0.18), transparent 70%);
}
.cta-banner-inner { position: relative; max-width: 600px; margin: 0 auto; }
.cta-banner h2 {
  color: var(--gold);
  font-family: var(--display);
  margin-bottom: 0.8rem;
}
.cta-banner p {
  color: rgba(var(--parchment-rgb), 0.78);
  margin-bottom: 1.8rem;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
  background: var(--ink);
  border-top: 2px solid var(--gold);
  padding: 2.5rem 1.2rem 1.5rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

.footer-brand .logo { display: block; margin-bottom: 0.7rem; }
.footer-brand p { font-size: 0.85rem; color: rgba(var(--parchment-rgb), 0.5); line-height: 1.6; }

.footer-col h4 {
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a {
  font-size: 0.85rem;
  color: rgba(var(--parchment-rgb), 0.55);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--gold-light); }

.footer-bottom {
  max-width: 1080px;
  margin: 1.8rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--gold-rgb), 0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(var(--parchment-rgb), 0.3);
}
.footer-bottom a { color: rgba(var(--parchment-rgb), 0.45); }

/* ─── Animations ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-inner > * {
  animation: fadeUp 0.7s ease both;
}
.hero-badge    { animation-delay: 0.05s; }
.hero h1       { animation-delay: 0.15s; }
.hero-sub      { animation-delay: 0.25s; }
.hero p        { animation-delay: 0.35s; }
.btn-group     { animation-delay: 0.45s; }

/* Reveal-on-scroll via Intersection Observer */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════════════
   THEMES
   The default theme is the :root above (dark gothic/ink).
   Additional themes are applied via html[data-theme="X"] set by JS.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Theme: Heritage Cream ──────────────────────────────────────── */
/* Warm dark-brown ink, antique cream body — a heritage bookshop feel */
html[data-theme="heritage"] {
  --ink:        #2a1808;
  --parchment:  #faf5ed;
  --gold:       #9a6b20;
  --gold-light: #c9933a;
  --gold-pale:  #f0e0c0;
  --rust:       #7a2e1e;
  --sage:       #3d5438;
  --mid:        #5a4028;
  --text:       #1e1206;
  --muted:      #6b4a2c;
  --surface:    #f2e8d6;
  --card:       #fffdf8;

  --gold-rgb:      154, 107, 32;
  --ink-rgb:       42, 24, 8;
  --parchment-rgb: 250, 245, 237;
  --rust-rgb:      122, 46, 30;
  --sage-rgb:      61, 84, 56;

  --border:     rgba(154, 107, 32, 0.25);
  --shadow:     0 4px 32px rgba(42, 24, 8, 0.14);
  --focus-ring: 0 0 0 3px rgba(154, 107, 32, 0.55);
}

/* ─── Theme: Military Olive ──────────────────────────────────────── */
/* Dark olive ink, khaki parchment, bronze-green accents */
html[data-theme="military"] {
  --ink:        #141b12;
  --parchment:  #d4cdb8;
  --gold:       #8b9e5a;
  --gold-light: #a8ba74;
  --gold-pale:  #c8d4a0;
  --rust:       #8b6a3a;
  --sage:       #4a6a3a;
  --mid:        #4a6030;
  --text:       #1e2418;
  --muted:      #4a5c34;
  --surface:    #c4bda6;
  --card:       #ddd8c8;

  --gold-rgb:      139, 158, 90;
  --ink-rgb:       20, 27, 18;
  --parchment-rgb: 212, 205, 184;
  --rust-rgb:      139, 106, 58;
  --sage-rgb:      74, 106, 58;

  --border:     rgba(139, 158, 90, 0.3);
  --shadow:     0 4px 32px rgba(20, 27, 18, 0.3);
  --focus-ring: 0 0 0 3px rgba(139, 158, 90, 0.5);
}

/* ─── Theme: Bright Jade ─────────────────────────────────────────── */
/* Deep jade ink, crisp white body, vivid teal-green accent — fresh  */
/* and light; white replaces gold as the "on-accent" readable colour */
html[data-theme="bright"] {
  --ink:        #004d38;
  --parchment:  #ffffff;
  --gold:       #007d5e;
  --gold-light: #00a87e;
  --gold-pale:  #c0ece0;
  --rust:       #006650;
  --sage:       #2a8a6a;
  --mid:        #1a5e44;
  --text:       #002a1e;
  --muted:      #3d7a61;
  --surface:    #e8f5ee;
  --card:       #f4fdf8;

  --on-accent:  #ffffff;
  --stat-label: rgba(255, 255, 255, 0.85);

  --gold-rgb:      0, 125, 94;
  --ink-rgb:       0, 77, 56;
  --parchment-rgb: 255, 255, 255;
  --rust-rgb:      0, 102, 80;
  --sage-rgb:      42, 138, 106;

  --border:     rgba(0, 125, 94, 0.25);
  --shadow:     0 4px 32px rgba(0, 77, 56, 0.18);
  --focus-ring: 0 0 0 3px rgba(0, 125, 94, 0.5);
}
