@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── PP Neue Montreal (local) ─────────────────────────────── */
@font-face {
  font-family: 'PPNeueMontreal';
  src: url('./fonts/PPNeueMontreal-Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PPNeueMontreal';
  src: url('./fonts/PPNeueMontreal-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ─── Graphik (local) ───────────────────────────────────────── */
@font-face {
  font-family: 'Graphik';
  src: url('./fonts/Graphik-Light-Trial.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik';
  src: url('./fonts/Graphik-Regular-Trial.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik';
  src: url('./fonts/Graphik-Medium-Trial.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  /* Colour */
  --color-ink         : #1a1a1a;
  --color-muted       : #888888;
  --color-placeholder : #BBBBBB;
  --color-ghost       : rgba(0, 0, 0, 0.18);
  --color-divider     : rgba(0, 0, 0, 0.08);
  --color-bg          : #FFFFFF;

  /* Typography */
  --font              : 'Inter', sans-serif;
  --font-graphik      : 'Graphik', sans-serif;
  --font-montreal     : 'PPNeueMontreal', sans-serif;

  /* Grid */
  --grid-columns      : 12;
  --grid-gutter       : 20px;
  --grid-margin       : 20px;

  /* Spacing */
  --space-1           :   4px;
  --space-2           :   8px;
  --space-4           :  16px;
  --space-5           :  20px;
  --space-8           :  40px;
  --space-16          :  80px;
  --space-24          : 120px;

  /* Transitions */
  --transition-link   : opacity 200ms ease-out;
  --transition-page   : opacity 300ms ease;
  --transition-hero   : opacity 250ms ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--color-placeholder);
}

/* ─── Grid ──────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gutter);
  padding-inline: var(--grid-margin);
}

/* ─── Header ────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-4) var(--grid-margin) 0;
  background: transparent;
}

.header-identity {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
}

.header-name {
  font: 500 12px/1 var(--font-graphik);
  color: var(--color-ink);
  position: relative;
}

.header-sep {
  font: 400 12px/1 var(--font-graphik);
  letter-spacing: -0.2px;
  color: #1a1a1a;
}

.header-role {
  font: 400 12px/1 var(--font-graphik);
  color: #1a1a1a;
}

.header-tagline {
  font: 400 12px/1.4 var(--font-graphik);
  letter-spacing: -0.2px;
  color: var(--color-ink);
  opacity: 1;
  transition: opacity 400ms ease;
}

/* header-tagline visible on all views */

.header-nav a {
  font: 500 12px/1.4 var(--font-graphik);
  letter-spacing: -0.2px;
  color: var(--color-ink);
  text-decoration: none;
}

.header-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── "human" link in tagline ────────────────────────────── */
.human-link {
  font-weight: 500;
  position: relative;
  text-decoration: none;
}

.human-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#handCursor {
  position: fixed;
  pointer-events: none;
  z-index: 201;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

#handCursor img {
  width: 28px;
  height: auto;
  display: block;
  background: transparent;
}

/* ─── "meet me" label under "human" ─────────────────────── */
.human-text-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  font: 400 12px/1.1 var(--font-graphik);
  color: var(--color-ink);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(0.33, 1, 0.68, 1),
              transform 500ms cubic-bezier(0.33, 1, 0.68, 1);
}

.human-link:hover .human-text-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Header name — home tooltip ────────────────────────────── */
body[data-view="home"] .header-name {
  cursor: pointer;
}

body[data-view="home"] .header-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.name-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(0.33, 1, 0.68, 1),
              transform 500ms cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 200;
}

.name-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms cubic-bezier(0.33, 1, 0.68, 1),
              transform 500ms cubic-bezier(0.33, 1, 0.68, 1);
}

.name-tooltip-gif {
  width: 46px;
  height: auto;
  display: block;
}

.name-tooltip-text {
  font: 400 12px/1.1 var(--font-graphik);
  color: var(--color-ink);
}

.name-tooltip-text::first-letter {
  text-transform: uppercase;
}

/* ─── Header name — work page link back ─────────────────────── */
body[data-view="work"] .header-name {
  cursor: pointer;
}

body[data-view="work"] .header-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── View switching & transitions ──────────────────────────── */
.view {
  opacity: 1;
}

.view--hidden {
  display: none !important;
}

/* View fade-out (home zooms slightly out) */
.view.fade-out {
  opacity: 0;
  transform: scale(1.025);
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease;
}

@keyframes homeEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Home→Work: work content fades in (used for work→work swap) */
@keyframes workContentEnter {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}

.work-content.content-enter {
  animation: workContentEnter 750ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

.view.anim-home-enter {
  animation: homeEnter 350ms ease both;
}

@keyframes thumbsAlignRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

.work-thumbs-fixed.anim-thumbs-enter {
  animation: thumbsAlignRight 400ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

/* ─── Homepage — sticky hero + scrollable feed ───────────────── */
.home-layout {
  min-height: 100vh;
  padding-inline: var(--grid-margin);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gutter);
  align-items: start;
}

/* Hero — 8 middle cols (3–11), 74vh tall, vertically centred in viewport */
.hero-image-wrap {
  grid-column: 3 / 11;
  grid-row: 1;
  position: sticky;
  top: calc(50vh - 37vh);
  height: 74vh;
  margin-inline-start: 4vw;
  margin-inline-end: 0;
  overflow: visible; /* allow badge to bleed outside the hero bounds */
  display: block;
  z-index: 2; /* above feed (z-index:1) so badge bleed area is never covered */
}

.hero-image-wrap .front,
.hero-image-wrap .behind {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--color-placeholder);
  transition: opacity 250ms ease, transform 600ms ease;
  z-index: 0; /* explicit layer — keeps badge definitively above during GPU compositing */
}

/* Under-construction badge — top-left corner of hero, slow clockwise spin */
@keyframes spinCW {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero-badge {
  position: absolute;
  top: -65px;
  left: -65px;
  width: 130px;
  height: 130px;
  pointer-events: none;
  mix-blend-mode: color;
  animation: spinCW 14s linear infinite;
  z-index: 1; /* sits above .front/.behind (z-index: 0) */
}

/* Feed — cols 11–13, last 2 columns, overlays hero right edge */
.projects-feed {
  grid-column: 11 / 13;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  padding-top: 0;    /* computed in JS: 50vh − entryH/2 − home-layout-pt, first entry centred */
  padding-bottom: 0; /* computed in JS: 50vh − entryH/2, last entry can reach centre exactly */
}

/* One entry per project */
.project-entry {
  width: 100%;
  cursor: pointer;
  transform-origin: left top;
}


/* Image wrapper — 3:2 ratio, cropped */
.project-entry-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.project-entry-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Persistent project label — fixed, outside both views ──── */
/* Visible on both home and work. Never hidden by view transitions. */
.site-label {
  position: fixed;
  bottom: var(--space-5);
  left: var(--grid-margin);
  z-index: 50;
  pointer-events: none;
  max-width: calc(3 * (100vw - 2 * var(--grid-margin) - 11 * var(--grid-gutter)) / 12 + 2 * var(--grid-gutter));
}

.site-label-title {
  font: 700 48px/0.95 var(--font-graphik);
  letter-spacing: -0.02em;
  text-indent: var(--space-8);
  text-transform: uppercase;
  color: #1a1a1a;
}

.ghost-inline {
  display: inline-block;
  font: 400 11px/1 var(--font-graphik);
  letter-spacing: 0;
  text-transform: none;
  text-indent: 0;
  white-space: nowrap;
  color: #ffffff;
  padding: 8px 9px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
  transition: background-color 400ms ease;
}

.site-label-ghost {
  display: none;
}

/* ─── Copyright — fixed bottom-right, all pages ─────────────── */
.site-copyright {
  position: fixed;
  bottom: var(--space-5);
  right: var(--grid-margin);
  font: 400 12px/1.4 var(--font-graphik);
  color: var(--color-ink);
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: multiply;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes imageReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.is-visible {
  animation: fadeIn 800ms ease forwards;
}

.work-image-row.animate-on-scroll.is-visible .work-image {
  animation: imageReveal 1000ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* first-image-reveal no longer used — all images use animate-on-scroll */


/* ─── Work Page ─────────────────────────────────────────────── */
.work-layout {
  min-height: 100vh;
}

/* Single scrollable content column — paragraphs and images interleaved */
.work-content {
  padding-top: var(--space-24);
  padding-bottom: 10px;
}

/* Paragraph row — 3-col editorial column starting at col 4 */
.work-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gutter);
  padding-inline: var(--grid-margin);
  margin-bottom: var(--space-4);
}

.work-row p {
  grid-column: 4 / 7;
  margin-right: 4vw;
  font-family: var(--font-graphik);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-ink);
}

.work-row p.medium {
  font-weight: 500;
}

.work-row p.lead {
  font-weight: 500;
  line-height: 1.5;
}

.work-row p a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-row p a:hover {
  opacity: 0.6;
  transition: opacity 200ms ease-out;
}

/* Credits colophon — inline beside paragraph, right-aligned with image */
.credits-inline {
  grid-column: 9 / 11;
  align-self: end;
  font: 400 12px/1.4 var(--font-graphik);
  color: var(--color-ink);
}

.credits-inline a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.credits-inline a:hover {
  opacity: 0.6;
  transition: opacity 200ms ease-out;
}

/* Image row — cols 4–10, 60vh */
.work-image-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gutter);
  padding-inline: var(--grid-margin);
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.work-image-row:last-child {
  margin-bottom: 10px;
}

