/* FABIAN — Premium animations layer
   Loaded on top of style.css. Only transform/opacity for GPU.
   Honors prefers-reduced-motion via the final block.
*/

/* ---------- 1. HERO: glow halo around bottle ---------- */
.hero-visual {
  /* establish stacking for halo */
}
.hero-visual .bottle-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(91, 155, 213, 0.18) 0%, rgba(91, 155, 213, 0.08) 45%, transparent 75%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: fabian-halo 4s ease-in-out infinite;
  will-change: transform, opacity;
}
:root[data-theme="dark"] .hero-visual .bottle-halo {
  background: radial-gradient(closest-side, rgba(201, 169, 97, 0.18) 0%, rgba(91, 155, 213, 0.10) 45%, transparent 75%);
}
@keyframes fabian-halo {
  0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 0.75; transform: translate(-50%, -50%) scale(1.06); }
}

/* ---------- 1b. HERO: bubbles ---------- */
.hero-visual .fabian-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.hero-visual .fabian-bubbles .bubble {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), rgba(91, 155, 213, 0.18) 60%, transparent 75%);
  filter: blur(0.5px);
  opacity: 0;
  animation-name: fabian-bubble-rise;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
:root[data-theme="dark"] .hero-visual .fabian-bubbles .bubble {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(201, 169, 97, 0.18) 60%, transparent 75%);
}
@keyframes fabian-bubble-rise {
  0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  10%  { opacity: 0.6; }
  80%  { opacity: 0.4; }
  100% { transform: translate3d(var(--bx, 0px), calc(var(--by, -90vh)), 0) scale(1); opacity: 0; }
}

/* ---------- 1c. HERO: script shimmer (eyebrow / h-script) ---------- */
.hero-text .eyebrow,
.hero-text .h-script {
  position: relative;
}
.hero-text .h-script.fabian-shimmer,
.hero-text .eyebrow.fabian-shimmer {
  background-image: linear-gradient(
    100deg,
    var(--c-cobalt) 0%,
    var(--c-cobalt) 35%,
    var(--c-gold-light) 50%,
    var(--c-cobalt) 65%,
    var(--c-cobalt) 100%
  );
  background-size: 250% 100%;
  background-position: 150% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fabian-shimmer-sweep 10s ease-in-out infinite;
}
@keyframes fabian-shimmer-sweep {
  0%   { background-position: 150% 0; }
  30%  { background-position: -50% 0; }
  100% { background-position: -50% 0; }
}

/* ---------- 1d. HERO buttons: hover glow ---------- */
.hero .btn {
  position: relative;
  transition: all var(--t-mid), box-shadow .35s ease;
}
.hero .btn:hover {
  box-shadow: 0 0 0 1px rgba(201, 169, 97, 0.35), 0 6px 22px rgba(27, 58, 142, 0.22);
}
.hero .btn.btn-ghost:hover {
  box-shadow: 0 0 0 1px rgba(201, 169, 97, 0.45), inset 0 0 14px rgba(91, 155, 213, 0.25);
}

/* count-up: keep target value invisible-ready */
[data-countup] { display: inline-block; }
[data-countup].counting { will-change: contents; }

/* ---------- 2. Third golden orbital ring ---------- */
.hero-visual .fabian-ring-gold {
  content: "";
  position: absolute;
  width: 45%;
  height: 45%;
  top: 27.5%;
  left: 27.5%;
  border-radius: 50%;
  border: 1px dashed var(--c-gold);
  opacity: 0.3;
  animation: fabian-rotate-rev 200s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes fabian-rotate-rev {
  to { transform: rotate(-360deg); }
}

/* ---------- 3. About: stagger reveal for pillars ---------- */
.pillars .pillar {
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  transition: opacity .9s cubic-bezier(.22,.84,.36,1),
              transform .9s cubic-bezier(.22,.84,.36,1),
              border-color var(--t-mid),
              background var(--t-mid);
}
.pillars.fabian-in .pillar { opacity: 1; transform: translateY(0) scale(1); }
.pillars.fabian-in .pillar:nth-child(1) { transition-delay: 0ms; }
.pillars.fabian-in .pillar:nth-child(2) { transition-delay: 120ms; }
.pillars.fabian-in .pillar:nth-child(3) { transition-delay: 240ms; }
.pillars.fabian-in .pillar:nth-child(4) { transition-delay: 360ms; }

/* gold sweep on hover */
.pillar { position: relative; overflow: hidden; }
.pillar::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 169, 97, 0.75) 50%, transparent 100%);
  transition: transform 2s ease;
  pointer-events: none;
}
.pillar:hover::after {
  animation: fabian-pillar-sweep 2s ease-out;
}
@keyframes fabian-pillar-sweep {
  0%   { transform: translateX(0%); }
  100% { transform: translateX(200%); }
}

