/* ============================================================================
   APOTHECARY PHARMA — standalone microsite theme.
   Gold-on-black Victorian apothecary. Everything is scoped under .apo-root so
   it never leaks into (or inherits from) the main Nordic Altar app.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Grenze+Gotisch:wght@500;600;700;800;900&family=Cinzel:wght@400;500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

.apo-root {
  /* --- palette --- */
  --apo-black: #0a0906;
  --apo-black-2: #100d08;
  --apo-ink: #0c0a07;
  --apo-gold: #e8c272;
  --apo-gold-bright: #f6e3a9;
  --apo-gold-deep: #b8893b;
  --apo-gold-dim: #8a6a35;
  --apo-line: rgba(199, 158, 84, 0.42);
  --apo-line-soft: rgba(199, 158, 84, 0.2);
  --apo-text: #e7d8b6;
  --apo-text-dim: #b7a37a;
  --apo-text-faint: #8d7c59;

  --apo-serif: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --apo-caps: 'Cinzel', Georgia, serif;
  --apo-black-letter: 'Grenze Gotisch', 'Cinzel', serif;

  --apo-frame-max: 1180px;

  /* Reusable gold filigree corner (top-left oriented; rotate per corner). */
  --apo-corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80' fill='none' stroke='%23b8893b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 40L2 2L40 2'/%3E%3Cpath d='M8 30C8 18 18 8 30 8'/%3E%3Cpath d='M8 40C8 22 22 8 40 8'/%3E%3Cpath d='M18 24C24 16 34 16 40 20'/%3E%3Cpath d='M24 18C20 24 20 34 24 40'/%3E%3Ccircle cx='3' cy='3' r='2.2' fill='%23e8c272' stroke='none'/%3E%3C/svg%3E");

  position: relative;
  min-height: 100vh;
  width: 100%;
  background: var(--apo-black);
  color: var(--apo-text);
  font-family: var(--apo-serif);
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.apo-root *,
.apo-root *::before,
.apo-root *::after { box-sizing: border-box; }

.apo-root a { color: inherit; text-decoration: none; }

/* ---- Ambient backdrop: layered gold glows + grain + vignette --------------
   Fixed so it stays put behind scroll. Three slow-drifting radial pools of
   warm gold over near-black, a faint film grain, and a heavy vignette. */
.apo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 760px at 82% -8%, rgba(214, 164, 86, 0.16), transparent 60%),
    radial-gradient(900px 680px at -6% 108%, rgba(184, 137, 59, 0.13), transparent 58%),
    radial-gradient(720px 600px at 50% 52%, rgba(232, 194, 114, 0.05), transparent 66%),
    var(--apo-black);
}
.apo-bg::before {
  /* drifting ember pool */
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(42% 46% at 28% 30%, rgba(232, 194, 114, 0.1), transparent 62%),
    radial-gradient(40% 44% at 74% 70%, rgba(184, 137, 59, 0.09), transparent 62%);
  filter: blur(40px);
  animation: apoDrift 26s ease-in-out infinite alternate;
}
.apo-bg::after {
  /* film grain + vignette */
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: overlay;
}
.apo-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(130% 110% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.72) 100%);
}

@keyframes apoDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.apo-page { position: relative; z-index: 1; }

/* ---- Fixed ornamental page frame (the label border on the page) ---------- */
.apo-frameline {
  position: fixed;
  inset: 14px;
  z-index: 6;
  pointer-events: none;
  border: 1px solid var(--apo-line);
}
.apo-frameline::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--apo-line-soft);
}
.apo-fc {
  position: absolute;
  width: 72px;
  height: 72px;
  background: var(--apo-corner) center / contain no-repeat;
  opacity: 0.9;
}
.apo-fc.tl { top: -2px; left: -2px; }
.apo-fc.tr { top: -2px; right: -2px; transform: rotate(90deg); }
.apo-fc.br { bottom: -2px; right: -2px; transform: rotate(180deg); }
.apo-fc.bl { bottom: -2px; left: -2px; transform: rotate(270deg); }
@media (max-width: 600px) {
  .apo-frameline { inset: 9px; }
  .apo-fc { width: 54px; height: 54px; }
}

/* ---- Shared frame + ornament vocabulary ---------------------------------- */
.apo-wrap {
  width: 100%;
  max-width: var(--apo-frame-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 48px);
}

/* Double-rule gold frame with ornamental corners (echoes the labels). */
.apo-frame {
  position: relative;
  border: 1px solid var(--apo-line);
  box-shadow: inset 0 0 0 4px var(--apo-black), inset 0 0 0 5px var(--apo-line-soft);
  padding: clamp(24px, 5vw, 56px);
}
.apo-frame::before,
.apo-frame::after {
  content: '❖';
  position: absolute;
  font-size: 18px;
  color: var(--apo-gold-deep);
  line-height: 1;
}
.apo-frame::before { top: 10px; left: 12px; }
.apo-frame::after  { bottom: 10px; right: 12px; }

