/* Mitchell Creative
   Type: TT Commons only. Bold (700) for headings, Medium (500) for everything else.
   Layout: a 4-column grid of square tiles on the brand's dark plum. Pink marks the thing to act on. */

@font-face {
  font-family: "TT Commons";
  src: url("fonts/tt-commons-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "TT Commons";
  src: url("fonts/tt-commons-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #2a262c;
  --tile: #1e1a23;
  --ink: #ffffff;
  --muted: #b5afba;
  --pink: #e6007e;
  --green: #1ed760;
  --dark: #1e1a23;
  --edge: #ffffff17;
  --lift: 0 6px 16px -10px #0009, 0 1px 2px #0003;

  --font: "TT Commons", "Helvetica Neue", Arial, sans-serif;
  --heading: 700;
  --medium: 500;
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.5rem;
  --t-3xl: clamp(2.5rem, 6vw, 3.5rem);

  --s-1: 8px;
  --s-2: 12px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;

  --gap: var(--s-3);
  --pad: var(--s-4);
  --radius: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- base */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  max-width: 1232px;
  margin: 0 auto;
  padding-block: var(--s-4) 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg);
  color: var(--ink);
  font: var(--medium) var(--t-md) / 1.2 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { text-wrap: pretty; }

h1, h2, h3 { font-weight: var(--heading); line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); letter-spacing: 0; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: var(--s-1); z-index: 20; }
.skip:focus { left: var(--s-3); }

/* full-width band: background runs edge to edge, content stays in the column */
.band {
  margin-inline: calc(50% - 50vw);
  padding-block: var(--s-6);
  padding-left: max(16px, env(safe-area-inset-left, 0px), calc(50vw - 600px));
  padding-right: max(16px, env(safe-area-inset-right, 0px), calc(50vw - 600px));
  background: var(--tile);
}

/* depth: dark surfaces get a fine light edge, pictures and colour blocks get a soft shadow */
.text, .wide, .filter { border: 1px solid var(--edge); }
.work, .spotify, .contact, .gallery a, .hero { box-shadow: var(--lift); }

/* ---------- buttons: one shape, one size */
.btn, .chip, .skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--dark);
  font: var(--medium) var(--t-sm) / 1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

/* ---------- header */
body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.logo { position: relative; display: block; width: 52px; text-decoration: none; }
.logo img { width: 100%; transition: transform .35s var(--ease), opacity .25s; }

/* on hover the M flips away and the name pops up letter by letter */
.wordmark {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  translate: 0 -50%;
  font-size: var(--t-lg);
  font-weight: var(--heading);
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: none;
}
.wordmark span {
  display: inline-block;
  opacity: 0;
  transform: translateY(70%) rotate(8deg);
  transition: opacity .2s, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.wordmark .dot { color: var(--pink); }
.logo:is(:hover, :focus-visible) img { transform: rotateX(90deg) scale(.6); opacity: 0; }
.logo:is(:hover, :focus-visible) .wordmark span {
  opacity: 1;
  transform: none;
  transition-delay: calc(80ms + var(--i) * 22ms);
}

/* the switch: a pink marker slides to the chosen option (position set by site.js) */
.filter {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--tile);
}
.filter::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--w, 0);
  translate: var(--x, 0) 0;
  border-radius: 999px;
  background: var(--pink);
  transition: translate .5s cubic-bezier(.3, 1.3, .5, 1), width .5s cubic-bezier(.3, 1.3, .5, 1);
}
.filter > * {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: var(--medium) var(--t-sm) / 1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: color .3s;
}
.filter > :hover,
.filter > [aria-pressed="true"] { color: #fff; }

/* ---------- tiles */
.tile {
  position: relative;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile);
  transition: opacity .35s;
}
.tile p { color: var(--muted); }
.is-dim { opacity: .2; pointer-events: none; }

main { container-type: inline-size; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(calc((100cqw - 3 * var(--gap)) / 4), auto);
  grid-auto-flow: dense;
  gap: var(--gap);
}

/* square text tile */
.text {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--s-2);
  padding: var(--pad);
  text-align: center;
}
.text img { width: 64px; }
.text .btn { margin-top: var(--s-1); }

/* wide tile: picture beside text */
.wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.wide > div {
  display: grid;
  gap: var(--s-2);
  padding: var(--pad) var(--s-5) var(--pad) 0;
}
.intro { grid-template-columns: 1fr 2fr; }
.intro img { justify-self: center; width: 78%; }
.intro h1 { font-size: var(--t-lg); line-height: 1.3; letter-spacing: 0; }
.intro h1 span { display: block; margin-bottom: var(--s-2); font-size: var(--t-2xl); line-height: 1.1; }
.london img { width: 100%; height: 100%; object-fit: cover; }

.spotify { display: grid; place-items: center; background: var(--green); }
.spotify img { width: 46%; }

/* picture tiles: the button appears on hover.
   Arrow = goes somewhere, magnifier = opens the picture larger. */
