/* =========================================================
   Werzuo Digital — Project showcase (laptop + phone mockups,
   project cards, quick look modal). Shared by index & web-design.
   ========================================================= */

/* ---------- Device mockups (laptop + phone) ----------
   All sizes use container-query units (cqw) relative to .duo,
   so the pair scales perfectly at any card width. */
.duo { position: relative; width: 100%; aspect-ratio: 100 / 56; container-type: inline-size; }

.laptop { position: absolute; left: 4cqw; top: 0; width: 76cqw; transition: transform .7s var(--ease); }
.laptop__lid {
  position: relative;
  padding: 1.6cqw 1.6cqw 2.4cqw;
  background: linear-gradient(180deg, #1b1b25, #0c0c12);
  border-radius: 2.2cqw 2.2cqw .6cqw .6cqw;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 2.5cqw 5cqw -2cqw rgba(17,17,58,.45);
}
.laptop__lid::before { /* camera */
  content: ""; position: absolute; top: .55cqw; left: 50%; width: .55cqw; height: .55cqw; border-radius: 50%;
  background: #2d2d3a; transform: translateX(-50%);
}
.laptop__screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: .5cqw; background: #f4f4f8; }
.laptop__base {
  position: relative; height: 2.4cqw; margin: 0 -4cqw;
  background: linear-gradient(180deg, #e9eaef 0%, #c9cbd3 55%, #a4a7b2 100%);
  border-radius: .3cqw .3cqw 2.4cqw 2.4cqw / .3cqw .3cqw 1.8cqw 1.8cqw;
  box-shadow: 0 1.6cqw 2.6cqw -1cqw rgba(17,17,58,.35);
}
.laptop__base::before { /* thumb notch */
  content: ""; position: absolute; top: 0; left: 50%; width: 12cqw; height: .9cqw; transform: translateX(-50%);
  background: linear-gradient(180deg, #b8bac4, #d9dbe2); border-radius: 0 0 1cqw 1cqw;
}

.phone-m {
  position: absolute; right: 1cqw; bottom: 0; width: 20cqw; aspect-ratio: 9 / 19.5;
  padding: .85cqw; border-radius: 3.4cqw;
  background: linear-gradient(160deg, #23232f, #0b0b10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 3cqw 5cqw -2cqw rgba(17,17,58,.55);
  transition: transform .7s var(--ease);
}
.phone-m__screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 2.6cqw; background: #fff; }
.phone-m__screen::before { /* dynamic island */
  content: ""; position: absolute; z-index: 2; top: .9cqw; left: 50%; width: 6cqw; height: 1.7cqw; border-radius: 99px;
  background: #0b0b10; transform: translateX(-50%);
}

/* Screens: tall screenshots that scroll on hover */
.laptop__screen img, .phone-m__screen img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  transition: object-position 1.4s var(--ease);
}
@media (hover: hover) {
  .wd-proj:hover .laptop__screen img { object-position: 50% 100%; transition: object-position 9s linear; }
  .wd-proj:hover .phone-m__screen img { object-position: 50% 100%; transition: object-position 7s linear .4s; }
}
.is-autoscroll { animation: autoscroll 16s ease-in-out 1.5s infinite alternate; }
.is-autoscroll--slow { animation-duration: 20s; animation-delay: 2.5s; }
@keyframes autoscroll { 0%, 8% { object-position: 50% 0; } 92%, 100% { object-position: 50% 100%; } }

/* ---------- Projects ---------- */
.wd-work { padding-top: 0; }
.wd-work__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 56px); }
.wd-work__head .section-title { margin-bottom: .75rem; }
.wd-work__lead { color: var(--muted); max-width: 560px; margin: 0; }

.wd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 2.6vw, 32px); }
.wd-proj { min-width: 0; }
.wd-proj__stage {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-lg);
  padding: 13% 8% 7%;
  background: linear-gradient(145deg, var(--t1, var(--navy-50)), var(--t2, var(--navy-100)));
}
.wd-proj__stage::before { /* soft grid texture */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}
.wd-proj__stage::after { /* glow orb */
  content: ""; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; border-radius: 50%;
  right: -20%; top: -30%; background: rgba(255,255,255,.5); filter: blur(40px);
}
.wd-proj__cat {
  position: absolute; top: 18px; left: 18px; z-index: 3;
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .76rem; font-weight: 700; color: var(--navy);
  background: rgba(255,255,255,.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.9); padding: .4rem .8rem; border-radius: 999px;
}
.wd-proj__cat i { color: var(--red); font-size: .95rem; }
.wd-proj:hover .laptop { transform: translateY(-1.5cqw); }
.wd-proj:hover .phone-m { transform: translateY(-3.5cqw) rotate(-2deg); }

.wd-proj__quick {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 700; color: #fff; background: var(--navy);
  padding: .55rem 1rem; border-radius: 999px; box-shadow: var(--shadow);
  transition: background .3s, transform .45s var(--ease), opacity .3s;
}
.wd-proj__quick:hover { background: var(--red); }
.wd-proj__quick:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
@media (hover: hover) {
  .wd-proj__quick { opacity: 0; transform: translateY(-8px); }
  .wd-proj:hover .wd-proj__quick, .wd-proj__quick:focus-visible { opacity: 1; transform: none; }
}

