@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg-deep: #150d07;
  --bg-mid: #24160b;
  --bg-warm: #3a2312;
  --cream: #f7ead0;
  --muted: #d4bf9e;
  --amber: #e3ac4c;
  --amber-hi: #f2c56e;
  --amber-lo: #b8761f;
  --btn-text: #2a1808;
  --card: rgba(36, 22, 11, 0.78);
  --card-border: rgba(227, 172, 76, 0.24);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* overflow-x only on html: setting it on body as well breaks position: sticky */
html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layers: bg 0, canvas 1, texture 1, content 2+, nav 100, footer 10 ---------- */
.grain-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(227, 172, 76, 0.26), transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(184, 118, 31, 0.20), transparent 70%),
    radial-gradient(ellipse 60% 50% at 95% 90%, rgba(138, 75, 23, 0.22), transparent 70%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
}

#grain-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: block;
}

.texture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.13;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.85  0 0 0 0 0.6  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 24px 32px;
  background: rgba(21, 13, 7, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(227, 172, 76, 0.08);
  transition: padding 250ms ease, background-color 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--cream);
  text-decoration: none;
  transition: font-size 250ms ease;
}

.wordmark:hover {
  color: var(--cream);
  text-decoration: none;
}

.wordmark span {
  color: var(--amber);
}

#buy_now_link {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
  color: var(--btn-text);
  text-decoration: none;
  white-space: nowrap;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo));
  box-shadow: 0 4px 16px rgba(227, 172, 76, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: padding 250ms ease, font-size 250ms ease, transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

#buy_now_link:hover,
#buy_now_link:focus {
  color: var(--btn-text);
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(227, 172, 76, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#buy_now_link:focus-visible,
#buy_now_bottom:focus-visible,
.wordmark:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

.site-nav.nav-scrolled {
  padding: 10px 32px;
  background: rgba(21, 13, 7, 0.92);
  border-bottom-color: rgba(227, 172, 76, 0.22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.site-nav.nav-scrolled .wordmark {
  font-size: 1.35rem;
}

.site-nav.nav-scrolled #buy_now_link {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  padding: 12vh 24px 8vh;
  text-align: center;
}

.hero h1 {
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}

.hero h1 .line {
  display: block;
}

.hero h1 .line + .line {
  color: var(--amber-hi);
}

.hero p {
  max-width: 680px;
  margin: 32px auto 0;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

/* ---------- Cards ---------- */
.cards-section {
  position: relative;
  z-index: 2;
}

.cards-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4vh 24px 10vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.malt-card {
  position: relative;
  padding: 38px;
  border-radius: 18px;
  color: var(--muted);
  background: linear-gradient(160deg, rgba(58, 35, 18, 0.92), rgba(36, 22, 11, 0.9));
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(247, 234, 208, 0.08);
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.malt-card:hover {
  transform: translateY(-8px);
  border-color: rgba(227, 172, 76, 0.55);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(227, 172, 76, 0.12), inset 0 1px 0 rgba(247, 234, 208, 0.12);
}

.malt-card::before {
  content: "";
  display: block;
  width: 34px;
  height: 16px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--amber-lo), var(--amber-hi));
  transform: rotate(-24deg);
  box-shadow: 0 0 18px rgba(227, 172, 76, 0.4);
}

.malt-card h3 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--cream);
}

.malt-card p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 6vh 24px 16vh;
}

.cta p {
  margin: 0;
}

.signal-status {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--amber);
}

#buy_now_bottom {
  display: inline-block;
  max-width: 100%;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  letter-spacing: 0.02em;
  color: var(--btn-text);
  text-decoration: none;
  padding: 22px 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, var(--amber-lo));
  box-shadow: 0 10px 34px rgba(227, 172, 76, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

#buy_now_bottom:hover {
  color: var(--btn-text);
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.08);
  box-shadow: 0 16px 46px rgba(227, 172, 76, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#buy_now_bottom:active,
#buy_now_link:active {
  transform: translateY(0);
}

.signal-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
/* Footer markup is injected via SSI; keep it solid and above the fixed background layers. */
footer {
  position: relative;
  z-index: 10;
  padding: 18px 20px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg-deep);
  border-top: 1px solid rgba(227, 172, 76, 0.22);
}

footer div {
  margin: 0;
}

footer a {
  color: var(--amber-hi);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .site-nav {
    padding: 14px 16px;
  }
  .site-nav.nav-scrolled {
    padding: 8px 16px;
  }
  .wordmark {
    font-size: 1.45rem;
  }
  .site-nav.nav-scrolled .wordmark {
    font-size: 1.15rem;
  }
  #buy_now_link {
    padding: 9px 16px;
    font-size: 0.85rem;
  }
  .site-nav.nav-scrolled #buy_now_link {
    padding: 7px 13px;
    font-size: 0.8rem;
  }
  .hero {
    padding: 11vh 18px 6vh;
  }
  .hero p {
    font-size: 1rem;
    margin-top: 24px;
  }
  .cards-grid {
    padding: 3vh 16px 8vh;
  }
  .malt-card {
    padding: 30px 26px;
  }
  #buy_now_bottom {
    padding: 18px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .site-nav, .wordmark, #buy_now_link, #buy_now_bottom, .malt-card {
    transition: none;
  }
  .malt-card:hover, #buy_now_link:hover, #buy_now_bottom:hover {
    transform: none;
  }
}
