/* ─────────────────────────────────────────────────────────────────────────
 * polish.css — sitewide UI refinement layer.
 * Inspired by Active Theory, Linear, Vercel, Stripe, Instrument, Ueno.
 * Loaded LAST so it can refine without rewriting existing styles.
 * ───────────────────────────────────────────────────────────────────────── */

/* ── Cursor spotlight follower (subtle, premium) ─────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mx, -200px) var(--my, -200px),
    rgba(212, 175, 55, .055),
    transparent 40%
  );
  transition: background .12s linear;
  mix-blend-mode: screen;
  opacity: .8;
}
@media (max-width: 768px) {
  body::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* ── Refined link underlines (sitewide) ──────────────────────────────────── */
.nav__link {
  position: relative;
  transition: color .25s ease;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  opacity: .6;
  transition: right .35s cubic-bezier(.16, 1, .3, 1);
}
.nav__link:hover::after,
.nav__link.active::after { right: 0; }

/* ── Buttons: refined microinteraction + better focus ────────────────────── */
.btn, .nav__cta {
  position: relative;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .35s ease, background .25s ease;
  letter-spacing: .04em;
}
.btn:hover, .nav__cta:hover { transform: translateY(-1px); }
.btn:active, .nav__cta:active { transform: translateY(0); }
.btn:focus-visible, .nav__cta:focus-visible {
  outline: 2px solid var(--accent, #d4af37);
  outline-offset: 4px;
}
.btn--filled:hover {
  box-shadow:
    0 0 32px rgba(212, 175, 55, .35),
    0 0 64px rgba(212, 175, 55, .15),
    0 6px 24px -8px rgba(212, 175, 55, .4);
}
/* Soft sheen sweep on hover */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(120%); }

/* ── Nav refinement on scroll ────────────────────────────────────────────── */
.nav.is-scrolled {
  background: rgba(10, 10, 10, .82);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

/* ── Section rhythm + smooth transitions ─────────────────────────────────── */
.section + .section { position: relative; }
.section--tight { padding: clamp(48px, 6vw, 80px) 0; }

/* ── Stats block refinement ──────────────────────────────────────────────── */
.stats-section { background: linear-gradient(180deg, transparent 0%, rgba(212,175,55,.025) 50%, transparent 100%); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, .06);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.stats-grid .stat {
  background: #0a0a0a;
  padding: 48px 24px;
  text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: background .35s ease;
}
.stats-grid .stat:hover { background: #0e0e0e; }
.stat__number {
  font-family: 'Instrument Serif', Georgia, serif !important;
  font-size: clamp(3rem, 5vw, 4.5rem) !important;
  line-height: 1 !important;
  margin: 0 !important;
}
.stat__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: rgba(245, 242, 238, .55);
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Service rows: refine typography only — leave grid to original CSS ──── */
.service-row__num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  color: var(--accent, #d4af37) !important;
  opacity: .7;
}
.service-row__title {
  font-family: 'Instrument Serif', Georgia, serif;
  letter-spacing: -.01em;
}

/* ── Featured project cards (work.html — MAA + MDN flagships) ────────────── */
.pgrid__card--feature {
  position: relative;
}
.pgrid__card--feature .pgrid__card-visual {
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, .25),
    0 30px 80px -30px rgba(212, 175, 55, .35),
    0 12px 40px -12px rgba(0, 0, 0, .6);
  transition: box-shadow .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}
.pgrid__card--feature:hover .pgrid__card-visual {
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, .55),
    0 40px 100px -25px rgba(212, 175, 55, .55),
    0 12px 40px -12px rgba(0, 0, 0, .6);
}
.pgrid__card-feature-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  padding: 6px 14px;
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: linear-gradient(135deg, #f3d56a 0%, #d4af37 50%, #b8932b 100%);
  border-radius: 999px;
  box-shadow:
    0 4px 16px -4px rgba(212, 175, 55, .5),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  pointer-events: none;
}

/* ── Ventures cards refined ──────────────────────────────────────────────── */
.ventures-card {
  position: relative;
  transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s ease, border-color .35s ease;
}
.ventures-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(212,175,55,.18);
}

