/* Shared by every page: the corner links, so they sit at exactly the same place
   everywhere. The fonts are in fonts.css (built by build-site.py), loaded without blocking
   the page. Edit this file, then run: python3 build-site.py */


:root {
  --side: 3.6vw;        /* left / right margin of the links */
  --top: 2.1vw;         /* top margin of the links */
  --bottom: 2.6vw;      /* bottom margin of the links */
  --nav-size: clamp(11px, 1vw, 21px);
  --band-top: calc(var(--top) * 2 + var(--nav-size));
  --band-bottom: calc(var(--bottom) * 2 + var(--nav-size));
}

@media (max-width: 640px), (max-aspect-ratio: 1/1) {
  :root {
    --side: 20px;
    --top: 20px;
    --bottom: 24px;
  }
}

/* Three links along the top and the language switch bottom right, always above everything. */
.nav a {
  position: fixed;
  z-index: 30;
  color: #fff;
  font-family: "Unbounded", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--nav-size);
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.35s ease;
}
.nav a:hover, .nav a:focus-visible { opacity: 0.5; outline: none; }
.nav .home    { top: var(--top); left: var(--side); }
.nav .about   { top: var(--top); right: var(--side); }
.nav .index   { top: var(--top); left: 50%; transform: translateX(-50%); }
.nav .mail    { bottom: var(--bottom); left: var(--side); font-weight: 400; }


/* Language switch: the current language in regular, the other one in light. */
.nav .lang {
  position: fixed;
  z-index: 30;
  bottom: var(--bottom);
  right: var(--side);
  display: flex;
  gap: 0.55em;
  font-family: "Unbounded", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--nav-size);
  line-height: 1;
  letter-spacing: 0.01em;
}
.nav .lang button {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-weight: 300;
  letter-spacing: inherit;
  cursor: pointer;
  transition: opacity 0.35s ease;
}
.nav .lang button.is-current { font-weight: 400; }
.nav .lang button:hover { opacity: 0.5; }
.nav a:focus-visible, .nav .lang button:focus-visible { opacity: 1; outline: 1px solid #fff; outline-offset: 4px; }

/* Phones: Project, About and the language switch move into a full-screen menu (menu.js),
   opened by three thin lines top right. The black opens from its centre line, like the
   images; the words come in just after, very large and tight. */
.nav .menu-toggle { display: none; }
@media (max-width: 640px) {
  .nav .menu-toggle {
    display: block;
    position: fixed;
    z-index: 32;
    top: calc(var(--top) - 8px);
    right: calc(var(--side) - 6px);
    width: 34px;
    height: 28px;
    padding: 8px 6px;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    height: 1.5px;
    margin-bottom: 3.75px;
    background: #fff;
    transition: transform 0.35s ease, opacity 0.35s ease;
  }
  .nav.is-open .menu-toggle span:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
  .nav.is-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .menu-toggle span:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }
  .nav .menu-toggle:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }

  .nav::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 31;
    background: #000;
    clip-path: inset(0 50% 0 50%);
    transition: clip-path 0.4s cubic-bezier(0.77, 0, 0.18, 1);
    pointer-events: none;
  }
  .nav.is-open::before { clip-path: inset(0); pointer-events: auto; }
  .nav .home { font-size: 16px; }
  .nav.is-open .home { z-index: 32; }

  .nav .index, .nav .about, .nav .lang {
    left: var(--side);
    right: auto;
    transform: none;
    z-index: 32;
    font-size: clamp(20px, 6vw, 30px);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .nav .index { top: calc(var(--band-top) + 28px); bottom: auto; }
  .nav .about { top: calc(var(--band-top) + 28px + 1.6em); }
  .nav .lang  { top: auto; bottom: var(--bottom); gap: 0.35em; flex-direction: row-reverse; }
  .nav .lang button { font-weight: 250; }
  .nav .lang button.is-current { font-weight: 500; }
  .nav.is-open .index, .nav.is-open .about, .nav.is-open .lang {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease 0.12s, visibility 0s;
  }
  html.menu-open { overflow: hidden; }
  /* A tap is never held back waiting for a possible double-tap zoom. */
  .nav a, .nav button { touch-action: manipulation; }
  /* No hover dimming on phones: after a tap it would stay stuck on the link. */
  .nav a:hover, .nav .lang button:hover { opacity: 1; }
}

/* Scrolling pages: black bands behind the links, so content scrolls under them. */
.bands::before,
.bands::after {
  content: "";
  position: fixed;
  z-index: 29;
  left: 0;
  right: 0;
  background: #000;
  pointer-events: none;
}
.bands::before { top: 0; height: var(--band-top); }
.bands::after { bottom: 0; height: var(--band-bottom); }

/* Scrolling pages never show a scrollbar, so nothing shifts between pages. */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* A page shown inside the home page's panel: the home page's links stay on top,
   so this page's own links are hidden (the bands stay). */
.embedded .nav { display: none; }

/* Read by search engines and screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Coming from the other language: black until the page has opened its own cover. */
html.arriving::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 27;
  background: #000;
}
