/* Avg Joe — studio site. 1rem = 1vw on desktop, so design px at 1600 wide = px/16 rem. */

@font-face{font-family:"Nuckle";src:url(fonts/nuckle-medium.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Nuckle";src:url(fonts/nuckle-semibold.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Nuckle";src:url(fonts/nuckle-arrows.woff2) format("woff2");font-weight:500;unicode-range:U+2197-2198}
@font-face{font-family:"Riccione";src:url(fonts/riccione-light.woff2) format("woff2");font-weight:300;font-display:swap}
/* rotation faces */
@font-face{font-family:"r-avebury";src:url(fonts/avebury.woff2) format("woff2")}
@font-face{font-family:"r-campground";src:url(fonts/campground.woff2) format("woff2")}
@font-face{font-family:"r-gilroy-heavy";src:url(fonts/gilroy-heavy.woff2) format("woff2")}
@font-face{font-family:"r-kelsi";src:url(fonts/kelsi.woff2) format("woff2")}
@font-face{font-family:"r-postoni";src:url(fonts/postoni.woff2) format("woff2")}
@font-face{font-family:"r-iowan-black";src:url(fonts/iowan-black.woff2) format("woff2")}
@font-face{font-family:"r-iowan-black-italic";src:url(fonts/iowan-black-italic.woff2) format("woff2")}
@font-face{font-family:"r-snell-black";src:url(fonts/snell-black.woff2) format("woff2")}
@font-face{font-family:"snell";src:url(fonts/snell-regular.woff2) format("woff2");font-display:swap}

:root{
  --cream:#f1eee7; --ink:#0b0b0b; --white:#fff;
  --frame:.625rem;
  /* grid: one system for the whole site. Content edges sit on --margin; columns are split by --gutter;
     vertical gaps use the --s steps only. Press G on the page to see the grid. */
  --cols:12; --margin:1.25rem; --gutter:1.25rem;
  --s1:.75rem; --s2:1.5rem; --s3:3rem; --s4:6rem;
  --pad:var(--margin);
  --small:max(.8rem,11px);
}
*{box-sizing:border-box;margin:0;padding:0}
html{font-size:1vw;background:var(--cream);overscroll-behavior:none;scrollbar-width:none}
html::-webkit-scrollbar{display:none}
/* Lenis */
html.lenis,html.lenis body{height:auto}
.lenis:not(.lenis-autoToggle).lenis-stopped{overflow:clip}
#scroll-space{width:1px;pointer-events:none}
body{background:var(--cream);color:var(--ink);
  font-family:"Nuckle",system-ui,sans-serif;font-weight:500;letter-spacing:-.03em;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;overscroll-behavior:none}
a{color:inherit;text-decoration:none}
ul{list-style:none}
img{display:block;max-width:100%}

#stage{position:fixed;inset:0;overflow:hidden}
.layer{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
#veil{position:fixed;inset:0;background:var(--cream);opacity:0;pointer-events:none;z-index:40}

/* ---------- logo ---------- */
.logo{position:fixed;left:0;top:0;z-index:60;color:#fff;mix-blend-mode:difference;
  line-height:1.6rem;height:1.6rem;white-space:nowrap;will-change:transform;opacity:0}
#logo-avg{font-weight:600;font-size:1.4rem;letter-spacing:-.04em}
#logo-joe{font-family:"Riccione",Georgia,serif;font-weight:300;font-size:1.62rem;letter-spacing:-.01em}

/* ---------- small sentence ---------- */
/* the sentence only shows in the gap between Avg and Joe as they part (set from main.js) */
#s-line{z-index:3;pointer-events:none;color:var(--ink);--l:50vw;--r:50vw;
  clip-path:inset(-200% var(--r) -200% var(--l))}
.mbr{display:none}
.line{font-size:1.56rem;line-height:1.3;white-space:nowrap;letter-spacing:-.035em}
.slot1{--w:0;display:inline-block;vertical-align:middle;height:1.7rem;
  width:calc(var(--w)*2.5rem);margin:0 calc(var(--w)*.15rem) 0 calc(var(--w)*.6rem);position:relative;top:-.08em}

/* letters that rotate through typefaces */
.cycle{white-space:nowrap}
/* each letter is a fixed-width, zero-height box on the baseline: any face can swap in without moving the line or its neighbours */
.cy{display:inline-block;text-align:center;line-height:0;vertical-align:baseline;letter-spacing:0;white-space:nowrap}

/* ---------- travelling image ---------- */
#hero{position:fixed;left:0;top:0;z-index:2;overflow:hidden;width:0;height:0;border-radius:.25rem;
  will-change:transform,width,height}
