/* ============================================================
   Brigitte Voigt - Inner Garden
   A quiet animated art object. Mobile-first.
   ============================================================ */

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

:root {
  /* Colors: deep forest green, warm gold, sage */
  --bv-bg-deep: #050d09;
  --bv-bg-forest: #0a1a11;
  --bv-bg-moss: #10241a;
  --bv-gold: #d4b26a;
  --bv-gold-soft: #e8d9ae;
  --bv-sage: #8fae94;
  --bv-text: #ecefe8;
  --bv-text-soft: #c3cfc2;
  --bv-text-faint: #93a596;

  /* Typography */
  --bv-font: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --bv-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;

  /* Card */
  --bv-card-radius: 26px;
  --bv-card-blur: 8px;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--bv-font-sans);
  color: var(--bv-text);
  background:
    radial-gradient(120vmax 90vmax at 50% 118%, #16301f 0%, transparent 55%),
    radial-gradient(90vmax 70vmax at 50% -25%, #0e2015 0%, transparent 60%),
    linear-gradient(180deg, var(--bv-bg-deep) 0%, var(--bv-bg-forest) 55%, var(--bv-bg-deep) 100%);
  background-color: var(--bv-bg-deep);
}

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

/* ---------- Background layers ---------- */

.bv-pollen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.bv-aura {
  position: fixed;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 120vmin;
  height: 120vmin;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(143, 174, 148, 0.2) 0%, rgba(143, 174, 148, 0.08) 42%, transparent 72%),
    radial-gradient(closest-side, rgba(212, 178, 106, 0.11) 0%, transparent 58%);
  animation: bv-aura-breath 16s ease-in-out infinite;
}

