@font-face {
  font-family: 'Amontillado';
  src: url('../assets/fonts/Amontillado.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #2b2620;
  --ink-soft: #55504a;
  --paper: #ffffff;
  --paper-soft: #f7f6f4;
  --accent: #4fb7c7;
  --accent-bright: #7ad5e2;
  --dark: #2b2825;
  --dark-soft: #3a362f;
  --line: #e7e4de;
  --radius: 10px;
  --maxw: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Raleway', sans-serif;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

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

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

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

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: background .35s ease, padding .35s ease, box-shadow .35s ease;
}

.site-header.is-scrolled {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  padding: 12px 0;
  box-shadow: 0 1px 0 var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand img { height: 22px; width: auto; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 34px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-soft);
  transition: color .2s ease;
  position: relative;
}

.main-nav a:hover,
.main-nav a.is-active { color: var(--ink); }

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.main-nav a:hover::after,
.main-nav a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

/* ---------- hero ---------- */

.hero-pin {
  position: relative;
  height: 160vh;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--paper);
  padding: 120px 0 60px;
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero .wrap { width: 100%; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-logo {
  width: min(560px, 84vw);
  margin: 0 auto 36px;
}

@media (min-width: 1024px) {
  .hero-logo { width: min(760px, 62vw); }
}
@media (min-width: 1440px) {
  .hero-logo { width: min(860px, 56vw); }
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  animation: bob 2.2s ease-in-out infinite;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
}
.hero-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.hero-cta:hover { animation-play-state: paused; }

/* ---------- buttons / chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  transition: transform .25s ease, background .25s ease, rotate .25s ease;
}
.btn:hover { background: var(--ink); transform: translateY(-2px) rotate(-1deg); }

.btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn.outline:hover { border-color: var(--accent); background: transparent; color: var(--ink); }

/* ---------- section framing ---------- */

section { padding: 100px 0; }

#work {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: -200px;
  margin-bottom: -200px;
  padding-bottom: 200px;
}

@media (max-width: 720px) {
  #work { margin-top: -120px; margin-bottom: -120px; padding-bottom: 120px; }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.section-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(122, 213, 226, .25);
}

.section-head h2 { font-size: 2rem; margin: 0; }
.section-head p { color: var(--ink-soft); max-width: 480px; margin: 10px 0 0; }

/* ---------- filter pills ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all .2s ease;
}
.filter-pill:hover { border-color: var(--accent); color: var(--ink); }
.filter-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- project grid ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-divider {
  margin-top: 48px;
  border-top: 1px solid var(--line);
}

.project-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  transition: transform .3s ease, box-shadow .3s ease;
  display: block;
}

.project-card:hover {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: 0 20px 40px -20px rgba(43,38,32,.25);
}
.project-card:nth-child(even):hover { transform: translateY(-6px) rotate(0.6deg); }

.project-thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  position: relative;
  background: var(--dark);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.06); }

.project-title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px 22px;
  background: linear-gradient(to top, rgba(20,17,14,.78), rgba(20,17,14,0) 65%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}
.project-card:hover .project-title-overlay,
.project-card:focus-visible .project-title-overlay {
  opacity: 1;
  transform: translateY(0);
}

.project-title-overlay h3 { font-size: 1.08rem; margin: 0; color: #fff; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: rgba(79,183,199,.12);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
}

.tag-chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-bright);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- bottom section ---------- */

.bottom-section {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--paper);
  padding: 260px 0 0;
}

#particle-canvas-bottom {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.stripe {
  position: relative;
  z-index: 1;
  background: var(--dark);
  height: 220px;
  display: flex;
  align-items: center;
}

