:root {
  --ink: #161616;
  --muted: #6a6a6a;
  --paper: #f4f3f0;
  --surface: #fff;
  --stroke: #ececec;
  --stroke-strong: #cfc6b4;
  --header-h: 108px;
  --bar-h: 48px;
}
html[data-theme="dark"] {
  --ink: #f3f1ea;
  --muted: #a8a49a;
  --paper: #1c1b19;
  --surface: #111110;
  --stroke: #2e2c28;
  --stroke-strong: #6f6a60;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
}
img {
  -webkit-user-drag: none;
  user-select: none;
}
.stage {
  height: 100dvh;
  height: 100vh;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 8;
  height: var(--header-h);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 36px 0;
  background: linear-gradient(to bottom, var(--surface) 0%, var(--surface) 58%, transparent);
  pointer-events: none;
}
header a, header nav, header button { pointer-events: auto; }
.logo {
  height: 64px;
  width: auto;
  display: block;
  background: transparent;
}
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 18px;
  padding-top: 8px;
  max-width: 560px;
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle svg { width: 16px; height: 16px; display: block; }
nav a {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
nav a:hover { opacity: 0.55; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 18px;
}
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.viewport { background: var(--paper); }
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.slide.is-on { opacity: 1; pointer-events: auto; }
.bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px;
}
.bar button {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  padding: 8px 12px;
}
.pause-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 12px;
  height: 12px;
}
.pause-icon::before,
.pause-icon::after {
  content: "";
  width: 2px;
  height: 10px;
  background: currentColor;
}
#pause.is-paused .pause-icon { gap: 0; }
#pause.is-paused .pause-icon::before {
  width: 0;
  height: 0;
  background: none;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}
