/* An office's portfolio at its address's root (backend/web/portfolio_page.py).
   The images are the page: the works as a grid of covers, a work as its photos
   large, one at a time; the words small, and after the images. */
:root{color-scheme:light dark;--paper:#fbfaf7;--ink:#1d1d1b;--muted:#6b6a64;--line:#e4e2db;--tint:#f1efe9;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;color:var(--ink);background:var(--paper)}
@media (prefers-color-scheme:dark){:root{--paper:#151514;--ink:#efede7;--muted:#a3a19a;--line:#2e2d2a;--tint:#1f1e1c}}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-size:16px;line-height:1.65;background:var(--paper)}
body.held{overflow:hidden}
a{color:inherit;text-underline-offset:4px}
a:focus-visible,button:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
h1,h2,p,dl,dd,figure{margin:0}
img{display:block;max-width:100%;height:auto}
.wrap{width:min(1320px,calc(100% - 80px));margin-inline:auto}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.preview{padding:10px 16px;text-align:center;font-size:13px;background:#ffe9a8;color:#3b3000}
.label{font-size:11px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}

/* Header: the logo, and the page's sections. */
.top{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-block:28px}
.brand{display:block;text-decoration:none;font-size:15px;letter-spacing:.12em;text-transform:uppercase}
.brand img{max-height:48px;max-width:min(220px,42vw);width:auto}
.top nav{display:flex;gap:28px;margin-left:auto;font-size:13px;letter-spacing:.08em;text-transform:uppercase}
.top nav a{text-decoration:none;padding-block:4px;border-bottom:1px solid transparent}
.top nav a:hover{border-bottom-color:currentColor}
/* The office's networks: their marks after the sections, and with their names in the footer. */
.top .follow{display:flex;gap:14px;margin-left:12px;padding-left:26px;border-left:1px solid var(--line)}
.top .follow a,footer .nets a{color:var(--muted);transition:color .2s}
.top .follow a:hover,footer .nets a:hover{color:var(--ink)}
.top .follow a{display:flex;padding-block:4px}
.top .follow svg,footer .nets svg{width:17px;height:17px;fill:currentColor;flex:none}

/* The works: the first screen, a grid of covers under the menu of types. A
   work's title shows over its cover under the pointer (always where there is
   none to hover with); its type, place and year wait for its page. */
.projects{padding-block:4px 72px;scroll-margin-top:24px}
.types{margin-bottom:20px}
.types ul{display:flex;flex-wrap:wrap;gap:6px 26px;list-style:none;margin:0;padding:0;font-size:13px;letter-spacing:.08em;text-transform:uppercase}
.types a{display:inline-block;padding-block:4px;text-decoration:none;color:var(--muted);border-bottom:1px solid transparent}
.types a:hover{color:var(--ink)}
.types a[aria-current]{color:var(--ink);border-bottom-color:currentColor}
.works{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.works a,.mosaic a{position:relative;display:block;overflow:hidden;text-decoration:none;background:var(--tint)}
.frame{display:block;position:relative;overflow:hidden;aspect-ratio:4/3}
.frame img{width:100%;height:100%;object-fit:cover}
.works img,.mosaic img{transition:transform .6s cubic-bezier(.2,.7,.2,1)}
.works a:hover img,.mosaic a:hover img{transform:scale(1.035)}
.works .title,.mosaic .title{position:absolute;left:0;right:0;bottom:0;padding:56px 16px 14px;color:#fff;font-size:15px;line-height:1.3;letter-spacing:-.005em;background:linear-gradient(to top,rgba(0,0,0,.62),rgba(0,0,0,0));opacity:0;transition:opacity .25s;pointer-events:none}
.works a:hover .title,.works a:focus-visible .title,.mosaic a:hover .title,.mosaic a:focus-visible .title{opacity:1}
/* A piece of several images carries the networks' stack mark in its corner. */
.works .stack,.mosaic .stack{position:absolute;top:10px;right:10px;width:18px;height:18px;color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5));pointer-events:none}
@media (hover:none){.works .title,.mosaic .title{opacity:1}}
.empty{padding-block:64px 104px;color:var(--muted)}

/* The office's own words, after the works. */
.intro{padding-block:64px 88px;border-top:1px solid var(--line)}
.intro .label{margin-bottom:20px}
.intro p{max-width:900px;font-size:clamp(20px,2.2vw,28px);line-height:1.4;letter-spacing:-.015em}
.intro p+p{margin-top:16px}

/* One work: its photos large, one at a time, each at its own shape and never
   taller than most of the screen, side by side in a track that slides from one
   to the next (a swipe, the trackpad, or the arrows and the count portfolio.js
   shows); the type, title, place and year over the first, on a shade so they
   read over any photo. A click on a photo opens it large over the page. */
.work-top{padding-block:4px 14px}
.back{display:inline-block;font-size:12px;letter-spacing:.08em;text-transform:uppercase;text-decoration:none;color:var(--muted)}
.back:hover{color:var(--ink)}
.run{--h:min(78vh,860px)}
.stage{position:relative}
.track{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;overscroll-behavior-x:contain}
.track::-webkit-scrollbar{display:none}
.track:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
/* The track as tall as the tallest photo; each centred in its slide. */
.slide{flex:0 0 100%;display:flex;justify-content:center;align-items:center;scroll-snap-align:start;scroll-snap-stop:always}
.shot{position:relative;max-width:100%;margin:0}
.shot a{display:block;position:relative;cursor:zoom-in;background:var(--tint)}
.shot img{width:auto;height:auto;max-width:100%;max-height:var(--h)}
.over{position:absolute;left:0;right:0;bottom:0;display:flex;flex-direction:column;gap:6px;padding:96px 28px 26px;color:#fff;background:linear-gradient(to top,rgba(0,0,0,.62),rgba(0,0,0,0));pointer-events:none}
.over .label{color:rgba(255,255,255,.82)}
.over h1{max-width:24ch;font-size:clamp(26px,3.4vw,46px);line-height:1.06;font-weight:500;letter-spacing:-.03em;text-shadow:0 1px 20px rgba(0,0,0,.3)}
.over .meta{font-size:15px;color:rgba(255,255,255,.85)}
/* The arrows, over the track's sides; the count under it. An arrow at the end
   of the track fades. */
.run>.stage>.prev,.run>.stage>.next{position:absolute;top:calc(50% - 24px);z-index:2;width:48px;height:48px;border:1px solid var(--line);border-radius:50%;background:var(--paper);color:var(--ink);font:inherit;font-size:18px;cursor:pointer;box-shadow:0 2px 12px rgba(0,0,0,.12);transition:background .2s,color .2s,opacity .2s}
.run .prev{left:16px}
.run .next{right:16px}
.run .prev:hover,.run .next:hover{background:var(--ink);color:var(--paper)}
.run .prev:disabled,.run .next:disabled{opacity:.25;cursor:default;background:var(--paper);color:var(--ink)}
.run>.count{margin-top:12px;text-align:center;font-size:13px;letter-spacing:.12em;font-variant-numeric:tabular-nums;color:var(--muted)}
/* A video among the photos: its poster, with a play mark. */
.play{position:absolute;left:50%;top:50%;width:52px;height:52px;margin:-26px 0 0 -26px;border-radius:50%;background:rgba(0,0,0,.5);border:1px solid rgba(255,255,255,.8);pointer-events:none;transition:background .2s}
.play::after{content:"";position:absolute;left:20px;top:16px;border-style:solid;border-width:10px 0 10px 16px;border-color:transparent transparent transparent #fff}
.film:hover .play{background:rgba(0,0,0,.75)}
/* After the photos, "Sobre o projeto": the sheet and the text side by side,
   the text in a reading measure, its first paragraph a little larger when
   there are more; the photo credits last. */
.about{display:grid;grid-template-columns:minmax(200px,260px) minmax(0,640px);gap:28px 72px;margin-top:48px;padding-block:44px 80px;border-top:1px solid var(--line)}
.about.solo{grid-template-columns:minmax(0,640px)}
.about .label,.credits{grid-column:1/-1}
.facts{display:grid;gap:14px;align-content:start}
.facts div{display:grid;grid-template-columns:104px 1fr;gap:12px;align-items:baseline}
.work dt{font-size:11px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.work dd{font-size:15px}
.work .text{max-width:640px;font-size:17px;line-height:1.6}
.work .text p+p{margin-top:14px}
.work .text p:first-child:not(:only-child){font-size:20px;line-height:1.45;letter-spacing:-.01em;margin-bottom:22px}
.credits{font-size:13px;color:var(--muted)}
.gallery{padding-top:16px}

/* A photo opened large: the whole screen, dark, with arrows and a count. */
.lightbox{width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:rgba(12,12,11,.96);color:#fff}
.lightbox::backdrop{background:rgba(0,0,0,.6)}
.lightbox img,.lightbox video{position:absolute;inset:64px 88px;width:calc(100% - 176px);height:calc(100% - 128px);object-fit:contain}
.lightbox [hidden]{display:none}
.lightbox button{position:absolute;width:48px;height:48px;border:1px solid rgba(255,255,255,.5);border-radius:50%;background:transparent;color:#fff;font:inherit;font-size:18px;cursor:pointer;transition:background .2s,color .2s}
.lightbox button:hover{background:#fff;color:#1d1d1b}
.lightbox .close{top:12px;right:16px;border:0;font-size:28px}
.lightbox .prev{left:20px;top:calc(50% - 24px)}
.lightbox .next{right:20px;top:calc(50% - 24px)}
.lightbox .count{position:absolute;left:0;right:0;bottom:20px;text-align:center;font-size:13px;letter-spacing:.12em;font-variant-numeric:tabular-nums;color:rgba(255,255,255,.75)}
/* A before-and-after comparison (A46): its two photos split down the middle on a
   thumbnail; large, the "after" under the "before", which shows up to the handle. */
.split{position:relative;display:block}
/* Large, in a work's run: the split as wide as its photo, the tag clear of the title. */
.shot .split{display:inline-block;vertical-align:top}
.shot .compare-tag{top:12px;bottom:auto;left:12px}
.split .after{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;clip-path:inset(0 0 0 50%)}
.split::after{content:"";position:absolute;top:0;bottom:0;left:50%;border-left:2px solid #fff;box-shadow:0 0 4px rgba(0,0,0,.35)}
.compare-tag{position:absolute;left:10px;bottom:10px;padding:3px 9px;border-radius:3px;background:rgba(255,255,255,.9);color:#1d1d1b;font-size:12px;line-height:1.5;pointer-events:none}
.lightbox .compare{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);aspect-ratio:var(--shape,1.5);width:min(calc(100vw - 176px),calc((100vh - 128px) * var(--shape,1.5)));overflow:hidden;cursor:ew-resize;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.lightbox .compare img{inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.lightbox .compare img.before{clip-path:inset(0 calc(100% - var(--at,50%)) 0 0)}
.lightbox .compare .side{position:absolute;top:12px;max-width:40%;padding:3px 10px;border-radius:3px;background:rgba(255,255,255,.9);color:#1d1d1b;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
.lightbox .compare .side.before{left:12px}
.lightbox .compare .side.after{right:12px}
.lightbox .handle{position:absolute;top:0;bottom:0;left:var(--at,50%);border-left:2px solid #fff;box-shadow:0 0 6px rgba(0,0,0,.4);outline:none}
.lightbox .handle::before{content:"\2039\00a0\203A";position:absolute;top:50%;left:-1px;width:44px;height:44px;transform:translate(-50%,-50%);border-radius:50%;background:rgba(255,255,255,.92);color:#1d1d1b;font-size:20px;line-height:42px;text-align:center;box-shadow:0 2px 10px rgba(0,0,0,.3)}
.lightbox .handle:focus-visible::before{outline:2px solid #fff;outline-offset:3px}
.following{position:relative;display:block;height:min(56vh,560px);min-height:300px;color:#fff;text-decoration:none;overflow:hidden}
.following img{width:100%;height:100%;object-fit:cover;transition:transform .8s cubic-bezier(.2,.7,.2,1)}
.following:hover img{transform:scale(1.03)}
.following::after{content:"";position:absolute;inset:0;background:rgba(0,0,0,.38)}
.following>span{position:absolute;z-index:1;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:24px}
.following .label{color:rgba(255,255,255,.85)}
.following .title{font-size:clamp(28px,4vw,52px);font-weight:500;letter-spacing:-.03em;line-height:1.05}

/* A work opened over the works (portfolio.js): the whole screen, rising over
   the grid and scrolling on its own; × or Escape closes it back to the same
   place in the grid. The way back to all the works is the × here. */
.layer{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--paper);color:var(--ink);overflow-y:auto;overscroll-behavior:contain}
.layer::backdrop{background:rgba(0,0,0,.5)}
.layer[open]{animation:rise .4s cubic-bezier(.2,.7,.2,1)}
@keyframes rise{from{transform:translateY(32px);opacity:0}}
.layer>.close{position:sticky;top:14px;z-index:3;display:block;width:48px;height:48px;margin:0 16px -48px auto;border:1px solid var(--line);border-radius:50%;background:var(--paper);color:var(--ink);font:inherit;font-size:26px;line-height:1;cursor:pointer;box-shadow:0 2px 12px rgba(0,0,0,.12);transition:background .2s,color .2s}
.layer>.close:hover{background:var(--ink);color:var(--paper)}
.layer .back{display:none}
.layer .work-top{padding-top:24px}
.layer .post-head{padding-top:24px}

footer{display:flex;justify-content:space-between;align-items:flex-end;gap:32px 56px;flex-wrap:wrap;border-top:1px solid var(--line);padding-block:48px 56px}
footer .office{margin-top:10px;font-size:22px}
footer .ways{display:flex;flex-wrap:wrap;gap:6px 24px;margin-top:8px;font-size:15px;color:var(--muted)}
footer .small{margin-left:auto;font-size:12px;color:var(--muted)}
footer .nets{display:flex;flex-wrap:wrap;gap:10px 24px;margin-top:10px;font-size:15px}
footer .nets a{display:inline-flex;align-items:center;gap:9px;text-decoration:none;color:var(--ink)}
footer .nets a:hover{text-decoration:underline;text-underline-offset:4px}

/* The office's card: its address until the portfolio is published. */
.card{box-sizing:border-box;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;padding:48px 24px;text-align:center}
.card h1{font-size:clamp(26px,4vw,40px);font-weight:500;letter-spacing:-.02em}
.card h1 img{max-height:120px;max-width:min(320px,80vw);width:auto}
.card .ways{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 24px;font-size:15px;color:var(--muted)}
.card .nets{display:flex;flex-wrap:wrap;justify-content:center;gap:10px 24px;font-size:15px}
.card .nets a{display:inline-flex;align-items:center;gap:9px;text-decoration:none}
.card .nets a:hover{text-decoration:underline}
.card .nets svg{width:17px;height:17px;fill:currentColor;flex:none}
.card .small{margin-top:32px;font-size:12px;color:var(--muted)}

@media (max-width:1100px){.works{grid-template-columns:repeat(2,1fr)}}
/* Narrower than the sheet and a readable text side by side: the sheet above. */
@media (max-width:900px){
  .about{grid-template-columns:1fr;gap:24px;padding-block:36px 56px}
  .facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 32px}
}
@media (max-width:820px){
  .wrap{width:calc(100% - 32px)}
  .top{padding-block:18px}
  /* No room for the marks beside the logo and the sections (seven networks take
     some 240 px, and the header doesn't wrap): the footer carries them. */
  .top .follow{display:none}
  .top nav{gap:16px;font-size:12px}
  .types{margin-bottom:14px}
  .works{gap:6px}
  .works .title,.mosaic .title{padding:40px 12px 10px;font-size:13px}
  .projects{padding-block:0 56px}
  .intro{padding-block:48px 56px}
  .run{--h:min(64vh,640px);width:100%}
  .run>.stage>.prev,.run>.stage>.next{width:40px;height:40px;top:calc(50% - 20px);font-size:16px}
  .run .prev{left:8px}
  .run .next{right:8px}
  .run>.count{margin-top:8px;font-size:12px}
  .over{padding:64px 16px 18px;gap:4px}
  .over h1{font-size:clamp(24px,7vw,36px)}
  .over .meta{font-size:14px}
  .about{margin-top:32px;gap:20px;padding-block:28px 40px}
  .facts{grid-template-columns:1fr;gap:10px}
  .facts div{grid-template-columns:96px 1fr}
  .work .text p:first-child:not(:only-child){font-size:18px;margin-bottom:16px}
  .following{height:40vh;min-height:240px}
  .lightbox img,.lightbox video{inset:56px 0 88px;width:100%;height:calc(100% - 144px)}
  .lightbox .prev,.lightbox .next{top:auto;bottom:16px}
  .lightbox .count{bottom:30px}
  .lightbox .compare{width:min(100vw,calc((100vh - 144px) * var(--shape,1.5)))}
  .layer>.close{top:10px;width:40px;height:40px;margin:0 10px -40px auto;font-size:22px}
  .layer .work-top{padding-top:16px}
  footer{flex-direction:column;align-items:flex-start}
  footer .small{margin-left:0}
}
/* A phone upright, as the networks show a profile: the gallery three square
   covers across with hairline gaps (Instagram), the mosaic two columns (VSCO);
   no titles to see, the images alone. The title stays the link's name for a
   screen reader (the cover's alt is empty), so it is hidden as .sr-only is. */
@media (max-width:540px){
  .works{grid-template-columns:repeat(3,1fr);gap:2px}
  .frame{aspect-ratio:1}
  .works .title,.mosaic .title{width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;background:none}
  .works .stack,.mosaic .stack{top:6px;right:6px;width:14px;height:14px}
}
@media (max-width:420px){
  .top nav{gap:12px;font-size:11px}
  .top nav a[href$="#escritorio"]{display:none}
  .brand img{max-width:38vw}
}
/* Where there is nothing to hover with, a swipe moves the track: no arrows. */
@media (hover:none) and (pointer:coarse){.run .prev,.run .next{display:none}}
@media (prefers-reduced-motion:reduce){html,.track{scroll-behavior:auto}.works img,.mosaic img,.following img,.lightbox button,.layer>.close,.run .prev,.run .next,.play,.works .title,.mosaic .title{transition:none}.layer[open]{animation:none}}

/* An upright cover (a post, a story) in the grid's landscape frame: whole, on
   a blurred copy of itself, instead of cropped. */
.tall .backdrop{position:absolute;inset:0;filter:blur(28px) brightness(.7);transform:scale(1.15)}
.frame.tall img:not(.backdrop){position:relative;object-fit:contain}

/* The "mosaic" format: every image in its own shape, as the networks show them.
   The covers as a mosaic; a work as a grid of its images under its title. */
.mosaic{list-style:none;margin:0;padding:0;columns:3;column-gap:8px}
.mosaic li{break-inside:avoid;margin-bottom:8px}
/* Laid out by portfolio.js: flex columns filled in the works' order. */
.mosaic[data-columns]{columns:auto;display:flex;gap:8px}
.mosaic .column{flex:1 1 0;min-width:0;margin:0}
.mosaic .column>ul{list-style:none;margin:0;padding:0}
.mosaic img{width:100%;height:auto;background:var(--tint)}
.post-head{display:flex;flex-direction:column;gap:10px;padding-block:4px 20px}
.post-head h1{max-width:24ch;font-size:clamp(28px,3.6vw,48px);line-height:1.06;font-weight:500;letter-spacing:-.03em}
.post-head .meta{font-size:15px;color:var(--muted)}
.posts a{cursor:zoom-in}
/* A work's own images on a desktop: never wider than 72% of the screen or 1100 px,
   nor taller than 82% of it, centred in their column (one image alone filled the
   width at twice the screen's height). A phone keeps them across. */
@media (min-width:821px){
  .posts .column>ul{container-type:inline-size}
  .posts a{width:fit-content;margin-inline:auto}
  /* Not a comparison's "after": it lies over its "before", at its size. */
  .mosaic.posts img:not(.after){width:min(100cqw,72vw,1100px,calc(82vh * var(--r,99)))}
}
@media (max-width:1100px){.mosaic{columns:2}}
@media (max-width:820px){.mosaic{column-gap:4px}.mosaic[data-columns]{gap:4px}.mosaic li{margin-bottom:4px}.post-head{padding-block:4px 14px}}
@media (max-width:540px){.mosaic{columns:2;column-gap:2px}.mosaic[data-columns]{gap:2px}.mosaic li{margin-bottom:2px}}
