/* Alpenvital - Global Stylesheet
 * Sits on top of the compiled Tailwind utilities (assets/css/tailwind.css). Defines design tokens, font wiring,
 * editorial layout primitives, and motion utilities.
 */

:root {
  /* Brand colors */
  --av-white: #FAFAF7;
  --av-stone: #F0EBE2;
  --av-stone-soft: #E5DFD2;
  --av-cream: #F4F1EC;
  --av-pine: #2E4A3A;
  --av-pine-dark: #1F3328;
  --av-alpenglow: #C9854D;
  --av-alpenglow-dark: #A06A3A;
  /* Text-safe accent: >= 4.5:1 on all light surfaces (WCAG 1.4.3) */
  --av-alpenglow-text: #8A5A2E;
  --av-charcoal: #1F1F1F;
  --av-slate: #5E5E5E;
  --av-slate-soft: #9A9A9A;
  --av-helvetia: #B83A3A;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Container width */
  --container: 1280px;
  --container-narrow: 880px;
}

/* Reset / Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--av-charcoal);
  background: var(--av-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography primitives */
.display-xl { font-family: var(--font-display); font-size: clamp(3rem, 7vw, 6rem); font-weight: 400; line-height: 0.95; letter-spacing: -0.02em; }
.display-lg { font-family: var(--font-display); font-size: clamp(2.5rem, 5.5vw, 4.5rem); font-weight: 400; line-height: 1; letter-spacing: -0.015em; }
.display-md { font-family: var(--font-display); font-size: clamp(1.875rem, 3.5vw, 3rem); font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; }
.display-sm { font-family: var(--font-display); font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 500; line-height: 1.2; }
.eyebrow { font-family: var(--font-body); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--av-slate); }
.lede { font-family: var(--font-body); font-size: 1.25rem; line-height: 1.5; color: var(--av-slate); font-weight: 300; }

/* Editorial layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: var(--space-xl) 0; }
.section-sm { padding: var(--space-lg) 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  text-decoration: none;
}
.btn-primary { background: var(--av-pine); color: var(--av-white); }
.btn-primary:hover { background: var(--av-pine-dark); transform: translateY(-1px); }
.btn-accent { background: var(--av-alpenglow-text); color: var(--av-white); }
.btn-accent:hover { background: #6F4824; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--av-charcoal); border-color: var(--av-charcoal); }
.btn-ghost:hover { background: var(--av-charcoal); color: var(--av-white); }
.btn-link { background: transparent; color: var(--av-charcoal); padding: 0; border-bottom: 1px solid var(--av-charcoal); border-radius: 0; }
.btn-link:hover { color: var(--av-alpenglow-text); border-color: var(--av-alpenglow-text); }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.8rem; }

/* Cards */
.card { background: var(--av-white); border: 1px solid var(--av-stone-soft); border-radius: 6px; overflow: hidden; transition: all 0.3s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -20px rgba(0,0,0,0.1); }
.card-stone { background: var(--av-cream); }

/* Product card */
.product-card {
  position: relative;
  background: var(--av-white);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.product-card:hover { transform: translateY(-4px); }
.product-card-image { aspect-ratio: 4/5; background: var(--av-stone); overflow: hidden; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .product-card-image img { transform: scale(1.04); }
.product-card-body { padding: 1.25rem 0.25rem; }
.product-card-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; line-height: 1.2; margin: 0 0 0.25rem; color: var(--av-charcoal); }
.product-card-meta { font-family: var(--font-body); font-size: 0.85rem; color: var(--av-slate); margin: 0 0 0.75rem; letter-spacing: 0.02em; }
.product-card-price { font-family: var(--font-display); font-size: 1.25rem; color: var(--av-charcoal); }

/* Pill / badge */
.pill {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  background: var(--av-stone);
  color: var(--av-charcoal);
  font-weight: 500;
}
.pill-pine { background: var(--av-pine); color: var(--av-white); }
.pill-red { background: var(--av-helvetia); color: var(--av-white); }
.pill-glow { background: var(--av-alpenglow-text); color: var(--av-white); }

/* Divider */
.divider {
  height: 1px;
  width: 60px;
  background: var(--av-alpenglow);
  margin: 1.5rem 0;
}
.divider-center { margin-left: auto; margin-right: auto; }

/* Nav */
.nav-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.94);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--av-stone-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; }
.nav-logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; letter-spacing: 0.04em; color: var(--av-charcoal); text-decoration: none; }
.nav-logo-sub { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--av-slate); display: block; margin-top: -2px; }
.nav-links { display: flex; gap: 2rem; }
.nav-link { font-size: 0.9rem; color: var(--av-charcoal); text-decoration: none; transition: color 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--av-alpenglow-text); }
.nav-actions { display: flex; gap: 1rem; align-items: center; }