/* Corner flourishes as span ornaments (all four). */
.apo-corner {
  position: absolute;
  color: var(--apo-gold-deep);
  font-size: 20px;
  line-height: 1;
  opacity: 0.8;
}
.apo-corner.tl { top: 10px; right: 12px; }
.apo-corner.bl { bottom: 10px; left: 12px; }

/* Ornamental section divider: — ❦ — */
.apo-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: clamp(32px, 6vw, 60px) 0;
  color: var(--apo-gold-deep);
}
.apo-rule::before,
.apo-rule::after {
  content: '';
  height: 1px;
  flex: 1;
  max-width: 240px;
  background: linear-gradient(90deg, transparent, var(--apo-line), transparent);
}
.apo-rule span { font-size: 20px; letter-spacing: 0.3em; }
.apo-rule span::before,
.apo-rule span::after {
  content: '✦';
  font-size: 9px;
  color: var(--apo-gold-dim);
  vertical-align: middle;
  margin: 0 15px;
}

/* ---- Typography ---------------------------------------------------------- */
.apo-kicker {
  font-family: var(--apo-caps);
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--apo-gold-deep);
}
.apo-blackletter {
  font-family: var(--apo-black-letter);
  font-weight: 700;
  line-height: 0.98;
  color: var(--apo-gold-bright);
  background: linear-gradient(170deg, #fff4d6 0%, var(--apo-gold) 38%, var(--apo-gold-deep) 72%, #7c5a28 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 2px 14px rgba(214, 164, 86, 0.18));
}
.apo-descriptor {
  font-family: var(--apo-caps);
  font-weight: 500;
  color: var(--apo-gold);
  letter-spacing: 0.01em;
}
.apo-eyebrow {
  font-family: var(--apo-caps);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--apo-gold-deep);
  font-size: 11px;
}
.apo-lede { font-size: clamp(18px, 2.4vw, 22px); color: var(--apo-text); max-width: 60ch; }
.apo-body { color: var(--apo-text-dim); max-width: 64ch; }
.apo-body p + p { margin-top: 1em; }

/* ---- Buttons / links ----------------------------------------------------- */
.apo-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--apo-caps);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--apo-gold-bright);
  padding: 14px 26px;
  border: 1px solid var(--apo-line);
  background: linear-gradient(180deg, rgba(232, 194, 114, 0.08), rgba(232, 194, 114, 0.02));
  transition: all 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: pointer;
}
.apo-btn:hover {
  border-color: var(--apo-gold);
  color: #fff6de;
  box-shadow: 0 0 26px rgba(214, 164, 86, 0.25), inset 0 0 18px rgba(214, 164, 86, 0.08);
  transform: translateY(-2px);
}
.apo-btn .arw { transition: transform 0.4s ease; }
.apo-btn:hover .arw { transform: translateX(5px); }
.apo-link-quiet {
  font-family: var(--apo-caps);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--apo-text-faint);
  transition: color 0.3s;
}
.apo-link-quiet:hover { color: var(--apo-gold); }

/* ============================================================================
   LANDING
   ========================================================================== */
.apo-hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 0 40px;
}
.apo-hero .apo-mark {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-family: var(--apo-caps);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  font-size: clamp(13px, 2vw, 16px);
  color: var(--apo-gold);
  margin-bottom: 28px;
  animation: apoFadeUp 1s ease both;
}
.apo-hero .apo-mark::before,
.apo-hero .apo-mark::after {
  content: '';
  width: clamp(24px, 6vw, 54px);
  height: 1px;
  background: var(--apo-line);
}
.apo-hero .apo-crest {
  font-size: clamp(52px, 11vw, 120px);
  margin: 6px 0 10px;
  animation: apoFadeUp 1.1s ease 0.1s both;
}
.apo-hero .apo-sub {
  font-style: italic;
  color: var(--apo-text-dim);
  font-size: clamp(17px, 2.3vw, 22px);
  max-width: 44ch;
  margin: 10px auto 40px;
  animation: apoFadeUp 1.1s ease 0.25s both;
}
.apo-hero .apo-enter { animation: apoFadeUp 1.1s ease 0.4s both; }
.apo-crest-mask {
  font-size: clamp(60px, 13vw, 150px);
  line-height: 1;
  filter: drop-shadow(0 6px 30px rgba(214, 164, 86, 0.3));
  animation: apoBreathe 7s ease-in-out infinite;
}
.apo-crest-img {
  display: block;
  height: clamp(130px, 22vw, 230px);
  width: auto;
  margin: 2px 0 6px;
  filter: drop-shadow(0 8px 34px rgba(214, 164, 86, 0.32));
  animation: apoFadeUp 1.1s ease 0.1s both, apoBreathe 7.5s ease-in-out 1.1s infinite;
}
.apo-foot-crest {
  display: block;
  height: 74px;
  width: auto;
  margin: 0 auto 16px;
  opacity: 0.8;
  filter: drop-shadow(0 4px 18px rgba(214, 164, 86, 0.22));
}

@keyframes apoFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes apoBreathe {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 6px 30px rgba(214, 164, 86, 0.25)); }
  50%      { transform: translateY(-6px) scale(1.015); filter: drop-shadow(0 10px 42px rgba(214, 164, 86, 0.4)); }
}

