/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 22px clamp(20px, 4vw, 64px);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--fg, #f2efe8);
  gap: 24px;
}

/* ── LOGO ──────────────────────────────────────────────────── */
.logo {
  position: relative;
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: 33px;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
}
.logo-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  position: relative;
  flex-shrink: 0;
  transform: rotate(-12deg);
  transition: transform 320ms cubic-bezier(.7,0,.2,1);
}
.logo-emblem img {
  width: 100%; height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.logo:hover .logo-emblem { transform: rotate(0deg) scale(1.05); }
.logo.popping {
  /* per-pop transform applied via Web Animations API on .logo */
  will-change: transform;
}

.logo-wordmark {
  display: inline-flex;
  line-height: 1;
  padding-bottom: 0.06em;
}
.logo-text-hot { color: #FFBE25; }
.logo-text-doc { color: var(--fg); }

/* popcorn burst clones */
.logo-burst {
  position: fixed;
  pointer-events: none;
  width: 38px; height: 38px;
  z-index: 10001;
  will-change: transform, opacity;
}
.logo-burst img {
  width: 100%; height: 100%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45));
}
.logo-burst {
  animation: pop-fly var(--dur, 1100ms) linear forwards;
}
@keyframes pop-fly {
  0%   { transform: translate(0, 0) rotate(var(--r0, 0deg)) scale(0.55); opacity: 0; }
  4%   { transform: translate(calc(var(--tx-end) * 0.04), calc(var(--peak) * 0.32)) rotate(calc(var(--r0, 0deg) + 25deg)) scale(0.95); opacity: 1; }
  20%  { transform: translate(calc(var(--tx-end) * 0.20), calc(var(--peak) * 0.85)) rotate(calc(var(--r0, 0deg) + 90deg)) scale(1); opacity: 1; }
  40%  { transform: translate(calc(var(--tx-end) * 0.40), var(--peak)) rotate(calc(var(--r0, 0deg) + 160deg)) scale(1); opacity: 1; }
  60%  { transform: translate(calc(var(--tx-end) * 0.60), calc(var(--peak) * 0.55 + var(--drop) * 0.18)) rotate(calc(var(--r0, 0deg) + 230deg)) scale(1); opacity: 1; }
  78%  { transform: translate(calc(var(--tx-end) * 0.78), calc(var(--drop) * 0.55)) rotate(calc(var(--r0, 0deg) + 300deg)) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx-end), var(--drop)) rotate(calc(var(--r0, 0deg) + 380deg)) scale(1); opacity: 1; }
}

/* ── NAV ───────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-left: auto;
  margin-right: 24px;
}
.nav-link {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--fg-dim);
  letter-spacing: 0.03em;
  text-transform: lowercase;
  transition: color 220ms;
}
.nav-link:hover { color: var(--fg); }
@media (max-width: 900px) {
  .site-nav { display: none; }
}

/* ── HEADER CTA ────────────────────────────────────────────── */
.header-cta {
  font-family: var(--mono);
  font-size: 21px;
  text-decoration: none;
  color: inherit;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  transition: gap 280ms cubic-bezier(.7,0,.2,1), color 280ms, border-color 280ms;
  line-height: 1;
}
.header-cta::after { content: "→"; transition: transform 280ms cubic-bezier(.7,0,.2,1); }
.header-cta:hover { gap: 18px; color: var(--accent); border-color: var(--accent); }

/* ── SHARED CONTAINER (used by header/footer + page bodies) ──── */
.wrap {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  padding: 56px 0 40px;
  font-family: var(--grotesk);
  color: var(--fg-dim);
  line-height: 1.0;
  text-align: left;
}
.footer-links a, .footer-copy, .footer-sep { line-height: 1.1; }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px 32px;
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  align-items: baseline;
}
.footer-links a, .footer-copy {
  font-family: var(--grotesk);
  font-weight: 400;
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.005em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 220ms, border-color 220ms;
}
.footer-links a:hover { color: var(--accent); border-color: var(--accent); }
.footer-sep { color: var(--fg-faint); font-size: 18px; }
.footer-copy { border-bottom: none; }
.footer-copy a.footer-ksg-link {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--fg-faint);
  padding-bottom: 1px;
  transition: color 220ms, border-color 220ms;
}
.footer-copy a.footer-ksg-link:hover { color: var(--accent); border-color: var(--accent); }
.footer-legal {
  margin-top: 11px;
  font-size: 18px;
  color: var(--fg-dim);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.footer-legal a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 220ms, border-color 220ms;
}
.footer-legal a:hover { color: var(--accent); border-color: var(--accent); }
.footer-legal .dot { color: var(--fg-faint); margin: 0 8px; }
.grain-footer-fade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%);
}
@media (max-width: 720px) {
  .footer-top { flex-direction: column; align-items: flex-start; }
  .site-header { padding: 16px clamp(18px, 4vw, 32px); }
  .logo { font-size: 26px; gap: 10px; }
  .logo-emblem { width: 30px; height: 30px; }
  .header-cta { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-emblem, .header-cta { transition-duration: 0.01ms !important; }
  .logo-burst { display: none !important; }
}
