* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --padding: 1.25rem;
  --color-black: #000;
  --color-white: #fff;
  --color-grey: #777;
  --color-light: #efefef;
  --color-text: var(--color-black);
  --color-text-grey: var(--color-grey);
  --color-background: var(--color-white);
  --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

html {
  font-family: var(--font-family-sans);
  color: var(--color-text);
  background: var(--color-background);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 60rem) {
  html { font-size: 17px; }
  :root { --padding: 2rem; }
}

body {
  padding: var(--padding);
  max-width: 70rem;
  margin: 0 auto;
}

img {
  max-width: 100%;
  height: auto;
}

li { list-style: none; }

a {
  color: currentColor;
  text-decoration: none;
}

button {
  font: inherit;
  background: none;
  border: 0;
  color: currentColor;
  cursor: pointer;
}

strong, b { font-weight: 600; }

small {
  font-size: inherit;
  color: var(--color-text-grey);
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

hr {
  border: 0;
  background: currentColor;
  height: 2px;
  width: 1.5rem;
  margin: 3rem auto;
}

.color-grey {
  color: var(--color-text-grey);
}

/* ─── header ───────────────────────────────────────── */

.header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin: 0 0 3rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.logo img {
  display: block;
  height: 48px;
  width: auto;
}

/* ─── menu ────────────────────────────────────────── */

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-right: auto;
}

