/* Layout concept: one cutting-mat surface opens the site; everything after it is paper,
   quiet and gridded, so the work carries the colour. Art Direction leads; the other
   three directions follow as equals. */
:root {
  --paper: #EFEBE3;
  --paper-2: #E4DFD4;
  --ink: #181715;
  --ink-soft: #5E5A52;
  --line: rgba(24, 23, 21, .14);
  --mat: #2D5A43;
  --mat-line: rgba(236, 244, 236, .12);
  --mat-line-strong: rgba(236, 244, 236, .24);
  --on-mat: #F4F1E8;
  --accent: #E2492B;          /* used sparingly: numbers, focus, hover */
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --track: -0.025em;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--display); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }

/* ───────── Nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.home .nav { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--on-mat); transition: background .3s, color .3s, border-color .3s; }
.home .nav.is-solid { background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--ink); border-color: var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav__mark { font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -.02em; transition: opacity .2s; }
.nav__mark:hover { opacity: .7; }
.nav__mark span { font-family: var(--serif); font-style: italic; font-weight: 400; }
.nav__links { display: flex; gap: clamp(12px, 2.2vw, 30px); margin-left: auto; }
.nav__links a { text-decoration: none; opacity: .75; transition: opacity .2s; white-space: nowrap; }
.nav__links a b { font-weight: 500; color: var(--accent); }
.home .nav:not(.is-solid) .nav__links a b { color: inherit; opacity: .7; }
.nav__links a:hover, .nav__links a[aria-current="page"] { opacity: 1; }
.nav__links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.nav__about { background: none; border: 1px solid currentColor; border-radius: 99px; padding: 6px 12px; opacity: .9; }
.nav__about:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 900px) { .nav__links { display: none; } .nav__about { margin-left: auto; } }

/* ───────── Hero: the cutting mat ───────── */
.hero {
  position: relative; min-height: min(100svh, 860px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 150px var(--gutter) clamp(40px, 7vh, 72px);
  overflow: hidden; touch-action: manipulation;
  color: var(--on-mat); pointer-events: none;
}
.hero .hero__name, .hero .hero__hint, .hero .thing { pointer-events: auto; }
/* one cutting mat runs under the whole home page: its printing, then the painted tiles */
.matmain { position: relative; background-color: var(--mat); isolation: isolate; }
.mat { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.mat canvas { position: absolute; left: 0; top: 0; }
.home .dirs { position: relative; pointer-events: none; }
.home .dirs .dir { pointer-events: auto; }
.home .dirs__title { color: var(--on-mat); opacity: .85; }
.home .dir { background: var(--paper); box-shadow: 0 24px 40px -24px rgba(0,0,0,.65), 0 2px 6px rgba(0,0,0,.18); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.home .dir:hover { transform: translateY(-4px) rotate(-.3deg); box-shadow: 0 34px 50px -26px rgba(0,0,0,.7), 0 4px 10px rgba(0,0,0,.2); }

/* ───────── Things lying on the mat ───────── */
.things { position: absolute; inset: 0; }
.thing {
  position: absolute; touch-action: none; cursor: grab;
  --dx: 0px; --dy: 0px; --lift: 0px; --tilt: 0deg; --s: 1;
  transform: translate(var(--dx), var(--dy)) translateY(var(--lift)) rotate(calc(var(--r) + var(--tilt))) scale(var(--s));
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.28)) drop-shadow(0 10px 12px rgba(0,0,0,.22));
  transition: transform .55s cubic-bezier(.2, 1.5, .4, 1), filter .45s var(--ease);
}
.thing svg, .thing img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.thing:hover, .thing.is-near { --lift: -8px; --tilt: 4deg; --s: 1.03; filter: drop-shadow(0 8px 6px rgba(0,0,0,.25)) drop-shadow(0 24px 24px rgba(0,0,0,.25)); }
.thing.is-dragging { cursor: grabbing; transition: filter .3s; --lift: -12px; --s: 1.05; filter: drop-shadow(0 12px 8px rgba(0,0,0,.25)) drop-shadow(0 30px 30px rgba(0,0,0,.28)); }
.thing--sheet-a { right: -120px; top: 64px; width: clamp(150px, 13vw, 200px); }
.thing--pencil { left: 50%; top: 12%; width: clamp(150px, 15vw, 220px); }
.thing--eraser { left: 63%; top: 47%; width: clamp(110px, 10vw, 150px); }
.thing--buds { right: 11%; top: 9%; width: clamp(150px, 13vw, 195px); }
@media (max-width: 860px) {
  .thing--sheet-a { right: -80px; top: 64px; width: 120px; }
  .thing--eraser { display: none; }
  .thing--pencil { left: auto; right: 22%; top: 26%; width: 130px; }
  .thing--buds { right: 4%; top: 40%; width: 90px; }
}

/* ───────── Cursor: a white dot that grows over things you can use ───────── */
.cursor { position: fixed; left: 0; top: 0; z-index: 100; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; pointer-events: none; mix-blend-mode: difference; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), opacity .3s; opacity: 0; }
.cursor.is-on { opacity: 1; }
.cursor.is-big { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.cursor.is-down { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.has-cursor, .has-cursor * { cursor: none !important; }

.hero__grid {
  position: relative; pointer-events: none;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; align-items: end;
}
.hero__grid > * { pointer-events: none; }
.hero__grid button { pointer-events: auto; }
.hero__who { grid-column: 1 / span 8; grid-row: 1; margin: 0 0 clamp(28px, 6vh, 64px); justify-self: start; }
/* the name is the invitation: a small pill with my video playing inside it */
.hero__name {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--on-mat); color: var(--ink); border: 0; border-radius: 99px;
  padding: 5px 18px 5px 5px;
  font-family: var(--display); font-weight: 700; font-size: clamp(15px, 1.3vw, 19px); letter-spacing: -.01em; line-height: 1;
  box-shadow: 0 12px 24px -12px rgba(0,0,0,.5);
  transition: transform .4s var(--ease), background .3s;
}
.hero__face { position: relative; flex: none; width: clamp(38px, 3vw, 46px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--ink); }
.hero__face video { width: 100%; height: 100%; object-fit: cover; }
.hero__face i { position: absolute; right: -1px; bottom: -1px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); border: 2px solid var(--on-mat); }
.hero__face i::after { content: ""; position: absolute; left: 55%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: 3.5px 0 3.5px 5.5px; border-color: transparent transparent transparent #fff; }
.hero__name:hover { transform: translateY(-2px) rotate(-1deg); background: #fff; }
.hero__title {
  grid-column: 1 / span 8; grid-row: 2; margin: 0;
  font-weight: 700; font-size: clamp(52px, 9.4vw, 160px); line-height: .95; letter-spacing: var(--track);
  text-wrap: balance;
}
/* the instruction note — taped onto the mat */
.hero__hint {
  position: absolute; right: clamp(16px, 6vw, 90px); bottom: clamp(110px, 16vh, 160px);
  background: var(--on-mat); color: var(--ink);
  padding: 22px 26px 18px; border-radius: 2px;
  transform: rotate(3deg);
  box-shadow: 0 18px 30px -12px rgba(0,0,0,.45);
  max-width: 300px; z-index: 2;
  animation: noteIn .9s .6s var(--ease) both;
}
.hero__hint-text { margin: 0; font-size: clamp(22px, 2.1vw, 30px); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.hero__arrow { position: absolute; left: -96px; top: -30px; width: 92px; color: var(--on-mat); transform: rotate(-8deg); animation: nudge 1.6s ease-in-out infinite; }
.hero__wash {
  margin-top: 14px; background: none; border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px;
  transition: background .3s, color .3s;
}
.hero__wash:hover { background: var(--ink); color: var(--on-mat); }
.tape {
  position: absolute; width: 92px; height: 26px; top: -13px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  background: rgba(240, 225, 170, .78);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  -webkit-mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent 0);
          mask: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent 0);
}
.hint-touch { display: none; }
@media (hover: none) { .hint-touch { display: inline; } .hint-desktop { display: none; } }
@keyframes noteIn { from { opacity: 0; transform: translateY(-20px) rotate(10deg); } }
@keyframes nudge { 50% { transform: translate(-6px, -4px) rotate(-8deg); } }
@media (max-width: 860px) {
  /* phone: content clears the ruler on the left and sits higher on the mat */
  .hero { padding: 110px 20px 15vh 52px; }
  .hero__title { grid-column: 1 / -1; }
  .hero__who { grid-column: 1 / -1; margin-bottom: 14px; }
  .hero__hint { position: relative; top: auto; right: auto; bottom: auto; align-self: flex-start; margin: 0 0 22px; transform: rotate(-2deg); order: -1; max-width: 190px; padding: 14px 16px 11px; }
  .hero__hint-text { font-size: 17px; }
  .hero__wash { margin-top: 10px; padding: 5px 10px; font-size: 10px; }
  .hero__arrow { display: none; }
}

/* ───────── Directions (home) ───────── */
.dirs { padding: clamp(56px, 9vw, 120px) var(--gutter) clamp(64px, 10vw, 140px); }
.dirs__title { margin: 0 0 24px; color: var(--ink-soft); }
.dirs__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dir { position: relative; display: grid; grid-template-rows: auto 1fr; text-decoration: none; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.dir--lead { grid-column: 1 / -1; grid-template-columns: 1.6fr 1fr; grid-template-rows: none; }
.dir__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink); }
.dir--lead .dir__media { aspect-ratio: 16 / 9; }
.dir__media img, .dir__media video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.dir:hover .dir__media img, .dir:hover .dir__media video { transform: scale(1.03); }
.dir__body { padding: 18px 20px 20px; display: grid; gap: 8px; align-content: start; }
.dir--lead .dir__body { padding: clamp(20px, 3vw, 40px); align-content: end; }
.dir__n { color: var(--accent); }
.dir__t { margin: 0; font-size: clamp(26px, 2.6vw, 38px); font-weight: 700; letter-spacing: var(--track); line-height: 1; }
.dir--lead .dir__t { font-size: clamp(40px, 5vw, 76px); }
.dir__line { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 42ch; }
.dir__go { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.dir:hover .dir__go span:last-child { color: var(--accent); }
.dir__tag { position: absolute; left: 14px; top: 14px; background: var(--paper); color: var(--ink); padding: 4px 8px; border-radius: 2px; }
@media (max-width: 900px) { .dirs__grid { grid-template-columns: 1fr; } .dir--lead { grid-template-columns: 1fr; } }

/* ───────── Category page ───────── */
.cat__head { padding: clamp(48px, 8vw, 110px) var(--gutter) clamp(28px, 4vw, 48px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; align-items: end; }
.cat__n { grid-column: 1 / -1; margin: 0 0 14px; color: var(--accent); }
.cat__title { grid-column: 1 / span 8; margin: 0; font-size: clamp(48px, 8.6vw, 140px); line-height: .95; letter-spacing: var(--track); font-weight: 700; text-wrap: balance; }
.cat__line { grid-column: 9 / -1; margin: 0 0 .5em; font-size: clamp(16px, 1.3vw, 19px); color: var(--ink-soft); max-width: 36ch; }
.cat__count { grid-column: 1 / -1; margin: 28px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-soft); }
@media (max-width: 860px) { .cat__title, .cat__line { grid-column: 1 / -1; } .cat__line { margin-top: 16px; } }

.work { padding: 0 var(--gutter) clamp(56px, 8vw, 110px); }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) 16px; }
.proj { display: grid; gap: 12px; text-decoration: none; background: none; border: 0; padding: 0; text-align: left; }
.proj:first-child { grid-column: 1 / -1; }
.proj__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--paper-2); }
.proj:first-child .proj__media { aspect-ratio: 21 / 9; }
.proj__media img, .proj__media video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.proj:hover .proj__media img, .proj:hover .proj__media video { transform: scale(1.03); }
.proj__badge { position: absolute; left: 12px; bottom: 12px; background: rgba(24,23,21,.75); color: #fff; padding: 4px 8px; border-radius: 2px; }
.proj__meta { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: baseline; }
.proj__t { margin: 0; font-size: clamp(22px, 2vw, 30px); font-weight: 700; letter-spacing: var(--track); line-height: 1.05; }
.proj__s { grid-column: 1; margin: 0; color: var(--ink-soft); font-size: 15px; }
.proj__r { grid-row: 1 / span 2; grid-column: 2; color: var(--ink-soft); text-align: right; }
.proj:hover .proj__t { color: var(--accent); }
[data-cat="design-illustration"] .work__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-cat="design-illustration"] .proj:first-child { grid-column: auto; }
[data-cat="design-illustration"] .proj__media, [data-cat="design-illustration"] .proj:first-child .proj__media { aspect-ratio: 1 / 1; }
@media (max-width: 1000px) { [data-cat="design-illustration"] .work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .work__grid, [data-cat="design-illustration"] .work__grid { grid-template-columns: 1fr; } .proj:first-child .proj__media { aspect-ratio: 4 / 3; } .proj__meta { grid-template-columns: 1fr; } .proj__r { grid-row: auto; grid-column: 1; text-align: left; } }

