/* ===========================================================
   Safed Kauwa — project pages (work/*.html)
   Brand guideline viewers and the Myabi shoot gallery.
   Builds on style.css + agency.css.
   =========================================================== */

.wk { background: var(--black); }

/* ---------- header band ---------- */
.wk-head {
  background: var(--soft);
  color: var(--black);
  padding: 120px var(--gutter) 64px;
}
.wk-head__inner { max-width: 1080px; margin: 0 auto; }
.wk-back {
  display: inline-block;
  margin-bottom: 36px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
}
.wk-back:hover { color: var(--deep); }
.wk-kicker {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--deep);
  margin-bottom: 14px;
}
.wk-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 120px);
  line-height: .92;
  text-transform: uppercase;
}
.wk-meta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px; margin-top: 28px; }
.wk-lede { max-width: 560px; font-size: 17px; line-height: 1.5; }
.wk-head .btn { font-size: 18px; }

/* ---------- guideline pages ---------- */
.wk-pages {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
  display: grid;
  gap: 24px;
}
.wk-pages--portrait { max-width: 860px; }
.wk-pages img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--ink);
}

/* ---------- photo gallery ---------- */
.wk-gallery {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
  columns: 3 280px;
  column-gap: 16px;
}
.wk-gallery button {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: zoom-in;
  break-inside: avoid;
  overflow: hidden;
}
.wk-gallery img { width: 100%; height: auto; display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.wk-gallery button:hover img { transform: scale(1.03); }
.wk-gallery button:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }

/* lightbox */
.wk-lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--black);
}
.wk-lb.open { display: flex; }
.wk-lb img { max-width: calc(100vw - 160px); max-height: calc(100vh - 120px); object-fit: contain; display: block; }
.wk-lb button {
  position: absolute;
  border: 0;
  background: none;
  color: var(--white);
  font-family: var(--font-label);
  font-weight: 600;
  cursor: pointer;
  padding: 16px;
}
.wk-lb button:hover { color: var(--mint); }
.wk-lb__close { top: 12px; right: 16px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.wk-lb__prev, .wk-lb__next { top: 50%; transform: translateY(-50%); font-size: 32px; }
.wk-lb__prev { left: 12px; }
.wk-lb__next { right: 12px; }
.wk-lb__count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-family: var(--font-label); font-size: 12px; letter-spacing: .08em; color: var(--pale); }
.wk-lock { overflow: hidden; }

/* ---------- next project ---------- */
.wk-next {
  display: block;
  padding: 56px var(--gutter);
  border-top: 4px solid var(--deep);
  text-decoration: none;
  color: var(--white);
  text-align: center;
}
.wk-next span { display: block; font-family: var(--font-label); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); margin-bottom: 10px; }
.wk-next strong { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 5vw, 56px); text-transform: uppercase; }
.wk-next:hover strong { color: var(--mint); }

@media (max-width: 720px) {
  .wk-head { padding: 96px var(--gutter) 48px; }
  .wk-pages, .wk-gallery { padding-top: 32px; padding-bottom: 56px; }
  .wk-pages { gap: 12px; }
  .wk-lb img { max-width: 100vw; max-height: calc(100vh - 140px); }
  .wk-lb__prev, .wk-lb__next { top: auto; bottom: 4px; transform: none; }
}

/* ---------- magazine reader (Aalta) ---------- */
.mg {
  --pw: 360px;
  --ph: 510px;
  background: radial-gradient(ellipse at 50% 40%, #2a0d14 0%, var(--black) 70%);
  padding: 48px var(--gutter) 40px;
  user-select: none;
}
.mg:fullscreen { display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.mg-stage { position: relative; display: flex; align-items: center; justify-content: center; max-width: 1400px; margin: 0 auto; min-height: calc(var(--ph) + 8px); }
.mg-book {
  position: relative;
  display: flex;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  perspective: 2600px;
  transition: transform .75s cubic-bezier(.45, .05, .25, 1);
  cursor: pointer;
}
.mg--single .mg-book { width: var(--pw); }
.mg-page {
  position: relative;
  width: var(--pw);
  height: var(--ph);
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.mg-page img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mg-blank { background: none; box-shadow: none; }
/* the fold: a soft shadow either side of the spine */
.mg-left::after, .mg-right::after { content: ""; position: absolute; top: 0; bottom: 0; width: 14%; pointer-events: none; }
.mg-left::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .35), transparent); }
.mg-right::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .35), transparent); }
.mg-blank::after, .mg-closed .mg-page::after { display: none; }

/* the turning leaf */
.mg-leaf { position: absolute; top: 0; width: var(--pw); height: var(--ph); -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.45, .05, .25, 1); z-index: 3; }
.mg-leaf--fwd { left: var(--pw); transform-origin: left center; }
.mg-leaf--back { left: 0; transform-origin: right center; }
.mg-leaf--fwd.mg-turning { transform: rotateY(-180deg); }
.mg-leaf--back.mg-turning { transform: rotateY(180deg); }
.mg-face { position: absolute; inset: 0; overflow: visible; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: rotateY(0deg) translateZ(.5px); }
.mg-back { transform: rotateY(180deg) translateZ(.5px); }
.mg-face img { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.mg-leaf .mg-face::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .75s; }
.mg-leaf--fwd .mg-front::before { background: linear-gradient(to right, rgba(0,0,0,.25), transparent 40%); opacity: 0; }
.mg-leaf--fwd.mg-turning .mg-front::before { opacity: 1; }

/* controls */
.mg-nav { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.mg-nav button { pointer-events: auto; }
.mg-prev, .mg-next {
  width: 48px; height: 48px;
  border: 0; border-radius: 0;
  background: var(--mint); color: var(--black);
  font-size: 18px; cursor: pointer;
  transition: background .15s steps(2), opacity .2s;
}
.mg-prev:hover, .mg-next:hover { background: var(--white); }
.mg-prev:disabled, .mg-next:disabled { opacity: 0; pointer-events: none; }
.mg-prev:focus-visible, .mg-next:focus-visible, .mg-fs:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.mg-bar { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 28px; font-family: var(--font-label); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--pale); }
.mg-fs { background: none; border: 0; color: var(--mint); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; padding: 10px 0; }
.mg-fs:hover { color: var(--white); }
.mg-hint { text-align: center; margin-top: 10px; font-size: 13px; color: var(--pale); opacity: .7; }

@media (max-width: 720px) {
  .mg { padding: 28px 16px 32px; }
  .mg-nav { inset: auto 0 -64px 0; justify-content: center; gap: 120px; }
  .mg-bar { margin-top: 76px; }
  .mg-fs { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mg-book, .mg-leaf { transition: none; } }