/* Cart indicator */
.cart-badge {
  position: relative;
  background: var(--av-charcoal);
  color: var(--av-white);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  text-decoration: none;
}
.cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--av-alpenglow-text);
  color: var(--av-white);
  font-size: 0.65rem;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Hero */
.hero-editorial {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: 80vh;
  padding: 4rem 0;
}
@media (max-width: 768px) {
  .hero-editorial { grid-template-columns: 1fr; gap: 2rem; min-height: auto; }
}
.hero-text h1 { margin-bottom: 1.5rem; }
.hero-image { aspect-ratio: 4/5; background: var(--av-stone); border-radius: 6px; overflow: hidden; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* Split lines (Pet vs Human) */
.split-lines { display: grid; grid-template-columns: 1fr 1fr; min-height: 70vh; }
.split-line { padding: 4rem 3rem; display: flex; flex-direction: column; justify-content: center; transition: background 0.3s ease; }
.split-line.pet { background: var(--av-cream); }
.split-line.human { background: var(--av-stone); }
.split-line:hover { background: var(--av-white); }
@media (max-width: 768px) { .split-lines { grid-template-columns: 1fr; } }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

/* Image lazy fade-in */
img.lazy { opacity: 0; transition: opacity 0.5s ease; }
img.lazy.loaded { opacity: 1; }

/* Scroll reveal - visible by default for no-JS / screenshot safety.
   JS adds .js-reveal-ready to <html> which then applies the hidden state. */
.reveal { opacity: 1; transform: translateY(0); transition: opacity 0.8s ease, transform 0.8s ease; }
.js-reveal-ready .reveal { opacity: 0; transform: translateY(20px); }
.js-reveal-ready .reveal.in { opacity: 1; transform: translateY(0); }

/* Testimonials */
.testimonial { padding: 2.5rem; border-left: 2px solid var(--av-alpenglow); }
.testimonial-quote { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.4; font-weight: 400; color: var(--av-charcoal); margin: 0 0 1rem; font-style: italic; }
.testimonial-author { font-size: 0.85rem; color: var(--av-slate); letter-spacing: 0.05em; }

/* FAQ */
.faq-item { border-top: 1px solid var(--av-stone-soft); padding: 1.5rem 0; }
.faq-item:last-of-type { border-bottom: 1px solid var(--av-stone-soft); }
.faq-q { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; list-style: none; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q .plus { font-size: 1.5rem; transition: transform 0.3s ease; }
details[open] > .faq-q .plus { transform: rotate(45deg); }
.faq-a { margin-top: 1rem; color: var(--av-slate); }
.faq-a p { margin: 0; }

/* Footer */
.footer { background: var(--av-charcoal); color: var(--av-stone); padding: 5rem 0 2rem; }
.footer h4, .footer .footer-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: var(--av-white); margin: 0 0 1rem; line-height: 1.3; }
.footer a { color: var(--av-stone-soft); text-decoration: none; display: block; padding: 0.25rem 0; font-size: 0.9rem; }
.footer a:hover { color: #E9B98C; }
.footer-bottom { border-top: 1px solid #333; margin-top: 3rem; padding-top: 2rem; font-size: 0.8rem; color: var(--av-slate-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Markdown / Editorial body (for advertorials, blog) */
.prose { max-width: 700px; margin: 0 auto; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.75; color: var(--av-charcoal); }
.prose h2 { font-family: var(--font-display); font-size: 2rem; line-height: 1.2; margin: 3rem 0 1rem; font-weight: 500; }
.prose h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 2rem 0 0.75rem; font-weight: 500; }
.prose p { margin: 0 0 1.5rem; }
.prose .pullquote {
  border-left: 3px solid var(--av-alpenglow);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--av-charcoal);
}
.prose img { width: 100%; border-radius: 4px; margin: 2rem 0; }
.prose figcaption { text-align: center; font-size: 0.85rem; color: var(--av-slate); margin-top: -1rem; }
.prose strong { color: var(--av-charcoal); font-weight: 600; }
.prose em { color: var(--av-pine); font-style: italic; }
.prose ul { margin: 0 0 1.5rem 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a { color: var(--av-pine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--av-alpenglow-text); }

/* Editorial article byline */
.byline { font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--av-slate); margin-bottom: 1rem; }
.byline .dot { margin: 0 0.75rem; opacity: 0.5; }

/* Form */
.input { width: 100%; padding: 0.875rem 1rem; border: 1px solid var(--av-stone-soft); border-radius: 4px; font-family: var(--font-body); font-size: 1rem; background: var(--av-white); transition: border-color 0.2s; }
.input:focus { border-color: var(--av-pine); }
.label { font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--av-slate); display: block; margin-bottom: 0.5rem; font-weight: 500; }

