/* ════════════════════════════════════════════════════════════════
   AFTERLUMA — Nav
   Uses the same tokens as home-page.css (--af-paper/--af-ink/etc).
   Kept in a separate file since the nav is site-wide.
   ════════════════════════════════════════════════════════════════ */

.af-nav {
  position: sticky;
  top: 0;
  z-index: 700;
  background: var(--af-paper);
  border-bottom: 1px solid var(--af-rule);
}

.af-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.af-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.af-nav-logo-mark {
  flex-shrink: 0;
}

.af-nav-logo-word {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: lowercase;
  color: var(--af-ink);
}

.af-nav-logo-word span {
  color: var(--af-accent);
}

.af-nav-links {
  display: none;
  align-items: center;
  gap: 4px;
}

.af-nav-links a {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--af-ink);
  padding: 8px 12px;
  position: relative;
}

.af-nav-links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 1px;
  background: var(--af-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

.af-nav-links a:hover::after,
.af-nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.af-nav-admin {
  color: var(--af-accent) !important;
}

.af-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.af-frame-counter {
  display: none;
  font-size: 11px;
  color: var(--af-grey);
  min-width: 54px;
}

.af-nav-login,
.af-nav-logout button {
  display: none;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--af-ink);
  background: none;
  border: 1px solid var(--af-rule);
  padding: 8px 14px;
  cursor: pointer;
}

.af-nav-login:hover,
.af-nav-logout button:hover {
  border-color: var(--af-accent);
  color: var(--af-accent);
}

.af-nav-logout {
  margin: 0;
}

/* ─── Aperture-dial language switch (signature element) ─────────── */
.af-lang-dial {
  position: relative;
}

.af-lang-dial-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.af-iris {
  transform-origin: 20px 20px;
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* rotate the iris to point at the active language */
.af-lang-dial[data-current="en"] .af-iris { transform: rotate(0deg); }
.af-lang-dial[data-current="ro"] .af-iris { transform: rotate(120deg); }
.af-lang-dial[data-current="it"] .af-iris { transform: rotate(240deg); }

.af-lang-current {
  font-size: 11px;
  color: var(--af-grey);
}

.af-lang-options {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 150px;
  background: var(--af-paper);
  border: 1px solid var(--af-rule);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.af-lang-dial.open .af-lang-options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.af-lang-options a {
  display: block;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-decoration: none;
  color: var(--af-ink);
}

.af-lang-options a:hover,
.af-lang-options a:focus-visible {
  background: var(--af-ink);
  color: var(--af-paper);
}

/* ─── Mobile menu button (reuses the hamburger-morph pattern) ────── */
.af-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--af-rule);
  color: var(--af-ink);
  cursor: pointer;
}

.af-line-top,
.af-line-mid,
.af-line-bottom {
  transition: transform .3s ease, opacity .3s ease;
  transform-origin: center;
}

.af-menu-btn[aria-expanded="true"] .af-line-top { transform: translateY(5px) rotate(45deg); }
.af-menu-btn[aria-expanded="true"] .af-line-mid { opacity: 0; }
.af-menu-btn[aria-expanded="true"] .af-line-bottom { transform: translateY(-5px) rotate(-45deg); }

/* ─── Mobile overlay — reads as a contents/index page ────────────── */
.af-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--af-paper);
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .3s ease, transform .3s ease;
  overflow-y: auto;
}

.af-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.af-menu-index {
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-menu-index li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  border-top: 1px solid var(--af-rule);
  padding: 18px 0;
}

.af-menu-index li:last-child {
  border-bottom: 1px solid var(--af-rule);
}

.af-menu-index span {
  color: var(--af-accent);
  font-size: 12px;
  flex-shrink: 0;
}

.af-menu-index a {
  text-decoration: none;
  color: var(--af-ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
}

.af-menu-footer {
  margin-top: 30px;
  padding: 20px 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.af-menu-lang {
  display: flex;
  gap: 4px;
}

.af-menu-lang a {
  text-decoration: none;
  color: var(--af-grey);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  border: 1px solid var(--af-rule);
  padding: 8px 12px;
}

.af-menu-lang a[data-active="true"] {
  color: var(--af-paper);
  background: var(--af-ink);
  border-color: var(--af-ink);
}

.af-menu-footer > a,
.af-menu-footer button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--af-ink);
  background: none;
  border: 1px solid var(--af-rule);
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
}

/* ─── Breakpoints ─────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .af-nav-links { display: flex; }
  .af-frame-counter { display: inline-block; }
  .af-nav-login,
  .af-nav-logout button { display: inline-flex; }
  .af-menu-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .af-iris,
  .af-menu-overlay,
  .af-line-top, .af-line-mid, .af-line-bottom {
    transition: none;
  }
}
