/* ==========================================================
   REZN® — Design Studio
   Screen 1: huge wordmark + 3D ring of works (see hero.css)
   Screen 2: twisting 3D ribbon of works
   ========================================================== */

:root {
  --ink: #0d0d0e;
  --fg: #f2f1ee;
  --fg-dim: rgba(242, 241, 238, .72);
  --line: rgba(242, 241, 238, .22);
  --paper: #ffffff;
  --paper-ink: #1a1a1b;
  --sans: "HelveticaNeueCyr", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "HelveticaNeueCyr", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(16px, 7vw, 140px);
  --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: #ffffff;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--fg); color: var(--ink); }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- film grain ---------- */
.grain {
  position: fixed; inset: -8%;   /* just enough room for the jitter below */
  z-index: 100; pointer-events: none;
  opacity: .045;
  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% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 50px; padding: 0 22px;
  border-radius: 999px;
  font-size: 16px; font-weight: 500;
  white-space: nowrap;
  transition: background .4s var(--ease), color .4s var(--ease), transform .4s var(--ease);
}
.btn span { transition: transform .4s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn--dark { background: rgba(28, 28, 30, .78); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--dark:hover { background: var(--fg); color: var(--ink); }
.btn--light { background: var(--fg); color: var(--ink); height: 44px; padding: 0 16px; font-size: 15px; }
.btn--light:hover { background: #fff; }
.btn--outline { border: 1px solid rgba(26, 26, 27, .35); color: var(--paper-ink); border-radius: 999px; }
.btn--outline:hover { background: var(--paper-ink); color: var(--paper); }


/* ==========================================================
   SCREEN 2 — WORKS RIBBON
   ========================================================== */
.works {
  position: relative;
  height: 580vh;                    /* 420vh of animation + 60vh resting on the grid (see rawProgress) */
  background: var(--paper);
  color: var(--paper-ink);
}
.works__sticky {
  position: sticky; top: 0;
  height: 100svh; min-height: 600px;
  overflow: hidden;
  padding: clamp(16px, 2.4vw, 40px);   /* same edges as the hero (hero.css --pad) */
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(70% 60% at 50% 45%, #ffffff, #f6f6f5 70%),
    var(--paper);
}
.works__bar { display: flex; justify-content: space-between; position: relative; z-index: 2; color: rgba(26, 26, 27, .65); }

.works__type {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  font-size: clamp(64px, 9.5vw, 190px); font-weight: 500; letter-spacing: -.06em; line-height: 1;
  text-transform: uppercase; white-space: nowrap;
  color: #262627;
}
.works__type .line { position: absolute; will-change: transform; }
/* both lines settle centred, one above the other (the scroll script then drifts them apart);
   'translate' centres them without touching the transform the script writes */
.works__type .line--1, .works__type .line--2 { left: 50%; translate: -50% 0; }
.works__type .line--1 { top: calc(50% - 1.06em); }
.works__type .line--2 { top: 50%; }
.works__caption {
  position: absolute; left: 50%; top: calc(50% + clamp(64px, 9.5vw, 190px) + 22px);
  transform: translateX(-50%);
  font-size: 10px; line-height: 1.5; letter-spacing: .08em; text-align: center;
  color: rgba(26, 26, 27, .7);
}

/* a quiet dot field behind the ribbon (not on phones); it leaves before the grid forms */
.works__dots {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; will-change: opacity;
  background: radial-gradient(circle, rgba(26, 26, 27, .3) 1px, transparent 1.4px) 0 0 / 26px 26px;
  -webkit-mask: radial-gradient(70% 70% at 50% 50%, transparent 40%, #000 100%); mask: radial-gradient(70% 70% at 50% 50%, transparent 40%, #000 100%);
}
@media (max-width: 720px) { .works__dots { display: none; } }

.ribbon {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ---------- final grid: real cards over the settled planes (index.html writes --wo / --wt) ---------- */
.wgrid {
  /* 3 × 2 edge to edge (same side edges as the bar above): cards always take the full row width;
     the image is 16:10 when the height allows, otherwise it gets shorter (cropped, not squeezed)
     so two rows of image + text fit between the top bar and the foot (186px = the insets below) */
  --pad-x: clamp(16px, 2.4vw, 40px);
  --gap-x: clamp(12px, 1.4vw, 28px); --gap-y: clamp(18px, 3vh, 36px); --text: 84px;
  --cw: calc((100vw - var(--pad-x) * 2 - var(--gap-x) * 2) / 3);
  --ch: min(calc(var(--cw) * .625), calc((100svh - 186px - var(--gap-y)) / 2 - var(--text)));
  position: absolute; z-index: 2;
  inset: 78px var(--pad-x) 108px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: var(--gap-y) var(--gap-x);
  pointer-events: none;
}
.wgrid.is-on { pointer-events: auto; }
.wcard { display: block; color: var(--paper-ink); min-width: 0; }
.wcard__img {
  display: block; position: relative; overflow: hidden;
  height: var(--ch); border-radius: calc(var(--cw) * .028);   /* same corner as the plane textures */
  background: #1b1b1c;
  opacity: var(--wo, 0);
}
.wcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: scale 1s var(--ease); }
.wcard:hover .wcard__img img { scale: 1.05; }
.wcard--soon:hover .wcard__img img { scale: none; }   /* not a link yet: no hover reaction */
.wcard__text {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  height: var(--text); padding-top: 14px;
  opacity: clamp(0, calc(var(--wt, 0) * 1.9 - var(--i) * .12), 1);
  translate: 0 calc((1 - var(--wt, 0)) * 16px);
}
.wcard__info { display: block; min-width: 0; padding-top: 4px; }
.wcard__title {
  display: block; font-size: clamp(14px, 1.15vw, 19px); font-weight: 600; letter-spacing: -.01em; line-height: 1.1;
  text-transform: uppercase; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wcard__sub {
  display: block; margin-top: 6px; font-size: 11px; font-weight: 500; letter-spacing: .02em; line-height: 1.3;
  text-transform: uppercase; color: #6f6f71; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wcard__go { flex: none; }
.wcard__go { transition: background .3s, color .3s, border-color .3s; }
.wcard:hover .wcard__go { background: #111; border-color: #111; color: #fff; }   /* black round button on hover, same as the case pages */

.works__foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
}
.works__foot p { margin: 0; max-width: 300px; font-size: 13px; color: rgba(26, 26, 27, .7); }


/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 720px) {
  .works__sticky { padding: 20px 16px; }
  .works__bar { margin-top: 24px; }   /* (02) Selected works a little lower from the top edge */
  .works__type { font-size: 16vw; }
  .works__caption { top: calc(50% + 16vw + 18px); }
  /* phones: the line of text sits centred under the top bar, the button centred at the bottom,
     the 2 × 3 grid of images in between */
  .works__foot { position: static; display: flex; justify-content: center; }
  .works__foot p {
    position: absolute; z-index: 2; left: 16px; right: 16px; top: 128px;
    max-width: 300px; margin: 0 auto; text-align: center;
  }
  .works__foot .pill { background: var(--paper); }
  /* six cards fill the width; images only, the titles live on the project pages */
  .wgrid {
    --pad-x: 16px; --gap-x: 8px; --gap-y: 8px; --text: 0px;
    --cw: calc((100vw - var(--pad-x) * 2 - var(--gap-x)) / 2);
    --ch: min(calc(var(--cw) * .625), calc((100svh - 280px - var(--gap-y) * 2) / 3));
    inset: 140px var(--pad-x) 90px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wcard__text { display: none; }
}

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