@keyframes bv-aura-breath {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

/* Light veil: no drawn beam, just the faint sense that it is brighter
   above. Two layers drifting against each other create the slow
   interference of light under a tree canopy (luminance, not geometry). */
.bv-veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.bv-veil-layer {
  position: absolute;
  left: -30%;
  top: -10vh;
  width: 160%;
  height: 95vh;
  opacity: 0;
}

.bv-veil-layer--1 {
  background: radial-gradient(
    ellipse 52% 100% at 50% 0%,
    rgba(232, 217, 174, 0.1) 0%,
    rgba(212, 178, 106, 0.05) 42%,
    transparent 74%
  );
  animation:
    bv-veil-in 5s ease-out 0.8s forwards,
    bv-veil-drift-1 47s ease-in-out 5.8s infinite alternate;
}

.bv-veil-layer--2 {
  background: radial-gradient(
    ellipse 40% 90% at 46% 0%,
    rgba(212, 178, 106, 0.08) 0%,
    rgba(143, 174, 148, 0.04) 45%,
    transparent 72%
  );
  animation:
    bv-veil-in 5s ease-out 1.8s forwards,
    bv-veil-drift-2 61s ease-in-out 6.8s infinite alternate;
}

@keyframes bv-veil-in {
  to { opacity: 1; }
}

@keyframes bv-veil-drift-1 {
  0%   { transform: translateX(-2.5%) scaleY(1); }
  55%  { opacity: 0.65; }
  100% { transform: translateX(2.5%) scaleY(1.04); opacity: 1; }
}

@keyframes bv-veil-drift-2 {
  0%   { transform: translateX(3%); }
  45%  { opacity: 0.55; }
  100% { transform: translateX(-3%); opacity: 1; }
}

/* Light arcs: a distant hint of wings or a garden gate */
.bv-arcs {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 118vmin;
  height: 118vmin;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* The gate draws itself once on load, then joins the shared breathing */
.bv-arc {
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0.7;
}

.bv-arc--left,
.bv-arc--right {
  animation:
    bv-arc-draw 3.4s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards,
    bv-arc-breath 16s ease-in-out 4.6s infinite;
}

.bv-arc--left2,
.bv-arc--right2 {
  stroke-width: 1.3;
  animation:
    bv-arc-draw 3.8s cubic-bezier(0.4, 0, 0.2, 1) 1.9s forwards,
    bv-arc-breath 16s ease-in-out 5.7s infinite;
}

.bv-arc--crown {
  stroke-width: 1.3;
  animation:
    bv-arc-draw 2.8s cubic-bezier(0.4, 0, 0.2, 1) 2.9s forwards,
    bv-arc-breath 16s ease-in-out 5.7s infinite;
}

@keyframes bv-arc-draw {
  to { stroke-dashoffset: 0; }
}

/* Gate glint: a brief shimmer that occasionally travels up one of the
   arcs. Triggered from script.js via the Web Animations API. */
.bv-arc-glint {
  fill: none;
  stroke: var(--bv-gold-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.12 1.5;
  stroke-dashoffset: 0.12;
  opacity: 0;
}

@keyframes bv-arc-breath {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* ---------- Stage and card ---------- */

.bv-stage {
  position: relative;
  z-index: 4;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vmin, 2rem);
}

.bv-card {
  width: min(92vw, 560px);
  max-height: 94svh;
  text-align: center;
  padding: clamp(2.2rem, 9svh, 5.5rem) clamp(1.4rem, 6vw, 4.5rem);
  border-radius: var(--bv-card-radius);
  border: 1px solid rgba(212, 178, 106, 0.18);
  background: linear-gradient(
    168deg,
    rgba(24, 44, 32, 0.52) 0%,
    rgba(12, 26, 18, 0.62) 100%
  );
  backdrop-filter: blur(var(--bv-card-blur));
  -webkit-backdrop-filter: blur(var(--bv-card-blur));
  box-shadow:
    0 0 0 1px rgba(6, 14, 10, 0.35),
    0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(232, 217, 174, 0.09);
  opacity: 0;
  transform: translateY(14px);
  animation: bv-card-in 1.3s cubic-bezier(0.22, 0.7, 0.3, 1) 0.25s forwards;
}

@keyframes bv-card-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography ---------- */

.bv-kicker {
  font-family: var(--bv-font-sans);
  font-size: clamp(0.68rem, 1.6vmin, 0.8rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--bv-sage);
  opacity: 0;
  animation: bv-fade-in 1.4s ease-out 1s forwards;
}

.bv-name {
  position: relative;
  font-family: var(--bv-font);
  font-weight: 500;
  font-size: clamp(2.1rem, 8.5vmin, 3.9rem);
  line-height: 1.12;
  letter-spacing: 0.02em;
  margin-top: clamp(0.9rem, 2.5svh, 1.5rem);
  color: var(--bv-text);
  text-shadow: 0 0 34px rgba(212, 178, 106, 0.2);
  opacity: 0;
  animation: bv-fade-in 1.6s ease-out 1.4s forwards;
}

/* Warm shimmer behind the name, breathing in sync with the aura */
.bv-name::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30% 12%;
  background: radial-gradient(42% 58% at 50% 55%, rgba(212, 178, 106, 0.09), transparent 68%);
  animation: bv-halo-breath 16s ease-in-out infinite;
}

@keyframes bv-halo-breath {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(1.05); }
}

/* Vine divider: grows once from the center, the small leaves unfold,
   then it breathes along with the rest of the scene */
.bv-ranke {
  display: flex;
  justify-content: center;
  margin-top: clamp(1.1rem, 3svh, 1.8rem);
  color: var(--bv-gold);
  animation: bv-ranke-breath 16s ease-in-out 6s infinite;
}

.bv-ranke svg {
  display: block;
  width: clamp(150px, 34vw, 230px);
  height: auto;
  overflow: visible;
  /* Barely perceptible sway, like air you cannot feel; starts and ends
     at zero so nothing jumps after the growth animation */
  animation: bv-ranke-sway 24s ease-in-out 5.2s infinite;
}

@keyframes bv-ranke-sway {
  0%, 100% { transform: rotate(0deg); }
  28%      { transform: rotate(-0.45deg); }
  72%      { transform: rotate(0.5deg); }
}

.bv-ranke-stem {
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.bv-ranke-stem--l {
  animation: bv-arc-draw 1.7s cubic-bezier(0.3, 0, 0.2, 1) 2.2s forwards;
}

.bv-ranke-stem--r {
  animation: bv-arc-draw 1.9s cubic-bezier(0.3, 0, 0.2, 1) 2.3s forwards;
}

.bv-ranke-leaf {
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform: scale(0.4);
  animation: bv-ranke-leaf 1.1s ease-out forwards;
}

.bv-ranke-leaf--bud {
  transform-origin: 50% 100%;
  animation-delay: 2.4s;
}

.bv-ranke-leaf--0 {
  transform-origin: 50% 0%;
  animation-delay: 3.2s;
}

.bv-ranke-leaf--1 {
  transform-origin: 30% 100%;
  animation-delay: 3s;
}

.bv-ranke-leaf--2 {
  transform-origin: 50% 0%;
  animation-delay: 3.35s;
}

.bv-ranke-leaf--3 {
  transform-origin: 25% 100%;
  animation-delay: 3.7s;
}

@keyframes bv-ranke-leaf {
  to { opacity: 1; transform: scale(1); }
}

@keyframes bv-ranke-breath {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.78; }
}

.bv-spruch {
  font-family: var(--bv-font);
  font-style: italic;
  font-size: clamp(1rem, 2.6vmin, 1.25rem);
  line-height: 1.6;
  color: var(--bv-text-soft);
  margin-top: clamp(1.1rem, 3svh, 1.8rem);
  min-height: 2.1em;
}

.bv-caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--bv-gold);
  opacity: 0;
}