.wd-proj__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.35rem .25rem 0; }
.wd-proj__meta h3 { font-size: 1.45rem; margin-bottom: .35rem; }
.wd-proj__meta p { color: var(--muted); margin: 0 0 .9rem; font-size: .95rem; }
.wd-proj__meta .tags { margin: 0; }
.wd-proj__visit {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.35rem;
  border: 1.5px solid var(--navy-100); color: var(--navy);
  transition: background .3s, color .3s, border-color .3s, transform .45s var(--ease);
}
.wd-proj__visit:hover, .wd-proj:hover .wd-proj__visit { background: var(--red); border-color: var(--red); color: #fff; transform: rotate(45deg); }

.wd-work__cta {
  margin-top: clamp(32px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: clamp(22px, 3vw, 32px) clamp(22px, 3.5vw, 40px);
  border-radius: var(--radius-lg); background: var(--surface); border: 1px dashed var(--navy-100);
}
.wd-work__cta h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); margin-bottom: .25rem; }
.wd-work__cta p { margin: 0; color: var(--muted); }

/* ---------- Quick look modal ---------- */
html.qv-open { overflow: hidden; }
.qv {
  width: min(1180px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: var(--radius-xl); background: #fff; color: var(--text);
  box-shadow: 0 40px 100px -20px rgba(17,17,58,.5); overflow: hidden;
}
.qv::backdrop { background: rgba(17,17,58,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qv[open] { animation: qvIn .5s var(--ease); }
.qv[open]::backdrop { animation: fadeIn .4s ease; }
@keyframes qvIn { from { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes fadeIn { from { opacity: 0; } }
.qv__inner { position: relative; display: grid; grid-template-rows: 1fr auto auto; max-height: calc(100dvh - 32px); }
.qv__close {
  position: absolute; top: 14px; right: 14px; z-index: 5; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.4rem; background: #fff; color: var(--navy); box-shadow: var(--shadow);
  transition: background .3s, color .3s, transform .4s var(--ease);
}
.qv__close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }
.qv__devices {
  min-height: 0; display: grid; grid-template-columns: 1fr 250px; gap: clamp(16px, 2.5vw, 32px); align-items: stretch;
  padding: clamp(18px, 3vw, 36px) clamp(18px, 3vw, 36px) 0;
  background: linear-gradient(160deg, var(--qv-t1, var(--navy-50)), var(--qv-t2, var(--navy-100)));
}
.qv__desk { display: flex; flex-direction: column; min-height: 0; height: min(62dvh, 600px); background: #fff; border-radius: 14px 14px 0 0; overflow: hidden; box-shadow: var(--shadow-lg); }
.qv__bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.qv__bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.qv__bar i:nth-child(2) { background: #febc2e; }
.qv__bar i:nth-child(3) { background: #28c840; }
.qv__url { margin-left: 12px; flex: 1; max-width: 340px; font-size: .78rem; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qv__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.qv__scroll img { width: 100%; height: auto; }
.qv__phone {
  align-self: end; display: flex; height: min(62dvh, 540px); max-height: 100%;
  padding: 8px; border-radius: 34px 34px 0 0; padding-bottom: 0;
  background: linear-gradient(160deg, #23232f, #0b0b10); box-shadow: var(--shadow-lg);
}
.qv__phone .qv__scroll { border-radius: 27px 27px 0 0; background: #fff; scrollbar-width: none; }
.qv__phone .qv__scroll::-webkit-scrollbar { display: none; }
.qv__info { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: clamp(18px, 2.5vw, 28px) clamp(18px, 3vw, 36px) .5rem; border-top: 1px solid var(--line); }
.qv__cat { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.qv__info h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: .2rem 0 .3rem; }
.qv__info p { margin: 0; color: var(--muted); max-width: 640px; }
.qv__hint { margin: 0; padding: 0 clamp(18px, 3vw, 36px) 1.1rem; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }

@media (max-width: 991px) {
  .qv__devices { grid-template-columns: 1fr 200px; }
}
@media (max-width: 767px) {
  .wd-grid { grid-template-columns: 1fr; }
  .wd-work__head { align-items: flex-start; }
  .qv__devices { grid-template-columns: 1fr; }
  .qv__desk { display: none; }
  .qv__phone { justify-self: center; width: min(300px, 100%); height: min(58dvh, 560px); }
}
@media (max-width: 575px) {
  .wd-proj__stage { padding: 16% 6% 7%; }
  .wd-proj__cat { top: 12px; left: 12px; font-size: .7rem; }
  .wd-proj__quick { top: 10px; right: 10px; padding: .45rem .8rem; font-size: .75rem; }
  .wd-proj__meta h3 { font-size: 1.25rem; }
  .wd-proj__visit { width: 44px; height: 44px; font-size: 1.15rem; }
  .qv { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 24px; }
  .qv__inner { max-height: calc(100dvh - 20px); }
  .qv__info .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .laptop__screen img, .phone-m__screen img { transition: none !important; }
}
