/* fern and the fog — shared styles */

:root {
  --bg: #fbfbf9; --root: transparent; --surface: rgba(240, 241, 237, 0.55); --ink: #151515; --muted: #575d5a; --line: #c9ccc7;
  --fernLogo: #688d66; --fogLogo: #87a9a8; --fern: #4b6d49; --fog: #4a7170; --fernTint: #e3ebe1;
  color-scheme: light;
}

body { margin: 0; }

/* soft, foggy background */
html {
  min-height: 100%;
  scrollbar-gutter: stable; /* page width stays put even when a page gets shorter */
  background:
    radial-gradient(circle at 12% 30%, rgba(135,169,168,.16), transparent 40%),
    linear-gradient(160deg, #fbfbf9 0%, #f3f5f0 50%, #ecf2f1 100%);
  background-attachment: fixed;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%;
  pointer-events: none;
}
body::before { width: 75vw; height: 75vw; top: -28vw; right: -24vw; background: radial-gradient(closest-side, #87a9a8, rgba(135,169,168,.45) 45%, rgba(135,169,168,0)); opacity: .3; animation: ff-drift 32s ease-in-out infinite; }
body::after { width: 70vw; height: 70vw; bottom: -28vw; left: -26vw; background: radial-gradient(closest-side, #688d66, rgba(104,141,102,.45) 45%, rgba(104,141,102,0)); opacity: .2; animation: ff-drift 40s ease-in-out infinite reverse; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a { color: inherit; text-decoration: none; transition: opacity .25s ease; }
a:hover { opacity: .6; }
input:focus, textarea:focus { outline: 2px solid currentColor; outline-offset: 2px; }
input, textarea { transition: border-color .3s ease; }
button { transition: transform .2s ease, opacity .2s ease, background .2s ease; }
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px); }

.ff-pill {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.ff-pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* soft motion */
@keyframes ff-rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes ff-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(48px, -20px) scale(1.08); } }
@keyframes ff-haze { 0%, 100% { filter: blur(0); opacity: 1; } 50% { filter: blur(2px); opacity: .75; } }
@keyframes ff-nudge { 0%, 100% { translate: 0 0; } 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

.ff-rise { animation: ff-rise .6s cubic-bezier(.2,.7,.2,1) both; }
.ff-d1 { animation-delay: .06s; } .ff-d2 { animation-delay: .12s; }
.ff-hero { position: relative; }
.ff-hero > *:not(.ff-fog) { position: relative; }
.ff-fog { position: absolute; border-radius: 50%; pointer-events: none; scale: 1.35;
  -webkit-mask-image: radial-gradient(closest-side, #000, rgba(0,0,0,.45) 45%, transparent);
  mask-image: radial-gradient(closest-side, #000, rgba(0,0,0,.45) 45%, transparent); animation: ff-drift 20s ease-in-out infinite; }
.ff-fog2 { animation-duration: 27s; animation-direction: reverse; }
.ff-haze { display: inline-block; animation: ff-haze 6s ease-in-out infinite; }
.ff-nudge { animation: ff-nudge .4s ease 1; }
.ff-card { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ff-card:hover { transform: translateY(-4px); }

/* scroll reveal: things below the fold drift up softly as they come into view
   (assets/site.js adds .ff-sr to them, then .ff-in once they're on screen) */
.ff-sr {
  opacity: 0; translate: 0 22px;
  transition: opacity .8s ease, translate .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--ff-sr-delay, 0s);
}
.ff-card.ff-sr { transition: opacity .8s ease, translate .9s cubic-bezier(.2,.7,.2,1), transform .5s cubic-bezier(.2,.7,.2,1); }
.ff-sr.ff-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------
   page transitions
   the header stays put while the page drifts out like fog and the
   next one settles in. the little mark under the tab glides over
   from the previous tab (assets/nav.js).
   (chrome, edge, safari 18.2+; other browsers get a js fallback.)
--------------------------------------------------------------- */

.ff-nav a { position: relative; transition: color .35s ease, opacity .25s ease; }
@keyframes ff-glide { from { transform: translate(var(--ff-dx, 0), var(--ff-dy, 0)) scaleX(var(--ff-s, 1)); } }
.ff-mark.ff-gliding { animation: ff-glide .38s cubic-bezier(.3,.8,.2,1) both; }
.ff-mark {
  position: absolute; left: 14px; right: 14px; bottom: 6px;
  height: 2px; border-radius: 2px; background: var(--fernLogo);
}
.ff-nav a:not([aria-current])::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px;
  height: 2px; border-radius: 2px; background: var(--line);
  transform: scaleX(0); transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.ff-nav a:not([aria-current]):hover::after { transform: scaleX(1); }

.ff-page { view-transition-name: page; }

@view-transition { navigation: auto; }

@keyframes ff-fog-out { to { opacity: 0; filter: blur(6px); transform: translateY(-8px); } }
@keyframes ff-fog-in { from { opacity: 0; filter: blur(6px); transform: translateY(10px); } }

::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(page) { animation: none; }
::view-transition-old(page) { animation: ff-fog-out .18s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(page) { animation: ff-fog-in .38s cubic-bezier(.2,.7,.2,1) both; }

/* fallback for browsers without cross-page transitions */
.ff-novt .ff-page { animation: ff-fog-in .38s cubic-bezier(.2,.7,.2,1) both; }
.ff-novt.ff-leaving .ff-page { animation: ff-fog-out .14s cubic-bezier(.4,0,1,1) both; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------------------------------------------------------------
   sticky header
   follows you down the page. once you scroll, it tucks in a little
   and gets a soft misty backing so the menu stays readable.
--------------------------------------------------------------- */

.ff-header {
  position: sticky; top: 0; z-index: 50;
  transition: padding .4s cubic-bezier(.2,.7,.2,1);
}
.ff-header::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0;
  left: 50%; width: 100vw; transform: translateX(-50%);
  background: rgba(251, 251, 249, .9);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 1px 0 rgba(201, 204, 199, .55);
  opacity: 0; transition: opacity .35s ease;
  pointer-events: none;
}
.ff-header.ff-scrolled { padding-top: 14px !important; padding-bottom: 14px !important; }
.ff-header.ff-scrolled::before { opacity: 1; }
.ff-header.ff-instant, .ff-header.ff-instant::before { transition: none !important; }

/* small screens: keep the header compact so it doesn't eat the page */
@media (max-width: 600px) {
  .ff-header { row-gap: 0 !important; padding-top: 16px !important; padding-bottom: 8px !important; }
  .ff-header.ff-scrolled { padding-top: 8px !important; padding-bottom: 4px !important; }
  .ff-nav { gap: 0 !important; margin-left: -9px; font-size: 15px !important; }
  .ff-nav a { padding: 12px 9px !important; }
  .ff-mark, .ff-nav a:not([aria-current])::after { left: 9px; right: 9px; }
}

/* keep the header on top during page transitions */
.ff-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation: none; z-index: 2; }
::view-transition-old(site-header) { display: none; }
::view-transition-new(site-header) { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .ff-header, .ff-header::before { transition: none; }
}
