/* =========================================================================
   AURORA — shared component layer for inner pages
   Loads on any page tagged `.ap-aurora-page` (currently: About). Carries the
   reusable primitives that the bespoke homepage keeps inline in home.css:
   aurora field, glass, buttons, reveal motion, newsletter, portrait, etc.
   Pairs with assets/js/reveal.js.

   NOTE: home.css still ships its own copy of these primitives so the homepage
   renders byte-identical to before (it does NOT load this file). When you're
   ready, the homepage can switch to aurora.css + a trimmed home.css and the
   duplication goes away. Until then keep shared changes in sync across both.
   ========================================================================= */

/* ---- Neutralise Astra's flex content container for full-bleed sections ----
   Astra wraps content in a FLEX .ast-container; a full-bleed <main> flex item
   (min-width:auto) stretches to its widest descendant and blows the page out.
   Force plain block flow + allow shrinking. (Same fix the homepage uses.) */
.ap-aurora-page #content { padding: 0; }
.ap-aurora-page #content > .ast-container {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.ap-aurora-page #primary,
.ap-aurora-page .ast-container > #primary {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.ap-aurora-page #main,
.ap-aurora-page .site-content { padding: 0; }
.ap-aurora-page .entry-header,
.ap-aurora-page .ast-archive-description { display: none; }

/* Soft fixed aurora wash behind everything so glass surfaces refract. */
.ap-aurora-main {
  position: relative;
  min-width: 0;
  max-width: 100%;
  background:
    radial-gradient(60% 50% at 85% -5%, rgba(18,185,116,.10), transparent 60%),
    radial-gradient(50% 40% at 5% 12%, rgba(15,184,176,.08), transparent 60%),
    var(--ap-bg);
  overflow-x: clip;
}

/* ---- Header: transparent over the hero, glass once scrolled ---------- */
.ap-aurora-page #masthead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  background: transparent;
  box-shadow: none;
  transition: background .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.ap-aurora-page.ap-scrolled #masthead {
  background: rgba(246, 249, 247, .82);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 1px 0 rgba(10, 20, 16, .07), 0 14px 40px -28px rgba(10, 30, 22, .4);
}

/* =========================================================================
   Shared bits
   ========================================================================= */
.glass {
  background: rgba(255, 255, 255, .60);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: var(--ap-shadow);
}
.ap-grad-text {
  background: linear-gradient(100deg, var(--ap-green-ink), var(--ap-teal) 55%, var(--ap-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ap-dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--ap-green); display: inline-block;
  box-shadow: 0 0 0 4px rgba(18, 185, 116, .15);
}
.ap-dot--alt { background: var(--ap-teal); box-shadow: 0 0 0 4px rgba(15, 184, 176, .15); }

.ap-section-head { max-width: 40ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.ap-section-head h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.05; margin: .5rem 0 0; }
.ap-section-head--center { margin-inline: auto; text-align: center; }
.ap-section-head--center .eyebrow { justify-content: center; }

/* ---- Buttons ---------------------------------------------------------- */
.ap-btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 1em 1.6em; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s, background .28s, color .28s, border-color .28s;
}
.ap-btn svg { transition: transform .28s cubic-bezier(.2,.7,.2,1); }
.ap-btn:hover svg { transform: translateX(3px); }
.ap-btn--primary {
  background: linear-gradient(120deg, var(--ap-green) 0%, var(--ap-teal) 60%, var(--ap-cyan) 110%);
  color: #04150d;
  box-shadow: 0 14px 34px -12px rgba(18, 185, 116, .6);
}
.ap-btn--primary:hover { transform: translateY(-2px); color: #04150d; box-shadow: 0 20px 46px -14px rgba(18, 185, 116, .75); }
.ap-btn--ghost {
  background: rgba(255, 255, 255, .55);
  border-color: rgba(10, 20, 16, .16);
  color: var(--ap-ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ap-btn--ghost:hover { transform: translateY(-2px); border-color: var(--ap-green); color: var(--ap-green-ink); }

.ap-link-arrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 600; text-decoration: none; color: var(--ap-ink);
  margin-top: auto; padding-top: .25rem;
}
.ap-link-arrow span { transition: transform .28s cubic-bezier(.2,.7,.2,1); color: var(--ap-green-ink); }
.ap-link-arrow:hover { color: var(--ap-green-ink); }
.ap-link-arrow:hover span { transform: translateX(5px); }

/* =========================================================================
   Aurora field + grain
   ========================================================================= */
.ap-aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ap-blob {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .55;
  will-change: transform;
  animation: ap-drift 22s ease-in-out infinite alternate;
}
.ap-blob--green  { width: 46vw; height: 46vw; top: -10%; right: -6%;  background: radial-gradient(circle at 30% 30%, var(--ap-green-bright), transparent 70%); }
.ap-blob--teal   { width: 40vw; height: 40vw; top: 30%;  left: -12%;  background: radial-gradient(circle at 50% 50%, var(--ap-teal), transparent 70%); animation-delay: -7s; opacity: .45; }
.ap-blob--violet { width: 34vw; height: 34vw; bottom: -14%; right: 18%; background: radial-gradient(circle at 50% 50%, var(--ap-violet), transparent 70%); animation-delay: -13s; opacity: .30; }
.ap-blob--cyan   { width: 38vw; height: 38vw; top: -8%; left: 10%; background: radial-gradient(circle at 50% 50%, var(--ap-cyan), transparent 70%); animation-delay: -4s; opacity: .4; }

@keyframes ap-drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(4%, 6%, 0) scale(1.12); }
  100% { transform: translate3d(-5%, -4%, 0) scale(.95); }
}

