/* Work gallery and project pages in the front-page look (Task #52, OpenPencil "Rebrind website - front-page look 2026-10-25").
   Fonts: Roboto 500 headings, Cuprum 400/700 text, labels and buttons, Open Sans 600 menu and filters (loaded by the page from Google Fonts, as on the front pages).
   Colours: ground #141414, surface #231F20, black only behind video and in the header bar, white at 100/75/55 %, red #FD0003. */
:root{color-scheme:dark;--ground:#141414;--surface:#231f20;--red:#fd0003;--fg:#fff;--fg-75:rgba(255,255,255,.75);--fg-55:rgba(255,255,255,.55);--line:rgba(255,255,255,.16);--gap:8px;--header-height:60px;--heading:Roboto,Helvetica,Arial,Lucida,sans-serif;--text:Cuprum,"Cuprum fallback",Helvetica,Arial,Lucida,sans-serif;--menu:"Open Sans",Helvetica,Arial,sans-serif;--ease-art:cubic-bezier(.2,.65,.3,1)}
/* Local fallback sized like Cuprum (measured: 84 % of Arial's width, 83 % in bold), so text wraps the same before and after the web font arrives (no layout shift). Latin text only: arrows, which Cuprum lacks, keep the system font. Nothing is downloaded. */
@font-face{font-family:"Cuprum fallback";font-weight:400;src:local("Arial"),local("ArialMT"),local("Helvetica");size-adjust:84%;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122;}
@font-face{font-family:"Cuprum fallback";font-weight:700;src:local("Arial Bold"),local("Arial-BoldMT"),local("Helvetica Bold");size-adjust:83%;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122;}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--header-height) + 16px)}
body{margin:0;background:var(--ground);color:var(--fg);font:18px/1.4 var(--text);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer}
button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
img,video{display:block;max-width:100%}
a:focus-visible,button:focus-visible,audio:focus-visible,video:focus-visible{outline:3px solid var(--fg);outline-offset:4px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.skip-link{position:fixed;top:-100px;left:10px;z-index:100;background:var(--red);color:var(--fg);padding:12px;border-radius:2px}.skip-link:focus{top:10px}

/* Header: the front-page bar in black. */
.work-header{position:sticky;top:0;z-index:20;height:var(--header-height);padding:0 5%;display:flex;align-items:center;justify-content:space-between;background:#000}
.work-brand{flex-shrink:0}.work-brand img{width:auto;height:24px}
.work-header nav{display:flex;gap:26px;align-items:center;margin-left:auto}
.work-header nav a{position:relative;font:600 14px/19px var(--menu);letter-spacing:.02em;white-space:nowrap;transition:color .3s}
.work-header nav a:hover{color:rgba(255,255,255,.8)}
.work-header nav>[aria-current]::after{content:"";position:absolute;left:0;right:0;bottom:-5.5px;height:2px;background:var(--red)}
.work-header .nav-project{background:var(--fg);color:var(--red);padding:9px 18px;border-radius:2px;transition:background .25s,color .25s}
.work-header .nav-project:hover{background:var(--surface);color:var(--fg)}

/* Buttons: primary red. Secondary white is the compact Play / Pause button. */
.work-btn{display:inline-block;font:700 15px/1.25 var(--text);letter-spacing:.04em;text-transform:uppercase;color:var(--fg);background:var(--red);padding:14px 30px;border-radius:2px;white-space:nowrap;transition:background .2s,color .2s}
.work-btn:hover{background:var(--fg);color:var(--red)}

/* Labels: Cuprum 700, 13, capitals, white 55 %. */
#project-count{font:400 18px/30px var(--text);color:var(--fg-55)}
.project-caption>span,.case-top span,.case-brief dt,.case-next span{font:700 13px/1.4 var(--text);letter-spacing:.05em;text-transform:uppercase;color:var(--fg-55)}

/* Gallery */
.work-main,.case-main{padding:0 var(--gap)}
.gallery-toolbar{display:flex;align-items:flex-end;gap:24px;padding:28px 16px 12px}
.gallery-heading{display:flex;align-items:flex-end;gap:12px;flex-shrink:0}
.gallery-heading h1{margin:0;font:500 40px/46px var(--heading)}
.filters{display:flex;flex-wrap:wrap;align-items:center;gap:0 24px;margin-left:auto}
.filters button{border:0;border-bottom:2px solid transparent;background:transparent;padding:10px 0 4px;font:600 14px/19px var(--menu);letter-spacing:.02em;color:var(--fg-75);white-space:nowrap;transition:color .16s}
.filters button:hover{color:var(--fg)}
.filters button[aria-pressed=true]{color:var(--fg);border-bottom-color:var(--red)}
.motion-toggle{border:0;background:transparent;padding:4px 0;font:400 18px/1.25 var(--text);color:var(--fg);white-space:nowrap}
.motion-toggle:hover{text-decoration:underline;text-underline-offset:4px}
.work-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px var(--gap)}
.project-card{position:relative;min-width:0}
.project-cover{position:relative;display:block;aspect-ratio:4/5;overflow:hidden;background:var(--surface)}
.project-cover>.cover-media{width:100%;height:100%;object-fit:cover;transition:transform .42s var(--ease-art)}
.project-cover:focus-visible{outline-offset:-4px}
.field-editorial .project-cover>.cover-media,.field-data .project-cover>.cover-media{object-position:center top}
.field-identity .project-cover>.cover-media{object-fit:contain}
.field-video .project-cover{background:#000}
.project-card[data-project="bhisa-brand-identity"] .project-cover{background:#c12132}
.project-card[data-project="imasare-brand-development"] .project-cover{background:#fff}
.cover-corner{position:absolute;right:14px;bottom:12px;width:36px;height:36px;display:grid;place-items:center;font-size:26px;color:var(--fg);background:rgba(20,20,20,.9);border-radius:2px;opacity:0;transform:translateY(6px);transition:opacity .16s,transform .16s}
.project-cover:hover .cover-corner,.project-cover:focus-visible .cover-corner{opacity:1;transform:none}
.project-caption{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px}
.project-caption h2{margin:0;font:500 18px/1.15 var(--heading);overflow-wrap:anywhere}
.project-caption>a:hover h2{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.project-caption>span{white-space:nowrap}
.preview-toggle{position:absolute;left:12px;top:12px;z-index:3;border:0;border-radius:2px;background:var(--fg);color:var(--red);padding:8px 16px;font:700 15px/1.25 var(--text);letter-spacing:.04em;text-transform:uppercase;transition:background .2s,color .2s}
.preview-toggle:hover{background:var(--surface);color:var(--fg)}

/* Sound cover: red waveform on the surface. The waveform file is lime, so a filter turns it #FD0003 (CSS cannot load a recoloured copy). */
.sound-cover{--pad:24px;position:relative;width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;justify-content:space-between;padding:var(--pad);overflow:hidden;background:var(--surface);color:var(--fg)}
.sound-top,.sound-bottom{position:relative;z-index:1;display:flex;justify-content:space-between;gap:20px;font:700 13px/1.4 var(--text);letter-spacing:.05em;text-transform:uppercase;color:var(--fg-75)}
.sound-bottom>span,.sound-bottom>a{color:var(--fg)}
.sound-cover strong{position:relative;z-index:1;font:500 clamp(45px,6.1vw,125px)/1.05 var(--heading)}
.sound-cover .waveform{position:absolute;left:0;bottom:25px;width:100%;height:55%;object-fit:fill;opacity:.6;filter:brightness(0) invert(26%) sepia(82%) saturate(6562%) hue-rotate(-26deg) brightness(75%) contrast(196%)}
/* The design stretches the bars to the cover, which object-fit cannot do for an SVG. Where the browser can
   divide lengths, the image box takes the SVG's own shape (viewBox 900 x 420) and is scaled to the drawn height. */
/* ponytail: 420/900 is the Sreeya waveform's viewBox; another waveform shape needs its own ratio here. */
@supports (scale:1 calc(2px / 1px)){
  /* Container units measure inside the padding; --pad adds it back to get the cover's full size. */
  .sound-cover{container-type:size;--wave-w:calc(100cqw + 2 * var(--pad));--wave-h:calc(100cqh + 2 * var(--pad))}
  .sound-cover .waveform,.case-hero .sound-cover .waveform{bottom:19px;height:calc(var(--wave-w) * 420 / 900);transform-origin:50% 100%;scale:1 calc(.57 * var(--wave-h) / (var(--wave-w) * 420 / 900))}
  .case-hero .sound-cover .waveform{scale:1 calc(.72 * var(--wave-h) / (var(--wave-w) * 420 / 900))}
}

/* Project page */
.case-top{display:flex;justify-content:space-between;align-items:center;padding:14px 16px}
.case-top a{font:400 18px/22px var(--text)}
.case-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:32px;padding:8px 16px 24px}
.case-heading h1{margin:0;max-width:78%;font:500 40px/46px var(--heading)}
.case-heading>span{max-width:22%;text-align:right;font:400 18px/1.25 var(--text);color:var(--fg-75)}
.case-hero{margin:0;background:var(--surface)}
.case-hero>.cover-media{width:100%;height:auto;max-height:85vh;object-fit:contain}
.case-hero>video{background:#000}
.case-hero>.sound-cover{--pad:40px;height:min(550px,55vw)}
.case-hero .sound-cover strong{font-size:clamp(75px,17vw,240px)}
.case-hero .waveform{height:70%;opacity:.45}
.case-brief{display:grid;grid-template-columns:1.6fr 1fr;gap:8vw;padding:28px 16px}
.case-brief>p{margin:0;font:400 22px/31px var(--text)}
.case-brief .case-outcome{grid-column:1;font-size:18px;line-height:26px;color:var(--fg-75)}
.case-brief dl{display:grid;grid-template-columns:100px 1fr;gap:10px 16px;align-content:start;margin:0}
.case-brief dt{line-height:22px}
.case-brief dd{margin:0;font:400 18px/22px var(--text)}
.case-gallery{display:grid;grid-template-columns:1fr 1fr;gap:var(--gap)}
.case-media{margin:0;min-width:0;background:var(--surface)}
.case-media .cover-media{width:100%;height:auto}
.case-media.media-audio{display:flex;flex-direction:column;align-items:flex-start;gap:20px;padding:24px;border:1px solid #464344}
.media-audio h2{margin:0;font:500 24px/30px var(--heading)}
.media-audio audio{width:100%;height:46px}
.audio-download{font:400 18px/22px var(--text)}
.audio-download:hover,.case-top a:hover{text-decoration:underline;text-underline-offset:4px}
.case-bottom{display:flex;justify-content:space-between;align-items:center;gap:24px;margin:24px 16px 0;padding:28px 0;border-top:1px solid var(--line)}
.case-next{display:flex;flex-direction:column;gap:8px}
.case-next strong{font:500 36px/40px var(--heading)}
.case-next:hover strong{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}

/* Footer: the front-page footer. */
.work-footer{display:flex;align-items:center;justify-content:center;gap:14px;padding:20px 6%;background:var(--surface);text-align:center}
.work-footer img{width:auto;height:28px}
.work-footer p{margin:0;font:400 14px/1.4 var(--text);white-space:nowrap}

@media(hover:hover) and (pointer:fine){.project-cover:hover>.cover-media{transform:scale(1.025)}}
@media(min-width:1800px){.work-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.sound-cover strong{font-size:6vw}}
@media(max-width:1100px){.gallery-toolbar{gap:12px}.filters{column-gap:16px}}
@media(max-width:1000px){
  .work-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sound-cover strong{font-size:10vw}
  .gallery-toolbar{flex-wrap:wrap;row-gap:8px}.motion-toggle{margin-left:auto}.filters{order:3;width:100%;margin:0}
  .case-heading h1{max-width:82%}.case-brief{gap:25px}
}
@media(max-width:720px){.work-footer{flex-wrap:wrap}.work-footer p{white-space:normal}}
@media(max-width:600px){
  .gallery-toolbar{flex-direction:column;align-items:flex-start;padding:20px 4px 12px}
  .filters{order:0;gap:8px 12px}.filters button{padding-top:0}.motion-toggle{margin:0;padding:0}
  .work-grid{grid-template-columns:1fr;row-gap:16px}.sound-cover strong{font-size:21vw}
  .case-top{padding:14px 4px}
  .case-heading{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:8px 4px 18px}
  .case-heading h1,.case-heading>span{max-width:none;text-align:left}
  .case-brief{grid-template-columns:1fr;gap:24px;padding:22px 4px}
  .case-brief>p{font-size:18px;line-height:26px}
  .case-gallery{grid-template-columns:1fr}
  .case-hero>.sound-cover{--pad:24px;height:360px}.case-hero .sound-cover strong{font-size:24vw}
  .case-bottom{flex-direction:column;align-items:flex-start;gap:20px;margin:24px 4px 0}
  .case-next strong{font-size:30px;line-height:34px}
}
/* Phone header fix (round 2): one line, logo clear of Work. */
@media(max-width:480px){.work-header{padding:0 16px}.work-header nav{gap:14px}.work-header .nav-project{padding:9px 12px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}.project-cover:hover>.cover-media{transform:none}}
