/* moser.ink 2D gallery — restrained editorial, paper-white salon wall.
   Counterpart to the dark immersive 3D gallery. CSS-only motion. */

:root {
  --paper: #f4f1ea;
  --paper-2: #ece8df;
  --ink: #17130d;
  --muted: rgba(23, 19, 13, 0.52);
  --line: rgba(23, 19, 13, 0.14);
  --bar-h: 56px;
  --wall-max: 1080px; /* narrower, centred wall — keeps columns small so 384px thumbs stay crisp */
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; }

/* ---------- top bar ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

.wordmark {
  font-weight: 600;
  letter-spacing: 0.32em;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}
.brand-logo {
  height: 42px;
  width: auto;
  /* logo art is black ink — already correct on the paper background; no disc */
}

.bar-right { display: flex; gap: 18px; align-items: center; }

.toggle { display: inline-flex; gap: 2px; }
.toggle button {
  appearance: none;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px;
  cursor: pointer;
  transition: color 0.18s ease;
}
.toggle button:hover { color: var(--ink); }
.toggle button[aria-selected="true"] { color: var(--ink); }
.toggle button[aria-selected="true"]::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--ink);
  margin-top: 3px;
}

.alt-view {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 9px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.alt-view:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- stage / views ---------- */
#stage { padding: calc(var(--bar-h) + clamp(20px, 5vw, 56px)) clamp(16px, 4vw, 40px) 64px; }
/* `hidden` must beat id-specificity display rules (e.g. #wall { display:flex }). */
[hidden] { display: none !important; }

.status {
  max-width: 480px;
  margin: 18vh auto;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- wall (masonry) ---------- */
#wall { display: flex; gap: clamp(10px, 1.6vw, 20px); align-items: flex-start; max-width: var(--wall-max, 1080px); margin: 0 auto; }
.wall-col { flex: 1 1 0; display: flex; flex-direction: column; gap: clamp(10px, 1.6vw, 20px); min-width: 0; }

.tile {
  position: relative;
  cursor: pointer;
  background: var(--paper-2);
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.tile img { width: 100%; height: auto; }

/* hover: gently lift the hovered work — no dimming of the others */
#wall .tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 38px rgba(23, 19, 13, 0.20);
}

.tile-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(244, 241, 234, 0.92), transparent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.tile:hover .tile-cap { opacity: 1; transform: none; }
.tile-cap .yr { color: var(--muted); }

/* ---------- index (list) ---------- */
#index { max-width: 920px; margin: 0 auto; }
.row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  cursor: pointer;
  color: var(--muted);
  transition: color 0.18s ease, padding-left 0.18s ease;
}
.row:hover { color: var(--ink); padding-left: 14px; }
.row .num { font-size: 12px; }
.row .ttl { font-size: clamp(15px, 2.4vw, 22px); letter-spacing: 0.01em; }
.row .yr { font-size: 12px; }

/* floating thumbnail trailing the cursor */
.trail {
  position: fixed;
  top: 0; left: 0;
  width: 180px;
  height: auto;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  will-change: transform;
}
.trail.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- social rail (same icons as the 3D gallery) ---------- */
.social-rail {
  position: fixed;
  bottom: 28px;
  left: clamp(16px, 4vw, 40px);
  display: flex;
  gap: 14px;
  z-index: 6; /* under the corridor overlay (z 100) */
}
.social-link {
  display: inline-flex;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.social-link:hover { color: #ff5a3c; transform: translateY(-2px); }
.social-link svg { width: 100%; height: 100%; fill: currentColor; }

/* ---------- corridor (detail overlay) ---------- */
.corridor {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
}
.corridor[hidden] { display: none; }

.corridor-track {
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.corridor-track::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(var(--bar-h) + 24px) clamp(20px, 6vw, 96px) 28px;
}
.slide figure { margin: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22); }
.slide .fallback { width: min(60vw, 420px); aspect-ratio: 3 / 4; }

.slide-cap {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 18px;
  font-family: var(--mono);
  font-size: 13px;
}
.slide-cap .ttl { font-size: 16px; letter-spacing: 0.02em; }
.slide-cap .yr, .slide-cap .desc { color: var(--muted); }
.slide-cap .desc { flex-basis: 100%; max-width: 70ch; line-height: 1.6; }
.slide-cap .palette { display: inline-flex; gap: 4px; }
.slide-cap .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }

/* controls */
.corridor-close, .corridor-nav {
  position: fixed;
  z-index: 110;
  appearance: none;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, transform 0.18s ease;
}
.corridor-close { top: 14px; right: clamp(16px, 4vw, 40px); width: 40px; height: 40px; font-size: 15px; }
.corridor-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 26px; line-height: 1; }
.corridor-nav.prev { left: clamp(12px, 2vw, 28px); }
.corridor-nav.next { right: clamp(12px, 2vw, 28px); }
.corridor-close:hover, .corridor-nav:hover { background: var(--paper-2); }
.corridor-nav[disabled] { opacity: 0.3; pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .wordmark { letter-spacing: 0.22em; }
  .bar-right { gap: 10px; }
  .trail { display: none; } /* no cursor on touch */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- about / o mnie overlay ---------- */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: about-fade 0.25s ease;
}
.about-overlay[hidden] { display: none; }
@keyframes about-fade { from { opacity: 0; } to { opacity: 1; } }

.about-card {
  position: relative;
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid #ff5a3c;
  padding: clamp(28px, 5vw, 44px);
  box-shadow: 0 24px 80px rgba(23, 19, 13, 0.28);
}
.about-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.about-close:hover { color: var(--ink); border-color: var(--ink); }

.about-name {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 22px;
}
.about-sub {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff5a3c;
}
.about-tag {
  margin: 4px 0 20px;
  font-size: 13px;
  color: var(--muted);
}
.about-body p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}
.about-body p:first-child { color: var(--ink); }
.about-sig {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.about-links {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
}
.about-links a {
  color: #ff5a3c;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid transparent;
}
.about-links a:hover { border-bottom-color: currentColor; }