.ap-grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  mix-blend-mode: overlay;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* =========================================================================
   Portrait (reusable headshot frame with rotating glow + floating chips)
   ========================================================================= */
.ap-portrait {
  position: relative; width: min(30rem, 80vw); aspect-ratio: 4 / 5;
  border-radius: var(--ap-radius-lg);
  transform-style: preserve-3d; transition: transform .3s ease;
}
.ap-portrait img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  border-radius: var(--ap-radius-lg);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--ap-shadow-lg);
}
.ap-portrait__glow {
  position: absolute; inset: -14% -14% -8% -14%; z-index: 1; border-radius: 50%;
  background: conic-gradient(from 120deg, var(--ap-green-bright), var(--ap-cyan), var(--ap-violet), var(--ap-green-bright));
  filter: blur(46px); opacity: .55; animation: ap-spin 18s linear infinite;
}
@keyframes ap-spin { to { transform: rotate(360deg); } }

.ap-chip {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem .95rem; border-radius: 999px;
  font-size: .82rem; font-weight: 600; white-space: nowrap;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 14px 30px -16px rgba(10,30,22,.5);
}
.ap-chip--top { top: 8%; left: -8%; }
.ap-chip--bottom { bottom: 9%; right: -7%; }

/* =========================================================================
   Stat row (gradient numbers under a hero)
   ========================================================================= */
.ap-hero__stats {
  display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 4vw, 2.75rem);
  list-style: none; margin: 2.75rem 0 0; padding: 1.5rem 0 0;
  border-top: 1px solid var(--ap-line);
}
.ap-hero__stats li { display: flex; flex-direction: column; gap: .15rem; }
.ap-num, .ap-num-text {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1;
  background: linear-gradient(120deg, var(--ap-green-ink), var(--ap-teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ap-num-text { font-size: clamp(1.05rem, 1.6vw, 1.25rem); letter-spacing: -.01em; }
.ap-stat-label { font-size: .82rem; color: var(--ap-ink-faint); font-weight: 500; }

/* =========================================================================
   Newsletter (the conversion spine — shared across pages)
   ========================================================================= */
.ap-news { position: relative; padding-block: clamp(4rem, 9vw, 8rem); isolation: isolate; }
.ap-news__card {
  position: relative; z-index: 2;
  max-width: 760px; margin-inline: auto; text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem); border-radius: var(--ap-radius-lg);
}
.ap-news__card h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.04; margin: .6rem 0 .85rem; }
.ap-news__card .eyebrow, .ap-news__card .ap-lead { justify-content: center; margin-inline: auto; }
.ap-news__card .ap-lead { color: var(--ap-ink-soft); }

.ap-subscribe {
  display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center;
  max-width: 480px; margin: 1.75rem auto 0; position: relative;
}
.ap-subscribe input[type="email"] {
  flex: 1 1 240px; min-width: 0;
  padding: 1em 1.25em; border-radius: 999px;
  border: 1.5px solid var(--ap-line); background: rgba(255,255,255,.85);
  font: inherit; color: var(--ap-ink);
  transition: border-color .25s, box-shadow .25s;
}
.ap-subscribe input[type="email"]:focus {
  outline: none; border-color: var(--ap-green);
  box-shadow: 0 0 0 4px rgba(18,185,116,.18);
}
.ap-subscribe .ap-btn { flex: 0 0 auto; }
.ap-news__msg { flex: 1 0 100%; margin: .25rem 0 0; font-size: .9rem; min-height: 1.2em; color: var(--ap-green-ink); font-weight: 600; }
.ap-news__fine {
  display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: center;
  margin: 1.5rem auto 0; font-size: .92rem; color: var(--ap-ink-soft); max-width: 46ch;
}

/* =========================================================================
   Scroll-reveal states (driven by reveal.js → .is-visible)
   Hidden state is gated on html.ap-js; if JS never runs, content stays visible.
   ========================================================================= */
html.ap-js [data-reveal] {
  opacity: 0; transform: translateY(30px); filter: blur(8px);
  transition:
    opacity .85s cubic-bezier(.2,.7,.2,1),
    transform .85s cubic-bezier(.2,.7,.2,1),
    filter .85s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--reveal-delay, 0) * 95ms);
  will-change: opacity, transform;
}
html.ap-js [data-reveal].is-visible { opacity: 1; transform: none; filter: none; }
[data-reveal-delay="1"] { --reveal-delay: 1; }
[data-reveal-delay="2"] { --reveal-delay: 2; }
[data-reveal-delay="3"] { --reveal-delay: 3; }
[data-reveal-delay="4"] { --reveal-delay: 4; }
[data-reveal-delay="5"] { --reveal-delay: 5; }

/* =========================================================================
   Reduced motion — respect it fully
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html.ap-js [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  .ap-blob, .ap-portrait__glow { animation: none !important; }
  .ap-btn:hover { transform: none; }
}
