/* Self-hosted fonts (latin subset, variable weight) */
@font-face{ font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('fonts/newsreader.woff2') format('woff2'); }
@font-face{ font-family: 'Newsreader'; font-style: italic; font-weight: 200 800; font-display: swap; src: url('fonts/newsreader-italic.woff2') format('woff2'); }
@font-face{ font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/montserrat.woff2') format('woff2'); }

/* ============================================
   Tommi Tuovinen — Portfolio
   Design tokens
   ============================================ */
:root{
  --bg: #1c1b1a;
  --bg-raised: #232220;
  --fg: #f5f3ef;
  --muted: #8c8a86;
  --panel: #e8e6e1;
  --violet: #c1502e;
  --yellow: #e08a3e;
  --rule: rgba(245,243,239,0.14);


  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

  --maxw: none;
  --pad: clamp(24px, 5vw, 64px);
  --grid-cols: 6;
  --grid-col-w: calc((100vw - 2 * var(--pad)) / var(--grid-cols));
  --grid-line: rgba(245,243,239,0.045);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Very faint vertical guides echoing the column grid the layout is built on.
   The first and last line land exactly on the standard content gutter
   (var(--pad)), so major sections/cards line up with them by default. */
.grid-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--grid-col-w) - 1px),
    var(--grid-line) calc(var(--grid-col-w) - 1px),
    var(--grid-line) var(--grid-col-w)
  );
  background-position: var(--pad) 0;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
p{ max-width: 60ch; }

::selection{ background: var(--violet); color: var(--fg); }

:focus-visible{
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- Nav ---------- */
.nav{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--pad);
  background: linear-gradient(rgba(28,27,26,0.7), rgba(28,27,26,0));
}
.nav__mark{
  display: inline-flex; align-items: baseline;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav__mark:hover{ color: var(--fg); }
/* TT expands to TOMMI TUOVINEN once the hero has scrolled past (home page only) */
.nav__x{
  display: inline-grid; grid-template-columns: 0fr; opacity: 0;
  transition: grid-template-columns 0.7s cubic-bezier(.2,.7,.2,1), opacity 0.5s ease;
}
.nav__x > span{ overflow: hidden; min-width: 0; }
.nav.is-full .nav__x{ grid-template-columns: 1fr; opacity: 1; }
@media (prefers-reduced-motion: reduce){
  .nav__x{ transition: none; }
}
@media (max-width: 560px){
  .nav__mark{ font-size: 11px; letter-spacing: 0.06em; flex: none; }
  .nav__links{ gap: 18px; }
}
@media (max-width: 440px){
  .nav.is-full .nav__x{ grid-template-columns: 0fr; opacity: 0; }
}
.nav__links{
  display: flex;
  gap: 32px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav__links a{ transition: color 0.2s ease; }
.nav__links a:hover{ color: var(--fg); }
.nav__back{
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}
.nav__back:hover{ color: var(--fg); }

/* ---------- Hero ---------- */
.hero{
  padding: 4px var(--pad) calc(12vh + 18px);
  max-width: var(--maxw);
  margin: 0 auto;
}
.hero__line{
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s cubic-bezier(.2,.7,.2,1) forwards;
}
.hero__line--muted{
  font-style: italic;
  animation-delay: 0.08s;
  color: var(--muted);
}
.hero__meta{
  margin-top: 20px;
  margin-bottom: 40px;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: rise 0.7s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: 0.2s;
}

.hero__meta span{ display: block; }

/* Hand-drawn coffee cup: six hand-shifted frames stepped at ~7fps so the line
   "boils", plus a slow float. Sits after the coffee drinker line. */
.hero__meta span:last-child{ display: inline-block; position: relative; }
.cup{
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  width: 44px;
  height: 43px;
  margin-top: -28px;
  background: url('images/cup-sprite.png') 0 0 / 600% 100% no-repeat;
  animation:
    cup-boil 0.86s infinite,
    cup-float 5s ease-in-out infinite alternate;
}
@keyframes cup-boil{
  0%     { background-position: 0% 0;   animation-timing-function: step-end; }
  16.66% { background-position: 20% 0;  animation-timing-function: step-end; }
  33.33% { background-position: 40% 0;  animation-timing-function: step-end; }
  50%    { background-position: 60% 0;  animation-timing-function: step-end; }
  66.66% { background-position: 80% 0;  animation-timing-function: step-end; }
  83.33% { background-position: 100% 0; animation-timing-function: step-end; }
}
@keyframes cup-float{
  from{ transform: translateY(2px) rotate(-2deg); }
  to{   transform: translateY(-6px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce){
  .cup{ animation: none; }
}

.cup canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s ease;
}
/* While the cup is drawing itself, hide the boiling sprite and keep only the float. */
.cup--drawing{
  background-image: none;
  animation: cup-float 5s ease-in-out infinite alternate;
}

@keyframes rise{
  to{ opacity: 1; transform: translateY(0); }
}

/* ---------- Section heading ---------- */
.section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 var(--pad);
  max-width: var(--maxw);
  margin: 0 auto 48px;
}
.section-head h2{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 4vw, 48px);
  margin: 0;
}


/* ---------- Hand-drawn arrow next to "Selected work" ---------- */
.arrow{
  position: relative;
  display: inline-block;
  width: 1.4em;
  height: 1.167em;
  margin-left: 0.3em;
  vertical-align: -0.3em;
  background: url('images/arrow-sprite.png') 0 0 / 600% 100% no-repeat;
  animation:
    arrow-boil 0.86s infinite,
    arrow-float 5.5s ease-in-out infinite alternate;
}
@keyframes arrow-boil{
  0%     { background-position: 0% 0;   animation-timing-function: step-end; }
  16.66% { background-position: 20% 0;  animation-timing-function: step-end; }
  33.33% { background-position: 40% 0;  animation-timing-function: step-end; }
  50%    { background-position: 60% 0;  animation-timing-function: step-end; }
  66.66% { background-position: 80% 0;  animation-timing-function: step-end; }
  83.33% { background-position: 100% 0; animation-timing-function: step-end; }
}
@keyframes arrow-float{
  from{ transform: translateY(1px) rotate(-1.5deg); }
  to{   transform: translateY(-3px) rotate(1.5deg); }
}
.arrow canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s ease;
}
.arrow--wait{ visibility: hidden; }
.arrow--drawing{
  background-image: none;
  animation: arrow-float 5.5s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce){
  .arrow{ animation: none; }
}

