/* ============================================================
   WASAFIRI — a minimalist gallery of the wild
   plaster walls · hung works · hairline details
   ============================================================ */

:root {
  /* wall tone sampled from the video frames' edges (#B0A9A0–#B9B0A7)
     so the works melt into the wall */
  --wall: #b3aca3;
  --wall-deep: #a89f95;
  --ink: #1a1510;
  --ink-soft: #4e433a;
  --hairline: rgba(26, 21, 16, 0.2);
  --gold: #7c621c;
  --gold-soft: #98803a;
  --serif: "Cormorant Garamond", serif;
  --sans: "Outfit", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: initial; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--sans);
  background: var(--wall);
  background-image: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255,255,255,.16), transparent 60%);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--wall); }

em { font-style: italic; }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 90;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); }
  60% { transform: translate(-2%,-2%); }
  80% { transform: translate(3%,3%); }
}

/* ---------- the work, melting into the wall ---------- */
.art { position: relative; transform-style: preserve-3d; }
.art-media {
  position: relative;
  background: transparent;
  transform-style: preserve-3d;
  /* fully feathered edges — the video dissolves into the wall,
     no rectangle, no border, no shadow */
  -webkit-mask-image: radial-gradient(115% 100% at 50% 50%, #000 42%, transparent 74%);
  mask-image: radial-gradient(115% 100% at 50% 50%, #000 42%, transparent 74%);
}
.art-media video {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.art-caption {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-top: 1.1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--hairline);
}
.art-caption-no {
  font-size: .62rem;
  letter-spacing: .3em;
  color: var(--gold);
  white-space: nowrap;
}
.art-caption-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0;
  background: var(--wall);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.loader-inner { text-align: center; }
.loader-word {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 5vw, 3rem);
  letter-spacing: .5em;
  padding-left: .5em;
}
.loader-line {
  display: block;
  width: min(240px, 55vw);
  height: 1px;
  background: var(--hairline);
  margin: 1.5rem auto;
  overflow: hidden;
}
.loader-line-fill {
  display: block; height: 100%; width: 0%;
  background: var(--ink);
  transition: width .3s ease;
}
.loader-sub {
  font-size: .62rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.6rem clamp(1.4rem, 4vw, 3.2rem);
  transition: background .4s ease, padding .4s ease;
}
.nav.scrolled {
  background: rgba(179,172,163,.88);
  backdrop-filter: blur(12px);
  padding-top: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}
.nav-logo {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: .35em;
  color: var(--ink);
  text-decoration: none;
}
.nav-links { display: flex; gap: 2.4rem; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .7rem;
  font-weight: 300;
  letter-spacing: .26em;
  text-transform: uppercase;
  transition: color .3s;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-size: .68rem;
  font-weight: 300;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: .35em;
  transition: color .3s, border-color .3s;
}
.nav-cta:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- hero — step into the sunset (3D scroll film) ----------
   a tall runway; the film stays pinned and fullscreen while scroll
   scrubs it, and panes of copy fly past in depth, one per scene */
.hero {
  position: relative;
  height: 520vh;
}
.hero-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  perspective: 1000px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  will-change: transform;
}
.hero-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(6rem, 12vh, 8rem) clamp(1.4rem, 5vw, 4rem);
  opacity: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  /* legible directly over the film — light type with a soft shadow */
  color: #fdf8f0;
  text-shadow: 0 1px 30px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.4);
}
.hero-scene.is-first { opacity: 1; }
.hero-scene.is-live { pointer-events: auto; }

.hero-scene-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1.08;
  max-width: 11em;
  margin-top: 1.2rem;
}
.hero-scene-title em { color: #f2c879; font-style: italic; }
.hero-scene-text {
  margin-top: 1.6rem;
  font-weight: 300;
  font-size: .9rem;
  line-height: 1.9;
  color: #f4ede2;
}

.hero-cta-row {
  margin-top: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  flex-wrap: wrap;
}
.hero-cta {
  display: inline-block;
  font-size: .72rem;
  font-weight: 300;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--wall);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 1.15em 2.8em 1.05em;
  transition: background .35s, color .35s;
}
.hero-cta {
  background: rgba(253,248,240,.96);
  border-color: rgba(253,248,240,.96);
  color: var(--ink);
  text-shadow: none;
}
.hero-cta:hover { background: transparent; color: #fdf8f0; }
.hero-cta-ghost {
  font-size: .7rem;
  font-weight: 300;
  letter-spacing: .26em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fdf8f0;
  border-bottom: 1px solid rgba(253,248,240,.7);
  padding-bottom: .4em;
  transition: color .3s, border-color .3s;
}
.hero-cta-ghost:hover { color: #f2c879; border-color: #f2c879; }

.hero-kicker span {
  display: inline-block;
  font-size: .68rem;
  font-weight: 300;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: #f4ede2;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.2rem, 9.5vw, 8.5rem);
  line-height: 1.02;
  letter-spacing: .01em;
  margin-top: 1.2rem;
}
.hero-title-row { display: block; overflow: hidden; }
.hero-title-em { font-style: italic; }
.reveal-word { display: inline-block; }
.reveal-line { overflow: hidden; }

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.6rem, 4vh, 2.6rem);
  transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
}
.hero-scroll-text {
  font-size: .6rem; letter-spacing: .32em; text-transform: uppercase;
  color: #f4ede2;
  text-shadow: 0 1px 12px rgba(0,0,0,.5);
}
.hero-scroll-track {
  width: 1px; height: 52px;
  background: rgba(253,248,240,.35);
  position: relative; overflow: hidden;
}
.hero-scroll-thumb {
  position: absolute; top: -16px; left: 0;
  width: 1px; height: 16px;
  background: #fdf8f0;
  animation: scrollThumb 1.9s ease-in-out infinite;
}
@keyframes scrollThumb { 0% { top: -16px; } 100% { top: 52px; } }

