*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root { --fs: 11px; --pad: 20px; }
@media (min-width: 810px)  { :root { --fs: 10px; --pad: 50px; } }
@media (min-width: 1200px) { :root { --fs: 13px; --pad: 50px; } }
@media (min-width: 1440px) { :root { --fs: 15px; --pad: 80px; } }
@media (min-width: 1920px) { :root { --fs: 17px; --pad: 120px; } }

html, body {
  width: 100%; height: 100%;
  font-family: Helvetica, Arial, sans-serif;
  font-size: var(--fs);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  background-color: #f5f4f0;
}

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 52px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 var(--pad);
}
nav a {
  text-decoration: none; color: #111;
  font-size: var(--fs); letter-spacing: 0.1em; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
nav a:hover { opacity: 0.5; }
.nav-active { opacity: 0.5; pointer-events: none; cursor: default; }
.nav-right-group { display: flex; align-items: center; gap: 3em; }
.nav-center {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  height: 52px; display: flex; align-items: center;
  white-space: nowrap; z-index: 9100;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.nav-center:hover { opacity: 0.5; }
.nav-title, .nav-subtitle {
  font-size: var(--fs); font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.nav-gap { display: inline-block; width: 3em; }
@media (max-width: 809px) {
  .nav-subtitle  { display: none; }
  .nav-gap       { display: none; }
  /* Mobile nav: hide active page label, keep editorial + title */
  .nav-active    { display: none; }
}

.slider-wrapper {
  position: fixed; top: 52px; left: 0; right: 0; z-index: 1100;
  padding: 20px var(--pad) 6px; display: flex; flex-direction: column;
}
.slider-track {
  position: relative; width: 100%; height: 84px;
  cursor: pointer; background-repeat: no-repeat;
}
.slider-thumb {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; background: #111; border-radius: 50%;
  cursor: grab; z-index: 1; pointer-events: none;
}
.slider-label {
  font-size: var(--fs); letter-spacing: 0.06em; color: #333;
  margin-top: 4px; position: relative; align-self: flex-start;
}

#scene {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden; cursor: pointer;
}
#scene.grabbing { cursor: grabbing; }

#grid {
  position: absolute; top: 0; left: 0;
  display: grid;
  grid-template-columns: repeat(10, var(--tile));
  gap: var(--gap);
  padding: calc(var(--tile) * 3);
  transform-origin: 0 0;
  will-change: transform;
}

.tile {
  width: var(--tile); height: var(--tile);
  overflow: visible; position: relative;
  z-index: 0; display: flex; align-items: center; justify-content: center;
}

.tile::before {
  content: ""; position: absolute;
  inset: calc(var(--gap) / -2); z-index: 2;
}

.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: auto; -webkit-user-drag: none;
  cursor: default;
  transition: transform 2.4s cubic-bezier(0.85, 0, 1, 1);
  transform-origin: center center; position: relative; z-index: 0;
}



.tile-placeholder {
  width: 100%; height: 100%; background: #dddbd7;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #999; letter-spacing: 0.05em;
  pointer-events: none;
  transition: transform 2.4s cubic-bezier(0.37, 0, 0.63, 1);
  transform-origin: center center;
}


footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  padding: 12px var(--pad);
}
footer p {
  font-size: var(--fs); font-family: Helvetica, Arial, sans-serif;
  line-height: 1.20; color: #111; letter-spacing: 0.01em;
  text-align: justify; white-space: normal;
}

/* ── SLIDER TICKS ────────────────────────────────────────────
   Centralized here so both index.html and detail.html can
   share them via style.css, with responsive mobile override.
─────────────────────────────────────────────────────────── */
.slider-tick {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 42px;
  margin-top: -21px;
  background: #111;
  transform-origin: center center;
  transform: scaleY(0);
  transition: none;
}
.slider-tick-tall {
  height: 84px;
  margin-top: -42px;
}
.slider-tick.tick-visible {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scaleY(1);
}
@media (max-width: 809px) {
  .slider-wrapper        { padding-top: 10px; }
  .slider-track          { height: 72px; }
  .slider-tick           { width: 1px; height: 36px; margin-top: -18px; }
  .slider-tick-tall      { height: 72px; margin-top: -36px; }
  .slider-thumb          { width: 7px; height: 7px; }
  .slider-label          { margin-top: 4px; }
  .edge-overlay.top      { height: 20px; }
  /* On mobile: hide left/right overlays — neighbours are far off-screen,
     overlays only add unwanted gradient over the hero image edges. */
  .edge-overlay.left,
  .edge-overlay.right    { display: none; }
}

/* ── EDGE FADE + BLUR OVERLAYS ──────────────────────────────
   Four absolutely positioned divs over #scene.
   Each uses backdrop-filter: blur() + a gradient mask
   so blur and opacity both fade from edge inward.
   The gradient on -webkit-mask-image controls the opacity falloff.
   pointer-events: none so they dont block interaction.
─────────────────────────────────────────────────────────── */
.edge-overlay {
  position: fixed;
  z-index: 90;
  pointer-events: none;
}

/* Each overlay uses backdrop-filter for the blur,
   and mask-image to fade it from full effect at edge to nothing inward */

.edge-overlay.top {
  top: 0; left: 0; right: 0;
  height: 40px;
 /*  backdrop-filter: blur(4px); */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: linear-gradient(
    to bottom,
    rgba(245,244,240, 0.80) 0%,
    rgba(245,244,240, 0.00) 100%
  );
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  mask-image:         linear-gradient(to bottom, black 0%, transparent 100%);
}

.edge-overlay.bottom {
  bottom: 0; left: 0; right: 0;
  height: 25%;
  /*  backdrop-filter: blur(4px); */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: linear-gradient(
    to top,
    rgba(245,244,240, 0.80) 0%,
    rgba(245,244,240, 0.00) 100%
  );
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
  mask-image:         linear-gradient(to top, black 0%, transparent 100%);
}

.edge-overlay.left {
  top: 0; left: 0; bottom: 0;
  width: 20%;
  /*  backdrop-filter: blur(4px); */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: linear-gradient(
    to right,
    rgba(245,244,240, 0.80) 0%,
    rgba(245,244,240, 0.00) 100%
  );
  -webkit-mask-image: linear-gradient(to right, black 0%, transparent 100%);
  mask-image:         linear-gradient(to right, black 0%, transparent 100%);
}

.edge-overlay.right {
  top: 0; right: 0; bottom: 0;
  width: 20%;
  /*  backdrop-filter: blur(4px); */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: linear-gradient(
    to left,
    rgba(245,244,240, 0.80) 0%,
    rgba(245,244,240, 0.00) 100%
  );
  -webkit-mask-image: linear-gradient(to left, black 0%, transparent 100%);
  mask-image:         linear-gradient(to left, black 0%, transparent 100%);
}