/* ---------- Work list — case rows: title/description/tags, photos alongside ---------- */
.work-list{
  margin: 0 var(--pad) 14vh;
  border-bottom: 1px solid var(--rule);
}
.work-case{
  display: flex;
  align-items: stretch;
  gap: 32px;
  padding: 6vh 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s cubic-bezier(.2,.7,.2,1) forwards;
}
.work-case__info{
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
}
.work-case__head{
  display: block;
}
.work-case__head h3{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(20px, 2vw, 26px);
  margin: 0;
}
.work-case__desc{
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.work-case__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 20px;
}
.work-case__tags span{
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.work-case__photos{
  display: flex;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.work-case__photo{
  position: relative;
  flex: 1;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--panel);
}
.work-case__photo img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
}
.work-glyph{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 4vw, 56px);
  color: rgba(28,27,26,0.16);
  user-select: none;
}
.work-case__photo::before{
  content: "";
  position: absolute; inset: 0;
  background: var(--tint, var(--violet));
  opacity: 0;
  transition: opacity 0.4s ease;
}
.work-case:hover .work-case__photo img{ transform: scale(1.05); }
.work-case:hover .work-case__photo::before{ opacity: 0.16; }

@media (max-width: 900px){
  .work-case{ flex-direction: column; align-items: stretch; gap: 20px; }
  .work-case__info{ flex: 0 0 auto; }
  .work-case__photo:nth-child(3){ display: none; }
}

