/* Rubick, THE GER. Day edition: warm summer, green and blue. */

:root {
  --bg: #f2e9d7;
  --ink: #241b0e;
  --dim: #7d7057;
  --line: #d9cbab;
  --red: #b3402a;
  --red-hot: #d05236;
  --gold: #a08543;
  --gold-soft: #8f7439;
  --paper: #faf4e6;
  --display: "Cormorant Garamond", serif;
  --body: "Golos Text", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
::selection {
  background: var(--red);
  color: var(--paper);
}

/* film grain over everything: ties the photography together */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.03;
  mix-blend-mode: overlay;
}

/* ---------- preloader: the ride starts only when everything is in memory ---------- */
html.is-loading {
  overflow: hidden;
}
.loader {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
/* the rider gallops in place while the felt loads, offline-dino style */
.loader-horse {
  width: 112px;
  height: 80px;
  image-rendering: pixelated;
}
.loader-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--ink);
}
.loader-bar {
  width: 172px;
  height: 12px;
  border: 1px solid var(--dim);
  padding: 2px;
  overflow: hidden;
}
.loader-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 8px);
  transform: scaleX(0);
  transform-origin: left center;
}
.loader-pct {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  padding-top: max(18px, env(safe-area-inset-top));
  background: linear-gradient(rgba(36, 27, 14, 0.38), rgba(36, 27, 14, 0));
  pointer-events: none;
}
.nav a,
.nav .loc {
  pointer-events: auto;
}
.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fffdf6;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.34em;
  text-shadow: 0 1px 10px rgba(20, 16, 8, 0.45);
}
.mark svg {
  color: #fffdf6;
  filter: drop-shadow(0 1px 6px rgba(20, 16, 8, 0.4));
}
.links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--mono);
  font-size: 12px;
}
.navstudio {
  color: #fffdf6;
  text-decoration: none;
  letter-spacing: 0.18em;
  border: 1px solid rgba(255, 253, 246, 0.55);
  border-radius: 3px;
  padding: 8px 16px;
  background: rgba(36, 27, 14, 0.25);
  backdrop-filter: blur(4px);
  transition:
    border-color 0.3s,
    color 0.3s,
    background 0.3s;
}
.navstudio:hover {
  border-color: var(--red-hot);
  color: #fff;
  background: var(--red);
}
.loc {
  color: rgba(255, 253, 246, 0.85);
  letter-spacing: 0.18em;
  text-shadow: 0 1px 8px rgba(20, 16, 8, 0.45);
}

/* ---------- full-bleed photo helper ---------- */
.s1-art picture,
.toono-img,
.night-img {
  position: absolute;
  inset: 0;
}
.s1-art img,
.toono-img img,
.night-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- scene 1: approach + entry, one continuous shot ---------- */
.s1 {
  position: relative;
  height: 100vh;
  /* biome-ignore lint/suspicious/noDuplicateProperties: dvh upgrade where supported */
  height: 100dvh;
  overflow: hidden;
}
.s1-art {
  position: absolute;
  inset: 0;
  will-change: transform;
  z-index: 0;
}
.s1-breathe {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.entry-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  pointer-events: none;
  will-change: transform, opacity;
}
/* the tilt film is a body-level overlay: fixed positioning that no pinned
   or transformed ancestor can capture, it always covers the true viewport */
.walls-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  pointer-events: none;
  will-change: opacity;
}
#smoke {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(2.5px);
  z-index: 2;
}
.entry-video.playing {
  position: fixed;
  z-index: 55;
}
.walls-video.playing {
  z-index: 55;
}
.white-out {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  z-index: 56;
  pointer-events: none;
}

/* light veils: scenes open from warm daylight, every handoff is a light flash */
.veil {
  position: absolute;
  inset: 0;
  background: #f7efdd;
  opacity: 1;
  z-index: 8;
  pointer-events: none;
}
/* the walls open on the exact frame the walls film ends on */
.s4-veil {
  background-image: url("assets/khana-view-2560.webp");
  /* biome-ignore lint/suspicious/noDuplicateProperties: url() fallback for browsers without image-set type() */
  background-image: image-set(
    url("assets/khana-view-2560.avif") type("image/avif"),
    url("assets/khana-view-2560.webp") type("image/webp")
  );
  background-size: cover;
  background-position: center;
}