/* ---------- manifesto ---------- */
.manifesto {
  padding: clamp(7rem, 16vh, 12rem) 1.5rem;
  display: flex; justify-content: center;
}
.manifesto-text {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1.45;
  max-width: 20em;
  text-align: center;
}
.manifesto-text em { color: var(--gold); }
.manifesto-text .w {
  display: inline-block;
  opacity: .1;
}

/* ---------- gallery — one wall, three works ---------- */
.gallery { position: relative; }
.gallery-pin {
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  position: relative;
}
.gallery-track {
  display: flex;
  height: 100%;
  width: max-content;
  will-change: transform;
  transform-style: preserve-3d;
}
.exhibit-art, .exhibit-info { will-change: transform; }
.exhibit {
  width: 100vw;
  height: 100%;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(5rem, 10vh, 7rem) clamp(1.6rem, 6vw, 6.5rem);
}
.exhibit-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.exhibit-flip .exhibit-info { order: 2; }
.exhibit-flip .exhibit-art { order: 1; }

.exhibit-info { max-width: 30rem; }
.exhibit-no {
  font-size: .64rem;
  letter-spacing: .34em;
  color: var(--gold);
}
.exhibit-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 6.5vw, 5.6rem);
  line-height: 1;
  margin: 1.1rem 0 1.4rem;
}
.exhibit-desc {
  font-weight: 300;
  font-size: clamp(.88rem, 1.1vw, 1rem);
  line-height: 1.85;
  color: var(--ink-soft);
  margin-bottom: 1.8rem;
}
.exhibit-link {
  font-size: .7rem;
  font-weight: 300;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: .4em;
  transition: color .3s, border-color .3s, letter-spacing .3s;
}
.exhibit-link:hover { color: var(--gold); border-color: var(--gold); letter-spacing: .32em; }

.exhibit-art {
  width: 100%;
  will-change: transform;
}
.exhibit-art .art-media { aspect-ratio: 16 / 10; }

.gallery-progress {
  position: absolute;
  left: 50%; bottom: clamp(1.6rem, 4vh, 2.6rem);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 1rem;
  font-size: .62rem;
  letter-spacing: .26em;
  color: var(--ink-soft);
}
.gallery-progress-bar {
  width: min(180px, 30vw);
  height: 1px;
  background: var(--hairline);
  overflow: hidden;
}
#galleryBar {
  display: block;
  height: 100%; width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------- expeditions ---------- */
.expeditions {
  padding: clamp(7rem, 14vh, 11rem) clamp(1.4rem, 5vw, 4rem);
}
.expeditions-head { text-align: center; margin-bottom: clamp(3.5rem, 8vh, 6rem); }
.section-kicker {
  font-size: .66rem;
  font-weight: 300;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}
.expeditions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  max-width: 1360px;
  margin: 0 auto;
}
.card {
  transform-style: preserve-3d;
  will-change: transform;
}
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image: radial-gradient(115% 100% at 50% 50%, #000 40%, transparent 74%);
  mask-image: radial-gradient(115% 100% at 50% 50%, #000 40%, transparent 74%);
}
.card-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.6,.2,1);
}
.card:hover .card-media video { transform: scale(1.06); }
.card-body {
  padding: 1.3rem .2rem 0;
}
.card-tag {
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.card-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.65rem;
  margin: .55rem 0 .5rem;
}
.card-text {
  font-weight: 300;
  font-size: .87rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.card-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}
.card-price { font-family: var(--serif); font-size: 1.05rem; }
.card-link {
  font-size: .66rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: .3em;
  transition: color .3s, border-color .3s;
}
.card-link:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- footer ---------- */
.footer {
  padding: clamp(7rem, 16vh, 12rem) clamp(1.4rem, 5vw, 4rem) 2.5rem;
  border-top: 1px solid var(--hairline);
}
.footer-inner { max-width: 1360px; margin: 0 auto; text-align: center; }
.footer-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 1.04;
  margin-bottom: 2.8rem;
}
.footer-title em { color: var(--gold); }
.footer-mail {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: .18em;
  transition: color .3s, border-color .3s;
}
.footer-mail:hover { color: var(--gold); border-color: var(--gold); }
.footer-phone {
  margin-top: 1.3rem;
  font-weight: 300;
  font-size: .82rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
}
.footer-bottom {
  margin-top: clamp(4.5rem, 9vh, 7rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .64rem;
  font-weight: 300;
  letter-spacing: .18em;
  color: var(--ink-soft);
}
.footer-socials { display: flex; gap: 1.6rem; }
.footer-socials a { color: var(--ink-soft); text-decoration: none; transition: color .3s; }
.footer-socials a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .hero { height: 460vh; }
  .hero-scene-text br { display: none; }
  .hero-scene-text { max-width: 34ch; }
  .exhibit, .exhibit-flip {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 1.8rem;
    padding-top: clamp(5rem, 12vh, 7rem);
  }
  .exhibit-flip .exhibit-info { order: 1; }
  .exhibit-flip .exhibit-art { order: 2; }
  .exhibit-art .art-media { aspect-ratio: 16 / 9; }
  .exhibit-title { font-size: clamp(2.2rem, 9vw, 3.2rem); margin: .8rem 0 1rem; }
  .exhibit-desc { margin-bottom: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .hero-scroll-thumb { animation: none; }
}