/* ---------- (legacy) card frame — still used by project covers ---------- */
.card__frame{
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--panel);
  overflow: hidden;
  filter: grayscale(1);
  box-shadow: 0 22px 44px -22px rgba(0,0,0,0.7);
  transition: filter 0.4s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.card__frame img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card__frame video{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card__frame::before{
  content: "";
  position: absolute; inset: 0;
  background: var(--tint, var(--violet));
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ---------- Tags ---------- */
.tags{ display: flex; flex-wrap: wrap; gap: 10px; }
.tag{
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- About ---------- */
.about{
  border-top: 1px solid var(--rule);
  padding: 12vh var(--pad);
  text-align: center;
}
.about__bio{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
  max-width: 700px;
  margin: 0 auto;
}
.about__bio a{ color: var(--yellow); border-bottom: 1px solid currentColor; }

.stats{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px 56px;
  max-width: 720px;
  margin: 56px auto 0;
}
.stat{
  background: var(--bg);
  padding: 28px;
}
.stat b{
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 40px;
}
.stat span{
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats .stat{
  background: none;
  padding: 0;
  text-align: center;
}
.stats .stat b{
  font-size: 26px;
  color: var(--fg);
}
.stats .stat span{
  font-size: 11px;
}


/* ---------- Hand-drawn smiley next to the About text ---------- */
.about__bio{ position: relative; }
.smiley{
  position: absolute;
  left: 100%;
  bottom: 0.3em;
  margin-left: 0.9em;
  width: 1.9em;
  height: 1.69em;
  background: url('images/smiley-sprite.png') 0 0 / 600% 100% no-repeat;
  animation:
    smiley-boil 0.86s infinite,
    smiley-float 5s ease-in-out infinite alternate;
}
@keyframes smiley-boil{
  0%     { background-position: 0% 0;   animation-timing-function: step-end; }
  16.66% { background-position: 20% 0;  animation-timing-function: step-end; }
  33.33% { background-position: 40% 0;  animation-timing-function: step-end; }
  50%    { background-position: 60% 0;  animation-timing-function: step-end; }
  66.66% { background-position: 80% 0;  animation-timing-function: step-end; }
  83.33% { background-position: 100% 0; animation-timing-function: step-end; }
}
@keyframes smiley-float{
  from{ transform: translateY(2px) rotate(-3deg); }
  to{   transform: translateY(-4px) rotate(3deg); }
}
.smiley canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s ease;
}
.smiley--wait{ visibility: hidden; }
.smiley--drawing{
  background-image: none;
  animation: smiley-float 5s ease-in-out infinite alternate;
}
/* Not enough room beside the text on narrow screens: sit below it instead. */
@media (max-width: 960px){
  .smiley{ position: relative; display: block; left: auto; bottom: auto; margin: 0.8em auto 0; }
}
@media (prefers-reduced-motion: reduce){
  .smiley{ animation: none; }
}

/* ---------- Skills pill cloud ---------- */
.skills{
  border-top: 1px solid var(--rule);
  padding: 12vh 0 14vh;
}
.pill-cloud{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 12px;
  padding: 0 var(--pad);
}
.pill-cloud__title{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 4vw, 48px);
  margin: 0;
  padding: 0 28px;
  color: var(--fg);
  /* Zero-height box so the title never makes its row taller than the pills,
     which keeps the vertical spacing identical for every pill. */
  height: 0;
  display: flex;
  align-items: center;
  overflow: visible;
  white-space: nowrap;
}
.pill{
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  cursor: default;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.pill--active{
  background: var(--fg);
  color: #1c1b1a;
  border-color: var(--fg);
  z-index: 2;
}

/* ---------- Connect ---------- */
.connect{
  border-top: 1px solid var(--rule);
  padding: 12vh var(--pad) 14vh;
  text-align: center;
}
.connect__title{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  margin: 0 0 22px;
}
.connect__bio{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.4;
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
}
.connect__bio a{
  position: relative;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.connect__bio a.has-drawn{ text-decoration: none; }
.connect__bio a canvas{
  position: absolute;
  left: 0;
  bottom: -0.36em;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.connect__bio a .ul-boil{
  position: absolute;
  left: 0;
  bottom: -0.36em;
  width: 100%;
  aspect-ratio: 236 / 36;
  background: url('images/underline-sprite.png') 0 0 / 600% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  animation: ul-boil 0.86s infinite;
}
.connect__bio a.is-boiling .ul-boil{ opacity: 1; }
.connect__bio a.is-boiling canvas{ opacity: 0; }
@keyframes ul-boil{
  0%     { background-position: 0% 0;   animation-timing-function: step-end; }
  16.66% { background-position: 20% 0;  animation-timing-function: step-end; }
  33.33% { background-position: 40% 0;  animation-timing-function: step-end; }
  50%    { background-position: 60% 0;  animation-timing-function: step-end; }
  66.66% { background-position: 80% 0;  animation-timing-function: step-end; }
  83.33% { background-position: 100% 0; animation-timing-function: step-end; }
}
@media (prefers-reduced-motion: reduce){
  .connect__bio a .ul-boil{ animation: none; }
}


/* ---------- Hand-drawn next-project arrow ---------- */
.next h2.has-arrow::before{ display: none; }
.next-arrow{
  display: inline-block;
  flex: none;
  width: 1.5em;
  height: 0.682em;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.next:hover .next-arrow, .next a:hover .next-arrow{ transform: translateX(10px); }
.next-arrow__art{
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: url('images/nextarrow-sprite.png') 0 0 / 600% 100% no-repeat;
  animation: nxa-boil 0.86s infinite, nxa-float 5s ease-in-out infinite alternate;
}
@keyframes nxa-boil{
  0%     { background-position: 0% 0;   animation-timing-function: step-end; }
  16.66% { background-position: 20% 0;  animation-timing-function: step-end; }
  33.33% { background-position: 40% 0;  animation-timing-function: step-end; }
  50%    { background-position: 60% 0;  animation-timing-function: step-end; }
  66.66% { background-position: 80% 0;  animation-timing-function: step-end; }
  83.33% { background-position: 100% 0; animation-timing-function: step-end; }
}
@keyframes nxa-float{
  from{ transform: translateY(1px) rotate(-1deg); }
  to{   transform: translateY(-2px) rotate(1deg); }
}
.next-arrow__art canvas{ position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.4s ease; }
.next-arrow--wait .next-arrow__art{ visibility: hidden; }
.next-arrow--drawing .next-arrow__art{ background-image: none; animation: nxa-float 5s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce){
  .next-arrow__art{ animation: none; }
}


/* ---------- Per-case hand-drawn icons (front page hover + case title) ---------- */
.case-icon{ display: block; pointer-events: none; }
.case-icon__art{
  position: relative; display: block; width: 100%; height: 100%;
  background-repeat: no-repeat; background-size: 600% 100%; background-position: 0 0;
  animation: ci-boil 0.86s infinite, ci-float 5s ease-in-out infinite alternate;
}
@keyframes ci-boil{
  0%     { background-position: 0% 0;   animation-timing-function: step-end; }
  16.66% { background-position: 20% 0;  animation-timing-function: step-end; }
  33.33% { background-position: 40% 0;  animation-timing-function: step-end; }
  50%    { background-position: 60% 0;  animation-timing-function: step-end; }
  66.66% { background-position: 80% 0;  animation-timing-function: step-end; }
  83.33% { background-position: 100% 0; animation-timing-function: step-end; }
}
@keyframes ci-float{
  from{ transform: translateY(1px) rotate(-1deg); }
  to{   transform: translateY(-2px) rotate(1deg); }
}
.case-icon__art canvas{ position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.4s ease; }
.case-icon.is-drawing .case-icon__art{ background-image: none !important; animation: ci-float 5s ease-in-out infinite alternate; }
.case-icon.is-hidden{ opacity: 0; }
/* front page: sits between description and tags, appears on hover */
.case-icon--list{
  flex: none; position: relative; height: 0; margin-top: auto; width: 100%;
  transition: opacity 0.3s ease;
}
.case-icon--list .case-icon__inner{
  position: absolute; left: var(--ix, 0); bottom: var(--iy, 0);
  width: var(--iw, 130px); aspect-ratio: var(--ar, 2.4);
  transform: rotate(var(--ir, 0deg));
}
.work-case__info:has(.case-icon--list) .work-case__tags{ margin-top: 0; }
/* case page: right after the title */
.case-icon--title{
  display: inline-block; position: relative;
  width: var(--tw, 1.6em); aspect-ratio: var(--ar, 2.4);
  margin-left: var(--tx, 0.25em); vertical-align: var(--ty, 0);
  transform: rotate(var(--tr, 0deg));
  margin-right: calc(-1 * var(--tw, 1.6em) - var(--tx, 0.25em));
  transition: opacity 0.3s ease;
}
@media (max-width: 780px){
  .case-icon--title{ margin-right: 0; }
}
@media (prefers-reduced-motion: reduce){
  .case-icon__art{ animation: none; }
}


/* ---------- Hero image trail (mouse only, hero section only) ---------- */
.hero > *{ position: relative; z-index: 2; }
.trail{
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}
.trail img{
  position: absolute; left: 0; top: 0;
  width: 120px; height: 120px; object-fit: cover;
  opacity: 0; will-change: transform, opacity;
  pointer-events: none; user-select: none;
}
.section-head{ position: relative; z-index: 2; }


/* ---------- "Let's [thumbnails] connect": a slow stack of case photos ---------- */
.connect__title{ margin-bottom: calc(22px + 0.7em); }
.thumb-stack{
  position: relative; display: inline-block;
  width: 2.2em; height: 1em;
  margin: 0 0.2em; vertical-align: -0.1em;
}
.thumb-stack img{
  position: absolute; left: 0; top: 50%; margin-top: -1.1em;
  width: 2.2em; height: 2.2em;
  object-fit: cover; opacity: 0; pointer-events: none; user-select: none;
}
@media (max-width: 480px){
  .thumb-stack{ width: 1.6em; }
  .thumb-stack img{ width: 1.6em; height: 1.6em; margin-top: -0.8em; }
  .connect__title{ margin-bottom: calc(22px + 0.4em); }
}


/* ---------- Small image captions (bottom left, under the image) ---------- */
.project-cover .caption{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}
.project-cover .caption::before{
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: -3px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

/* ---------- About: small portrait beside the centered text (above it on smaller screens) ---------- */
.about__inner{ position: relative; max-width: 700px; margin: 0 auto; }
.about__photo{
  margin: 0; position: absolute; top: 50%; margin-top: -115px; right: calc(100% + clamp(28px, 3vw, 48px));
  width: 230px; aspect-ratio: 1 / 1;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(-3.5deg);
  will-change: transform;
}
.about__photo-frame{
  position: absolute; inset: 0; overflow: hidden;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,0.75);
}
.about__photo img{
  display: block; width: 100%; height: 100%; object-fit: cover;
}
@media (max-width: 1400px){
  .about__photo{ position: relative; top: auto; right: auto; width: min(240px, 64vw); margin: 0 auto 52px; }
}


/* ---------- About portrait: fades in when it scrolls into view (before the smiley draws) ---------- */
.about__photo-frame{ transition: opacity 0.9s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.about__photo.is-wait .about__photo-frame{ opacity: 0; transform: translateY(28px) scale(0.97); }
@media (prefers-reduced-motion: reduce){
  .about__photo.is-wait .about__photo-frame{ opacity: 1; transform: none; }
}

/* ---------- About: hand-drawn signature over the portrait's lower right corner ---------- */
.about__sig{
  position: absolute; right: -22px; bottom: -26px; z-index: 2;
  width: 112px; aspect-ratio: 360 / 250;
  transform: rotate(-7deg);
  background-repeat: no-repeat; background-size: 600% 100%; background-position: 0 0;
  animation: ci-boil 0.86s infinite;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
  pointer-events: none; opacity: 0;
}
.about__sig.is-in{ opacity: 1; }
.about__sig canvas{ position: absolute; inset: 0; width: 100%; height: 100%; }
.about__sig.is-drawing{ background-image: none !important; animation: none; }
@media (prefers-reduced-motion: reduce){
  .about__sig{ animation: none; opacity: 1; }
}

/* ---------- Small motion touches: case images ease in on scroll, pages cross-fade ---------- */
.rv{ opacity: 0; }
@media (prefers-reduced-motion: no-preference){
  @view-transition{ navigation: auto; }
  ::view-transition-old(root){ animation: vt-out 0.28s ease both; }
  ::view-transition-new(root){ animation: vt-in 0.5s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes vt-out{ to{ opacity: 0; } }
@keyframes vt-in{ from{ opacity: 0; transform: translateY(10px); } }


/* ---------- Footer ---------- */
.footer{
  padding: 40px var(--pad) 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a:hover{ color: var(--fg); }

/* ---------- Project page ---------- */
.project-hero{
  padding: 10vh var(--pad) 6vh;
  max-width: var(--maxw);
  margin: 0 auto;
}
.project-hero h1{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 7vw, 96px);
  margin: 32px 0 24px;
  line-height: 1.02;
  max-width: 20ch;
}
.external-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.external-link svg{ width: 12px; height: 12px; }
.external-link:hover{ color: var(--fg); }
.project-cover{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) 8vh;
}
.project-cover .card__frame{ aspect-ratio: 16/9; filter: none; box-shadow: 0 30px 60px -24px rgba(0,0,0,0.75); }
.project-cover .card__frame::before{ opacity: 0.14; }
.project-cover .card__frame--natural{ aspect-ratio: auto; }
.project-cover .card__frame--natural img{ position: static; width: 100%; height: auto; }

.columns{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6vh var(--pad) 10vh;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  border-top: 1px solid var(--rule);
}
.columns h3{
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.columns p{ margin: 0; color: var(--fg); opacity: 0.92; max-width: 46ch; }

@media (max-width: 780px){
  .columns{ grid-template-columns: 1fr; }
}

/* ---------- Media rows — big image, copy alongside, alternating sides ---------- */
.media-row{
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8vh var(--pad);
  border-top: 1px solid var(--rule);
}
.media-row--reverse{ grid-template-columns: 1fr 1.3fr; }
.media-row--reverse .media-row__media{ order: 2; }
.media-row--reverse .media-row__copy{ order: 1; }
.media-row__media{
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 24px 48px -24px rgba(0,0,0,0.7);
}
.media-row__media img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.media-row__media .work-glyph{ font-size: clamp(48px, 7vw, 96px); }
.media-row__copy h3{
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.media-row__copy p{ margin: 0; color: var(--fg); opacity: 0.92; max-width: 46ch; }

.media-row__media--duo{
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: none;
  box-shadow: none;
}
.media-row__media--duo .duo-item{
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 24px 48px -24px rgba(0,0,0,0.7);
}
.media-row__media--duo .duo-item img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.media-row__media--duo .duo-item--natural{ aspect-ratio: auto; }
.media-row__media--duo .duo-item--natural img{ position: static; height: auto; }
.project-duo{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) 8vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.project-duo .card__frame{ aspect-ratio: 3 / 2; filter: none; }
.project-duo .caption{
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}
.project-duo .caption::before{
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: -3px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
@media (max-width: 780px){
  .project-duo{ grid-template-columns: 1fr; }
}

@media (max-width: 780px){
  .media-row{ grid-template-columns: 1fr; gap: 24px; padding: 6vh var(--pad); }
  .media-row--reverse{ grid-template-columns: 1fr; }
  .media-row--reverse .media-row__media{ order: 1; }
  .media-row--reverse .media-row__copy{ order: 2; }
}

.results{
  max-width: var(--maxw);
  margin: 0 var(--pad) 12vh;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.results .stat{
  background: transparent;
}
.results .stat b{ color: var(--fg); }
.results .stat span{ color: var(--muted); }

/* Stack the three result tiles on phones so nothing forces the page wider. */
@media (max-width: 780px){
  .results{ grid-template-columns: 1fr; gap: 12px; }
  .results .stat{ min-width: 0; }
}

.next{
  border-top: 1px solid var(--rule);
  padding: 8vh var(--pad);
  text-align: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 2.2fr);
}
@media (min-width: 900px){ .next h2{ white-space: nowrap; } }
.next span{ grid-column: 2; grid-row: 1; justify-self: center; }
.next h2{ grid-column: 2 / -1; grid-row: 2; text-align: left; }
.pull-quote{
  max-width: 900px;
  margin: 0 auto;
  padding: 10vh var(--pad);
  text-align: center;
  border-top: 1px solid var(--rule);
}
.pull-quote p{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 4.5vw, 52px);
  line-height: 1.3;
  margin: 0;
}
.next span{
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.next h2{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 6vw, 56px);
  margin: 14px 0 0;
  transition: color 0.2s ease;
}
.next h2{ display: flex; align-items: center; gap: 0.5em; }
.next h2::before{
  content: "\2192";
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.7em;
  display: inline-block;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.next:hover h2::before, .next a:hover h2::before{ transform: translateX(10px); }
