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

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

body {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #fff;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 80%;
  font-weight: 500;
  overflow-x: hidden;
}

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

/* ── HEADER ── */
header {
  position: relative;
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ── MARQUEE ── */
.marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0.3rem 0 0.6rem;
}

.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 250s linear infinite;
  will-change: transform;
}

.marquee-track span {
  display: inline-block;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: 0;
  padding-right: 3rem;
  padding-left: 1.5rem;
}

.marquee-track span:not(:first-child) { padding-left: 0; }

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── NAV ── */
.nav {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.nav-shell {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 0;
  background: #000;
  border-radius: 500px;
  box-shadow: 0px 0.6021873017743928px 0.6021873017743928px -1.25px rgba(0, 0, 0, 0.17997), 0px 2.288533303243457px 2.288533303243457px -2.5px rgba(0, 0, 0, 0.15889), 0px 10px 10px -3.75px rgba(0, 0, 0, 0.0625);
  border-radius: 500px;
  cursor: pointer;
  padding: 0;
  transition: opacity 160ms ease;
}

.nav-arrow { display: flex; align-items: center; justify-content: center; }

/* Clip wrapper animates max-width; keeps overflow hidden */
.nav-bubble-clip {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  max-width: 48px;
  overflow: hidden;
  border-radius: 500px;
  box-shadow: 0px 0.6021873017743928px 0.6021873017743928px -1.25px rgba(0, 0, 0, 0.17997), 0px 2.288533303243457px 2.288533303243457px -2.5px rgba(0, 0, 0, 0.15889), 0px 10px 10px -3.75px rgba(0, 0, 0, 0.0625);
  border-radius: 500px;
  opacity: 0;
  pointer-events: none;
  transition: max-width 950ms cubic-bezier(.2, .9, .2, 1.1), opacity 340ms ease;
}

/* Actual pill: layout like reference (email left, icons right) */
.nav-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 12px 16px;
  height: 48px;
  background: #000;
  white-space: nowrap;
  width: calc(100vw - 1.5rem);
}



.nav.open .nav-bubble-clip {
  max-width: calc(100vw - 0.75rem);
  opacity: 1;
  pointer-events: auto;
}

.nav.open .nav-shell { opacity: 0; pointer-events: none; }

.nav-left{ display:flex; align-items:center; flex:1 1 auto; min-width:0; overflow:hidden; padding-right: 110px; }
.nav-right{ position:absolute; right:16px; top:50%; transform: translateY(-50%); display:flex; align-items:center; gap: 14px; flex-shrink:0; }
.nav-right svg{ width:24px; height:24px; }
.nav-item  { display: flex; align-items: center; color: #fff; flex-shrink: 0; }
.nav-email { display:block; max-width:100%; font-size: 20px; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-close {
  display: flex;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
}

/* ── CATEGORIES ── */
.header-categories {
  font-size: 0.65rem;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.12em;
  padding: 0 1.5rem;
  text-align: center;
}

/* ── PORTFOLIO INDEX ── */
.portfolio {
  padding: 0 1.5rem 4rem;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.project-card:hover .bubble-img { opacity: 0.88; }

.bubble-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  --bubble-mask: url("/bubble.avif");
  --bubble-mask-inverted: linear-gradient(#fff 0 0), var(--bubble-mask);
}

.bubble-wrap.send {
  --bubble-mask: url("/bubble_send.avif");
}

.bubble-img-container {
  position: relative;
  width: 100%;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.18));
}

.bubble-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  -webkit-mask-image: var(--bubble-mask-inverted);
  mask-image: var(--bubble-mask-inverted);
  -webkit-mask-mode: alpha, alpha;
  mask-mode: alpha, alpha;
  -webkit-mask-size: 100.5% 100.5%, 100.5% 100.5%;
  mask-size: 100.5% 100.5%, 100.5% 100.5%;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  -webkit-mask-composite: source-out;
  mask-composite: subtract;
  transition: opacity 0.2s;
}

.bubble-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #999;
  text-align: center;
  padding: 1rem;
  -webkit-mask-image: var(--bubble-mask-inverted);
  mask-image: var(--bubble-mask-inverted);
  -webkit-mask-mode: alpha, alpha;
  mask-mode: alpha, alpha;
  -webkit-mask-size: 100.5% 100.5%, 100.5% 100.5%;
  mask-size: 100.5% 100.5%, 100.5% 100.5%;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  -webkit-mask-composite: source-out;
  mask-composite: subtract;
}

.iphone-crop .bubble-img {
  -webkit-mask: none;
  mask: none;
}

.iphone-crop .bubble-placeholder {
  -webkit-mask: none;
  mask: none;
}

.project-meta {
  margin-top: 18px;
  padding: 0 0 28px;
  text-align: center;
}
.project-title { font-size: 22px; font-weight: 500; letter-spacing: 0; line-height: 1.1; text-align: center; }
.project-category { display: none; }

/* ── PROJECT PAGE ── */
.project-page {
  padding: 1.2rem 1.5rem 4rem;
  width: 100%;
  margin: 0 auto;
}
.project-page-header {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 2rem;
  text-align: center;
}
.project-page-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.project-page-category {
  font-size: 0.65rem;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
}
.project-page-desc {
  font-size: 0.7rem;
  color: #555;
  letter-spacing: 0.05em;
  font-weight: 400;
}
.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
}
.photo-grid img {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 20px;
}

.photo-grid video {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 20px;
  background: #000;
}

/* ── BREAKPOINTS ── */
@media (min-width: 650px){
  .marquee-track span{ font-size:44px; }
}

@media (min-width: 768px) {
  .portfolio {
    padding: 1rem 1.5rem 5rem;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2rem) / 3);
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    align-items: start;
  }

  .portfolio::-webkit-scrollbar { display: none; }

  .project-card {
    min-width: 0;
    scroll-snap-align: center;
  }

  .bubble-wrap {
    max-width: none;
    margin: 0;
    width: 100%;
  }

  .bubble-img-container {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
    filter: none;
    background: #fff;
    border-radius: 20px;
    clip-path: inset(0 round 20px);
    overflow: hidden;
  }

  .bubble-img,
  .bubble-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    -webkit-mask: none;
    mask: none;
    border-radius: 20px;
    clip-path: inset(0 round 20px);
  }

  .iphone-crop .bubble-img {
    object-fit: contain;
    background: #fff;
  }

  .project-meta { margin-top: 0.4rem; }

  .project-page { padding: 1.5rem 1.5rem 5rem; }
  .project-page-header { margin-bottom: 2.5rem; }
  .photo-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
  .header-categories { padding: 0 3rem; }
  .nav { right: 2px; }
  .nav.open .nav-bubble-clip { max-width: min(760px, calc(100vw - 3rem)); }
  .nav-bubble { width: min(760px, calc(100vw - 3rem)); }
}

@media (min-width: 1200px) {
  .portfolio { grid-auto-columns: calc((100% - 3rem) / 4); }
}