/* ---------- 4. Product gallery: shine on bottle ---------- */
.product-image-wrap { position: relative; overflow: hidden; }
.product-image-wrap img {
  transform: scale(0.94);
  opacity: 0.85;
  transition: transform 1.2s cubic-bezier(.22,.84,.36,1), opacity 1.2s ease;
  will-change: transform, opacity;
}
.product-image-wrap.fabian-in img { transform: scale(1); opacity: 1; }
.product-image-wrap::after {
  /* keep existing "EST. 2018" caption as-is */
}
.product-image-wrap .fabian-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.product-image-wrap .fabian-shine::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -30%;
  width: 30%;
  height: 140%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.18) 45%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0.18) 55%, transparent 100%);
  transform: translateX(-100%) rotate(8deg);
  animation: fabian-shine-sweep 5s ease-in-out infinite;
  animation-delay: 1.5s;
  mix-blend-mode: screen;
}
:root[data-theme="dark"] .product-image-wrap .fabian-shine::before {
  background: linear-gradient(105deg, transparent 0%, rgba(201,169,97,0.10) 45%, rgba(229,212,166,0.40) 50%, rgba(201,169,97,0.10) 55%, transparent 100%);
}
@keyframes fabian-shine-sweep {
  0%   { transform: translateX(-100%) rotate(8deg); }
  35%  { transform: translateX(420%) rotate(8deg); }
  100% { transform: translateX(420%) rotate(8deg); }
}

/* ---------- 5. Market numbers: count-up + golden line draw ---------- */
.market-numbers .market-num { position: relative; }
.market-numbers .market-num + .market-num::before {
  content: "";
  position: absolute;
  top: 18%;
  left: 0;
  width: 1px;
  height: 64%;
  background: linear-gradient(180deg, transparent, var(--c-gold) 40%, var(--c-gold) 60%, transparent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 1.1s cubic-bezier(.22,.84,.36,1);
  opacity: 0.55;
  pointer-events: none;
}
.market-numbers.fabian-in .market-num + .market-num::before { transform: scaleY(1); }
.market-numbers.fabian-in .market-num + .market-num:nth-child(2)::before { transition-delay: 200ms; }
.market-numbers.fabian-in .market-num + .market-num:nth-child(3)::before { transition-delay: 380ms; }
.market-numbers.fabian-in .market-num + .market-num:nth-child(4)::before { transition-delay: 560ms; }

/* ---------- 6. Strategy timeline: line + dot ---------- */
.timeline { position: relative; }
.timeline .fabian-tl-line {
  position: absolute;
  top: 0;
  left: 100px;
  width: 1px;
  background: linear-gradient(180deg, var(--c-gold) 0%, rgba(201, 169, 97, 0.25) 100%);
  height: 0%;
  transition: height .35s linear;
  pointer-events: none;
  opacity: 0.7;
  transform-origin: top;
}
.tl-step { position: relative; }
.tl-step::before {
  content: "";
  position: absolute;
  left: 96px;
  top: 44px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
  transform: scale(0);
  transition: transform .6s cubic-bezier(.22,.84,.36,1);
  z-index: 1;
}
.tl-step.fabian-in::before { transform: scale(1); }
.tl-year {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22,.84,.36,1);
}
.tl-step.fabian-in .tl-year { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  .timeline .fabian-tl-line { left: 44px; }
  .tl-step::before { left: 40px; top: 36px; }
}
@media (max-width: 600px) {
  .timeline .fabian-tl-line, .tl-step::before { display: none; }
}

