/* ═══ SITE CHROME — nav, footer, skip link ═══ */

.skip-link {
  position: fixed;
  top: -60px;
  left: var(--space-4);
  z-index: calc(var(--z-nav) + 1);
  padding: 0.6em 1.2em;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: top var(--dur-fast) ease;
}
.skip-link:focus { top: var(--space-4); }

/* ── Nav: floating glass bar that condenses on scroll ── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding-top: var(--space-4);
  transition: transform var(--dur-med) var(--ease-out);
}
/* Compact pill — narrower than the page container */
.nav .container { width: min(920px, 100% - 2 * var(--gutter)); }
.nav.is-hidden { transform: translateY(-110%); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: background-color var(--dur-med) ease, border-color var(--dur-med) ease,
              box-shadow var(--dur-med) ease, backdrop-filter var(--dur-med) ease;
}
.nav.is-scrolled .nav-inner {
  background: var(--surface);
  border-color: var(--border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
}

.nav-logo {
  position: relative;
  z-index: calc(var(--z-nav) + 1); /* stay above .nav-links when the mobile menu overlay is open */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}
.nav-logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--aurora);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
}
.nav-links a {
  position: relative;
  color: var(--text-secondary);
  transition: color var(--dur-fast) ease;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--aurora);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-med) var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Fixed off-white pill, regardless of theme — a consistent brand CTA
   rather than one that fades into a light-theme background. Elevation
   (shadow) does the separating work instead of color contrast alone. */
.nav-links .nav-cta {
  padding: 0.55em 1.3em;
  border-radius: var(--radius-full);
  background: #f2efe6;
  color: #14161f;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease;
}
.nav-links .nav-cta::after { display: none; }
.nav-links .nav-cta:hover {
  color: #14161f;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22), var(--glow-accent);
}

/* Positioned + raised above .nav-links so the burger/close icon stays
   visible and clickable while the mobile menu overlay is open (the
   overlay covers the full viewport via inset:0, including this strip). */
.nav-actions {
  position: relative;
  z-index: calc(var(--z-nav) + 1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--accent); transform: rotate(15deg); }
:root[data-theme='dark'] .icon-moon { display: none; }
:root[data-theme='light'] .icon-sun { display: none; }

.nav-burger { display: none; }

@media (max-width: 780px) {
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-6);
    font-size: var(--text-lg);
    background: var(--bg-0);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-med) ease;
  }
  .nav.menu-open .nav-links {
    z-index: var(--z-nav); /* was left at -1 (the closed state) — page content rendered on top of the "open" overlay */
    opacity: 0.98;
    pointer-events: auto;
  }

  /* Locks body scroll while the menu is open (toggled in app.js) */
  html.nav-scroll-lock,
  html.nav-scroll-lock body { overflow: hidden; height: 100%; }

  .nav-burger {
    display: grid;
    gap: 5px;
    width: 36px;
    height: 36px;
    place-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
  }
  .nav-burger span {
    display: block;
    width: 15px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
    transition: transform var(--dur-fast) ease;
  }
  .nav.menu-open .nav-burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.menu-open .nav-burger span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }
}

/* ── Footer ── */

.footer {
  position: relative;
  margin-top: var(--space-8);
  background: var(--bg-1);
  overflow: hidden;
}
/* Glowing aurora hairline instead of a flat border */
.footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--aurora);
  opacity: 0.85;
}
.footer::after {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  translate: -50% 0;
  width: min(900px, 92%);
  height: 200px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--flare) 14%, transparent), transparent);
  pointer-events: none;
}
.footer-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  padding-block: var(--space-7);
}
.footer-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.footer-tag { margin-top: var(--space-2); max-width: 320px; font-size: var(--text-sm); }
.footer-links,
.footer-explore {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}
.footer-links a,
.footer-explore a {
  position: relative;
  width: fit-content;
  color: var(--text-secondary);
  transition: color var(--dur-fast) ease, padding-left var(--dur-fast) var(--ease-out);
}
.footer-links a::before,
.footer-explore a::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: var(--accent);
  transform: translateY(-50%) scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-fast) var(--ease-out);
}
.footer-links a:hover,
.footer-explore a:hover { color: var(--accent); padding-left: 14px; }
.footer-links a:hover::before,
.footer-explore a:hover::before { transform: translateY(-50%) scaleX(1); }
.footer-col-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
@media (min-width: 700px) {
  .footer-explore { padding-left: var(--space-6); border-left: 1px solid var(--border); }
}
.footer-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-block: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.footer-mono { font-family: var(--font-mono); }
.footer-heart { color: var(--flare); }