/* Neutralise paragraph's own bottom margin when it sits directly above an image,
   so the gap above and below every image is equally var(--space-8) = 40px */
.work-row:has(+ .work-image-row) {
  margin-bottom: 0;
}

.work-image-row .work-image {
  grid-column: 4 / 11;
}

.work-image-row .work-image img {
  width: 100%;
  height: auto;
  display: block;
}


/* ─── Work page — fixed other-project thumbnails (bottom-right) ─ */
/* Width mirrors the home feed: 80% of the 2-column strip in the same grid column */
/* Work nav — unused in this layout */
.work-nav {
  display: none;
}

/* ─── Custom cursor ─────────────────────────────────────────── */
#customCursor {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  background: #ffffff;
  color: #1a1a1a;
  font: 500 9px/1 var(--font-graphik);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.08);
  /* exit transition */
  transition: opacity 0.2s ease,
              transform 0.22s cubic-bezier(0.4, 0, 0.6, 1);
}

#customCursor.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scaleX(1) scaleY(1);
  /* enter transition — bouncy spring */
  transition: opacity 0.15s ease,
              transform 0.28s cubic-bezier(0.34, 1.7, 0.64, 1);
}

#customCursorText {
  display: block;
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}

#customCursor.text-visible #customCursorText {
  opacity: 1;
}

