:root {
  --inset: 16px;
  --chip-pad-y: 8px;
  --chip-pad-x: 24px;
  --gap: 8px;

  --bg: #a8a8a8;
  --chip-bg: #f2f2f2;
  --chip-fg: #1a1a1a;
  --overlay-bg: #f2f2f2;
  --overlay-fg: #1a1a1a;

  --font: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--chip-fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Shared chip styling ---------- */
.chip {
  display: inline-block;
  margin: 0;
  padding: var(--chip-pad-y) var(--chip-pad-x);
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
}

button.chip { -webkit-appearance: none; appearance: none; }

.chip:focus-visible {
  outline: 2px solid var(--chip-fg);
  outline-offset: 2px;
}

.title {
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: default;
}

.tagline {
  cursor: default;
}

/* ---------- Fixed chrome ---------- */
.chrome-top {
  position: fixed;
  top: var(--inset);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
}

.chrome-bottom {
  position: fixed;
  bottom: var(--inset);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.nav-up { left: var(--inset); }
.nav-down { right: var(--inset); }

.nav[disabled] {
  opacity: 0.4;
  cursor: default;
}

/* Dynamic image caption: plain white text, aligned to the bottom-left 16px
   inset (its baseline row sits level with the bottom of the contact button).
   Hidden when it has no text. */
.caption {
  position: fixed;
  bottom: var(--inset);
  left: var(--inset);
  z-index: 10;
  max-width: min(60ch, calc(50vw - var(--inset) - 60px));
  margin: 0;
  padding: 0;
  background: none;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.caption:empty {
  display: none;
}

/* ---------- Gallery ---------- */
.gallery {
  display: block;
}

.slide,
.gallery figure,
.gallery picture,
.gallery img {
  display: block;
  width: 100vw;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* Placeholder blocks keep a stable aspect ratio so layout doesn't shift. */
.slide {
  aspect-ratio: var(--ar, 3 / 2);
  background: var(--bg);
}

/* ---------- Overlays (native <dialog>) ---------- */
.overlay {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: var(--inset);
  border: 0;
  background: var(--overlay-bg);
  color: var(--overlay-fg);
}

.overlay::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.overlay-close {
  position: fixed;
  top: var(--inset);
  right: var(--inset);
}

.overlay-body {
  max-width: 60ch;
  margin: 0 auto;
  padding: 18vh var(--inset) var(--inset);
}

.overlay-body h2 {
  margin: 0 0 1rem;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay-body p {
  margin: 0 0 1rem;
  font-size: 15px;
  line-height: 1.7;
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 2;
}

.overlay-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