/* ── Back-to-top ── */

.back-to-top {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--z-nav);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) ease, visibility var(--dur-fast) ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--accent); box-shadow: var(--glow-accent); transform: translateY(-3px); }
@media (max-width: 640px) {
  .back-to-top { right: var(--space-4); bottom: var(--space-4); width: 40px; height: 40px; }
}

/* ── Command palette ── */

.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh var(--gutter) 0;
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  backdrop-filter: blur(6px);
}
.palette-overlay.is-open { display: flex; }

.palette {
  width: min(560px, 100%);
  overflow: hidden;
  animation: palette-in 0.22s var(--ease-out);
}
@keyframes palette-in {
  from { transform: translateY(-14px) scale(0.98); opacity: 0; }
}

.palette-input {
  width: 100%;
  font: inherit;
  font-size: var(--text-md);
  color: var(--text-primary);
  padding: var(--space-4) var(--space-5);
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.palette-input:focus { outline: none; }

.palette-results {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-2);
}
.palette-results li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}
.palette-results li:hover,
.palette-results li.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text-primary);
}
.palette-type {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  min-width: 52px;
}
.palette-empty { color: var(--text-muted); cursor: default; }
.palette-hint {
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Scroll progress bar ── */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-nav) + 1);
  height: 2.5px;
  background: var(--aurora);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ── Outlined name marquee (pre-footer) ── */

.name-marquee {
  overflow: hidden;
  padding-block: var(--space-6);
  border-top: 1px solid var(--border);
}
.name-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
  font-family: var(--font-condensed);
  font-size: clamp(4.5rem, 3rem + 8vw, 10rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--text-muted) 45%, transparent);
  white-space: nowrap;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  .name-marquee-track { animation: none; }
}

/* ── Footer socials strip: ruled cells ── */

.footer-socials-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border-block: 1px solid var(--border);
}
.footer-social-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: background-color var(--dur-fast) ease;
}
.footer-social-cell:last-child { border-right: none; }
.footer-social-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, color-mix(in srgb, var(--flare) 10%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.footer-social-cell:hover::before { opacity: 1; }
.footer-social-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}
.footer-social-icon svg { display: block; }
.footer-social-cell:hover .footer-social-icon { color: var(--accent); transform: translateY(-2px) scale(1.08); }
.footer-social-text { position: relative; display: flex; flex-direction: column; gap: 4px; }
.footer-social-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.footer-social-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  transition: color var(--dur-fast) ease;
}
.footer-social-cell:hover .footer-social-value { color: var(--accent); }
.footer-social-go {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--text-muted);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.footer-social-cell:hover .footer-social-go { opacity: 1; transform: translate(0, 0); color: var(--accent); }

/* ── Footer v2: CTA block + brand ── */

.footer-cta {
  text-align: center;
  padding-block: var(--space-9) var(--space-8);
}
.footer-cta-title {
  font-size: clamp(3rem, 2rem + 5.5vw, 6.5rem);
  color: var(--text-primary);
  margin-top: var(--space-4);
}
.footer-cta-sub {
  margin: var(--space-4) auto var(--space-6);
  max-width: 420px;
  color: var(--text-secondary);
}

.footer .name-marquee { border-block: 1px solid var(--border); }

.footer-brand { max-width: 300px; }
.footer-logo { border-radius: 10px; margin-bottom: var(--space-3); box-shadow: 0 0 0 1px var(--border); }