#pause.is-paused .pause-icon::after { display: none; }
.caption {
  min-width: 0;
  flex: 1;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress {
  width: min(280px, 28vw);
  height: 2px;
  background: var(--stroke);
  position: relative;
  flex-shrink: 0;
}
.progress > span {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--ink);
}
.more {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
main { max-width: 1180px; margin: 0 auto; padding: 72px 24px 100px; }
h1 {
  font-weight: 400;
  letter-spacing: 0.28em;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 22px;
}
#about > h1 {
  font-weight: 700;
  font-size: clamp(32px, 7vw, 52px);
  letter-spacing: 0.14em;
  line-height: 1.1;
  margin-bottom: 28px;
}
p { font-size: 17px; line-height: 1.7; margin-bottom: 1.1em; color: var(--ink); }
.note { color: var(--muted); font-size: 14px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0 22px;
}
.filters button {
  background: none;
  border: 1px solid var(--stroke-strong);
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
}
.filters button.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px 14px;
}
.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  text-align: left;
  padding: 0;
  font: inherit;
}
.tile .frame {
  background: var(--paper);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile figcaption {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--stroke);
  padding: 28px 40px 40px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer a { color: inherit; }
.footer-end {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-cookie-settings {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  display: inline-block;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.footer-cookie-settings:hover { color: var(--ink); }
.cookieadmin_reconsent_wrap,
.cookieadmin_re_consent {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body.page-work header,
body.page-gallery header,
body.page-about header,
body.page-contact header {
  position: relative;
  height: auto;
  background: var(--surface);
  pointer-events: auto;
  justify-content: space-between;
  width: 100%;
  max-width: none;
}
body.page-gallery header > nav,
body.page-about header > nav,
body.page-contact header > nav {
  max-width: none;
  flex: 1;
  justify-content: flex-end;
}
body.page-about {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
body.page-about .about-main {
  flex: 1;
  width: 66.666%;
  max-width: 100%;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
body.page-about .about-page-title {
  display: block;
  position: static;
  height: auto;
  width: 100%;
  margin: 0 0 40px;
  padding: 0;
  text-align: center;
  background: none;
  pointer-events: auto;
}
body.page-about .about-page-title h1 {
  font-weight: 700;
  font-size: clamp(32px, 7vw, 52px);
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: none;
  margin: 0;
  color: var(--ink);
}
body.page-about .about-section {
  margin-bottom: 56px;
}
body.page-about .about-section:last-child {
  margin-bottom: 0;
}
body.page-about .about-section > h2 {
  font-weight: 400;
  letter-spacing: 0.28em;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 28px;
  color: var(--muted);
}
body.page-about .about-section p {
  font-size: 17px;
  line-height: 1.7;
}
body.page-about .about-quote {
  margin: 1.5em 0 0;
  padding-left: 1.25em;
  border-left: 2px solid var(--stroke-strong);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  font-style: italic;
}
@media (max-width: 720px), ((max-width: 1024px) and (orientation: portrait)) {
  body.page-about .about-main {
    width: 100%;
    padding: 28px 20px 72px;
  }
}
body.page-contact {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
body.page-contact .contact-main {
  flex: 1;
  width: 66.666%;
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
body.page-contact .contact-page-title {
  display: block;
  position: static;
  height: auto;
  width: 100%;
  padding: 0;
  margin: 0 0 40px;
  background: none;
  pointer-events: auto;
  text-align: center;
}
body.page-contact .contact-page-title h1 {
  font-weight: 700;
  font-size: clamp(32px, 7vw, 52px);
  letter-spacing: 0.14em;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
}
body.page-contact .contact-lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}
body.page-contact .contact-form-message {
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 24px;
}
body.page-contact .contact-form-message--success {
  border: 1px solid var(--stroke-strong);
  background: color-mix(in srgb, var(--stroke-strong) 18%, var(--surface));
  color: var(--ink);
}
body.page-contact .contact-form-message--error {
  border: 1px solid #c44;
  background: color-mix(in srgb, #c44 12%, var(--surface));
  color: var(--ink);
}
body.page-contact .contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
body.page-contact .contact-field label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
body.page-contact .contact-required {
  color: var(--stroke-strong);
  font-weight: 400;
}
body.page-contact .contact-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
  padding: 12px 14px;
  border: 1px solid var(--stroke-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
}
body.page-contact .contact-input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
body.page-contact .contact-textarea {
  min-height: 160px;
  resize: vertical;
}
body.page-contact .contact-recaptcha-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
body.page-contact .contact-recaptcha-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.page-contact .contact-submit {
  align-self: flex-start;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
  border-radius: 2px;
}
body.page-contact .contact-submit:hover:not(:disabled) {
  opacity: 0.88;
}
body.page-contact .contact-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (max-width: 720px), ((max-width: 1024px) and (orientation: portrait)) {
  body.page-contact .contact-main {
    width: 100%;
    padding: 28px 20px 72px;
  }
}
/* reCAPTCHA v3 badge is fixed bottom-right; keep footer clear of it */
body.page-contact footer {
  padding-right: 112px;
}
@media (max-width: 720px), ((max-width: 1024px) and (orientation: portrait)) {
  body.page-contact footer {
    padding-right: 96px;
  }
}
body.page-gallery {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
body.page-gallery .gallery-main {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 0 72px;
}
body.page-gallery .gallery-intro {
  display: block;
  position: static;
  height: auto;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto 28px;
  padding: 0 22px;
  text-align: center;
  background: none;
  pointer-events: auto;
}
body.page-gallery .gallery-intro h1 {
  font-weight: 700;
  font-size: clamp(32px, 7vw, 52px);
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: none;
  margin-bottom: 20px;
}
body.page-gallery .gallery-intro p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}
body.page-gallery nav.gallery-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0 auto 36px;
  padding: 0 22px;
  gap: 12px 28px;
}
body.page-gallery nav.gallery-cats button {
  flex: 0 1 auto;
  background: none;
  border: 0;
  padding: 6px 2px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.45;
}
body.page-gallery nav.gallery-cats button:hover { opacity: 0.75; }
body.page-gallery nav.gallery-cats button.is-on {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.35em;
}
body.page-gallery .gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 0 22px;
}
body.page-gallery .gallery-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
  width: 100%;
}
body.page-gallery .gallery-band--duo {
  display: flex;
  justify-content: center;
  gap: 22px;
}
body.page-gallery .gallery-band--duo .gallery-tile {
  flex: 0 1 calc((100% - 44px) / 3);
  max-width: calc((100% - 44px) / 3);
}
body.page-gallery .gallery-band--landscape.gallery-band--duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
body.page-gallery .gallery-band--landscape.gallery-band--duo .gallery-tile {
  flex: none;
  max-width: none;
  width: 100%;
}
body.page-gallery .gallery-band--solo {
  display: flex;
  justify-content: center;
}
body.page-gallery .gallery-band--solo .gallery-tile {
  flex: 0 1 calc((100% - 44px) / 3);
  max-width: calc((100% - 44px) / 3);
}
body.page-gallery .gallery-tile {
  width: 100%;
}
body.page-gallery .gallery-item {
  display: block;
  position: relative;
  width: 100%;
}
body.page-gallery .gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
body.page-gallery .gallery-item-label {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
body.page-gallery .gallery-tile:hover .gallery-item-label,
body.page-gallery .gallery-tile:focus-visible .gallery-item-label {
  color: var(--ink);
}
@media (max-width: 900px) {
  body.page-gallery .gallery-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
  }
  body.page-gallery .gallery-band--portrait.gallery-band--duo .gallery-tile,
  body.page-gallery .gallery-band--solo .gallery-tile {
    flex-basis: calc((100% - 16px) / 2);
    max-width: calc((100% - 16px) / 2);
  }
  body.page-gallery .gallery-band--landscape.gallery-band--duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  body.page-gallery nav.gallery-cats {
    gap: 10px 20px;
  }
  body.page-gallery nav.gallery-cats button {
    letter-spacing: 0.12em;
    font-size: 10px;
  }
}
@media (max-width: 720px), ((max-width: 1024px) and (orientation: portrait)) {
  body.page-gallery .gallery-grid {
    padding: 0;
    align-items: center;
    gap: 22px;
  }
  body.page-gallery .gallery-band,
  body.page-gallery .gallery-band--duo,
  body.page-gallery .gallery-band--solo {
    display: grid;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: 1fr;
    gap: 22px;
  }
  body.page-gallery .gallery-band--landscape.gallery-band--duo {
    grid-template-columns: 1fr;
  }
  body.page-gallery .gallery-band--duo .gallery-tile,
  body.page-gallery .gallery-band--solo .gallery-tile,
  body.page-gallery .gallery-tile {
    width: 100%;
    max-width: none;
    flex: none;
  }
  body.page-gallery nav.gallery-cats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    padding: 0 5%;
    justify-items: center;
    align-items: center;
  }
  body.page-gallery nav.gallery-cats button {
    width: 100%;
    max-width: 11em;
    flex: none;
    font-size: 10px;
    white-space: normal;
    line-height: 1.35;
    padding: 4px 2px;
  }
}
@media (min-width: 400px) and (max-width: 720px),
((min-width: 400px) and (max-width: 1024px) and (orientation: portrait)) {
  body.page-gallery nav.gallery-cats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  body.page-gallery nav.gallery-cats button {
    letter-spacing: 0.1em;
  }
}
.lightbox {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  z-index: 20;
  display: none;
  flex-direction: column;
  color: var(--ink);
}
.lightbox.is-open { display: flex; }
.lightbox .frame {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 16px;
  overflow: hidden;
}
.lightbox .lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.lightbox .lb-stage.is-panning { cursor: grabbing; }
.lightbox .lb-stage.can-pan { cursor: grab; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
}
.lightbox .meta {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px 20px;
  padding: 12px 24px 24px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lightbox .lb-share {
  background: none;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: inherit;
  white-space: nowrap;
}
.lightbox .lb-share:hover { opacity: 0.55; }
.lightbox .lb-share.is-copied { opacity: 1; }
.lightbox .meta #lb-cap {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox .lb-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lightbox .lb-zoom input[type="range"] {
  width: min(160px, 28vw);
  accent-color: var(--ink);
  cursor: pointer;
}
@media (max-width: 640px) {
  .lightbox .meta {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "cap close"
      "share share"
      "zoom zoom";
  }
  .lightbox .meta #lb-cap { grid-area: cap; }
  .lightbox .meta .lb-share {
    grid-area: share;
    justify-self: center;
  }
  .lightbox .meta .lb-zoom {
    grid-area: zoom;
    justify-content: center;
    width: 100%;
  }
  .lightbox .meta .lb-dismiss { grid-area: close; justify-self: end; }
}
.lightbox button {
  background: none;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: inherit;
}
.lightbox .lb-close-x {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  padding: 8px;
  line-height: 1;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.lightbox .lb-close-x:hover { opacity: 0.55; }

/* Framed: painting sits between header and View More */
body.layout-framed .stage { display: flex; flex-direction: column; }
body.layout-framed .viewport { flex: 1; min-height: 0; position: relative; }
body.layout-framed .slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) - 8px) 40px 12px;
}
body.layout-framed .slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
body.layout-framed .bar {
  flex-shrink: 0;
  border-top: 1px solid var(--stroke);
  background: var(--surface);
}

/* Edge-to-edge: painting fills the window; menus overlay it */
body.layout-bleed .viewport { position: absolute; inset: 0; }
body.layout-bleed .slide { margin: 0; padding: 0; }
body.layout-bleed .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
body.layout-bleed .bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  border-top: 0;
  background: linear-gradient(to top, var(--surface) 0%, color-mix(in srgb, var(--surface) 82%, transparent) 70%, transparent);
}

/* Hard-line chrome: same edge-to-edge cover as bleed, solid bars instead of fades */
body.layout-lines .viewport { position: absolute; inset: 0; }
body.layout-lines .slide { margin: 0; padding: 0; }
body.layout-lines .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
body.layout-lines header {
  height: auto;
  align-items: center;
  padding: 16px 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--stroke-strong);
}
body.layout-lines nav { padding-top: 0; }
body.layout-lines .bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  background: var(--surface);
  border-top: 1px solid var(--stroke-strong);
}