/* ---------- 7. Investors: rotating golden glow + stagger ---------- */
.cta-block::before {
  animation: fabian-rotate-slow 60s linear infinite;
  transform-origin: center;
  will-change: transform;
}
@keyframes fabian-rotate-slow {
  to { transform: rotate(360deg); }
}
.fin-grid .fin-cell {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.22,.84,.36,1), border-color var(--t-mid);
}
.fin-grid.fabian-in .fin-cell { opacity: 1; transform: translateY(0); }
.fin-grid.fabian-in .fin-cell:nth-child(1) { transition-delay: 0ms; }
.fin-grid.fabian-in .fin-cell:nth-child(2) { transition-delay: 100ms; }
.fin-grid.fabian-in .fin-cell:nth-child(3) { transition-delay: 200ms; }
.fin-grid.fabian-in .fin-cell:nth-child(4) { transition-delay: 300ms; }

/* ---------- 8. Forms ---------- */
.form-card input,
.form-card textarea {
  transition: border-color var(--t-fast), box-shadow .35s ease, background var(--t-fast);
}
.form-card input:focus,
.form-card textarea:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
}
.form-card .btn.fabian-pulsed { animation: fabian-pulse-success .35s ease-out; }
@keyframes fabian-pulse-success {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ---------- 9. Footer ---------- */
.footer-brand img {
  transition: transform 1.1s cubic-bezier(.22,.84,.36,1), filter var(--t-fast);
}
.footer-brand:hover img { transform: rotate(360deg); }

.footer-links a {
  position: relative;
  padding-bottom: 4px;
  background-image: linear-gradient(90deg, var(--c-gold), var(--c-gold));
  background-position: 100% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size .45s cubic-bezier(.22,.84,.36,1), color var(--t-fast);
}
.footer-links a:hover {
  color: var(--c-gold);
  background-size: 100% 1px;
  background-position: 0 100%;
}

/* ---------- 10. Bottom bar entrance + ripple ---------- */
.bottom-bar {
  opacity: 0;
  transform: translate(-50%, 24px);
  transition: opacity .6s cubic-bezier(.22,.84,.36,1), transform .6s cubic-bezier(.22,.84,.36,1);
}
.bottom-bar.fabian-ready {
  opacity: 1;
  transform: translate(-50%, 0);
}

.theme-switch button,
.history-nav button { position: relative; overflow: hidden; }
.theme-switch button .fabian-ripple,
.history-nav button .fabian-ripple {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(201, 169, 97, 0.55);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: fabian-ripple .45s ease-out forwards;
}
@keyframes fabian-ripple {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(7);   opacity: 0; }
}

/* ---------- 11. Header shadow on scroll ---------- */
.site-header {
  transition: all var(--t-mid), box-shadow .4s ease;
}
.site-header.fabian-scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}
:root[data-theme="dark"] .site-header.fabian-scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- MOBILE: trim heavy effects ---------- */
@media (max-width: 768px) {
  .hero-visual .fabian-bubbles,
  .hero-visual .bottle-halo,
  .hero-visual .fabian-ring-gold,
  .product-image-wrap .fabian-shine { display: none; }
  .cta-block::before { animation: none; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-visual .bottle-halo,
  .hero-visual .fabian-bubbles,
  .hero-visual .fabian-ring-gold,
  .product-image-wrap .fabian-shine,
  .hero-text .h-script.fabian-shimmer,
  .hero-text .eyebrow.fabian-shimmer,
  .cta-block::before { animation: none !important; }

  .pillars .pillar,
  .fin-grid .fin-cell,
  .tl-year,
  .product-image-wrap img,
  .bottom-bar {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .tl-step::before { transform: scale(1) !important; }
  .market-numbers .market-num + .market-num::before { transform: scaleY(1) !important; }
}
