@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Serif:wght@400;500&display=swap');

:root {
  --site-font: 'IBM Plex Mono', ui-monospace, monospace;
  --site-logo-font: 'IBM Plex Serif', Georgia, serif;
  --site-heading-tracking: -.02em;
  --site-body-size: 14px;
  --site-nav-size: 10px;
  --site-meta-size: 10px;
  --site-hero-size: clamp(1.5rem, 3.2vw, 2.2rem);
  --site-section-size: clamp(1.6rem, 3vw, 2.8rem);
  --site-paper: #f7f5ef;
  --site-surface: #efebe3;
  --site-ink: #171614;
  --site-muted: #625c54;
  --site-line: rgba(23, 22, 20, .18);
  --site-focus: #b34838;
  --site-header-height: 76px;
  --site-page-gutter: clamp(20px, 4vw, 64px);
  --site-content-width: 1240px;
}

html body,
html body button,
html body input,
html body select,
html body textarea { font-family: var(--site-font) !important; }

html body,
html body[class] {
  color: var(--site-ink);
  font-size: var(--site-body-size);
  font-weight: 400;
  line-height: 1.55;
}

main :where(p, li, dd, .lede, .hint, .helper, .description, .caption) {
  color: var(--site-muted);
  font-weight: 400;
}

/* One public header: the component owns its links, dimensions, and contrast. */
html body .gallery-header,
html body .house-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--site-header-height);
  margin: 0;
  padding: 14px var(--site-page-gutter);
  border: 0;
  background: transparent;
  color: var(--site-ink);
  box-shadow: none;
}

html body .gallery-header.storefront-header {
  position: fixed !important;
  right: 0;
  left: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

/* One shared nav treatment: transparent at the top of every public page, and a
   solid paper bar once the page scrolls so content never runs under the logo. */
html body .gallery-header.storefront-header {
  background: transparent;
  box-shadow: none;
}

html body .gallery-header.nav-scrolled,
html body .house-header.nav-scrolled,
html body .gallery-header.storefront-header.nav-scrolled {
  background: rgba(247, 245, 239, .96);
  color: var(--site-ink);
  box-shadow: 0 1px 0 var(--site-line), 0 8px 22px rgba(23, 22, 20, .08);
  backdrop-filter: blur(12px);
}

html body .gallery-header.nav-scrolled .wordmark .e,
html body .house-header.nav-scrolled .wordmark .e { color: #d94a3d; }

.gallery-header .wordmark,
.house-header .wordmark {
  position: absolute;
  left: 50%;
  z-index: 1;
  color: inherit;
  font-family: var(--site-logo-font) !important;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  text-decoration: none;
  text-transform: lowercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.gallery-header .wordmark .e,
.house-header .wordmark .e {
  display: inline-block;
  color: #d94a3d;
  animation: wordmark-e-cycle 6s linear infinite;
}

@keyframes wordmark-e-cycle {
  0%, 100% { color: #d94a3d; }
  25% { color: #f5c945; }
  50% { color: #3fa15a; }
  75% { color: #3a7fc8; }
}

.site-primary-nav {
  position: absolute;
  left: var(--site-page-gutter);
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 38px);
  margin: 0;
  transform: translateY(-50%);
}

.site-primary-nav a {
  color: inherit;
  font: 500 var(--site-nav-size)/1.2 var(--site-font);
  text-decoration: none;
}

.site-primary-nav a[aria-current='page'] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.gallery-menu,
.house-header .nav-toggle {
  position: absolute;
  top: 50%;
  right: var(--site-page-gutter);
  z-index: 2;
  display: block;
  width: auto;
  height: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  font: 500 var(--site-nav-size)/1 var(--site-font);
  cursor: pointer;
  transform: translateY(-50%);
}

.gallery-menu::after { content: 'menu'; font: inherit; }

.house-menu {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  width: min(520px, 100%);
  max-height: 100svh;
  overflow-y: auto;
  padding: 34px clamp(26px, 6vw, 72px);
  background: var(--site-ink);
  color: var(--site-paper);
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.76, 0, .24, 1);
}

.house-menu.open { transform: none; }

/* The drawer is a keyboard-contained dialog. It remains scrollable when its
   links exceed the viewport, including on short mobile screens. */
.house-menu[aria-hidden='true'] { visibility: hidden; pointer-events: none; }
.house-menu[aria-hidden='false'] { visibility: visible; pointer-events: auto; }

.menu-close {
  float: right;
  min-width: 48px;
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: 500 var(--site-nav-size)/1 var(--site-font);
  cursor: pointer;
}

.house-menu nav {
  display: flex;
  flex-direction: column;
  margin-top: 15vh;
  padding-bottom: 34px;
}

.house-menu nav a {
  padding: 15px 0;
  color: inherit;
  font: 400 clamp(1rem, 2vw, 1.4rem)/1.2 var(--site-font);
  text-decoration: none;
}

.house-menu nav a[aria-current='page'] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

/* Shared footer component, injected and populated by gallery-shell.js. */
.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .72fr);
  gap: 36px clamp(36px, 8vw, 120px);
  margin: 0;
  padding: clamp(38px, 5vw, 60px) var(--site-page-gutter) 30px;
  background: var(--site-ink);
  color: var(--site-paper);
  font: 400 12px/1.55 var(--site-font);
  text-transform: lowercase;
}

.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover,
.site-footer a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.site-footer-brand { display: grid; gap: 14px; max-width: 58ch; }
.site-footer-mark { font: 500 1.6rem/1 var(--site-logo-font); letter-spacing: -.02em; }
.site-footer-mark .e { color: #d94a3d; }
.site-footer p { max-width: 58ch; margin: 0; color: rgba(247, 245, 239, .8); }
.site-footer .site-footer-note { color: rgba(247, 245, 239, .66); font-size: var(--site-meta-size); }
.site-footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; align-content: start; }
.site-footer-meta { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid rgba(247, 245, 239, .2); color: rgba(247, 245, 239, .62); font-size: var(--site-meta-size); }

/* Shared interaction states. Components may define their own geometry but inherit these cues. */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--site-focus);
  outline-offset: 3px;
}

:where(button, input, select, textarea):disabled,
[aria-disabled='true'] { cursor: not-allowed; opacity: .48; }

[aria-busy='true'] { cursor: progress; }

.site-control-status { min-height: 1.45em; margin: 8px 0 0; color: var(--site-muted); font-size: 13px; }
.site-control-status[data-state='error'] { color: #a32e22; }
.site-control-status[data-state='success'] { color: #1f6a49; }

body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
  :root { --site-header-height: 62px; --site-page-gutter: 16px; }
  html body .gallery-header,
  html body .house-header { min-height: var(--site-header-height); padding: 8px var(--site-page-gutter); }
  /* The header may inherit older page styles, but the shared mobile shell owns
     this breakpoint everywhere: desktop links never sit beside the menu. */
  html body .gallery-header .site-primary-nav { display: none !important; }
  .gallery-header .wordmark,
  .house-header .wordmark { font-size: 1.5rem; }
  .gallery-menu { width: auto; height: auto; }
  .site-footer { grid-template-columns: 1fr; gap: 28px; }
  .site-footer-links { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-header,
  .house-menu { transition: none !important; }
  .gallery-header .wordmark .e,
  .house-header .wordmark .e { animation: none; }
}