.work { display: block; }
.work img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.work:hover img { transform: scale(1.04); }
.chip {
  position: absolute;
  bottom: var(--s-3);
  left: var(--s-3);
  max-width: calc(100% - 2 * var(--s-3));
  box-shadow: 0 2px 10px #0004;
  opacity: 0;
  translate: 0 6px;
  transition: opacity .25s, translate .25s var(--ease);
}
:is(.tile, .gallery a):is(:hover, :focus-visible) .chip { opacity: 1; translate: none; }
.chip svg { flex: none; }
[data-zoom] { cursor: zoom-in; }

/* ---------- clients */
.partners { margin-top: var(--s-6); text-align: center; }
.partners ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: var(--s-4) var(--s-5);
  margin-top: var(--s-5);
}
.partners a { display: grid; place-items: center; opacity: .35; transition: opacity .2s; }
.partners a:is(:hover, :focus-visible) { opacity: 1; }
.partners img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; }

/* ---------- contact */
.contact {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  margin-block: var(--s-6);
  padding: var(--s-6) var(--s-5);
  background: var(--pink);
  text-align: center;
}
.contact p { max-width: 46ch; color: #fff; }
.contact .btn { margin-top: var(--s-1); }

/* ---------- project pages */
.project { display: grid; gap: var(--gap); }
.project > header { display: grid; gap: var(--s-3); max-width: 68ch; padding-bottom: var(--s-3); }
.project > header p,
.case p { color: var(--muted); }
.back::before { content: "←"; margin-right: var(--s-1); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: var(--t-xs);
  line-height: 1;
}

.hero { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius); }

.gallery { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--tile); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.gallery .chip { width: 44px; padding: 0; }

.quote { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-6) var(--s-3); text-align: center; }
.quote svg { color: var(--pink); }
.quote p { max-width: 28ch; font-size: var(--t-xl); line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.quote figcaption { color: var(--muted); font-size: var(--t-sm); }

.case { display: grid; gap: var(--gap); padding-bottom: var(--s-4); }
.case > div { display: grid; justify-items: start; gap: var(--s-3); max-width: 68ch; }

.project-nav { display: flex; justify-content: flex-end; padding-top: var(--s-4); }
.next { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--t-lg); text-decoration: none; }
.next:hover { text-decoration: underline; text-underline-offset: 5px; }

.notfound { display: grid; align-content: center; justify-items: start; gap: var(--s-3); min-height: 46vh; }
.notfound p { max-width: 50ch; color: var(--muted); }

/* ---------- enlarged image */
dialog { max-width: 94vw; max-height: 94vh; padding: 0; border: 0; background: none; overflow: visible; }
dialog::backdrop { background: #120f15e6; }
dialog img { max-width: 94vw; max-height: 88vh; border-radius: 16px; }
dialog .btn { position: fixed; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- footer */
body > footer {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  gap: var(--s-5) 120px;
  text-align: center;
}
body > footer div { display: grid; justify-items: center; gap: var(--s-2); }
body > footer a { font-size: var(--t-sm); text-decoration: none; }
body > footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
body > footer ul { display: flex; gap: var(--s-2); }
body > footer ul a { display: block; transition: transform .2s var(--ease); }
body > footer ul a:hover { transform: translateY(-2px); }
body > footer p { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-sm); }
body > footer p span { color: var(--pink); }

/* ---------- tablet */
@media (max-width: 979px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(calc((100cqw - var(--gap)) / 2), auto);
  }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- phone: tiles stack, labels move below pictures so nothing covers the work */
@media (max-width: 640px) {
  :root { --gap: 12px; --pad: 20px; --radius: 22px; --t-xl: 1.5rem; --t-2xl: 2rem; }

  body { padding-top: var(--s-3); }
  body > header { margin-bottom: var(--s-4); }
  .logo { width: 44px; }
  .filter > * { padding: 0 var(--s-2); }

  .text { grid-column: 1 / -1; padding-block: var(--s-5); }
  .wide, .intro { grid-template-columns: 1fr; }
  .wide > div { justify-items: center; padding: 0 var(--pad) var(--s-5); text-align: center; }
  .intro img { width: 34%; margin-block: var(--s-4) var(--s-3); }
  .london img { aspect-ratio: 2 / 1; margin-bottom: var(--s-3); }

  .partners ul { gap: var(--s-3); margin-top: var(--s-4); }
  .contact { padding: var(--s-5) var(--pad); }
  body > footer { grid-template-columns: 1fr; gap: var(--s-4); }

  .hero { aspect-ratio: 16 / 10; }
  .cols-2 { grid-template-columns: 1fr; }
  .cols-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
  .quote { padding: var(--s-5) var(--s-1); }
  .quote p { font-size: var(--t-lg); }
}

/* touch screens can't hover: the wordmark never shows, and picture tiles keep a small round button visible */
@media (hover: none) {
  .wordmark { display: none; }
  .chip { width: 44px; padding: 0; opacity: 1; translate: none; }
  .chip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
