/* ============================================================
   Landing page — name + nav centered; they slide to the edges
   (matching every other page) when you navigate.
   ============================================================ */

:root {
  --bg: #000000;
  --fg: #ffffff;
  /* mix-blend-difference chrome source (bar, space overlays) */
  --ink: #ffffff;
  --font-sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --fs-body: clamp(15px, 1.9vw, 18px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important;  /* always the custom + — never pointer/text/others */
}

/* Custom cursor: a "+" that inverts against the page, rotating into an "×"
   over anything clickable. */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}
.cursor__inner {
  position: absolute;
  inset: 0;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cursor__inner::before,
.cursor__inner::after {
  content: "";
  position: absolute;
  background: #fff;
}
.cursor__inner::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.cursor__inner::after  { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }
.cursor.is-x .cursor__inner { transform: rotate(45deg); }

html,
body {
  height: 100%;
}

/* Theme colour on the root too, so safe-area / overscroll strips show the page
   colour rather than a black band. */
html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  letter-spacing: -0.015em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  /* `clip` (not `hidden`): clips overflow WITHOUT making the root a scroll container.
     A non-scrollable `overflow: hidden` root makes iOS keep the fixed background out of
     the status-bar / toolbar safe areas (the black bands); `clip` lets it fill. */
  overflow: clip;
}

/* Cross-fading blurred backgrounds */
.bg {
  position: fixed;
  inset: -15vmax;                 /* oversize so the blur has no hard edges */
  z-index: 0;
  pointer-events: none;
}

.bg__layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(80px) saturate(1.15);    /* soft, even blur — a touch lighter than before */
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 1.6s ease;
}

.bg__layer.is-visible {
  opacity: 0.6;
}

/* The GiuLLM cover is a wordmark, not a photo — blur it a lot less so "Ask GiuLLM"
   stays readable as a background. */
.bg__layer--soft { filter: blur(48px) saturate(1.15); }

.bar {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 1;                       /* above the blurred backgrounds */
  display: flex;
  align-items: center;
  justify-content: center;          /* centered cluster (landing) */
  gap: clamp(20px, 3vw, 48px);
  padding-inline: clamp(20px, 2.2vw, 36px);
  font-size: var(--fs-body);
  mix-blend-mode: difference;
}

/* Spread state — logo to the left edge, nav to the right (every other page) */
.bar.spread {
  justify-content: space-between;
}

.logo {
  color: var(--ink);   /* inside the mix-blend-difference bar */
  text-decoration: none;
  letter-spacing: -0.015em;
  font-weight: 400;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: clamp(20px, 3vw, 48px);
}

.nav__link {
  color: var(--ink);   /* inside the mix-blend-difference bar */
  text-decoration: none;
  font-weight: 400;
  white-space: nowrap;
}

/* ---- Mobile ---- */
@media (max-width: 760px) {
  /* Stack the name + nav vertically. One identical gap everywhere — between
     GiuliaRinaldo and Index, and between each page name. */
  .bar {
    flex-direction: column;
    gap: clamp(22px, 4.6vh, 36px);
  }
  .nav {
    flex-direction: column;
    align-items: center;
    gap: clamp(22px, 4.6vh, 36px);
  }

  /* No text animation on mobile — the names are simply there (the desktop landing
     keeps its centre→edges FLIP). */
  .bar .logo,
  .bar .nav__link,
  .bar.is-in .logo,
  .bar.is-in .nav__link {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

::selection { background: var(--fg); color: var(--bg); }
::-moz-selection { background: var(--fg); color: var(--bg); }

@media (max-width: 760px) {
  :root { --fs-body: clamp(17px, 4.8vw, 20px); }
}
