/* ========================================================================
   SHARED SIDE BARS. Left site menu + right studio panel.
   Loaded on every page. Injected into DOM by js/sidebars.js.
   ======================================================================== */

@font-face {
  font-family: 'Galatea';
  src: url('./galatea-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sb-ink: #0f1a2e;
  --sb-paper: #ffffff;
  --sidebar-w: 88px;
  --side-delay: 3400ms;
  --sb-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --studio-panel-w: 33.3333vw;
  --studio-panel-dur: 520ms;
}

/* Pages without a hero skip the long intro delay so the strips appear fast. */
body:not(:has(.hero)) { --side-delay: 0ms; }

/* Reserve the horizontal gutters on both sides so content never slides
   under the fixed strips. Mobile collapses the strips to top chips. */
html, body { box-sizing: border-box; }
body {
  padding-left: var(--sidebar-w);
  padding-right: var(--sidebar-w);
}
@media (max-width: 820px) {
  body {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ============ LEFT STRIP ============ */
.hero__side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  z-index: 2000;
  background: var(--sb-paper);
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateX(-100%);
  animation: stripSlideInLeft 700ms var(--sb-ease) forwards;
  animation-delay: var(--side-delay);
  transition: background 300ms ease;
}

body:has(.site-menu[data-open="true"]) .hero__side-menu {
  z-index: 2100;
  background: transparent;
}

@keyframes stripSlideInLeft {
  from { opacity: 0; transform: translateX(-100%); }
  to   { opacity: 1; transform: translateX(0); }
}

.hero__side-menu .hero__name {
  position: absolute;
  top: 48px;
  left: 50%;
  translate: -50% 0;
}

.hero__side-menu .hero__menu-btn {
  position: absolute;
  bottom: 24px;
  left: 50%;
  translate: -50% 0;
}

.hero__name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  /* Matches .hero__menu-label. In vertical writing mode the line box width is
     the line-height, so a different value would park the two baselines on
     different vertical rules even with both boxes centred in the strip. */
  line-height: 1;
  color: var(--sb-ink);
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 200ms ease;
}

a.hero__name:hover,
a.hero__name:focus-visible { opacity: 0.6; }

.hero__menu-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--sb-ink);
}

.hero__menu-btn:focus-visible {
  outline: 2px solid var(--sb-ink);
  outline-offset: 2px;
}

.hero__menu-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--sb-ink);
  text-transform: uppercase;
}

.hero__menu-icon {
  display: block;
  width: 28px;
  height: auto;
}

/* ============ RIGHT STRIP ============ */
.studio-strip {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  z-index: 2000;
  background: var(--sb-paper);
  border-left: 1px solid rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateX(100%);
  animation: stripSlideInRight 700ms var(--sb-ease) forwards;
  animation-delay: var(--side-delay);
  transition: background 220ms ease, color 220ms ease;
}

.studio-strip:hover {
  background: var(--sb-ink);
  color: var(--sb-paper);
}

.studio-strip:hover .studio-strip__label,
.studio-strip:hover .studio-strip__arrow {
  color: var(--sb-paper);
}

@keyframes stripSlideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

.studio-strip__btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--sb-ink);
  gap: 12px;
  padding: 0;
}

.studio-strip__btn:focus-visible {
  outline: 2px solid var(--sb-ink);
  outline-offset: -4px;
}

.studio-strip__label {
  writing-mode: vertical-rl;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--sb-ink);
}

.studio-strip__arrow {
  position: absolute;
  bottom: 24px;
  left: 50%;
  translate: -50% 0;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: 18px;
  color: var(--sb-ink);
  transition: transform 200ms ease;
}

.studio-strip__btn:hover .studio-strip__arrow { transform: translateX(-4px); }

/* ============ FULL-SCREEN MENU OVERLAY ============ */
.site-menu {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(40px, 8vh, 96px) clamp(32px, 8vw, 120px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 350ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-menu[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-menu__nav {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 18px);
}

.site-menu__nav a {
  display: inline-block;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--sb-ink);
  text-decoration: none;
  transition: opacity 200ms ease, transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
  transform: translateY(16px);
}

.site-menu[data-open="true"] .site-menu__nav a {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--i, 0) * 60ms + 120ms);
}

.site-menu__nav a:hover,
.site-menu__nav a:focus-visible {
  opacity: 0.45;
  outline: none;
}

.site-menu__footer {
  position: absolute;
  bottom: clamp(24px, 4vh, 48px);
  left: clamp(32px, 8vw, 120px);
  right: clamp(32px, 8vw, 120px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #666;
}

.site-menu__footer a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms ease;
}

.site-menu__footer a:hover { color: var(--sb-ink); }

/* ============ STUDIO PANEL (RIGHT OVERLAY) ============ */
.studio-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--studio-panel-w);
  min-width: 360px;
  background: #0f1a2e;
  color: #ffffff;
  z-index: 2060;
  transform: translateX(100%);
  transition: transform var(--studio-panel-dur) cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.18);
}

.studio-panel[data-open="true"] {
  transform: translateX(0);
  /* Re-enables clicks: the boot style in js/sidebars.js sets pointer-events:none
     on this panel to kill the load flash, and nothing else turns it back on. */
  pointer-events: auto;
}

.studio-panel__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.studio-panel__close:focus-visible {
  outline: 1px solid #ffffff;
  outline-offset: 2px;
}

.studio-panel__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vh, 36px);
  padding: clamp(40px, 6vh, 72px) clamp(32px, 4vw, 56px);
  min-height: 100%;
}