/* ---------- scene 3: toono ---------- */
.s3 {
  position: relative;
  height: 100vh;
  /* biome-ignore lint/suspicious/noDuplicateProperties: dvh upgrade where supported */
  height: 100dvh;
}
.s3-pin {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #e9ddc4;
}
.s3-look {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.toono-img img {
  object-position: center center;
}
.shaft {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    46% 46% at 50% 46%,
    rgba(255, 224, 150, 0.18) 0%,
    rgba(255, 200, 110, 0.06) 42%,
    transparent 68%
  );
}
.motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mote {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 236, 190, 0.9);
  animation: drift linear infinite;
}
@keyframes drift {
  from {
    transform: translate(0, 0);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  88% {
    opacity: 0.5;
  }
  to {
    transform: translate(28px, -110px);
    opacity: 0;
  }
}
.name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", var(--display);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 68px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: #fffdf6;
  z-index: 3;
  text-shadow:
    0 2px 22px rgba(25, 45, 80, 0.45),
    0 0 60px rgba(255, 240, 200, 0.5);
  transform: translateY(-4%);
}
.name span {
  display: inline-block;
  will-change: transform, opacity, filter;
}
.tagline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  text-align: center;
  font-family: var(--body);
  font-size: clamp(14px, 1.6vw, 19px);
  color: #fffdf6;
  z-index: 3;
  text-shadow: 0 1px 14px rgba(25, 35, 60, 0.55);
}

/* ---------- scene 4: khana walls ---------- */
.s4 {
  position: relative;
  height: 100vh;
  /* biome-ignore lint/suspicious/noDuplicateProperties: dvh upgrade where supported */
  height: 100dvh;
}
.s4-pin {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}
.s4-title {
  position: absolute;
  top: 84px;
  left: 26px;
  z-index: 5;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--ink);
  opacity: 0.75;
}
.track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 3.5vw;
  padding: 0 7vw;
  width: max-content;
  will-change: transform;
  background-image: url("assets/khana-pan-7644.webp");
  /* biome-ignore lint/suspicious/noDuplicateProperties: url() fallback for browsers without image-set type() */
  background-image: image-set(
    url("assets/khana-pan-7644.avif") type("image/avif"),
    url("assets/khana-pan-7644.webp") type("image/webp")
  );
  background-repeat: repeat-x;
  /* COVER-match the veil so the wall keeps the exact same scale and crop
     when the veil lifts: height-fit normally, width-driven on wide screens,
     horizontally centered like cover on narrow ones */
  background-size: auto max(100%, 55.815vw);
  background-position: min(0px, calc((100vw - 179.167vh) / 2)) 50%;
}
.wallseg {
  width: 10vw;
  height: 52vh;
}
.wallseg.last {
  width: 8vw;
}
.window {
  width: min(460px, 80vw);
  flex-shrink: 0;
  border: 1px solid rgba(217, 203, 171, 0.9);
  border-radius: 6px;
  background: linear-gradient(rgba(250, 244, 230, 0.94), rgba(247, 239, 221, 0.96));
  padding: 18px 18px 26px;
  position: relative;
  box-shadow: 0 22px 60px rgba(105, 78, 38, 0.28);
}
.winart {
  display: block;
  margin-bottom: 18px;
}
.winart img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
}
.window h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.06em;
  color: var(--ink);
  padding: 0 10px;
}
.window p {
  margin: 10px 10px 18px;
  color: var(--dim);
  font-size: 15px;
}
.status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 3px;
  display: inline-block;
  margin-left: 10px;
}
.status.live {
  color: var(--red-hot);
  border: 1px solid var(--red);
}
.status.live:hover {
  background: var(--red);
  color: var(--paper);
}
.status.soon {
  color: var(--dim);
  border: 1px dashed var(--line);
}
.win-studio {
  box-shadow:
    0 0 80px rgba(255, 196, 90, 0.5),
    0 22px 60px rgba(105, 78, 38, 0.28);
}

