/* ============================================================
   Metzler Bros — static rebuild (de-Cargo'd)
   Typography, colors and metrics ported from the original
   Cargo site stylesheet. Layout + animations reimplemented.
   ============================================================ */

@font-face {
  font-family: "Diatype Variable";
  src: url("/assets/fonts/DiatypePlusVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --base-size: 12.96px;
  --swatch-1: rgba(0, 0, 0, 0.85);
  --swatch-2: rgba(0, 0, 0, 0.75);
  --swatch-3: rgba(0, 0, 0, 0.6);
  --swatch-4: rgba(0, 0, 0, 0.4);
  --swatch-5: rgba(0, 0, 0, 0.25);
  --accent: #ff0000;
  --pad: 2rem;
}

* { box-sizing: border-box; }
:focus { outline: 0; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-size: var(--base-size);
}
html, body { overflow-x: hidden; }
body { max-width: 100vw; }

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: none;
  background-color: #fff;
  font-family: "Diatype Variable", -apple-system, BlinkMacSystemFont, sans-serif;
  font-variation-settings: 'slnt' 0, 'MONO' 0;
  color: var(--swatch-2);
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:active, .zoomable img:active { opacity: 0.7; }

/* ---------- Typography (ported) ---------- */
h1 {
  font-family: "Diatype Variable";
  font-weight: 400;
  margin: 0;
  font-size: 5.45rem;
  line-height: 1;
  color: var(--swatch-1);
  letter-spacing: -0.02em;
  display: block;
}
h1 a { color: var(--swatch-1); }
h2 {
  font-family: "Diatype Variable";
  font-weight: 500;
  margin: 0;
  color: var(--swatch-2);
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}
h2 a { color: var(--swatch-2); text-decoration: none; }
bodycopy {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--swatch-2);
  font-family: "Diatype Variable";
  line-height: 1.2;
  display: block;
}

/* ---------- Fixed chrome ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--pad);
  pointer-events: none;
}
.site-header a { pointer-events: auto; }
.site-header .logo { display: block; width: 32.8%; max-width: 32.8%; }
.site-header .logo img { width: 100%; height: auto; display: block; }
.site-header .info-btn {
  font-family: "Diatype Variable";
  font-weight: 400;
  font-size: 5.45rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--swatch-1);
  white-space: nowrap;
}
.site-header .info-btn.active { color: var(--accent); }

.site-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  padding: var(--pad);
  padding-bottom: 1.5rem;
  pointer-events: none;
}
.site-nav h1 { pointer-events: none; }
.site-nav a { pointer-events: auto; }
.site-nav .num { font-feature-settings: normal; }
.site-nav a.active { color: var(--accent); }
.site-nav a:hover { color: var(--accent); }

/* ---------- Main scroll area ---------- */
.content {
  flex: 1 0 auto;
  width: 100%;
  position: relative;
  overflow-x: hidden; /* clip rotation overflow at the page edge, like the original */
}

/* Home: marquee fills viewport between fixed header & footer */
.page-home, body.page-home { height: 100vh; overflow: hidden; }
.page-home .content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 0;
}

/* Gallery pages: padding so content clears the fixed header/footer.
   Exact values are set by site.js (pin-padding); these are fallbacks
   matching the original at desktop width. */
.page-gallery .content {
  padding: var(--pad);
  padding-top: 148px;
  padding-bottom: 213px;
}

/* ---------- Marquee ---------- */
.marquee {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  align-items: center;
}
.marquee-track {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  height: 100%;
  animation: marquee-scroll 80s linear infinite;
  will-change: transform;
}
.marquee-track .m-cell {
  /* wide spacing so only one ornament is ever visible (no doubling) */
  flex: 0 0 170vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.marquee-track img {
  height: 70vh;
  width: auto;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Freeform gallery ---------- */
.gallery.freeform {
  position: relative;
  width: 100%;
  height: 0;
}
.gallery.freeform .item {
  position: absolute;
  transform-origin: center center;
}
.gallery.freeform .item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Columnized gallery (toppers) ---------- */
.gallery.columnized {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.gallery.columnized .col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gallery.columnized .item img {
  width: 100%;
  height: auto;
  display: block;
}

.zoomable { cursor: zoom-in; }

/* ---------- Animations: continuous rotation + twinkle ---------- */
@keyframes spin {
  from { transform: rotate(var(--rot, 0deg)); }
  to   { transform: rotate(calc(var(--rot, 0deg) + 360deg)); }
}
.item.spin {
  animation: spin var(--spin-dur, 60s) linear infinite;
  animation-direction: var(--spin-dir, normal);
}

/* ---------- Info page ---------- */
.page-info .content {
  padding: var(--pad);
  padding-top: 148px;
  padding-bottom: 213px;
}
.column-set {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  max-width: 100%;
}
.column-unit { grid-column: span 12; }
.info-content h2 { font-weight: 500; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(255, 255, 255, 0.96);
  display: none;
  align-items: center; justify-content: center;
  padding: 3rem;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Responsive ---------- */
/* Cargo keeps a fixed desktop base-size and switches to a viewport-scaled
   size on mobile (~2.755vw). */
@media (max-width: 767px) {
  :root { --base-size: 2.755vw; }
  h1 { font-size: 3rem; }
  .site-header .info-btn { font-size: 3rem; }
  .site-header .logo { width: 55%; max-width: 55%; }
  .gallery.columnized { flex-direction: column; }
  .column-unit { grid-column: span 12 !important; }
  .marquee-track .m-cell { flex: 0 0 220vw; }
  .marquee-track img { height: 52vh; }
  .page-gallery .content { padding-top: 7rem; }
}
@media (max-width: 420px) {
  :root { --base-size: 10.3px; }
}