.project-entry,
.hero-image-wrap,
.human-link {
  cursor: none;
}

.project-entry.is-work-thumb {
  opacity: 1;
}

/* ─── Project entry info — desktop hidden, mobile visible ── */
.project-entry-info {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — below 768px
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── Header: stack tagline below identity, right-aligned ─── */
  .site-header {
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0;
  }

  /* ── Homepage: no hero ───────────────────────────────────── */
  .hero-image-wrap {
    display: none !important;
  }

  .home-layout {
    display: block;
    padding-top: 68px;
  }

  .projects-feed {
    gap: 0;
    padding: 0;
  }

  /* Reset any GSAP-set transforms */
  .project-entry {
    transform: none !important;
    margin-bottom: 0 !important;
  }

  /* Title + tag below each thumbnail */
  .project-entry-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 24px;
    flex-wrap: wrap;
  }

  .project-entry-img {
    aspect-ratio: 4 / 5;
  }

  .project-entry-title {
    font: 700 32px/1 var(--font-graphik);
    text-transform: uppercase;
    letter-spacing: -0.02em;
  }

  .project-entry-tag {
    display: inline-block;
    font: 400 12px/1 var(--font-graphik);
    color: #ffffff;
    background: #1a1a1a;
    padding: 10px 12px;
    border-radius: 20px;
    white-space: nowrap;
  }

  /* ── Site label: hidden on home, top-anchored on work ────── */
  body[data-view="home"] .site-label {
    display: none;
  }

  body[data-view="work"] .site-label {
    position: static;
    bottom: auto;
    left: auto;
    max-width: none;
    padding-top: 68px;
    padding-inline: var(--grid-margin);
  }

  body[data-view="work"] .site-label-title {
    font-size: 32px;
    line-height: 1.2;
    text-indent: 0;
  }

  /* Category pill on work page label */
  .ghost-inline {
    font-size: 12px;
    padding: 10px 12px;
  }

  /* ── Work page ───────────────────────────────────────────── */
  .work-content {
    padding-top: 24px;
  }

  /* Paragraphs: 5 of 6 columns */
  .work-row {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }

  .work-row p {
    grid-column: 1 / 6;
    margin-right: 0;
  }

  /* Credits: full width, stacks below paragraph */
  .credits-inline {
    grid-column: 1 / -1;
    margin-top: var(--space-2);
  }

  /* Images: all available columns */
  .work-image-row {
    grid-template-columns: repeat(6, 1fr);
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
  }

  .work-image-row .work-image {
    grid-column: 1 / -1;
  }

  /* ── Work thumbnails: hidden ─────────────────────────────── */
  body[data-view="work"] #projectsFeed {
    display: none !important;
  }

  /* ── Copyright: left-aligned ─────────────────────────────── */
  .site-copyright {
    right: auto;
    left: var(--grid-margin);
  }

  /* ── Custom cursor: disabled on touch ────────────────────── */
  #customCursor,
  #handCursor {
    display: none !important;
  }

  .project-entry,
  .hero-image-wrap,
  .human-link {
    cursor: auto;
  }
}
