:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e7e5e1;
  --surface: #f6f5f2;
  --max-width: 1120px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}

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

/* ---------- Cross-page transitions ---------- */
body {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
body.pt-ready {
  opacity: 1;
  transform: translateY(0);
}
body.pt-exit {
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
@media (prefers-reduced-motion: reduce) {
  body, body.pt-exit {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

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

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  gap: 32px;
}
.main-nav a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--text); }

.header-cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  width: 100%;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-1px); background: #000; }
.btn-small { padding: 9px 18px; }
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  padding: 120px 32px 100px;
  max-width: 900px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 40px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 32px;
  border-top: 1px solid var(--border);
}
.section-head {
  margin-bottom: 56px;
  max-width: 640px;
}
.eyebrow {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.section-head h1, .section-head h2, .contact-section h2, .about-copy h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  margin: 0;
  letter-spacing: -0.01em;
}
.about-copy h2 {
  margin: 0 0 24px;
}
.section--first {
  border-top: none;
  padding-top: 56px;
}
.section--first .project-back {
  margin-top: 0;
  margin-bottom: 40px;
}

.link-underline {
  display: inline-block;
  margin-top: 40px;
  font-size: 15px;
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}

/* ---------- About ---------- */
.about-section {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-photo img {
  border-radius: 16px;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 20%;
}
.about-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 480px;
}

/* ---------- Clients marquee ---------- */
.marquee {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}
.marquee-row {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  animation: marquee-scroll 75s linear infinite;
}
.marquee-row.reverse {
  animation-duration: 64s;
  animation-direction: reverse;
}
.marquee:hover .marquee-row {
  animation-play-state: paused;
}
.logo-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-chip img {
  max-width: 140px;
  max-height: 36px;
  width: auto;
  height: auto;
  object-fit: contain;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-row { animation: none; }
}

/* ---------- Contact ---------- */
.contact-section {
  text-align: center;
  max-width: 640px;
}
.contact-section h2 { margin: 0 0 18px; }
.contact-section p {
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 16px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px;
  font-size: 13px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--text); }

/* ---------- Project page ---------- */
.project-hero {
  width: 100%;
  max-height: 78vh;
  overflow: hidden;
}
.project-hero img {
  width: 100%;
  height: 100%;
  max-height: 78vh;
  object-fit: cover;
}
.project-header {
  padding-bottom: 0;
}
.project-back {
  margin-top: 0;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--muted);
}
.project-header h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 52px);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.project-role {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 40px;
}
.project-meta {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}
.project-meta p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}
.project-video-section {
  padding: 56px 32px;
  border-top: none;
}
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.video-embed:hover .video-play {
  transform: scale(1.06);
  background: #fff;
}
.project-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
  gap: 24px;
}
.video-embed--portrait {
  aspect-ratio: 9 / 16;
}
.video-embed--portrait .video-play {
  width: 56px;
  height: 56px;
}
.project-body { padding-top: 64px; }
.project-body-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
  align-items: start;
}
.project-side-image {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.project-side-image--static {
  position: static;
}
.project-side-image img {
  width: 100%;
  display: block;
  border-radius: 14px;
}
.project-image-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 64px;
}
.project-image-row img {
  width: 100%;
  display: block;
  border-radius: 14px;
}
.project-lede {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  max-width: 760px;
  margin: 0 0 64px;
}
.project-copy {
  max-width: 640px;
}
.project-copy h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  margin: 48px 0 16px;
}
.project-copy h2:first-child { margin-top: 0; }
.project-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px;
}
.project-next {
  border-top: 1px solid var(--border);
  padding-top: 56px;
}
.project-next .link-underline { margin-top: 12px; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 32px;
    gap: 18px;
  }
  .about-section { grid-template-columns: 1fr; }
  .about-photo { max-width: 320px; }
  .hero { padding: 80px 24px 64px; }
  .section { padding: 64px 24px; }
  .project-body-grid { grid-template-columns: 1fr; gap: 40px; }
  .project-side-image { position: static; max-width: 320px; }
  .project-image-row { grid-template-columns: 1fr; margin-top: 40px; }
}

/* ---------- Large screens ---------- */
@media (min-width: 1400px) {
  :root { --max-width: 1360px; }

  .hero {
    max-width: var(--max-width);
    padding: 140px 32px 120px;
  }
  .hero h1 {
    font-size: 72px;
    max-width: 1100px;
  }

  .section-head h1,
  .section-head h2,
  .contact-section h2,
  .about-copy h2 { font-size: 48px; }
  .project-header h1 { font-size: 64px; }

  .about-copy p,
  .project-copy p { font-size: 18px; }
  .about-copy p { max-width: 560px; }
  .project-copy { max-width: 720px; }

  .project-body-grid { grid-template-columns: 1fr 360px; }
  .project-video-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 260px)); }

  .marquee-row { gap: 80px; }
  .logo-chip img {
    max-width: 168px;
    max-height: 42px;
  }
}

/* ---------- Wider side image (Avonmore) ---------- */
@media (min-width: 861px) {
  .project-body-grid--wide-side { grid-template-columns: 1fr 440px; }
}
@media (min-width: 1400px) {
  .project-body-grid--wide-side { grid-template-columns: 1fr 560px; }
}

/* ---------- Instagram embeds ---------- */
.project-instagram-section {
  padding-top: 24px;
  border-top: none;
}
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}
.instagram-embed {
  min-width: 0;
}
.instagram-embed .instagram-media {
  min-width: 326px;
  max-width: 540px;
  width: 100%;
  margin: 0 !important;
}
@media (max-width: 860px) {
  .instagram-grid { grid-template-columns: 1fr; }
}

/* ---------- All projects grid ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 32px;
}
.project-tile {
  display: block;
}
.project-tile--placeholder {
  cursor: default;
}
.project-tile-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 14px;
}
.project-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
a.project-tile:hover .project-tile-image img {
  transform: scale(1.04);
}
.project-tile-title {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.project-tile-meta {
  display: block;
  font-size: 15px;
  color: var(--muted);
  margin-top: 2px;
}
@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-image-row--gallery img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.project-image-row--gallery img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.project-image-row--shots {
  grid-template-columns: 1fr;
  gap: 32px;
}
.project-image-row--shots img {
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}
.project-tile-image--logo {
  background: #fff;
  border: 1px solid var(--border);
}
.project-tile-image--logo img {
  object-fit: contain;
}