/* ── Rocket: refined flame flicker + cinematic glow ──────────────────────── */
@keyframes ra-flicker-1 { 0%, 100% { transform: scaleY(1) scaleX(1); opacity: .95; } 50% { transform: scaleY(1.08) scaleX(.92); opacity: .8; } }
@keyframes ra-flicker-2 { 0%, 100% { transform: scaleY(1) scaleX(1); opacity: .9; } 50% { transform: scaleY(1.14) scaleX(.88); opacity: .75; } }
@keyframes ra-flicker-3 { 0%, 100% { transform: scaleY(1) scaleX(1); opacity: .85; } 50% { transform: scaleY(1.22) scaleX(.82); opacity: .65; } }
.rocket-arc__ship .ra-flame { transform-origin: 60px 144px; will-change: transform, opacity; }
.rocket-arc__ship.flying .ra-flame--outer { animation: ra-flicker-1 .14s ease-in-out infinite; }
.rocket-arc__ship.flying .ra-flame--inner { animation: ra-flicker-2 .10s ease-in-out infinite; }
.rocket-arc__ship.flying .ra-flame--core  { animation: ra-flicker-3 .07s ease-in-out infinite; }
.rocket-arc__ship.flying svg {
  filter: drop-shadow(0 0 8px rgba(212,175,55,.55)) drop-shadow(0 0 24px rgba(212,175,55,.25));
}
.rocket-arc__path {
  stroke: rgba(212,175,55,.5);
  stroke-width: 1.2;
  fill: none;
  filter: drop-shadow(0 0 4px rgba(212,175,55,.4));
}

/* ── Selection / scrollbar polish ────────────────────────────────────────── */
::selection { background: var(--accent, #d4af37); color: #0a0a0a; }
html { scrollbar-color: rgba(212,175,55,.4) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(212,175,55,.3), rgba(212,175,55,.55));
  border-radius: 6px;
  border: 2px solid #0a0a0a;
}
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,.7); }

/* ── Focus rings sitewide (excludes wide-row links to avoid edge artifacts) */
a:focus-visible:not(.service-row):not(.lp-faq__q):not(.industries-strip__chip),
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent, #d4af37);
  outline-offset: 3px;
  border-radius: 4px;
}
.service-row:focus-visible {
  outline: none;
  background: rgba(212, 175, 55, .04);
}

/* ── Mobile padding fix ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding-left: 24px; padding-right: 24px; }
  .section { padding: 64px 0; }
  .h1, .h2 { letter-spacing: -.015em; }
}

/* ── Subtle reveal-on-scroll improvement ─────────────────────────────────── */
.reveal {
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform 1.1s cubic-bezier(.16,1,.3,1);
}

/* ── Industries strip (used on home if present) ──────────────────────────── */
.industries-strip {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  margin-top: 32px;
}
.industries-strip__chip {
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  font-size: .82rem;
  color: rgba(245,242,238,.78);
  background: rgba(255,255,255,.02);
  transition: border-color .25s ease, color .25s ease, background .25s ease;
}
.industries-strip__chip:hover {
  border-color: rgba(212,175,55,.4);
  color: rgba(245,242,238,.98);
  background: rgba(212,175,55,.05);
}
.industries-strip__chip--cta {
  border-color: rgba(212,175,55,.5) !important;
  background: rgba(212,175,55,.08) !important;
  color: var(--accent, #d4af37) !important;
  font-weight: 500;
}
.industries-strip__chip--cta:hover {
  background: rgba(212,175,55,.18) !important;
  color: #fff !important;
}
.industries-strip__divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(212, 175, 55, .25);
  margin: 0 6px;
  align-self: center;
}

/* ── Collapsible footer columns (reduces visual length) ──────────────────── */
.footer-cluster details.footer-cluster__col {
  padding: 0;
}
.footer-cluster details.footer-cluster__col > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent, #d4af37);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, .15);
  user-select: none;
  transition: color .2s ease;
}
.footer-cluster details.footer-cluster__col > summary::-webkit-details-marker { display: none; }
.footer-cluster details.footer-cluster__col > summary::after {
  content: '+';
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent, #d4af37);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  font-weight: 400;
}
.footer-cluster details.footer-cluster__col[open] > summary::after {
  transform: rotate(45deg);
}
.footer-cluster details.footer-cluster__col > summary:hover {
  color: rgba(245, 242, 238, .95);
}
.footer-cluster details.footer-cluster__col[open] > .footer-cluster__col-body {
  animation: footerColExpand .35s cubic-bezier(.16,1,.3,1);
}
.footer-cluster__col-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,.3) transparent;
}
.footer-cluster__col-body::-webkit-scrollbar { width: 4px; }
.footer-cluster__col-body::-webkit-scrollbar-thumb { background: rgba(212,175,55,.3); border-radius: 2px; }
@keyframes footerColExpand {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.footer-cluster__count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: .58rem;
  letter-spacing: .12em;
  font-family: 'General Sans', system-ui, sans-serif;
  font-weight: 500;
  color: rgba(245, 242, 238, .6);
  background: rgba(212, 175, 55, .1);
  border-radius: 999px;
  vertical-align: middle;
}
/* On mobile, force-collapse all footer columns regardless of [open] attr */
@media (max-width: 700px) {
  .footer-cluster details.footer-cluster__col[open] > .footer-cluster__col-body {
    display: flex;
  }
  .footer-cluster details.footer-cluster__col:not([open]) > .footer-cluster__col-body {
    display: none;
  }
}

/* ── Screen-reader-only utility (for accessible h1 etc.) ─────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
