/* ==========================================================================
   Header: sticky bar with monogram, navigation, profile icons, theme toggle
   ========================================================================== */

.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; }

/* logo (assets/images/icons/logo.svg, inlined): "MA" as one flowing two-peaked shape with a lime
   star in the A, on a black tile. Its colours are fixed, so it looks the same in both themes; the
   hairline ring keeps the tile's edge visible on the dark page. The star pops in on load and
   turns on hover. */
.mark { flex: none; display: block; width: 38px; height: 38px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); transition: scale .45s var(--ease); }
.mark svg { display: block; width: 100%; height: 100%; }
.mark .logo-star { transform-box: fill-box; transform-origin: center; animation: logo-star-in .9s var(--ease) .45s backwards; transition: transform .7s var(--ease); }
.mark:hover .logo-star, .mark:focus-visible .logo-star { transform: rotate(180deg) scale(1.12); }
.mark:active { scale: .92; }
@keyframes logo-star-in { from { transform: scale(0) rotate(-90deg); } }

.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; position: relative; font-size: .9375rem; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.theme-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink);
  transition: transform .6s var(--ease), border-color .3s;
}
.theme-btn:hover { transform: rotate(180deg); border-color: var(--ink-soft); }
.theme-btn svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .nav { gap: 14px; }
}

/* GitHub / LinkedIn icons: compact to match the theme button; hidden on phones,
   where the hero and contact section carry them instead */
.social-top { gap: 6px; }
.social-top .icon-link { width: 34px; height: 34px; border-color: var(--line); background: transparent; }
.social-top .icon-link svg { width: 15px; height: 15px; }
@media (max-width: 560px) { .social-top { display: none; } }
