/* Project showcase (homepage, /work/ and case studies), rendered by portfolio-site.js, plus the floating WhatsApp button.
   Each website sits on a neutral "stage": the real desktop screenshot in a quiet browser frame with the real mobile
   screenshot beside it. Positions are percentages of the stage, so the composition holds at every width and nothing
   is cropped. */
#work .section-heading{margin-bottom:64px}

/* Stage */
.stage{--d-left:7%;--d-top:10%;--d-width:70%;--p-right:7%;--p-bottom:8%;--p-width:19%;
  position:relative;display:block;aspect-ratio:16/9.4;overflow:hidden;border-radius:var(--radius);background:var(--stage);color:inherit;text-decoration:none;isolation:isolate}
.stage::after{content:"";position:absolute;inset:0;border:1px solid var(--line);border-radius:inherit;pointer-events:none}
.stage-desktop{position:absolute;left:var(--d-left);top:var(--d-top);width:var(--d-width);overflow:hidden;border-radius:clamp(6px,.8vw,10px);background:var(--surface);box-shadow:0 0 0 1px var(--stage-ring),var(--stage-shadow);transition:transform .8s var(--ease)}
.stage-bar{display:flex;height:clamp(14px,1.9vw,26px);align-items:center;gap:clamp(3px,.35vw,5px);padding:0 clamp(8px,1vw,12px);background:var(--surface-2);border-bottom:1px solid var(--line)}
.stage-bar i{width:clamp(4px,.45vw,6px);height:clamp(4px,.45vw,6px);flex:none;border-radius:50%;background:var(--line-strong)}
.stage-bar span{margin-left:clamp(4px,.6vw,8px);overflow:hidden;color:var(--faint);font-size:clamp(7px,.75vw,11px);font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.stage img{display:block;width:100%;height:auto}
.stage-phone{position:absolute;right:var(--p-right);bottom:var(--p-bottom);width:var(--p-width);padding:clamp(2px,.3vw,4px);border-radius:clamp(12px,1.9vw,28px);background:#0b0b0c;box-shadow:0 0 0 1px var(--stage-ring),var(--stage-shadow);transition:transform .8s var(--ease)}
.stage-phone img{border-radius:clamp(10px,1.6vw,24px)}
.stage-cue{position:absolute;top:16px;right:16px;z-index:2;display:grid;width:40px;height:40px;place-items:center;border-radius:50%;background:var(--ink);color:var(--ink-text);font-size:16px;font-weight:700;opacity:0;transform:scale(.85);transition:opacity .3s ease,transform .4s var(--ease)}

/* Wide stages: a calmer, more panoramic composition */
.showcase-wide .stage{--d-left:9%;--d-top:9%;--d-width:62%;--p-right:11%;--p-width:17%;--p-bottom:7%;aspect-ratio:16/8.4}
/* Alternate the phone side on the /work/ page for rhythm */
.showcase-full .showcase-wide:nth-child(even) .stage{--d-left:27%}
.showcase-full .showcase-wide:nth-child(even) .stage-phone{right:auto;left:var(--p-right)}

/* Hover / focus: the screens lift a little, a cue appears */
.showcase-item:hover .stage-desktop,.showcase-item:focus-within .stage-desktop{transform:translateY(-1.4%)}
.showcase-item:hover .stage-phone,.showcase-item:focus-within .stage-phone{transform:translateY(-3%)}
.showcase-item:hover .stage-cue,.showcase-item:focus-within .stage-cue{opacity:1;transform:none}
.showcase-item:hover .stage::after,.showcase-item:focus-within .stage::after{border-color:var(--line-strong)}

/* Showcase grid */
.showcase{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:112px 32px}
.showcase-wide{grid-column:1/-1}
.showcase-full{gap:128px}
.showcase-item{display:flex;min-width:0;flex-direction:column}

/* Captions */
.showcase-caption{display:grid;flex:1;grid-template-columns:minmax(0,1fr);gap:16px;padding-top:28px}
.showcase-wide .showcase-caption{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:48px;padding-top:36px}
.showcase-index{margin:0 0 14px;color:var(--faint);font-size:12px;font-weight:700;letter-spacing:.1em;font-variant-numeric:tabular-nums}
.showcase-index span{color:var(--text)}
.showcase-index span::before{content:"";display:inline-block;width:6px;height:6px;margin-right:10px;vertical-align:2px;background:var(--accent)}
.showcase-title{margin:0;font-size:clamp(28px,2.6vw,36px);font-weight:700;line-height:1.05;letter-spacing:-.035em}
.showcase-wide .showcase-title{font-size:clamp(34px,4vw,56px);letter-spacing:-.045em}
.showcase-title a{color:inherit;text-decoration:none}
.showcase-title a:hover{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:6px}
.showcase-type{margin:12px 0 0;color:var(--muted);font-size:14px;font-weight:600}
.showcase-body{display:flex;flex-direction:column}
.showcase-desc{max-width:520px;margin:0;color:var(--muted);font-size:16px;line-height:1.65}
.showcase-wide .showcase-body{padding-top:30px}
.showcase-wide .showcase-desc{font-size:18px;line-height:1.6;color:var(--text)}
.showcase-links{display:flex;flex-wrap:wrap;align-items:center;gap:10px 28px;margin-top:auto;padding-top:24px}

/* Links shared by showcase, creative cards and case studies */
.project-meta{margin:0 0 12px;color:var(--faint);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.project-title{margin:0 0 12px;font-size:26px;font-weight:700;letter-spacing:-.03em;line-height:1.12}
.project-title a{color:inherit;text-decoration:none}
.project-title a:hover{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px}
.project-summary{max-width:560px;margin:0 0 24px;color:var(--muted);font-size:15px;line-height:1.65}
.project-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px 28px;align-self:end}
.project-link{display:inline-flex;align-items:center;gap:6px;min-height:28px;color:var(--text);font-size:14px;font-weight:700;text-decoration:none;border-bottom:1px solid var(--line-strong);padding-bottom:2px;transition:border-color .2s ease,color .2s ease}
.project-link:hover{border-color:var(--text)}
.project-link-quiet{color:var(--muted);border-color:transparent}
.project-link-quiet:hover{color:var(--text);border-color:var(--line-strong)}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Framed screenshots used inside case-study galleries */
.project-frame{display:block;overflow:hidden;border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--surface)}
.project-frame-bar{display:flex;align-items:center;height:32px;padding:0 14px;border-bottom:1px solid var(--line);background:var(--surface-2);color:var(--faint);font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-frame-bar::before{content:"";width:6px;height:6px;margin-right:10px;flex:none;border-radius:50%;background:var(--line-strong)}
.project-frame img{display:block;width:100%;height:auto}

/* Identity & print grid */
.creative-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0 24px;margin-bottom:-56px}
.creative-card{display:grid;grid-row:span 5;grid-template-rows:subgrid;row-gap:0;min-width:0;margin-bottom:56px}
.creative-media{position:relative;display:block;margin-bottom:24px;aspect-ratio:4/5;border:1px solid var(--line);border-radius:var(--radius);background:var(--stage);transition:border-color .25s ease}
.creative-media img{position:absolute;inset:28px;width:calc(100% - 56px);height:calc(100% - 56px);object-fit:contain;filter:drop-shadow(0 10px 24px rgba(0,0,0,.2))}
.creative-card:hover .creative-media,.creative-card:focus-within .creative-media{border-color:var(--text)}
.creative-card .project-title{font-size:20px}
.creative-card .project-summary{font-size:14px}

@media (max-width:1023px){
  .showcase,.showcase-full{grid-template-columns:1fr;gap:88px}
  .showcase-wide .showcase-caption{grid-template-columns:1fr;gap:0}
  .showcase-wide .showcase-body{padding-top:18px}
  .showcase-half .stage{--d-left:9%;--d-top:9%;--d-width:62%;--p-right:11%;--p-width:17%;--p-bottom:7%;aspect-ratio:16/8.4}
  .creative-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .showcase,.showcase-full{gap:72px}
  .stage,.showcase-wide .stage,.showcase-half .stage{--d-left:5%;--d-top:7%;--d-width:72%;--p-right:5%;--p-width:22%;--p-bottom:6%;aspect-ratio:4/2.9}
  .showcase-full .showcase-wide:nth-child(even) .stage{--d-left:23%}
  .stage-cue{display:none}
  .showcase-caption,.showcase-wide .showcase-caption{padding-top:22px}
  .showcase-wide .showcase-desc{font-size:17px}
  .creative-grid{grid-template-columns:1fr;row-gap:40px;margin-bottom:0}
  .creative-card{grid-row:auto;grid-template-rows:none;margin-bottom:0}
  .creative-media{aspect-ratio:1/1}
}
@media (prefers-reduced-motion:reduce){
  .stage-desktop,.stage-phone,.stage-cue,.creative-media,.project-link{transition:none}
  .showcase-item:hover .stage-desktop,.showcase-item:hover .stage-phone,.showcase-item:focus-within .stage-desktop,.showcase-item:focus-within .stage-phone{transform:none}
}

/* Floating WhatsApp (homepage) */
.floating-whatsapp{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:28;display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:0 16px;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--text);box-shadow:0 12px 32px rgba(0,0,0,.22);font-size:14px;font-weight:700;text-decoration:none;transition:opacity .2s ease,transform .2s ease,border-color .2s ease}
.floating-whatsapp:hover{border-color:var(--text)}
.floating-whatsapp svg{width:17px;height:17px;stroke:#25d366}
.floating-whatsapp[hidden]{display:none}
.floating-whatsapp.is-over-footer{opacity:0;transform:translateY(10px);pointer-events:none}
@media (max-width:760px){
  .floating-whatsapp{right:max(14px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));width:46px;height:46px;justify-content:center;padding:0}
  .floating-whatsapp span{display:none}
  .floating-whatsapp.is-clear-of-work{opacity:0;transform:translateY(10px);pointer-events:none}
}