/* ---- Collection grid ----------------------------------------------------- */
.apo-collection { padding: 20px 0 90px; }
.apo-collection-head { text-align: center; margin-bottom: 48px; }
.apo-collection-head h2 {
  font-family: var(--apo-caps);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(20px, 3vw, 30px);
  color: var(--apo-gold);
  margin: 10px 0 0;
}
.apo-collection-head h2::after {
  content: '— ✦ —';
  display: block;
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--apo-gold-dim);
}
.apo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.5vw, 30px);
}
.apo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--apo-black-2), var(--apo-black));
  border: 1px solid var(--apo-line-soft);
  padding: 20px 20px 26px;
  transition: all 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow: hidden;
}
.apo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(214, 164, 86, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.apo-card:hover {
  border-color: var(--apo-line);
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(214, 164, 86, 0.12);
}
.apo-card:hover::after { opacity: 1; }
.apo-card-art {
  position: relative;
  border: 1px solid var(--apo-line-soft);
  background: #000;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.apo-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.apo-card:hover .apo-card-art img { transform: scale(1.04); }
.apo-card-name {
  font-family: var(--apo-black-letter);
  font-weight: 700;
  font-size: 38px;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 16px 0 4px;
  color: var(--apo-gold-bright);
  background: linear-gradient(170deg, #fff4d6, var(--apo-gold) 45%, var(--apo-gold-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.apo-card-desc { font-family: var(--apo-caps); font-size: 13px; letter-spacing: 0.04em; color: var(--apo-text-dim); }
.apo-card-cta {
  margin-top: 16px;
  font-family: var(--apo-caps);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--apo-gold-deep);
  display: inline-flex;
  gap: 10px;
  transition: color 0.3s;
}
.apo-card:hover .apo-card-cta { color: var(--apo-gold); }

/* ============================================================================
   PRODUCT PAGE
   ========================================================================== */
.apo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
}
.apo-topbar .apo-home {
  font-family: var(--apo-caps);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--apo-gold);
}

.apo-product-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: 24px 0 10px;
}
.apo-product-art {
  position: relative;
  border: 1px solid var(--apo-line);
  box-shadow: inset 0 0 0 5px var(--apo-black), 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(214, 164, 86, 0.1);
  background: #000;
  overflow: hidden;
  animation: apoFadeUp 1s ease both;
}
.apo-product-art img { width: 100%; display: block; }
.apo-product-intro { animation: apoFadeUp 1s ease 0.12s both; }
.apo-product-intro .apo-name {
  font-size: clamp(60px, 10vw, 104px);
  margin: 12px 0 6px;
}
.apo-product-intro .apo-descriptor { font-size: clamp(16px, 2.4vw, 22px); display: block; margin-bottom: 20px; }
.apo-vol {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--apo-caps);
  letter-spacing: 0.24em;
  font-size: 12px;
  color: var(--apo-text-faint);
  border-top: 1px solid var(--apo-line-soft);
  padding-top: 14px;
}

/* ---- Body: actives + directions + ingredients ---------------------------- */
.apo-detail { padding: 10px 0 40px; }
.apo-body-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(28px, 5vw, 56px);
}
.apo-panel-title {
  font-family: var(--apo-caps);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--apo-gold);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.apo-panel-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--apo-line), transparent);
}
.apo-actives { list-style: none; margin: 0; padding: 0; }
.apo-actives li {
  padding: 14px 0;
  border-bottom: 1px solid var(--apo-line-soft);
}
.apo-actives .a-name {
  font-family: var(--apo-caps);
  font-weight: 600;
  color: var(--apo-gold-bright);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}
.apo-actives .a-note { color: var(--apo-text-dim); font-size: 16px; }

.apo-sidecard {
  position: relative;
  border: 1px solid var(--apo-line);
  box-shadow: inset 0 0 0 4px var(--apo-black), inset 0 0 0 5px var(--apo-line-soft);
  background: linear-gradient(180deg, var(--apo-black-2), var(--apo-black));
  padding: clamp(28px, 3.4vw, 38px);
}
.apo-directions { color: var(--apo-text); font-style: italic; }
.apo-inci {
  margin-top: 22px;
  color: var(--apo-text-faint);
  font-size: 13.5px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

/* ---- Footer -------------------------------------------------------------- */
.apo-foot {
  text-align: center;
  padding: 54px 0 70px;
  color: var(--apo-text-faint);
}
.apo-foot .apo-mark-sm {
  font-family: var(--apo-caps);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--apo-gold-deep);
  margin-bottom: 14px;
}
.apo-foot .apo-disclaimer {
  font-size: 12.5px;
  max-width: 62ch;
  margin: 0 auto;
  line-height: 1.7;
  color: var(--apo-text-faint);
}
.apo-foot .apo-nav { margin-top: 22px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .apo-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .apo-product-hero { grid-template-columns: 1fr; }
  .apo-product-art { order: -1; }
  .apo-body-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .apo-root *, .apo-root *::before, .apo-root *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