/* Adaptive: header, image well, controls — pan if the banner is wider than the well */
body.layout-adaptive .stage {
  display: flex;
  flex-direction: column;
}
body.layout-adaptive header {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  height: auto;
  flex-shrink: 0;
  align-items: center;
  padding: 16px 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--stroke-strong);
  pointer-events: auto;
}
body.layout-adaptive nav { padding-top: 0; }
body.layout-adaptive .viewport {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.layout-adaptive .slide {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
body.layout-adaptive .slide img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: unset;
  transform: translate3d(0, 0, 0);
}
@keyframes carousel-pan {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--pan-x, 0px), 0, 0); }
}
body.layout-adaptive .bar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
  z-index: 8;
  background: var(--surface);
  border-top: 1px solid var(--stroke-strong);
}

body.layout-menu {
  min-height: 100%;
  background: var(--surface);
}
body.layout-menu .theme-toggle {
  position: fixed;
  top: 22px;
  right: 36px;
  z-index: 8;
}
body.layout-menu .menu-page {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 80px 24px 48px;
}
body.layout-menu .menu-page .logo { height: 80px; }
body.layout-menu .layouts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: none;
  padding: 0;
}
body.layout-menu .layouts a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 280px;
  min-height: 48px;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
}
body.layout-menu .layouts a:hover {
  background: var(--ink);
  color: var(--surface);
}