.stripe-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.mask-mark {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

.mask-mark img {
  display: block;
  width: auto;
  height: min(170px, 30vw);
}

.wordmark { flex: 0 0 auto; }

.wordmark img {
  display: block;
  width: min(320px, 46vw);
  height: auto;
}

@media (max-width: 720px) {
  .bottom-section { padding: 160px 0 0; }
  .stripe { height: 130px; }
  .stripe-inner { justify-content: space-between; gap: 16px; }
  .mask-mark img { width: auto; height: min(100px, 22vw); }
  .wordmark img { width: min(150px, 42vw); }
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  background: var(--paper);
  padding: 10px 0;
  text-align: center;
  font-size: .7rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ---------- project detail page ---------- */

.project-hero {
  padding: 150px 0 40px;
}

.project-hero h1.wall-title {
  font-family: 'Amontillado', 'Poppins', sans-serif;
  font-size: 42vw;
  font-weight: normal;
  letter-spacing: 0;
  margin: 0 0 12px;
  max-width: none;
  text-align: left;
  line-height: 1;
}

@media (min-width: 900px) {
  .project-hero h1.wall-title { font-size: 21vw; }
}

.project-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.project-hero .back-link:hover { color: var(--accent); }

.project-hero h1 { font-size: 2.4rem; max-width: 760px; }
.project-hero .tag-row { margin-bottom: 18px; }

.project-meta {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.project-meta div span {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.project-meta div strong { font-size: .95rem; }

.project-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 40px 0;
  background: var(--dark);
}
.project-cover img { width: 100%; }

.project-body-text {
  max-width: 760px;
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.project-body-text p { margin: 0 0 1.2em; }

.project-links {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.project-split { display: block; }

.project-main { padding: 0 32px 40px; }

.project-main--wall { padding-bottom: 80px; }

.poster-wall {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 18px;
  margin-top: 40px;
}

.poster-wall .poster {
  display: block;
  position: relative;
  object-fit: cover;
  background: var(--dark);
  border: 6px solid var(--paper);
  box-shadow: 0 16px 30px -14px rgba(0,0,0,.45);
  filter: grayscale(100%);
  transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
  cursor: pointer;
}
.poster-wall .poster:hover {
  transform: rotate(0deg) scale(1.08) !important;
  box-shadow: 0 24px 44px -16px rgba(0,0,0,.55);
  z-index: 30 !important;
  filter: grayscale(0%);
}

.poster--lg   { width: min(260px, 46%); aspect-ratio: 4 / 3; }
.poster--md   { width: min(190px, 34%); aspect-ratio: 1 / 1; }
.poster--sm   { width: min(150px, 28%); aspect-ratio: 1 / 1; }
.poster--tall { width: min(160px, 30%); aspect-ratio: 3 / 4; }

/* repeating rotation/stagger pattern so the scatter keeps working no
   matter how many posters are in the wall */
.poster-wall .poster:nth-child(6n+1) { transform: rotate(-5deg); margin-top: 18px; }
.poster-wall .poster:nth-child(6n+2) { transform: rotate(4deg);  margin-top: -10px; }
.poster-wall .poster:nth-child(6n+3) { transform: rotate(-3deg); margin-top: 28px; }
.poster-wall .poster:nth-child(6n+4) { transform: rotate(6deg);  margin-top: 2px; }
.poster-wall .poster:nth-child(6n+5) { transform: rotate(-6deg); margin-top: -16px; }
.poster-wall .poster:nth-child(6n)   { transform: rotate(5deg);  margin-top: 24px; }

@media (max-width: 640px) {
  .poster--lg, .poster--md, .poster--sm, .poster--tall { width: min(220px, 64%); aspect-ratio: 4 / 3; }
}

.gallery-bg-wrap { display: block; width: 100%; height: 60vh; }
.gallery-bg-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 900px) {
  .project-split {
    display: flex;
    align-items: flex-start;
  }
  .project-main {
    width: 50%;
    padding: 0 40px 60px 32px;
    box-sizing: border-box;
  }
  .gallery-bg-wrap {
    position: fixed;
    top: 0;
    right: 0;
    /* The fixed panel's width resolves against the viewport, while the
       poster column's 50% resolves against the layout width (which excludes
       the scrollbar gutter) — the two 50%s are never exactly equal. Rather
       than chase that gap at specific breakpoints, permanently overlap the
       panel a little further left than a plain 50% so it always covers the
       seam, at any width or scrollbar style. */
    width: calc(50% + 14px);
    height: 100vh;
    z-index: 1;
  }
}

.related-strip {
  margin-top: 30px;
}

/* ---------- lightbox ---------- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(20, 18, 16, .93);
  cursor: pointer;
}

.lightbox.is-open { display: flex; }

.lightbox-flip { perspective: 1600px; }

.lightbox-flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4, .2, .2, 1);
}
.lightbox-flip-inner.is-flipped { transform: rotateY(180deg); }

.lightbox-flip-front,
.lightbox-flip-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.lightbox-flip.is-flippable .lightbox-flip-front,
.lightbox-flip.is-flippable .lightbox-flip-back {
  cursor: pointer;
}

.lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 85vh;
  display: block;
  cursor: default;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}

.lightbox-flip-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}

.lightbox-flip-back img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-egg-open {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20,17,14,.78);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: background .2s ease, border-color .2s ease;
}
.lightbox-egg-open:hover {
  background: rgba(20,17,14,.94);
  border-color: rgba(255,255,255,.7);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.lightbox-close:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.5);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 720px) {
  .main-nav { position: fixed; top: 0; right: 0; bottom: 0; width: 78vw; max-width: 320px;
    background: var(--paper); padding: 100px 30px 30px; box-shadow: -10px 0 40px rgba(0,0,0,.15);
    transform: translateX(100%); transition: transform .35s ease; z-index: 99; }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 24px; }
  .nav-toggle { display: block; }
  .project-grid { grid-template-columns: 1fr; }
  section { padding: 70px 0; }
  .project-hero h1 { font-size: 1.8rem; }
}