.studio-panel__brand {
  margin: 0;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms ease 180ms, transform 500ms var(--sb-ease) 180ms;
}

.studio-panel__brand span {
  display: block;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 6px;
  color: #a9a9a9;
}

.studio-panel__media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #1a1a1a;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease 260ms, transform 600ms var(--sb-ease) 260ms;
}

.studio-panel__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms var(--sb-ease);
}

.studio-panel__media:hover img { transform: scale(1.03); }

.studio-panel__text {
  margin: 0;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: clamp(1.1rem, 1.4vw, 1.4rem);
  line-height: 1.4;
  color: #e9e9e9;
  max-width: 42ch;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 500ms ease 340ms, transform 500ms var(--sb-ease) 340ms;
}

.studio-panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Galatea', 'Times New Roman', serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 6px;
  width: fit-content;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 500ms ease 420ms,
    transform 500ms var(--sb-ease) 420ms,
    border-color 200ms ease,
    color 200ms ease;
}

.studio-panel__cta:hover { border-color: #ffffff; color: #ffffff; }

.studio-panel[data-open="true"] .studio-panel__brand,
.studio-panel[data-open="true"] .studio-panel__media,
.studio-panel[data-open="true"] .studio-panel__text,
.studio-panel[data-open="true"] .studio-panel__cta {
  opacity: 1;
  transform: translateY(0);
}

/* ============ SCRIM ============ */
.overlay-scrim {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 2055;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.overlay-scrim[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

/* ============ MOBILE ============ */
@media (max-width: 820px) {
  :root {
    --studio-panel-w: 100vw;
  }

  /* env(safe-area-inset-*) keeps the chips clear of the notch and the rounded
     corners. It resolves to 0px on every device without insets, so the clamp
     below is the real offset on a plain screen. */
  /* One single top row: name pinned left, MENU pinned right. The box spans the
     full width so space-between can push them apart, which means it would also
     swallow taps across the whole strip, hence pointer-events off on the
     container and back on for the two children. */
  .hero__side-menu {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + clamp(14px, 2vh, 24px));
    left: calc(env(safe-area-inset-left, 0px) + clamp(8px, 2vw, 12px));
    right: calc(env(safe-area-inset-right, 0px) + clamp(8px, 2vw, 12px));
    bottom: auto;
    width: auto;
    height: auto;
    background: transparent;
    border: 0;
    border-right: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    z-index: 2060;
    transform: none;
    opacity: 1;
    animation: none;
    pointer-events: none;
  }

  .hero__side-menu .hero__name,
  .hero__side-menu .hero__menu-btn {
    position: static;
    top: auto;
    left: auto;
    bottom: auto;
    translate: 0 0;
    pointer-events: auto;
  }

  /* 44px is the Apple HIG floor for a touch target (Material asks 48dp). The
     strips paint on a transparent background, so growing the box only grows
     the hit area: nothing moves visually except the extra breathing room. */
  .hero__name,
  .hero__menu-btn,
  .studio-strip__btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .hero__menu-btn {
    flex-direction: row;
    gap: 8px;
    padding: 0 10px;
  }

  .hero__name {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 13px;
    letter-spacing: 0.04em;
    padding: 0 6px;
  }

  .hero__menu-label {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  /* The injected Studio chip is gone on mobile: the top right belongs to MENU,
     and Studio is already in the menu overlay. Scoped to the <aside> that
     sidebars.js injects, so /studio/'s own <a class="studio-strip"> back-home
     link survives. */
  aside.studio-strip { display: none; }

  .studio-strip {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + clamp(14px, 2vh, 24px));
    right: calc(env(safe-area-inset-right, 0px) + clamp(8px, 2vw, 12px));
    left: auto;
    bottom: auto;
    width: auto;
    height: auto;
    background: transparent;
    border-left: 0;
    z-index: 2060;
    transform: none;
    opacity: 1;
    animation: none;
  }

  .studio-strip__btn {
    position: static;
    width: auto;
    height: auto;
    padding: 0 10px;
  }

  .studio-strip__label {
    writing-mode: horizontal-tb;
    font-family: 'Galatea', 'Times New Roman', serif;
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  /* On mobile the strips stop being solid columns and become labels floating
     straight over the hero art, which on some pages is a video swinging from
     near-white to near-black. A fixed ink color loses one end of that range,
     and putting a backdrop behind the labels would defeat the floating
     treatment. So the labels paint white and difference-blend instead: they
     come out near-black over light art and white over dark art, with no panel.
     The icon is inverted to white first so it flips with the type. */
  .hero__side-menu,
  .studio-strip {
    mix-blend-mode: difference;
  }

  .hero__name,
  .hero__menu-label,
  .studio-strip__label {
    color: #ffffff;
  }

  .hero__menu-icon { filter: invert(1); }

  .studio-strip__arrow { display: none; }

  .studio-panel { min-width: 0; }

  /* Clears the top chips (44px tall plus their offset) and the notch. */
  .site-menu {
    padding: calc(env(safe-area-inset-top, 0px) + 92px) 24px 24px;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .hero__side-menu,
  .studio-strip {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .site-menu,
  .site-menu__nav a {
    transition: opacity 180ms linear !important;
    transform: none !important;
  }
  .studio-panel { transition: none !important; }
  .hero__name { transform: rotate(180deg) !important; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 820px) {
  .hero__name { transform: none !important; }
}
