/* Header, mobile menu, navigation, desktop sidebar. Owner: Foundation. */
lore-shell, lore-sidebar { display: block; }

/* ---------- Header ---------- */
.shell-header {
  position: fixed; z-index: 20; top: 0; left: 50%;
  width: calc(388 * var(--u));
  transform: translateX(-50%);
  color: var(--c-ink);
  font-size: var(--fs-ui);
}

.menu { background: var(--c-lime); padding: calc(2 * var(--u)) calc(3 * var(--u)) 0; }

.menu__more { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.35s ease, visibility 0.35s; }
.menu__clip { min-height: 0; overflow: hidden; }
.is-open .menu__more { grid-template-rows: 1fr; visibility: visible; }

.menu__bio { margin-top: calc(10 * var(--u)); }
.menu .experience { margin-top: calc(18 * var(--u)); }
.menu .experience li { display: grid; grid-template-columns: calc(79 * var(--u)) 1fr; }
.menu__row { display: flex; justify-content: space-between; margin-top: calc(28 * var(--u)); padding-bottom: calc(6 * var(--u)); }
.menu .social { display: flex; gap: calc(6 * var(--u)); }

.menu__toggle {
  display: grid; justify-items: center; gap: calc(5 * var(--u));
  width: 100%;
  padding: calc(13 * var(--u)) 0 calc(9 * var(--u));
}
.menu__toggle i { width: calc(41 * var(--u)); height: calc(4 * var(--u)); background: #000; }

.bar {
  display: flex; justify-content: space-between; align-items: center;
  height: var(--bar-h);
  padding: 0 calc(3 * var(--u));
  background: var(--c-grey);
  font-family: var(--f-display); font-weight: 900;
}
.bar a { text-decoration: none; }
.bar__name, .bar__contact { position: relative; white-space: nowrap; }
.bar__contact { display: flex; align-items: center; gap: calc(2 * var(--u)); }
.bar__contact img { width: var(--bar-h); height: var(--bar-h); }

/* Larger touch area than the drawn bar */
.bar a::before, .shell-nav a::before { content: ""; position: absolute; inset: -12px -2px; }

/* ---------- Navigation ---------- */
.shell-nav {
  position: fixed; z-index: 20; right: calc(26 * var(--u)); bottom: 0;
  display: grid; align-items: center;
  grid-template-columns: minmax(max-content, calc(54 * var(--u))) minmax(max-content, calc(48 * var(--u))) minmax(max-content, calc(59 * var(--u)));
  height: var(--bar-h);
  padding-left: calc(10 * var(--u));
  background: var(--c-lime);
  color: var(--c-ink-strong);
  font-family: var(--f-display); font-weight: 900; font-size: var(--fs-ui);
}
.shell-nav a { position: relative; text-decoration: none; }
.shell-nav a[aria-current="page"] { color: var(--c-grey); }

/* ---------- Shared text blocks ---------- */
.languages { display: grid; grid-template-columns: calc(79 * var(--u)) auto; justify-content: start; }
.experience h2 { font: inherit; letter-spacing: inherit; margin-bottom: 0.98em; }
.social__link { text-decoration: underline; }

/* ---------- Sidebar: desktop only ---------- */
lore-sidebar { display: none; }

@media (min-width: 900px) {
  .menu { display: none; }
  .shell-header { left: var(--gutter); width: calc(764 * var(--u)); transform: none; }
  .bar { padding: 0 calc(15 * var(--u)) 0 calc(12 * var(--u)); }
  .bar__contact { gap: calc(12 * var(--u)); }

  .shell-nav {
    right: calc(66 * var(--u));
    grid-template-columns: calc(220.5 * var(--u)) calc(196 * var(--u)) calc(240.75 * var(--u));
    padding-left: calc(41 * var(--u));
  }

  lore-sidebar {
    position: fixed; z-index: 10; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 0 0 calc(16 * var(--u)) var(--gutter);
    color: var(--c-text);
    font-size: var(--fs-body);
    pointer-events: none;
  }
  lore-sidebar::after {
    content: ""; position: absolute; right: 0;
    top: calc(39 * var(--u)); bottom: calc(49 * var(--u));
    border-right: var(--line);
  }
  lore-sidebar .languages { grid-template-columns: calc(232 * var(--u)) auto; margin-bottom: calc(112 * var(--u)); }
  lore-sidebar .experience { margin-bottom: calc(149 * var(--u)); }
  lore-sidebar .experience li { display: grid; grid-template-columns: calc(232 * var(--u)) calc(304 * var(--u)) auto; justify-content: start; }
  lore-sidebar .social { color: var(--c-text-link); }
  lore-sidebar a { pointer-events: auto; }
}

/* ---------- Loading screen (Figma 127:2740) ----------
   Mobile frame only in Figma, so it keeps the mobile size on desktop too. */
/* Cover Projects until js/shell.js decides whether the loader runs. Fails open after 10 s. */
html:not(.loader-on):not(.loader-off) body[data-page="projects"]::after {
  content: ""; position: fixed; inset: 0; z-index: 100;
  background: var(--c-grey);
  animation: loader-fail-open 0s 10s forwards;
}
@keyframes loader-fail-open { to { visibility: hidden; } }
html.loader-on body { overflow: hidden; }

.loader {
  --lu: calc(min(100vw, 560px) / 440);
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--c-grey);
  transition: opacity 0.45s ease, visibility 0.45s;
}
.loader-off .loader { opacity: 0; visibility: hidden; }
.loader__box { position: relative; display: grid; place-items: center; width: calc(171 * var(--lu)); height: calc(12 * var(--lu)); }
.loader__text {
  color: var(--c-ink);
  font-family: var(--f-display); font-weight: 900; font-size: max(10px, calc(10 * var(--lu)));
  white-space: nowrap;
}
.loader__bar {
  position: absolute; inset: 0;
  background: var(--c-lime);
  transform: scaleX(0.03); transform-origin: left;
}