.bv-caret.bv-caret--active {
  opacity: 1;
  animation: bv-caret-blink 0.9s steps(1) infinite;
}

@keyframes bv-caret-blink {
  50% { opacity: 0; }
}

.bv-sunrise {
  font-family: var(--bv-font-sans);
  font-size: clamp(0.68rem, 1.6vmin, 0.78rem);
  letter-spacing: 0.14em;
  color: var(--bv-text-faint);
  margin-top: clamp(1.4rem, 4svh, 2.4rem);
  opacity: 0;
}

.bv-sunrise.bv-sunrise--visible {
  animation: bv-fade-in 2.2s ease-out forwards;
}

@keyframes bv-fade-in {
  to { opacity: 1; }
}

.bv-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Mobile: tone down the light ---------- */

@media (max-width: 899px) {
  .bv-veil {
    opacity: 0.7;
  }
}

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
  :root {
    --bv-card-blur: 14px;
  }

  .bv-card {
    width: min(88vw, 790px);
    padding: clamp(3rem, 14svh, 8.5rem) clamp(3rem, 8vw, 6rem);
  }
}

/* Short viewports (e.g. 1366x768): keep the card compact */
@media (min-width: 900px) and (max-height: 820px) {
  .bv-card {
    padding-top: clamp(2.4rem, 8svh, 4rem);
    padding-bottom: clamp(2.4rem, 8svh, 4rem);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .bv-card,
  .bv-kicker,
  .bv-name,
  .bv-name::after,
  .bv-ranke,
  .bv-ranke svg,
  .bv-ranke-stem,
  .bv-ranke-leaf,
  .bv-arcs,
  .bv-aura,
  .bv-arc,
  .bv-veil-layer,
  .bv-caret,
  .bv-sunrise {
    animation: none;
  }

  .bv-card {
    opacity: 1;
    transform: none;
  }

  .bv-kicker,
  .bv-name,
  .bv-ranke,
  .bv-arcs,
  .bv-sunrise {
    opacity: 1;
  }

  .bv-ranke-stem {
    stroke-dashoffset: 0;
  }

  .bv-ranke-leaf {
    opacity: 1;
    transform: none;
  }

  .bv-arc {
    stroke-dashoffset: 0;
    opacity: 0.55;
  }

  .bv-veil-layer {
    opacity: 0.5;
  }

  .bv-name::after {
    opacity: 0.6;
  }

  .bv-caret {
    display: none;
  }
}
