/* Common Public portfolio
   One left column on every page: logo at the top, studio line and works list, menu at the bottom.
   Project pages run full width: the logo and menu keep their corners and show through the pictures. */
:root{
  --ground:#FAFAFA; --ink:#1B1B1B; --muted:#5C5C5C; --off:#A3A3A3; --tile:#ECECEC;
  --g:30px;              /* page margin: 30px all round (phones override to 12px) */
  --gap:12px;                              /* space between pictures */
  --side-w:clamp(200px,16vw,280px);        /* the left column (slimmer) */
  --col-gap:clamp(24px,3vw,48px);
  --main-x:calc(var(--g) + var(--side-w) + var(--col-gap));   /* where content starts */
  --intro-y:clamp(80px,6.6vw,96px);        /* where the studio line and the first pictures start, level with each other */
  --logo-w:clamp(128px,9.5vw,160px);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root{--ground:#141414; --ink:#F2F2F2; --muted:#B3B3B3; --off:#7A7A7A; --tile:#222; color-scheme:dark}
  .logo{filter:invert(1)}
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0; background:var(--ground); color:var(--ink); font-family:"Manrope",Arial,sans-serif; font-size:15px; line-height:1.35; font-weight:500; letter-spacing:-.005em; -webkit-font-smoothing:antialiased}
main{animation:cp-in .6s ease both}   /* the fade sits on the content only, so the logo and menu can blend with what's behind them */
@keyframes cp-in{from{opacity:0}to{opacity:1}}
a{color:inherit; text-decoration:none}
img{display:block; max-width:100%}
ul{list-style:none; margin:0; padding:0}
h1,p{margin:0}
::selection{background:#b1cece; color:#f36a11}   /* pale blue with orange text, from Michael's swatch */
.label{color:var(--off)}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* ---------- The left column ---------- */
.side{position:fixed; z-index:40; top:0; bottom:0; left:var(--g); width:var(--side-w); display:flex; flex-direction:column; padding:var(--g) 0 calc(var(--g) - 5px + env(safe-area-inset-bottom,0px))}
.brand{line-height:0; width:fit-content}
/* The wordmark is cut into five pieces (C, ommon, space, P, ublic). Scrolling folds it into CP; back at the top it opens out again */
.logo{--lw:var(--logo-w); display:flex; height:calc(var(--lw) * 96 / 817)}
.lg{display:block; flex:none; height:100%; overflow:hidden; background:url(/assets/logo.png) no-repeat; background-size:var(--lw) auto;
  width:calc(var(--lw) * var(--w) / 817); background-position:calc(var(--lw) * var(--x) / -817) 0;
  transition:width .75s cubic-bezier(.65,0,.35,1), opacity .45s ease}
.lg-c{--x:0; --w:83} .lg-o{--x:83; --w:398} .lg-s{--x:481; --w:26} .lg-p{--x:507; --w:69} .lg-u{--x:576; --w:241}
@media (min-width:721px){ html.is-down .lg-o, html.is-down .lg-s, html.is-down .lg-u{width:0; opacity:0; transition:width .75s cubic-bezier(.65,0,.35,1), opacity .35s ease} }  /* phones keep the full name */
@media (prefers-reduced-motion:reduce){ .lg{transition:none} }
.side-intro{margin-top:16px; font-size:15px; font-weight:400; line-height:1.3; letter-spacing:-.022em; max-width:270px}
/* Pointing at a project shows what we did and a short summary in the column */
.side-hover{position:relative; margin-top:40px}
.hv{position:absolute; top:0; left:0; right:0; display:flex; flex-direction:column; gap:14px; opacity:0; transform:translateY(6px); transition:opacity .35s ease, transform .35s ease; pointer-events:none}
.hv.is-on{opacity:1; transform:none}
.hv-services{display:flex; flex-direction:column; gap:2px; color:var(--muted)}
.hv-text{color:var(--muted); max-width:300px}
.dock{margin-top:auto; display:flex; flex-direction:column; gap:0; font-size:clamp(20px,1.7vw,26px); line-height:1.1; letter-spacing:-.01em}
.dock a{color:var(--off); transition:color .25s ease}
.dock a:hover, .dock a[aria-current]{color:var(--ink)}
main{margin-left:var(--main-x); padding:0 var(--g) var(--g) 0; min-height:100vh}

/* ---------- Works: two uneven columns of projects ---------- */
.grid{display:grid; grid-template-columns:minmax(0,42fr) minmax(0,58fr); gap:var(--gap); align-items:start; padding-top:var(--intro-y)}   /* the left column reaches back to the sidebar; the right keeps its size */
.col{display:flex; flex-direction:column; gap:20px}
.card{display:block; transition:opacity .45s ease}
.card-img{display:block; overflow:hidden; background:var(--tile)}
.card-img img{width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity .8s ease}
.card-img img.is-loaded{opacity:1}
.card-img:has(img.is-loaded){background:none}
.cap{display:flex; flex-direction:column; padding-top:10px; line-height:1.3}
.cap-line{color:var(--off)}   /* services and year in the same light grey as the menu */
.cap-line .dash{display:inline-block; width:1.6em; height:1px; background:currentColor; vertical-align:middle; margin:0 .4em; position:relative; top:-1px}
.cap-note{color:var(--off)}
.card.is-soon{cursor:default}
/* Pointing at a project: the others stay as they are; the one you're on flicks through its pictures (site.js) */

/* ---------- A project: full width; logo top left and menu bottom left, showing through the pictures ---------- */
.page-project .side{pointer-events:none; mix-blend-mode:difference; width:auto}
.page-project .side > *{pointer-events:auto}
.page-project .logo{filter:invert(1)}
.page-project .side-intro, .page-project .side-hover{display:none}
.page-project .dock a{color:#fff; opacity:.5; transition:opacity .25s ease}
.page-project .dock a:hover, .page-project .dock a[aria-current]{opacity:1}
.page-project main{margin-left:0; padding:0 var(--g) calc(var(--g) + 4.5em)}
.page-project .project{padding-bottom:clamp(40px,8vh,96px)}
.p-head, .p-row, .next{display:grid; grid-template-columns:1fr 1fr 2fr; column-gap:var(--col-gap)}
.p-head{padding:calc(var(--intro-y) + clamp(24px,9vh,110px)) 0 clamp(48px,9vh,96px); align-items:start}
.p-title{display:flex; flex-direction:column}
.p-title h1{font-size:clamp(30px,2.8vw,44px); font-weight:500; line-height:1.05; letter-spacing:-.03em; margin-bottom:10px}
.p-details{display:flex; flex-direction:column; gap:14px}
.p-details .d{display:flex; flex-direction:column}
.p-details a{text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px}
.p-details a:hover{color:var(--muted)}
.p-brief p, .p-text p{font-size:19px; font-weight:400; line-height:1.3; letter-spacing:-.022em; max-width:720px}
.p-brief, .p-text{display:flex; flex-direction:column; gap:1em}
.shot{margin:0 0 var(--gap); background:var(--tile); overflow:hidden}
.shot img{width:100%; height:auto; opacity:0; transition:opacity .8s ease}
.shot img.is-loaded{opacity:1}
.shot:has(img.is-loaded){background:none}
.pair{display:grid; grid-template-columns:1fr 1fr; gap:var(--gap)}
.pair .shot img{aspect-ratio:4/5; object-fit:cover; height:100%}
.pair.narrow{width:calc(75% + var(--gap)/2); margin-left:auto}   /* smaller pictures sit narrower so they stay sharp */
.p-row{padding:clamp(64px,14vh,160px) 0}
.p-row .label{grid-column:1}
.p-row .p-text{grid-column:3}
.next{align-items:end; padding-top:clamp(64px,14vh,160px)}
.next .label{grid-column:1; align-self:start}
.next-name{grid-column:2; font-size:clamp(30px,2.8vw,44px); font-weight:500; line-height:1.05; letter-spacing:-.03em; transition:color .25s ease}
.next-img{grid-column:3; display:block; overflow:hidden; background:var(--tile); aspect-ratio:16/9}
.next-img img{width:100%; height:100%; object-fit:cover}
.next:hover .next-name{color:var(--muted)}

/* ---------- About: same wording and lists as the current site ---------- */
.about{display:grid; grid-template-columns:1fr 1fr; column-gap:var(--col-gap); padding-top:var(--intro-y)}
.about-intro p{font-size:19px; font-weight:400; line-height:1.3; letter-spacing:-.022em; max-width:540px}
.about-lists{display:grid; grid-template-columns:1fr 1fr; gap:clamp(40px,7vh,72px) 24px; align-content:start}
.list{display:flex; flex-direction:column; gap:clamp(14px,2vh,22px); font-size:clamp(15px,1.05vw,17px)}
.list-label{color:var(--off)}
.list ul{display:flex; flex-direction:column; gap:2px}
.list .more{color:var(--off)}

/* ---------- Talk: the contact details set large, as on the current site ---------- */
.talk{display:flex; flex-direction:column; justify-content:flex-end; min-height:calc(100vh - var(--g)); min-height:calc(100svh - var(--g))}
.talk-big{display:flex; flex-direction:column; gap:.2em; font-size:clamp(28px,5.2vw,110px); font-weight:500; line-height:1; letter-spacing:-.045em}
.talk-big a{width:fit-content; overflow-wrap:anywhere; transition:color .25s ease}
.talk-big a:hover{color:var(--muted)}

/* ---------- Back to top ---------- */
.go-up{position:fixed; left:50%; bottom:calc(14px + env(safe-area-inset-bottom,0px)); transform:translate(-50%,8px); z-index:30; border:0; background:none; color:#fff; mix-blend-mode:difference; font:inherit; cursor:pointer; padding:6px 10px; opacity:0; pointer-events:none; transition:opacity .3s ease, transform .3s ease}
.go-up.is-on{opacity:1; pointer-events:auto; transform:translate(-50%,0)}
.go-up:hover{opacity:.7}

/* ---------- Tablets: the works list drops out of the column ---------- */
@media (max-width:1100px){
  :root{--side-w:clamp(200px,24vw,260px)}
  .side-hover{display:none}
  .side-intro{font-size:15px}
  .grid{grid-template-columns:1fr 1fr; width:100%}
  .about{grid-template-columns:1fr}
  .about-lists{margin-top:40px}
}

/* ---------- Phones: a slim bar across the top, logo on the left and the menu on the right ---------- */
@media (max-width:720px){
  :root{--gap:8px; --intro-y:40px; --bar-h:54px}
  .side, .page-project .side{left:0; right:0; top:0; bottom:auto; width:auto; height:var(--bar-h); padding:0 var(--g); flex-direction:row; align-items:center; justify-content:space-between;
    pointer-events:auto; mix-blend-mode:normal; z-index:40;
    background:color-mix(in srgb, var(--ground) 88%, transparent); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px)}
  .logo, .page-project .logo{--lw:clamp(124px,36vw,150px); filter:none}
  .side-intro, .side-hover{display:none}
  .dock{flex-direction:row; gap:18px; margin:0; font-size:15px; line-height:1}
  .dock a, .page-project .dock a{color:var(--off); opacity:1}
  .dock a[aria-current], .page-project .dock a[aria-current]{color:var(--ink)}
  main, .page-project main{margin-left:0; padding:var(--bar-h) var(--g) var(--g)}
  .grid{display:flex; flex-direction:column; gap:22px; padding-top:28px; width:auto; margin-left:0}
  .col{display:contents}
  .p-head, .p-row, .next{grid-template-columns:1fr; row-gap:28px}
  .p-head{padding:var(--intro-y) 0 36px}
  .p-details{flex-direction:row; flex-wrap:wrap; gap:14px 28px}
  .p-brief p, .p-text p{font-size:18px}
  .p-row{padding:56px 0}
  .p-row .label, .p-row .p-text, .next .label, .next-name, .next-img{grid-column:1}
  .pair{grid-template-columns:1fr}
  .pair.narrow{width:100%}
  .next{padding-top:56px}
  .about{grid-template-columns:1fr}
  .about-lists{gap:36px 20px; margin-top:28px}
  .talk{min-height:0; justify-content:flex-start; padding-top:var(--intro-y)}
  .talk-big{font-size:calc((100vw - 2 * var(--g)) / 14.5); white-space:nowrap; letter-spacing:-.04em; gap:.38em}
  .talk-big a{overflow-wrap:normal}
  .go-up{left:auto; right:var(--g); bottom:calc(var(--g) + env(safe-area-inset-bottom,0px)); transform:translateY(8px)}
  .go-up.is-on{transform:none}
}
.mobile-intro{display:none; padding-top:var(--intro-y); font-size:18px; font-weight:400; line-height:1.3; letter-spacing:-.022em}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important; transition:none !important}
}

/* Over links and projects, the arrow becomes a round dot that inverts whatever is under it (mouse only) */
.cursor-dot{position:fixed; left:0; top:0; z-index:60; width:44px; height:44px; margin:-22px 0 0 -22px; border-radius:50%; background:#fff; mix-blend-mode:difference; pointer-events:none; transform:translate3d(-100px,-100px,0) scale(0); transition:opacity .2s ease; will-change:transform}
html.has-dot a, html.has-dot button, html.has-dot .card{cursor:none}
@media (hover:none), (pointer:coarse){ .cursor-dot{display:none} }

/* ---------- Moving covers (video) ---------- */
.card-img.has-vid{position:relative; background:none}
.card-img.has-vid video{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block}
.card-img.has-vid img{position:relative; opacity:0; transition:none}
.card.is-cycling .card-img.has-vid img{opacity:1}
.shot.is-vid{background:none}
.shot.is-vid video{display:block; width:100%; height:auto}

/* Phones in dark mode: the logo flips to light, as on desktop */
@media (max-width:720px) and (prefers-color-scheme:dark){
  .logo, .page-project .logo{filter:invert(1)}
}

/* ---------- Desktop Works: card sizes and positions after varvaragodovikova.eu ----------
   Michael widened the sidebar: the grid now starts 24vw in (was 248px at 1440). Same as Varvara otherwise: columns 467px and 705px, 10px apart, 10px from the right edge, 39px from the top. */
@media (min-width:1101px){
  .page-works{--main-x:max(31vw, 340px)}
  .page-works .side{width:calc(var(--main-x) - var(--g) - 20px)}
  .page-works main{padding-right:var(--g)}   /* same margin as the left */
  .page-works .grid{grid-template-columns:minmax(0,45fr) minmax(0,55fr); column-gap:30px; row-gap:0; padding-top:calc(var(--g) + var(--logo-w) * 96 / 817 + 16px + 4px)}  /* image tops line up with the top of the studio line */
  .page-works .col{gap:1.7vw}
  .page-works .cap{padding-top:8px}
}

/* ---------- Phones: menu button and full-screen menu, after offformdesign.com ---------- */
.burger, .m-menu{display:none}
@media (max-width:720px){
  :root{--bar-h:50px}
  .side, .page-project .side{background:var(--ground); -webkit-backdrop-filter:none; backdrop-filter:none}
  .dock{display:none}
  .burger{display:flex; flex-direction:column; justify-content:center; gap:6px; width:28px; height:28px; margin-right:0; padding:0; border:0; background:none; color:var(--ink); cursor:pointer}
  .burger i{display:block; height:2px; width:100%; background:currentColor; transition:transform .3s ease}
  .m-menu{display:flex; flex-direction:column; justify-content:space-between; position:fixed; inset:0; z-index:39; background:var(--ink); color:var(--ground);
    padding:calc(var(--bar-h) + 44px) var(--g) calc(var(--g) + 60px + env(safe-area-inset-bottom,0px)); opacity:0; visibility:hidden; transition:opacity .3s ease, visibility 0s linear .3s}
  .m-links{display:flex; flex-direction:column; font-size:40px; font-weight:500; line-height:1.15; letter-spacing:-.03em}
  .m-links a{color:var(--ground)}
  .m-foot{display:flex; flex-direction:column; font-size:15px; line-height:1.35}
  .m-foot a{color:var(--ground)}
  html.menu-open{overflow:hidden}
  html.menu-open .m-menu{opacity:1; visibility:visible; transition:opacity .3s ease}
  html.menu-open .side{background:transparent}
  html.menu-open .logo{filter:invert(1)}
  html.menu-open .burger{color:var(--ground)}
  html.menu-open .burger i:first-child{transform:translateY(4px) rotate(45deg)}
  html.menu-open .burger i:last-child{transform:translateY(-4px) rotate(-45deg)}

  /* Works: full-width cards, one shape, the studio line after the second project */
  .grid{gap:0; padding-top:0}
  .grid .card{margin-bottom:32px}
  .grid .card-img{aspect-ratio:350/308 !important}
  .cap{padding-top:10px; font-size:14px}
  .mobile-intro{display:block; order:3; padding:4px 0 64px; font-size:30px; font-weight:500; line-height:1.2; letter-spacing:-.03em}
  .page-works main{padding-top:calc(var(--bar-h) + 6px)}
}
@media (max-width:720px) and (prefers-color-scheme:dark){
  html.menu-open .logo{filter:none}
}

/* ---------- Phones: the homepage opens on a project filling the screen inside the page margins, changing every 1.5 seconds ---------- */
.m-hero, .m-intro{display:none}
@media (max-width:720px){
  .m-hero{display:flex; flex-direction:column; height:calc(100vh - var(--bar-h) - 6px); height:calc(100svh - var(--bar-h) - 6px); margin-bottom:calc(32px - var(--g) - 48px)}
  .m-intro{display:none; margin:0 0 72px; text-indent:50%; font-size:14px; font-weight:400; line-height:1.35; letter-spacing:-.01em}
  .m-stage{position:relative; flex:1; min-height:0}
  .grid .mobile-intro{display:none}
  .m-slide{position:absolute; inset:0 0 calc(var(--g) + 48px) 0; display:flex; flex-direction:column; visibility:hidden}
  .m-slide.is-on{visibility:visible}
  .m-slide img{flex:1; min-height:0; width:100%; object-fit:cover; display:block; background:var(--tile)}
  .m-slide.is-fit img{object-fit:contain}
  .m-hero-cap{display:flex; flex-direction:column; padding-top:10px; font-size:14px; line-height:1.35; color:var(--ink)}
  .m-hero-cap span + span{color:var(--off)}
}

/* ---------- Phones: a tight header in the page colour, smaller logo ---------- */
@media (max-width:720px){
  :root{--bar-h:40px; --g:12px}   /* tighter side margins on phones */
  .side, .page-project .side{background:var(--ground); -webkit-backdrop-filter:none; backdrop-filter:none; mix-blend-mode:normal}
  html.menu-open .side{background:transparent}
  .logo, .page-project .logo{--lw:clamp(110px,30.8vw,130px); filter:none}
  .burger{width:24px; height:24px; gap:5px; color:var(--ink)}
  html.menu-open .logo{filter:invert(1)}
  html.menu-open .burger{color:var(--ground)}
  html.menu-open .burger i:first-child{transform:translateY(3.5px) rotate(45deg)}
  html.menu-open .burger i:last-child{transform:translateY(-3.5px) rotate(-45deg)}
}
@media (max-width:720px) and (prefers-color-scheme:dark){
  .logo, .page-project .logo{filter:invert(1)}
  html.menu-open .logo{filter:none}
}

/* No visible scrollbar anywhere; scrolling still works */
html, body{scrollbar-width:none; -ms-overflow-style:none}
html::-webkit-scrollbar, body::-webkit-scrollbar{display:none; width:0; height:0}

/* Pictures and videos can't be dragged out or saved with a long press */
img, video{-webkit-user-drag:none; user-drag:none; -webkit-touch-callout:none; -webkit-user-select:none; user-select:none}
/* iPhone: no long-press menu or link preview on project cards and pictures (tapping still opens them) */
.brand, .brand *, .card, .card *, .m-slide, .m-slide *, .shot, .next-img, .next-img *, .next{-webkit-touch-callout:none; -webkit-user-select:none; user-select:none}
/* Phones: the logo's C and the menu button sit exactly on the page margins, flush with the pictures */
@media (max-width:720px){ .logo, .page-project .logo{margin-left:-.5px} }
/* Desktop: the logo's C sits exactly on the 30px margin */
@media (min-width:721px){ .logo{margin-left:-1px} }