.cat__next { border-top: 1px solid var(--line); }
.cat__next a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: clamp(28px, 5vw, 56px) var(--gutter); text-decoration: none; }
.cat__next b { font-size: clamp(32px, 5vw, 72px); letter-spacing: var(--track); line-height: 1; }
.cat__next a:hover b { color: var(--accent); }

/* ───────── Footer ───────── */
.foot { background: var(--ink); color: var(--paper); }
.foot__inner { padding: clamp(64px, 10vw, 140px) var(--gutter) 28px; }
.foot__eyebrow { margin: 0 0 18px; opacity: .6; }
.foot__big { margin: 0; font-size: clamp(42px, 7vw, 116px); font-weight: 700; letter-spacing: var(--track); line-height: .95; }
.foot__big em { color: #EFA82C; }
.foot__links { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 40px; font-size: clamp(16px, 1.5vw, 20px); }
.foot__links a, .foot__mail { text-decoration: none; border-bottom: 1px solid rgba(239,235,227,.3); padding-bottom: 3px; }
.foot__mail { user-select: all; }
.foot__links a:hover { color: #EFA82C; border-color: #EFA82C; }
.foot__small { display: flex; justify-content: space-between; margin: clamp(56px, 8vw, 110px) 0 0; opacity: .5; }

/* ───────── Dialogs ───────── */
dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(24,23,21,.55); }
.dlg-close { position: sticky; top: 0; z-index: 3; margin-left: auto; display: block; background: var(--ink); color: var(--paper); border: 0; border-radius: 99px; padding: 10px 18px; }
.viewer { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; background: var(--paper); color: var(--ink); }
.viewer[open] { animation: up .5s var(--ease); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.viewer__inner { height: 100%; overflow-y: auto; padding: 20px var(--gutter) 80px; }
.viewer__head { max-width: 980px; margin: 20px 0 44px; }
.viewer__meta { color: var(--accent); margin: 0 0 14px; }
.viewer__title { margin: 0; font-size: clamp(44px, 7vw, 110px); line-height: .95; letter-spacing: var(--track); text-wrap: balance; }
.viewer__text { font-size: clamp(17px, 1.6vw, 22px); color: var(--ink-soft); max-width: 54ch; }
.viewer__link { display: inline-block; margin-top: 10px; font-size: 15px; text-underline-offset: 4px; }
.viewer__credits { margin: 14px 0 0; font-size: 16px; }
.viewer__credits .mono { color: var(--ink-soft); margin-right: 10px; }
/* slides sit in justified rows at their own proportions (sizes set in main.js) */
.viewer__gallery { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.slide { margin: 0; flex: none; overflow: hidden; border-radius: 6px; background: var(--paper-2); }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; }
.slide--video, .slide video { background: var(--ink); }

.about { width: min(1100px, calc(100% - 2 * var(--gutter))); max-height: calc(100% - 40px); background: var(--paper); color: var(--ink); border-radius: 6px; }
.about__inner { position: relative; padding: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.about .dlg-close { position: absolute; right: 18px; top: 18px; }
/* the reel is vertical: the frame takes its own 9:16 shape, so there are no black bars */
.about__video video { display: block; height: min(78vh, 720px); width: auto; aspect-ratio: 9 / 16; max-width: 100%; object-fit: cover; border-radius: 6px; background: transparent; }
.about__text { padding: 8px 12px 8px 0; }
.about__text h2 { margin: 6px 0 16px; font-size: clamp(36px, 4.4vw, 64px); line-height: .95; letter-spacing: var(--track); }
.about__text p { max-width: 42ch; }
.about__dirs { color: var(--ink-soft); margin-top: 22px; }
@media (max-width: 760px) { .about__inner { grid-template-columns: 1fr; } .about .dlg-close { position: sticky; } .about__video video { height: min(70vh, calc((100vw - 2 * var(--gutter) - 36px) * 16 / 9)); margin: 0 auto; } }

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

