/* ==========================================================
   REZN® — Case Studies page
   ========================================================== */

:root {
  --paper: #ffffff;
  --ink: #111112;
  --grey: #6f6f71;
  --line: rgba(17, 17, 18, .08);
  --line-dark: rgba(255, 255, 255, .07);
  --accent: #ff5a36;
  --sans: "HelveticaNeueCyr", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "HelveticaNeueCyr", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* 4-column grid: side gutter + 4 equal columns */
  --gut: clamp(16px, 3.3vw, 64px);
  --col: calc((100vw - var(--gut) * 2) / 4);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); } 50% { transform: translate(2%,-4%); } 75% { transform: translate(-4%,-1%); } }

/* ==========================================================
   INTRO
   ========================================================== */
.intro {
  position: relative; z-index: 1;
  background: var(--paper);
  padding: 32px var(--gut) clamp(40px, 5vw, 72px);
  display: flex; flex-direction: column;
}

.intro__head { max-width: 860px; margin: clamp(72px, 11vw, 160px) auto clamp(48px, 6vw, 88px); text-align: center; animation: rise 1.2s var(--ease) both; }
.intro__eyebrow { margin: 0 0 18px; font-size: 10px; color: var(--grey); }
.intro__head h1 { margin: 0; font-size: clamp(48px, 7.2vw, 132px); font-weight: 500; letter-spacing: -.05em; line-height: .95; }
.intro__text { margin: clamp(22px, 2.4vw, 36px) auto 0; max-width: 680px; font-size: 14px; line-height: 1.55; color: var(--grey); }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toolbar { width: 100%; max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 200px 200px 1fr; gap: 8px; animation: rise 1.2s .1s var(--ease) both; }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 20px; top: 50%; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select, .search { height: 60px; border-radius: 999px; background: none; border: 1px solid rgba(17, 17, 17, .14); transition: background-color .2s cubic-bezier(.614, .001, .333, .995), border-color .2s; }
.select select { width: 100%; appearance: none; -webkit-appearance: none; padding: 0 44px 0 20px; font: 13px var(--sans); color: var(--grey); cursor: pointer; }
.select select.is-set { color: #fff; background: var(--ink); border-color: var(--ink); }
.select:has(.is-set) { color: #fff; }
.select select:hover, .search:hover { background: rgba(17, 17, 17, .07); }
.select select.is-set:hover { background: #2a2a2b; }
.select select:focus-visible, .search:focus-within { outline: none; border-color: var(--ink); }
.search { grid-column: 3; justify-self: end; width: min(100%, 300px); display: flex; align-items: center; gap: 10px; padding: 0 20px; color: var(--grey); }
.search svg { width: 16px; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: 13px var(--sans); color: var(--ink); }
.search input::placeholder { color: var(--grey); }

.empty[hidden] { display: none; }
.empty { position: relative; z-index: 1; margin: 0; padding: 80px var(--gut); background: var(--paper); text-align: center; color: var(--grey); display: flex; flex-direction: column; align-items: center; gap: 20px; font-size: 15px; }

/* ==========================================================
   CASES — each one a full screen, stacked
   ========================================================== */
.case {
  position: sticky; top: 0;
  height: 100svh; min-height: 620px;
  overflow: hidden; isolation: isolate;
  color: #fff;
  background: #0d0f0e;
}
.case[hidden] { display: none; }

.case__bg { position: absolute; inset: -6%; z-index: -1; }
.case__bg img {
  width: 100%; height: 100%; object-fit: cover;
  transform: translateY(calc(var(--py, 0) * 1%)) scale(1.08);
  filter: blur(7px) brightness(.5) saturate(.85);
}
.case__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 30%, transparent 60%, rgba(0,0,0,.45)); }

.case__inner {
  height: 100%;
  padding: 28px var(--gut) 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto 1fr;
}

.case__meta { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr 1fr; font-size: 10px; }
.case__meta em { font-style: normal; color: rgba(255, 255, 255, .5); margin-right: 6px; }
.case__meta .num { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .6); }
.case__meta .num i { width: 5px; height: 5px; background: var(--accent); }

.case__thumb { grid-column: 1; grid-row: 2; align-self: center; position: relative; display: block; width: 100%; padding-right: 0; }
.case__img { display: block; aspect-ratio: 3 / 4; overflow: hidden; }
.case__img img {
  width: 100%; height: 115%; object-fit: cover;
  transform: translateY(calc(var(--ty, 0) * 1px - 7%));
  transition: scale 1s var(--ease);
}
.case__thumb:hover .case__img img { scale: 1.05; }
.case__view { position: absolute; left: 14px; bottom: 14px; }

.case__about { grid-column: 3; grid-row: 2; align-self: center; padding-top: 18vh; padding-right: 24px; }
.case__logo { display: flex; align-items: center; gap: 8px; margin: 0 0 32px; font-size: 18px; font-weight: 600; letter-spacing: -.03em; }
.case__logo .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; font-size: 12px; font-weight: 700; }
.case__about p { margin: 0 0 14px; font-size: 11px; line-height: 1.5; max-width: 260px; color: rgba(255, 255, 255, .85); }
.case__services { grid-column: 4; grid-row: 2; align-self: center; padding-top: calc(18vh + 50px); }
.case__services ul { list-style: none; margin: 0 0 14px; padding: 0; line-height: 1.6; color: rgba(255, 255, 255, .85); }
.sq { display: block; width: 4px; height: 4px; background: #fff; }

/* reveal when a case enters */
.case__thumb, .case__about, .case__services { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.case__about { transition-delay: .1s; }
.case__services { transition-delay: .2s; }
.case.in .case__thumb, .case.in .case__about, .case.in .case__services { opacity: 1; transform: none; }

/* ==========================================================
   END
   ========================================================== */
/* the case page's ending (closing.css), with the same colour glow as the case page's background */
.cta, .foot { position: relative; z-index: 1; }
.cta { background: radial-gradient(45% 60% at 8% 0%, rgba(255, 196, 180, .45), transparent 70%), radial-gradient(50% 65% at 92% 12%, rgba(196, 206, 240, .55), transparent 70%), #f1f1ef; }
.foot { background: radial-gradient(60% 90% at 50% 100%, rgba(222, 226, 236, .6), transparent 70%), #f1f1ef; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 820px) {
  .intro__head h1 { font-size: 15vw; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; grid-row: 1; width: 100%; }

  .case__inner { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; padding-bottom: 32px; gap: 0 16px; }
  .case__meta { grid-template-columns: 1fr auto auto; gap: 14px; }
  .case__thumb { grid-column: 1 / -1; grid-row: 2; width: 72%; }
  .case__about { grid-column: 1; grid-row: 3; padding: 0; }
  .case__services { grid-column: 2; grid-row: 3; padding: 50px 0 0; }
  .case__logo { margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- page curtain when a case is opened (project.html lifts it) ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 9000; background: #0e0e0f;
  transform: translateY(101%); pointer-events: none;
}
body.is-leaving .curtain { transform: translateY(0); transition: transform .65s cubic-bezier(.76, 0, .24, 1); }
.case { cursor: pointer; }
