:root { color-scheme: light; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--paper); color: var(--ink);
  padding: 8px 12px; z-index: 5;
}
.skip:focus { top: 12px; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.site-header { background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
html { scroll-padding-top: 96px; }
[id] { scroll-margin-top: 96px; }
.site-header a { color: #fff; text-decoration: none; }
.bar {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.brand { font-family: var(--display); font-size: 22px; letter-spacing: 0.01em; }
.nav-button {
  display: none; border: 1px solid rgba(255,255,255,.35); padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.nav-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.nav-links a { padding: 8px 2px; border-bottom: 2px solid transparent; }
.nav-links a[aria-current="page"], .nav-links a:hover { border-bottom-color: var(--accent); color: var(--accent); }
details.sub { position: relative; }
details.sub summary { cursor: pointer; list-style: none; padding: 8px 0; }
details.sub summary::-webkit-details-marker { display: none; }
details.sub[open] { background: rgba(0,0,0,.18); padding: 0 8px 8px; border-radius: 8px; }
details.sub a { display: block; padding: 4px 0; }
.banner { width: min(1100px, calc(100% - 28px)); margin: 18px auto 0; }
.banner img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; display: block; }
main { width: min(1100px, calc(100% - 28px)); margin: 18px auto 40px; }
article {
  background: var(--paper); color: var(--ink);
  border-radius: 16px; padding: 28px 28px 36px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
article h1, article h2, article h3 { font-family: var(--display); line-height: 1.25; font-weight: 600; }
article h1 { font-size: clamp(32px, 4vw, 46px); margin: 0 0 12px; }
article h2 { font-size: 28px; margin: 1.4em 0 .4em; }
article h3 { font-size: 22px; margin: 1.2em 0 .3em; }
article p { margin: 0 0 1em; }
.prose { max-width: 72ch; }
.prose a, .prose p, .prose li { overflow-wrap: anywhere; }
.prose figure { display: block; width: fit-content; max-width: 100%; margin: 12px 0 16px; }
.prose figcaption { font-size: 14px; color: var(--muted); }
.prose.gallery figure { display: inline-block; width: min(240px, 100%); margin: 8px 12px 12px 0; vertical-align: top; }
.prose img { border-radius: 10px; background: rgba(255,255,255,.55); }
.download { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); border-radius: 10px; }
.download .meta { color: var(--muted); margin-left: 8px; }
.paypal { margin: 12px 0 20px; }
.contact-form { display: grid; gap: 12px; max-width: 36rem; margin-top: 8px; }
.contact-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, white);
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 10px; padding: 8px 10px;
}
.contact-form button {
  width: fit-content; background: var(--nav); color: white; border: 0; border-radius: 10px;
  padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.hp { position: absolute; left: -9999px; }
.form-note { min-height: 1.2em; }
.site-footer { width: min(1100px, calc(100% - 28px)); margin: 0 auto 28px; color: var(--muted); font-size: 14px; }
@media (max-width: 800px) {
  .nav-button { display: inline-block; }
  .nav-links { display: none; width: min(1100px, calc(100% - 28px)); margin: 0 auto 12px; flex-direction: column; align-items: flex-start; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .site-header { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  html { scroll-padding-top: 76px; }
  [id] { scroll-margin-top: 76px; }
  article { padding: 20px 16px 28px; }
  .prose.gallery figure { width: calc(50% - 12px); }
}

/* Gallery layout */
.ruff-gallery { max-width: 100%; }
.prose:has(.ruff-gallery) { max-width: none; }
.ruff-gallery figure { display: block !important; width: auto !important; margin: 0 !important; }
.ruff-gallery img { display: block; width: 100%; height: auto; max-width: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ruff-gallery h3 { margin: 0 0 .4em; }
.ruff-gallery .g-text p, .ruff-gallery .g-pair-text p { margin: 0 0 .25em; }
.g-pair, .g-pair-text { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 760px; margin: 0 auto; }
.g-pair img { aspect-ratio: auto; height: auto; }
.g-pair { align-items: start; }
.g-pair-text { margin: 16px auto 36px; }
.g-row { display: grid; grid-template-columns: minmax(0, 42%) 1fr; gap: 28px; align-items: start; padding: 28px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.g-row figure img { max-width: 320px; }
.g-row.g-noimg { grid-template-columns: 1fr; }
@media (max-width: 640px) {
  .g-pair, .g-pair-text, .g-row { grid-template-columns: 1fr; gap: 16px; }
  .g-pair img { max-width: 320px; margin: 0 auto; }
  .g-row figure img { max-width: 100%; }
}
