:root {
  --bg: #0a0a0a;
  --fg: #f2f2f2;
  --muted: #777;
  --frame-bg: #141414;
  --ratio: 65 / 24;        /* the Xpan frame */
  --edge: clamp(20px, 5vw, 64px);              /* page side padding */
  --frame-w: calc(100vw - 2 * var(--edge));    /* one frame fits the view; height follows the ratio */
  --gap: 24px;
}

/* Light ("white") theme */
body.light {
  --bg: #f5f5f5;
  --fg: #111;
  --muted: #999;
  --frame-bg: #e6e6e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px var(--edge) 8px;
}

.theme-toggle {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--fg);
  /* half black / half white to signal the toggle */
  background: linear-gradient(90deg, var(--fg) 0 50%, var(--bg) 50% 100%);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
}

.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }

.masthead h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: 2px;
}

.masthead .colon { color: var(--muted); }

/* Hover menu of gallery titles, anchored under the page title */
.title-menu { position: relative; }
.title-menu h1 { cursor: default; }

.menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: 4px;
  padding: 10px 0;
  background: var(--bg);
  border: 1px solid var(--frame-bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 50;
}

/* reveal on hover or keyboard focus within the title area */
.title-menu:hover .menu,
.title-menu:focus-within .menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu a {
  padding: 8px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.menu a:hover,
.menu a:focus-visible { color: var(--fg); }

main { padding: 24px 0 64px; }

.section { margin: 8px 0 56px; scroll-margin-top: 24px; }

html { scroll-behavior: smooth; }

.section-title {
  margin: 0 0 16px;
  padding: 0 var(--edge);
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--muted);
}

/* Horizontal scrolling strip of 65:24 frames */
.strip {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 var(--edge);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* old Edge/IE */
}

.strip::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.frame {
  position: relative;
  flex: 0 0 auto;
  width: var(--frame-w);
  max-height: 80vh;          /* keep tall viewports from over-sizing a frame */
  aspect-ratio: var(--ratio);
  scroll-snap-align: center;
  background: var(--frame-bg);
  overflow: hidden;
  cursor: url("assets/cursor-normal.svg") 14 14, zoom-in;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.frame img.loaded { opacity: 1; }

.footer {
  padding: 24px var(--edge) 48px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
}

.empty {
  padding: 0 var(--edge);
  color: var(--muted);
  line-height: 1.6;
}

/* Fullscreen image preview */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(0, 0, 0, 0.94);
  cursor: url("assets/cursor-fullscreen.svg") 14 14, zoom-out;
  opacity: 0;
  animation: lb-fade 0.2s ease forwards;
}

.lightbox[hidden] { display: none; }

@keyframes lb-fade { to { opacity: 1; } }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
}

@media (max-width: 700px) {
  :root { --gap: 16px; }
}
