/* ==========================================================================
   Gumdrop Workflows — layout.css
   The site shell: ambient background field, navigation, footer.
   Every page includes this after base.css.
   ========================================================================== */

/* ==========================================================================
   Ambient background field (fixed, sits behind all content)
   ========================================================================== */

.field {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background: var(--ink);
}

/* Faint technical grid that drifts upward forever */
.field__grid {
  position: absolute;
  inset: -50% -10%;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 22%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 22%, #000 10%, transparent 72%);
  animation: grid-drift 34s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, -64px, 0); }
}

/* Soft colour orbs — slow, organic drift */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}

.orb--1 {
  width: 46vw; height: 46vw; min-width: 380px; min-height: 380px;
  top: -16vw; left: 50%;
  background: radial-gradient(circle, rgba(111, 25, 224, .85) 0%, rgba(111, 25, 224, 0) 68%);
  animation: orb-a 26s var(--ease-io) infinite;
}

.orb--2 {
  width: 34vw; height: 34vw; min-width: 300px; min-height: 300px;
  top: 6vw; left: 4vw;
  background: radial-gradient(circle, rgba(76, 111, 255, .55) 0%, rgba(76, 111, 255, 0) 70%);
  animation: orb-b 32s var(--ease-io) infinite;
}

.orb--3 {
  width: 30vw; height: 30vw; min-width: 260px; min-height: 260px;
  top: 12vw; right: 2vw;
  background: radial-gradient(circle, rgba(136, 85, 255, .48) 0%, rgba(136, 85, 255, 0) 70%);
  animation: orb-c 29s var(--ease-io) infinite;
}

@keyframes orb-a {
  0%, 100% { transform: translate(-50%, 0) scale(1); }
  50%      { transform: translate(-46%, 5vh) scale(1.14); }
}
@keyframes orb-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(7vw, 6vh) scale(1.2); }
}
@keyframes orb-c {
  0%, 100% { transform: translate(0, 0) scale(1.08); }
  50%      { transform: translate(-6vw, 8vh) scale(.9); }
}

/* Cursor spotlight — position fed by main.js */
.field__spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    620px circle at var(--px, 50%) var(--py, 0%),
    rgba(136, 85, 255, .085),
    transparent 62%
  );
  transition: opacity .5s var(--ease);
}

/* Fine noise to kill gradient banding */
.field__noise {
  position: absolute;
  inset: 0;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              backdrop-filter var(--t-med) var(--ease),
              height var(--t-med) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-stuck {
  height: 66px;
  background: rgba(10, 1, 23, .72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line);
}

/* Reading-progress hairline pinned to the bottom of the bar */
.nav__progress {
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: var(--grad-brand);
  box-shadow: 0 0 12px 1px rgba(136, 85, 255, .8);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.nav.is-stuck .nav__progress { opacity: 1; }

/* Three tracks with equal, flexible outer columns. `space-between` would put
   the link pill at the midpoint of the *leftover* space, which drifts off
   page-centre because the brand and the CTA aren't the same width — this keeps
   the pill on the same axis as the hero headline. */
.nav__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.nav__inner > * { min-width: 0; }

/* --- Brand --- */
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.03rem;
  letter-spacing: -.03em;
  transition: opacity var(--t-fast) var(--ease);
}
.brand:hover { opacity: .82; }

.brand__mark {
  width: 34px; height: 34px;
  flex: none;
  transition: transform var(--t-med) var(--ease), filter var(--t-med) var(--ease);
}
.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
  filter: drop-shadow(0 0 12px rgba(136, 85, 255, .8));
}

/* The wordmark collapses to nothing rather than being toggled with `display`,
   so the lockup animates down to just the mark instead of snapping. The
   negative margin swallows the flex gap once the width hits zero. */
.brand__name {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  margin-left: -.6rem;
  transition: max-width .5s var(--ease),
              opacity .28s var(--ease),
              margin-left .5s var(--ease);
}

@media (min-width: 420px) {
  .brand__name { max-width: 14em; opacity: 1; margin-left: 0; }

  /* Past the hero: mark only, everything else in the bar stays put. */
  .nav.is-compact .brand__name {
    max-width: 0;
    opacity: 0;
    margin-left: -.6rem;
  }
}

/* --- Centre link pill --- */
.nav__links {
  justify-self: center;
  display: none;
  align-items: center;
  gap: .18rem;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .035);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (min-width: 1040px) { .nav__links { display: flex; } }