/* ---------- scene 5: studio ---------- */
.s5 {
  position: relative;
  padding: 15vh 6vw 12vh;
  overflow: hidden;
}
.s5-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}
.s5 h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 54px);
  letter-spacing: 0.04em;
  color: var(--ink);
}
.film {
  display: flex;
  gap: 14px;
  margin: 44px 0 26px;
  will-change: transform;
}
.cell {
  flex: 0 0 200px;
  height: 260px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(105, 78, 38, 0.22);
}
.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ba {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 10px 0 26px;
}
.ba > div {
  position: relative;
  flex: 0 1 320px;
  height: 300px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(105, 78, 38, 0.22);
}
.ba img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ba span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  color: #fffdf6;
  background: rgba(36, 27, 14, 0.72);
  padding: 5px 10px;
  border-radius: 3px;
}
.after {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.pitch {
  color: var(--dim);
  max-width: 52ch;
  margin: 0 auto 34px;
}
.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.24em;
  color: #fffdf6;
  background: var(--red);
  text-decoration: none;
  padding: 16px 34px;
  border-radius: 3px;
  transition:
    background 0.3s,
    transform 0.3s;
  box-shadow: 0 10px 26px rgba(179, 64, 42, 0.35);
}
.cta:hover {
  background: var(--red-hot);
  transform: translateY(-2px);
}

/* ---------- scene 6: hearth ---------- */
.s6 {
  position: relative;
  padding: 20vh 8vw;
  text-align: center;
  overflow: hidden;
}
.s6 .glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 55% at 50% 78%, rgba(255, 196, 90, 0.25), transparent 70%);
}
.s6 .line {
  position: relative;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 40px);
  max-width: 26ch;
  margin: 0 auto 26px;
  color: var(--ink);
}

/* ---------- scene 7: footer, golden hour ---------- */
.s7 {
  position: relative;
  min-height: 100vh;
  /* biome-ignore lint/suspicious/noDuplicateProperties: dvh upgrade where supported */
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.s7::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52%;
  background: linear-gradient(transparent, rgba(24, 16, 7, 0.66));
  z-index: 2;
  pointer-events: none;
}
.s7-art {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.s7-ui {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 8vw 44px;
  padding-bottom: max(44px, calc(24px + env(safe-area-inset-bottom)));
}
.foot-links {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  flex-wrap: wrap;
}
.foot-links a {
  color: #fffdf6;
  text-decoration: none;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 10px rgba(30, 22, 10, 0.85);
}
.foot-links a:hover {
  color: #ffd9a8;
}
.foot-links .loc {
  color: rgba(255, 253, 246, 0.85);
}
.fine {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 253, 246, 0.8);
  letter-spacing: 0.16em;
  text-shadow: 0 1px 8px rgba(30, 22, 10, 0.8);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .mote {
    animation: none;
    opacity: 0.5;
  }
  .veil {
    display: none;
  }
  #smoke {
    display: none;
  }
  .entry-video,
  .walls-video {
    display: none;
  }
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .track {
    background-image: url("assets/khana-pan-3822.webp");
    /* biome-ignore lint/suspicious/noDuplicateProperties: url() fallback for browsers without image-set type() */
    background-image: image-set(
      url("assets/khana-pan-3822.avif") type("image/avif"),
      url("assets/khana-pan-3822.webp") type("image/webp")
    );
  }
  .wallseg {
    width: 12vw;
  }
  .window {
    padding: 14px 14px 20px;
  }
  .ba {
    flex-direction: column;
    align-items: center;
  }
  .ba > div {
    width: 100%;
  }
  .cell {
    flex-basis: 150px;
    height: 195px;
  }
}