.menu a {
  display: block;
  padding: .4rem .85rem;
  border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.menu a:hover {
  background: var(--color-light);
}

.menu a[aria-current="page"] {
  background: var(--color-text);
  color: var(--color-background);
  border-color: var(--color-text);
}

/* mobile-only hamburger toggle (a <details> sibling to the menu) */

.menu-disclosure {
  display: none;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .4rem .7rem;
  border: 1px solid var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  line-height: 1;
  transition: background-color .15s ease, color .15s ease;
}

.menu-toggle::-webkit-details-marker { display: none; }
.menu-toggle::marker { display: none; content: ""; }

.menu-disclosure[open] .menu-toggle,
.menu-toggle:hover {
  background: var(--color-text);
  color: var(--color-background);
}

.icon-menu {
  width: 1.2em;
  height: 1.2em;
}

/* ─── mobile collapse (uses :has() to read disclosure state) ─── */

@media (max-width: 47.99rem) {
  .menu-disclosure { display: inline-block; }

  /* on mobile the logo pushes everything else right; menu shouldn't add to that */
  .menu { margin-right: 0; }

  /* hide the menu by default on mobile; show it when the disclosure is [open] */
  .header > .menu { display: none; }
  .header:has(.menu-disclosure[open]) > .menu {
    display: flex;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 12rem;
    flex-direction: column;
    gap: 0;
    padding: .25rem;
    background: var(--color-background);
    border: 1px solid var(--color-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    z-index: 10;
  }

  .header:has(.menu-disclosure[open]) > .menu a {
    padding: .55rem .7rem;
    font-size: .95rem;
  }
}

/* ─── language switcher (details/summary dropdown) ─── */

.language-switcher {
  position: relative;
}

.language-switcher summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .55rem;
  border: 1px solid var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  line-height: 1;
  transition: background-color .15s ease, color .15s ease;
}

.language-switcher summary::-webkit-details-marker { display: none; }
.language-switcher summary::marker { display: none; content: ""; }

.language-switcher[open] summary,
.language-switcher summary:hover {
  background: var(--color-text);
  color: var(--color-background);
}

.lang-flag {
  font-size: 1.25rem;
  line-height: 1;
  /* Pull flag emojis up a touch — Apple's metrics sit them low */
  display: inline-block;
  transform: translateY(.05em);
}

.language-options {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 11rem;
  margin: 0;
  padding: .25rem;
  list-style: none;
  background: var(--color-background);
  border: 1px solid var(--color-text);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.language-options li { list-style: none; }

.language-options a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .65rem;
  font-size: .95rem;
  transition: background-color .15s ease, color .15s ease;
}

.language-options a:hover {
  background: var(--color-text);
  color: var(--color-background);
}

.language-options .lang-name {
  color: var(--color-text-grey);
}

.language-options a:hover .lang-name {
  color: inherit;
  opacity: .85;
}

/* ─── prose ───────────────────────────────────────── */

.text {
  line-height: 1.6;
}

.text a { text-decoration: underline; text-underline-offset: 2px; }
.text :first-child { margin-top: 0; }
.text :last-child { margin-bottom: 0; }

.text p,
.text ul,
.text ol {
  margin-bottom: 1.25rem;
}

.text ul,
.text ol {
  margin-left: 1.25rem;
}

.text ul p,
.text ol p { margin-bottom: 0; }
.text ul > li { list-style: disc; }
.text ol > li { list-style: decimal; }

.text ul ol,
.text ul ul,
.text ol ul,
.text ol ol { margin-bottom: 0; }

.text h1,
.h1 {
  font-size: clamp(1.5rem, 3vw + .5rem, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2rem;
}

.text h2,
.h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.text h3,
.h3 {
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: .75rem;
}

.text code {
  font-family: var(--font-family-mono);
  font-size: .95em;
  background: var(--color-light);
  padding: 0 .35rem;
  display: inline-block;
  color: var(--color-black);
}

.text pre {
  margin: 2rem 0;
  background: var(--color-black);
  color: var(--color-white);
  padding: 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}

.text pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.text hr {
  margin: 3rem 0;
}

.text dt { font-weight: 600; }

.text blockquote {
  font-size: 1.2rem;
  line-height: 1.4;
  border-left: 2px solid var(--color-black);
  padding-left: 1rem;
  margin: 2rem 0;
  max-width: 25rem;
}

.text blockquote footer {
  font-size: .875rem;
  font-style: italic;
}

.text figure { margin: 2rem 0; }

.text figcaption {
  padding-top: .5rem;
  font-size: .9rem;
  color: var(--color-text-grey);
}

/* ─── shared photo grid (album + timeline) ────────── */

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 0 0 3rem;
  list-style: none;
  padding: 0;
}

@media (min-width: 40rem) {
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

.photo {
  margin: 0;
  break-inside: avoid;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

.photo-caption {
  margin-top: .5rem;
  font-size: .9rem;
  color: var(--color-text-grey);
  line-height: 1.4;
}

/* ─── blocks/image (legacy block aspect-ratio container) ─ */

.video,
.img {
  position: relative;
  display: block;
  --w: 1;
  --h: 1;
  padding-bottom: calc(100% / var(--w) * var(--h));
  background: var(--color-white);
}

.img img,
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.img[data-contain] img {
  object-fit: contain;
}

.img-caption,
.video-caption {
  padding-top: .5rem;
  font-size: .9rem;
  color: var(--color-text-grey);
  line-height: 1.5;
}

/* ─── grid (layout snippet) ──────────────────────── */

.grid {
  --columns: 12;
  --gutter: 2rem;
  display: grid;
  grid-gap: var(--gutter);
  grid-template-columns: 1fr;
}

.grid > .column {
  margin-bottom: var(--gutter);
}

@media (min-width: 60rem) {
  .grid {
    grid-template-columns: repeat(12, 1fr);
  }
  .grid > .column {
    grid-column: span var(--columns);
    margin-bottom: 0;
  }
}

.margin-m { margin-bottom: 1.5rem; }

/* ─── footer ─────────────────────────────────────── */

.footer {
  padding: 4rem 0 2rem;
  line-height: 1.5;
  font-size: .9rem;
  color: var(--color-text-grey);
}

.footer:before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--color-black);
  margin-bottom: 1.5rem;
}

.footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer a:hover {
  color: var(--color-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-heading {
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--color-text);
}

.footer-credits {
  font-size: .85rem;
}