/* Sticky CTA bar on PDP */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--av-white);
  border-top: 1px solid var(--av-stone-soft);
  padding: 1rem 1.5rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 40;
  box-shadow: 0 -8px 24px -12px rgba(0,0,0,0.1);
}
.sticky-cta.show { display: flex; }
@media (min-width: 768px) { .sticky-cta { display: none !important; } }

/* Utility: Helvetia red dot (Swiss accent) */
.swiss-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--av-helvetia);
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Animation utilities */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slowFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.fade-up { animation: fadeUp 0.8s ease both; }
.fade-in { animation: fadeIn 1s ease both; }
.float { animation: slowFloat 6s ease-in-out infinite; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Marquee (ingredient ticker) */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--av-stone-soft);
  border-bottom: 1px solid var(--av-stone-soft);
  background: var(--av-cream);
  padding: 1rem 0;
}
.marquee-track { display: inline-block; animation: marquee 40s linear infinite; }
.marquee-item { display: inline-block; margin: 0 2rem; font-family: var(--font-display); font-size: 1.25rem; color: var(--av-charcoal); }
.marquee-item::after { content: "·"; margin-left: 4rem; color: var(--av-alpenglow); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Hero image overlay text */
.image-with-caption { position: relative; }
.image-with-caption .caption-overlay {
  position: absolute;
  bottom: 1.5rem; left: 1.5rem;
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--av-white);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  z-index: 1;
}
/* Scrim: guarantees contrast for the caption in the brightest image area (WCAG 1.4.3) */
.image-with-caption::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(20,20,20,0.78), rgba(20,20,20,0));
  pointer-events: none;
}

/* Trust strip */
.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; padding: 2.5rem 0; border-top: 1px solid var(--av-stone-soft); border-bottom: 1px solid var(--av-stone-soft); background: var(--av-cream); }
.trust-item { text-align: center; }
.trust-item .label { margin-bottom: 0.5rem; }
.trust-item .value { font-family: var(--font-display); font-size: 1.5rem; }
@media (max-width: 768px) { .trust-strip { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }

/* ---------- Compliance additions (2026-09-11) ---------- */

/* Visible keyboard focus on every surface: dark ring + light halo (>= 3:1 on light and dark backgrounds) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--av-pine);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--av-white);
  border-radius: 2px;
}
.footer a:focus-visible, .on-dark a:focus-visible, .on-dark button:focus-visible {
  outline-color: var(--av-white);
  box-shadow: 0 0 0 5px var(--av-charcoal);
}

/* Skip link */
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--av-charcoal); color: var(--av-white); padding: 0.75rem 1rem; border-radius: 4px; text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* Pre-launch notice bar (site-wide) */
.prelaunch-bar { background: var(--av-pine); color: var(--av-white); font-size: 0.85rem; line-height: 1.4; text-align: center; padding: 0.6rem 1.5rem; }
.prelaunch-bar a { color: var(--av-white); text-decoration: underline; text-underline-offset: 2px; }

/* Inline notice box (buy boxes, cart, checkout) */
.notice-box { background: var(--av-stone); border-left: 3px solid var(--av-pine); border-radius: 4px; padding: 1rem 1.25rem; font-size: 0.95rem; line-height: 1.5; color: var(--av-charcoal); }
.notice-box strong { font-weight: 600; }

/* Accent text that must pass contrast */
.accent-text { color: var(--av-alpenglow-text); }

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; font-size: 1.0625rem; line-height: 1.75; color: var(--av-charcoal); }
.legal h2 { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.2; font-weight: 500; margin: 2.75rem 0 0.75rem; }
.legal h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; margin: 1.75rem 0 0.5rem; }
.legal p { margin: 0 0 1.1rem; }
.legal ul { margin: 0 0 1.25rem 1.25rem; list-style: disc; }
.legal li { margin-bottom: 0.4rem; }
.legal a { color: var(--av-pine); text-decoration: underline; text-underline-offset: 3px; }
.legal address { font-style: normal; background: var(--av-cream); border-radius: 6px; padding: 1.25rem 1.5rem; margin: 0 0 1.5rem; line-height: 1.7; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1.5rem; }
.legal th, .legal td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--av-stone-soft); vertical-align: top; }
.legal th { font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; }
}