#hero img{position:absolute;left:0;top:0;max-width:none;object-fit:cover;will-change:transform}
/* intro: while you're at the top, Avg and Joe open on their own to show one of these */
#intro{position:fixed;left:50%;top:50%;z-index:59;pointer-events:none;color:var(--ink)}
#intro>*{position:absolute;left:0;top:0;visibility:hidden;opacity:0;display:block;max-width:none}
#intro .globe{width:2.6rem;height:auto}
#intro .bird{width:2.7rem;height:auto}
#intro .pic{width:3.1rem;height:2.05rem;object-fit:cover;border-radius:.3rem}

/* ---------- big sentence ---------- */
#s-big{z-index:1;visibility:hidden}
.big{font-size:6.25rem;line-height:1.03;letter-spacing:-.05em;text-align:center}
.big .ln{display:block;white-space:nowrap}
.slot2{display:inline-block;vertical-align:middle;width:7.95rem;height:5.2rem;margin:0 1.9rem 0 2.3rem;position:relative;top:-.05em}
.swallow{display:inline-block;vertical-align:middle;width:7.4rem;height:auto;margin:0 .6rem 0 .3rem;position:relative;top:-.04em}
.amp{font-family:"snell",cursive;letter-spacing:0;font-size:1.4em;margin:0 .1em 0 .06em;display:inline-block;line-height:0;vertical-align:baseline}
.ai{letter-spacing:-.04em;color:transparent;
  background:linear-gradient(100deg,#ff5a1f,#ff9248,#5d86c8,#d59bc0,#ff5a1f,#ff9248,#5d86c8);
  background-size:300% 100%;-webkit-background-clip:text;background-clip:text;animation:ai 7s linear infinite}
@keyframes ai{to{background-position:-150% 0}}

/* ---------- wheel ---------- */
#wheel-bg{position:absolute;inset:0;z-index:0;opacity:0;pointer-events:none;
  background:
    radial-gradient(55% 75% at -5% 45%,#8fc0dc 0%,rgba(143,192,220,.55) 35%,rgba(143,192,220,0) 72%),
    radial-gradient(45% 40% at 50% 105%,#f8ebe1 0%,rgba(248,235,225,0) 70%);
  animation:drift 14s ease-in-out infinite alternate}
@keyframes drift{to{transform:translate3d(3%,-4%,0) scale(1.08)}}
#s-wheel{z-index:4;display:block;visibility:hidden}
#wheel{position:absolute;left:-17.5rem;top:50%;width:0;height:0}
#wheel-list li{position:absolute;left:0;top:0;transform-origin:0 0;white-space:nowrap;
  font-weight:500;font-size:4.5rem;line-height:1.05;letter-spacing:-.05em;will-change:transform,filter,opacity;cursor:pointer}
#works{position:absolute;inset:0;pointer-events:none}
.work{position:absolute;visibility:hidden;pointer-events:auto;display:block}
.work img{width:100%;height:100%;object-fit:cover;border-radius:.5rem}
.work .ph{overflow:hidden;border-radius:.5rem;position:relative;z-index:1}
.work span,.more{display:inline-block;font-size:var(--small);letter-spacing:-.02em;margin-top:.7rem}
/* "View Case Study" waits tucked up behind the image and slides down out from under it on hover */
.work span{position:relative;z-index:0;opacity:0;transform:translateY(-130%);
  transition:transform .55s cubic-bezier(.2,.8,.2,1),opacity .35s ease}
.work:hover span,.work:focus-visible span{opacity:1;transform:none}
@media (hover:none){.work span{opacity:1;transform:none}}

/* ---------- cases ---------- */
/* soft top edge: the panel fades in from see-through to cream, so it never draws a hard line over the gradient */
#s-cases{z-index:5;display:block;overflow:hidden;background:linear-gradient(to bottom,rgba(241,238,231,0) 0,rgba(241,238,231,.85) 22vh,var(--cream) 38vh);visibility:hidden;scrollbar-width:none}
#s-cases::-webkit-scrollbar{display:none}
.grid{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));column-gap:var(--gutter);row-gap:var(--gutter);padding:0 var(--margin)}
.case{position:relative;align-items:start;padding-top:var(--s3);padding-bottom:var(--s4)}
.case h2{font-weight:500;letter-spacing:-.05em}
.pills{display:flex;flex-wrap:wrap;gap:var(--s1)}
.pills li{background:#fff;border-radius:99rem;padding:.6em 1.5em;font-size:var(--small);letter-spacing:-.01em;line-height:1.2}
/* a hairline between case studies, inside the margins */
.case + .case::before{content:"";grid-column:1/-1;height:1px;background:var(--ink);margin-bottom:calc(var(--s3) - var(--gutter))}
.case + .case{padding-top:0}
/* Boon: heading over 11 columns; images 8 + 4 columns, same height */
.case-boon{min-height:100vh;min-height:100svh}
.case-boon h2{grid-column:1/span 11;font-size:3.62rem;line-height:1.14;margin-bottom:calc(var(--s2) - var(--gutter))}
.boon-grid{display:contents}
.boon-grid img{width:100%;height:29.5rem;object-fit:cover}
.boon-grid figure{grid-column:1/span 8}
.boon-grid .van{grid-column:9/span 4;transition-delay:.14s}
.case-boon .more{grid-column:1/-1;margin-top:calc(var(--s1) - var(--gutter))}
/* 620: copy over 6 columns, image over the other 6; copy top and "View Case Study" line up with the image */
.case-620{min-height:100vh;min-height:100svh;align-items:stretch}
.case-620 .txt{grid-column:1/span 6;display:flex;flex-direction:column;justify-content:space-between}
.case-620 h2{font-size:3.8rem;line-height:1.03;letter-spacing:-.055em;margin-top:-.12em}
.case-620 .more{margin-top:var(--s2)}
.case-620 figure{grid-column:7/span 6}
.case-620 figure img{width:100%;height:auto}
/* lozenges sit on the image, top left, in every case study */
.case figure{position:relative}
.case figure .pills{position:absolute;left:var(--s2);top:var(--s2);right:var(--s2);z-index:1}
.sys{transition:color .6s}
.case-620:hover .sys{color:#3d6b12}
/* grid overlay (press G) */
#grid-ov{position:fixed;inset:0;z-index:200;pointer-events:none;display:none}
#grid-ov.on{display:grid}
#grid-ov i{background:rgba(255,40,90,.09);box-shadow:inset 1px 0 rgba(255,40,90,.35),inset -1px 0 rgba(255,40,90,.35)}
#grid-ov i:nth-child(n+5){display:var(--ov-wide,block)}
.rv{opacity:0;transform:translateY(2rem);transition:opacity .9s cubic-bezier(.2,.7,.2,1),transform 1.1s cubic-bezier(.2,.7,.2,1)}
.rv.in{opacity:1;transform:none}
.line-rv{display:block}
.line-rv.rv{transform:translateY(.6em)}
.line-rv.rv.in{transform:none}
.pills li.rv{transform:translateY(1rem)}
.pills li.rv.in{transform:none}
.case img.rv{transform:translateY(3rem)}
.case img.rv.in{transform:none}

/* ---------- nav notch ---------- */
/* the bar + notch are cut out of images in main.js (cutImages), so only images show them */
#nav{position:fixed;left:50%;bottom:calc(var(--frame) - 1px);transform:translateX(-50%);z-index:50}
/* one soft shape: big rounded shoulders that flare out into the bottom edge */
.notch{position:relative;width:29rem;height:2.6rem;display:flex;align-items:center;justify-content:center;gap:1.6rem;padding-top:.3rem}
/* three plain buttons; the middle one changes its words with where you are */
.nb{position:relative;font-size:var(--small);letter-spacing:-.02em;line-height:1.6;padding:.2rem 0;color:#8e8b86;transition:color .35s}
.nb:hover,.nb.on{color:var(--ink)}
.nb[data-k="studio"]{min-width:6.6rem;text-align:center;overflow:hidden}
.say{display:inline-block;white-space:nowrap}
a:focus-visible{outline:2px solid currentColor;outline-offset:3px;filter:none}

/* ---------- phones ---------- */
@media (max-width:760px){
  html{font-size:2.35vw}
  :root{--frame:.8rem;--cols:4;--margin:1.6rem;--gutter:1rem;--ov-wide:none}
  /* phones: the sentence sits on three lines with the image in the middle one, close to the centre */
  .line{white-space:nowrap;text-align:center;font-size:3.1rem;line-height:1.18}
  .mbr{display:inline}
  .slot1{height:3.3rem;width:calc(var(--w)*5rem);margin:0 calc(var(--w)*.5rem) 0 calc(var(--w)*.9rem)}
  .big{font-size:4.05rem}
  .work:nth-child(odd){left:60%!important;top:11%!important}
  .work:nth-child(even){left:56%!important;top:71%!important}
  .slot2{width:5.2rem;height:3.4rem;margin:0 .9rem}
  .swallow{width:4.7rem}
  #logo-avg{font-size:1.9rem}#logo-joe{font-size:2.2rem}.logo{height:2.2rem;line-height:2.2rem}
  #wheel{left:-22rem}
  #wheel-list li{font-size:4.2rem}
  .case-boon h2{font-size:3.1rem;grid-column:1/-1}
  .boon-grid img{height:auto}
  .boon-grid figure,.boon-grid .van{grid-column:1/-1}
  .case-620 .txt,.case-620 figure{grid-column:1/-1}
  .case-620{padding-bottom:9rem}
  .case-620 h2{font-size:3.6rem}
  .notch{width:38rem;height:3.6rem;gap:1.6rem}
  .nb[data-k="studio"]{min-width:9.5rem}
}

@media (prefers-reduced-motion:reduce){
  .ai,#wheel-bg{animation:none}
  .rv{transition:none}
}
