/* Chrome shared by the scroll story and the document pages: tokens, header,
   nav, language switcher, skip link. Loaded before the page-specific sheet. */

@font-face {
  font-family: "Ogg Medium";
  src: url("/fonts/OggText-Medium.woff2") format("woff2"),
    url("https://dcym8fthxf5uu.cloudfront.net/fonts/247a073c-29f5-4a89-aa3a-741020f346fc/OggText-Medium.woff2")
      format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111411;
  --paper: #fdf1e1;
  --shadow: rgba(0, 0, 0, 0.32);

  font-family: Inter, Satoshi, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--paper);
  background: #0b1110;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #0b1110;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  background: #0b1110;
}

button {
  border: 0;
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  color: var(--ink);
  background: #fdf1e1;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease-out;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* A single visible focus treatment for everything interactive. */
:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid #ffd9a0;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------- header */

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding: 24px 32px;
  color: rgba(253, 241, 225, 0.86);
}

.site-logo {
  justify-self: start;
  color: rgba(253, 241, 225, 0.92);
  font-family: "Ogg Medium", Georgia, serif;
  font-size: clamp(1.05rem, 1.4vw, 1.5rem);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  /* 44px tap target without changing the visual weight */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.2vw, 44px);
}

.site-nav a {
  color: rgba(253, 241, 225, 0.86);
  font-size: clamp(0.95rem, 1.2vw, 1.25rem);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  /* 44px minimum touch target without changing the visual rhythm */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fdf1e1;
}

.site-nav a[aria-current="page"] {
  color: #fdf1e1;
  box-shadow: inset 0 -2px 0 currentColor;
}

/* --------------------------------------------------------- language switcher */

.lang {
  position: relative;
  justify-self: end;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgba(253, 241, 225, 0.9);
  background: rgba(17, 20, 17, 0.35);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.lang-toggle:hover {
  background: rgba(17, 20, 17, 0.55);
}

.lang-caret {
  transition: transform 160ms ease-out;
}

.lang-toggle[aria-expanded="true"] .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 16px;
  color: var(--ink);
  background: #fdf1e1;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
  background: rgba(17, 20, 17, 0.08);
}

.lang-menu a[aria-current="true"] {
  font-weight: 700;
}

.lang-menu a[aria-current="true"]::after {
  content: " ✓";
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    padding: 16px 20px;
  }
  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    /* keep the first and last item clear of the screen edge while scrolling */
    padding-inline: 2px;
    scroll-padding-inline: 20px;
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  .site-nav a {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .skip-link,
  .lang-caret {
    transition: none;
  }
}