body.admin-bar .stage { height: calc(100dvh - 32px); height: calc(100vh - 32px); }

@media (max-width: 720px), ((max-width: 1024px) and (orientation: portrait)) {
  :root {
    --header-h: 68px;
    --bar-h: 40px;
  }
  header { padding: 10px 12px 0; align-items: center; }
  .logo { height: 44px; }
  nav {
    position: relative;
    flex-wrap: nowrap;
    max-width: none;
    gap: 0;
    padding-top: 0;
    align-items: center;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 168px;
    padding: 8px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--stroke-strong);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 12%, transparent);
    z-index: 12;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    padding: 12px 20px;
    font-size: 11px;
    letter-spacing: 0.18em;
  }
  .nav-toggle {
    display: inline-flex;
    width: 32px;
    height: 32px;
  }
  .nav-toggle span { width: 14px; }
  .theme-toggle { width: 32px; height: 32px; }
  .theme-toggle svg { width: 14px; height: 14px; }
  .bar { gap: 8px; padding: 0 10px; }
  .bar button { padding: 4px 8px; font-size: 16px; }
  .progress { width: min(200px, 36vw); }
  body.layout-framed .stage {
    height: auto;
    overflow: visible;
  }
  body.layout-framed header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: auto;
    padding: 10px 12px 8px;
    align-items: center;
    background: var(--surface);
    pointer-events: auto;
  }
  body.layout-framed .viewport {
    flex: none;
    background: var(--paper);
  }
  body.layout-framed .slide {
    position: absolute;
    inset: auto;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 10px;
    align-items: flex-start;
    justify-content: center;
  }
  body.layout-framed .slide.is-on {
    position: relative;
  }
  body.layout-framed .slide img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
  }
  body.layout-lines header { padding: 12px 14px; }

  /* Adaptive: framed stack on a phone or portrait screen */
  body.layout-adaptive .stage {
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }
  body.layout-adaptive header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: auto;
    padding: 10px 12px 8px;
    align-items: center;
    background: var(--surface);
    border-bottom: 0;
    pointer-events: auto;
  }
  body.layout-adaptive .viewport {
    position: relative;
    inset: auto;
    flex: none;
    background: var(--paper);
  }
  body.layout-adaptive .slide {
    position: absolute;
    inset: auto;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 10px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
  body.layout-adaptive .slide.is-on {
    position: relative;
  }
  body.layout-adaptive .slide img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  body.layout-adaptive .bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
    border-top: 1px solid var(--stroke);
    background: var(--surface);
  }

  html:has(body.is-pan-home),
  body.is-pan-home {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.layout-adaptive .stage.is-pan {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 100dvh;
    height: 100svh;
    overflow: hidden;
    border-bottom: 0;
  }
  body.layout-adaptive .stage.is-pan header {
    position: relative;
    flex-shrink: 0;
    z-index: 9;
    border-bottom: 1px solid var(--stroke-strong);
  }
  body.layout-adaptive .stage.is-pan .viewport {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--paper);
  }
  .pan-rail {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
    width: max-content;
    will-change: transform;
  }
  .pan-rail img {
    height: 100%;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    display: block;
  }
  body.layout-adaptive .stage.is-pan .viewport {
    touch-action: none;
  }
  body.layout-adaptive .stage.is-pan.is-pan-complete {
    touch-action: pan-y;
  }
  body.layout-adaptive .stage.is-pan.is-pan-complete .viewport {
    touch-action: pan-y;
  }
  body.layout-adaptive .stage.is-pan header,
  body.layout-adaptive .stage.is-pan .bar,
  body.is-pan-home footer {
    touch-action: pan-y;
  }
  .pan-scroll-spacer {
    display: block;
    width: 100%;
    min-height: 100svh;
    min-height: 100dvh;
  }
  body.is-pan-home footer {
    position: relative;
    z-index: 1;
  }
  body.layout-adaptive .stage.is-pan .bar {
    justify-content: center;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan {
    flex-wrap: wrap;
    align-content: center;
    align-items: stretch;
    flex: 0 0 auto;
    gap: 12px 12px;
    height: auto !important;
    max-height: none;
    min-height: var(--bar-h);
    overflow: visible;
    padding: 10px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
  }
  .pan-progress {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    flex: 1 1 100%;
    padding: 0 4px;
  }
  .pan-progress-oval {
    flex: 1 1 0;
    min-width: 0;
    height: 5px;
    border-radius: 999px;
    background: var(--stroke);
    overflow: hidden;
    position: relative;
  }
  .pan-progress-oval::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--fill, 0) * 100%);
    background: var(--ink);
    border-radius: inherit;
  }
  .pan-progress-oval.is-active::after {
    opacity: 1;
  }
  .pan-progress-oval.is-done::after {
    width: 100%;
  }
  body.layout-adaptive .stage.is-pan .bar #prev,
  body.layout-adaptive .stage.is-pan .bar #next,
  body.layout-adaptive .stage.is-pan .bar .progress {
    display: none;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause {
    order: 3;
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 52px;
    padding: 14px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause:not(.is-paused) .pause-icon {
    width: 14px;
    height: 14px;
    gap: 4px;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause:not(.is-paused) .pause-icon::before,
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause:not(.is-paused) .pause-icon::after {
    width: 3px;
    height: 14px;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause.is-paused .pause-icon {
    width: 12px;
    height: 12px;
    gap: 0;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause.is-paused .pause-icon::before {
    width: 0;
    height: 0;
    background: none;
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent currentColor;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan #pause.is-paused .pause-icon::after {
    display: none;
  }
  body.layout-adaptive .stage.is-pan .bar.bar--pan .more {
    order: 2;
    flex: 0 0 auto;
    min-height: 52px;
    padding: 14px 16px;
    font-size: 14px;
    letter-spacing: 0.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  body.layout-menu .theme-toggle { top: 14px; right: 14px; }
  body.layout-menu .menu-page .logo { height: 64px; }
  body.layout-menu .layouts { max-width: none; }
  body.layout-menu .layouts a { width: min(280px, 100%); }
  .caption { display: none; }
}