.nav__link {
  position: relative;
  font-family: var(--font-ui);
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-2);
  padding: .5rem 1.02rem;
  border-radius: var(--r-pill);
  transition: color var(--t-fast) var(--ease);
  z-index: 1;
}
.nav__link:hover { color: #fff; }

.nav__link.is-active { color: #fff; }
.nav__link.is-active::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: var(--r-pill);
  background: rgba(136, 85, 255, .18);
  border: 1px solid rgba(136, 85, 255, .32);
}

.nav__right { justify-self: end; display: flex; align-items: center; gap: .6rem; }
.nav__cta { display: none; }
@media (min-width: 560px) { .nav__cta { display: inline-flex; } }

/* --- Hamburger --- */
.burger {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--glass);
  backdrop-filter: blur(12px);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.burger:hover { border-color: var(--line-hot); background: var(--glass-2); }
@media (min-width: 1040px) { .burger { display: none; } }

.burger__box { width: 18px; height: 12px; position: relative; }
.burger__box span {
  position: absolute; left: 0;
  width: 100%; height: 1.6px;
  border-radius: 2px;
  background: #fff;
  transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}
.burger__box span:nth-child(1) { top: 0; }
.burger__box span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.burger__box span:nth-child(3) { bottom: 0; }

.burger[aria-expanded="true"] .burger__box span:nth-child(1) { transform: translateY(5.2px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__box span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__box span:nth-child(3) { transform: translateY(-5.2px) rotate(-45deg); }

/* --- Mobile drawer --- */
.drawer {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  z-index: 89;
  padding: 1.1rem var(--gutter) 1.6rem;
  background: rgba(9, 1, 20, .96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease),
              visibility var(--t-med);
}
.drawer.is-open { opacity: 1; transform: none; visibility: visible; }
@media (min-width: 1040px) { .drawer { display: none; } }

.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -.025em;
  padding: .82rem .25rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  transition: color var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}
.drawer__link:hover { color: #fff; padding-left: .7rem; }
.drawer__link span { color: var(--violet-soft); font-size: .95rem; }

.drawer__cta { margin-top: 1.35rem; }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  position: relative;
  overflow: hidden;              /* contains the oversized wordmark */
  padding-top: clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 130% at 50% 0%, rgba(111, 25, 224, .17), transparent 62%),
    var(--ink);
}

.footer__grid {
  display: grid;
  gap: 2.75rem 2rem;
  grid-template-columns: 1fr;
  padding-bottom: 3rem;
}

@media (min-width: 700px)  { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer__grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 2rem 2.5rem; } }

.footer__blurb {
  color: var(--text-3);
  font-size: var(--fs-sm);
  max-width: 33ch;
  margin: 1rem 0 1.5rem;
}

.footer__title {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 1.1rem;
}

.footer__list { display: flex; flex-direction: column; gap: .72rem; }

.footer__list a {
  position: relative;
  font-size: var(--fs-sm);
  color: var(--text-3);
  width: fit-content;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.footer__list a:hover { color: #fff; transform: translateX(4px); }

.socials { display: flex; gap: .5rem; }

.social {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--glass);
  color: var(--text-3);
  transition: all var(--t-med) var(--ease);
}
.social:hover {
  color: #fff;
  border-color: var(--line-hot);
  background: rgba(136, 85, 255, .15);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px rgba(136, 85, 255, .9);
}
.social svg { width: 17px; height: 17px; }

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-4);
}

/* Back to top */
.to-top {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text-3);
  transition: all var(--t-med) var(--ease);
}
.to-top:hover {
  color: #fff;
  border-color: var(--line-hot);
  background: rgba(136, 85, 255, .15);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px rgba(136, 85, 255, .9);
}
.to-top svg { width: 16px; height: 16px; }
.to-top:hover svg { animation: nudge-up .55s var(--ease); }

@keyframes nudge-up {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

/* Oversized wordmark bleeding off the bottom edge */
.footer__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  /* Sized so the full lockup fits the shell at every width — the string
     measures ~8.35em in Rethink Sans 700 at this tracking. */
  font-size: min(10.4vw, 8.3rem);
  line-height: .8;
  letter-spacing: -.05em;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, 0) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  pointer-events: none;
  margin-bottom: -.12em;
  padding-top: 1rem;
}
