/* =====================
   Base
===================== */
*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html{
  scroll-behavior: smooth;
}

body{
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  line-height: 1.6;
  background: #f4eddf;
  color: #222;
  overflow-x: hidden;
}

a{
  color: inherit;
  text-decoration: none;
}

img{
  display: block;
  max-width: 100%;
}

/* =====================
   Header + Nav
===================== */
header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: #f4eddf;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo{
  font-weight: 400;
  font-size: 1.5rem;
}

nav ul{
  display: flex;
  gap: 28px;
}

nav li{
  list-style: none;
}

header nav a{
  position: relative;
  display: inline-block;
  padding: 4px 0;
  border-radius: 17px;
  line-height: 0.9;
  transition:
    transform .22s cubic-bezier(.2,.7,.2,1),
    color .2s ease,
    text-shadow .2s ease;
}

header nav a::before{
  content: "";
  position: absolute;
  inset: -8px -14px;
  border-radius: inherit;
  background: rgba(244, 237, 223, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 5px 12px rgba(0,0,0,.08);
  transform: scale(.9);
  opacity: 0;
  transition:
    transform .22s cubic-bezier(.2,.7,.2,1),
    opacity .18s ease,
    box-shadow .18s ease;
  z-index: -1;
}

@media (min-width: 1025px) and (hover:hover) and (pointer:fine){
  header nav a:hover{
    transform: translateY(-1px);
    text-shadow: 0 1px 0 rgba(255,255,255,.6);
  }

  header nav a:hover::before{
    opacity: 1;
    transform: scale(1);
  }
}

/* =====================
   Hero
===================== */
.hero{
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 20px;
  text-align: center;
  background: #f4eddf;
}

.hero h1,
.hero p{
  opacity: 1;
  transform: none;
}

.hero h1{
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: .95;
  margin-bottom: 18px;
  font-weight: 400;
  max-width: 11ch;
}

.hero p{
  max-width: 760px;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  opacity: .88;
}

/* Bara desktop fade */
@media (min-width: 1025px){
  .hero h1,
  .hero p{
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity .8s ease,
      transform .8s ease;
  }

  body.page-ready .hero h1,
  body.page-ready .hero p{
    opacity: 1;
    transform: translateY(0);
  }

  body.page-ready .hero p:nth-of-type(1){
    transition-delay: .08s;
  }

  body.page-ready .hero p:nth-of-type(2){
    transition-delay: .16s;
  }
}

/* =====================
   Projects intro
===================== */
.projects-intro{
  padding: 40px 40px 24px;
  text-align: center;
  background: #fffaf0;
}

.projects-intro h2{
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 400;
  margin-bottom: 8px;
}

.projects-intro p{
  font-size: 1.1rem;
  opacity: .75;
}

/* =====================
   Horizontal section
===================== */
.horizontal-section{
  position: relative;
  background: #f4eddf;
  color: #1f1f1b;
  overflow: hidden;
}

.horizontal-pin{
  height: auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0;
  overflow: hidden;
}

.horizontal-track{
  display: flex;
  align-items: center;
  gap: 2vw;
  padding: 0 8vw;
  will-change: transform;
}

.horizontal-panel{
  flex: 0 0 auto;
}

.horizontal-text{
  width: min(36rem, 60vw);
}

.horizontal-text h3{
  font-size: clamp(2.5rem, 6vw, 6rem);
  line-height: .9;
  margin-bottom: 1rem;
  font-weight: 400;
  color: #1f1f1b;
}

.horizontal-text p{
  max-width: 28rem;
  font-size: 1.2rem;
  line-height: 1.6;
  opacity: .9;
  color: #1f1f1b;
}

.card-panel{
  width: min(34rem, 78vw);
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (min-width: 1025px) and (max-width: 1400px){
  .horizontal-pin{
    height: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
  }

  .horizontal-track{
    gap: 1.2vw;
    padding: 0 6vw;
  }

  .horizontal-text{
    width: min(32rem, 52vw);
  }

  .card-panel{
    width: min(30rem, 70vw);
  }
}

/* =====================
   Card base
===================== */
.project-card{
  background: none;
  padding: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  transition: transform .2s ease;
  width: 100%;
  max-width: 860px;
}

.card-hit{
  display: block;
  color: inherit;
  text-decoration: none;
  background: transparent;
  padding: 10px;
  border-radius: 24px;
  cursor: pointer;
}

/* =====================
   Card image + dim overlay
===================== */
.flip-card{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
}

.flip-card-inner{
  position: relative;
  width: 100%;
  height: 100%;
}

.flip-card-front,
.flip-card-back{
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
}

.flip-card-front img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.flip-card-back{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity .28s ease;
  z-index: 2;
}

.flip-back-content{
  max-width: 86%;
}

.flip-card-back h3{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: .45rem;
  color: #fff;
}

.flip-card-back p{
  font-size: 1rem;
  line-height: 1.5;
  opacity: .95;
  color: #fff;
}

@media (hover:hover) and (pointer:fine){
  .project-card:hover .flip-card-back{
    opacity: 1;
  }

  .project-card:hover .flip-card-front img{
    transform: scale(1.02);
  }

  .flip-card-front img{
    transition: transform .35s ease;
  }
}

/* =====================
   Fancybox caption
===================== */
.static-caption{
  max-width: 900px;
  margin: 12px auto 28px;
  padding: 0 20px;
  text-align: center;
  color: #fff;
  font-family: 'Instrument Serif', serif;
}

.static-caption h3{
  margin-bottom: 6px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.static-caption p{
  font-size: .95rem;
  line-height: 1.45;
  opacity: .95;
}

/* =====================
   AI popup grid
===================== */
#ai-lightbox-grid{
  background: #000;
  padding: 14px;
  border-radius: 10px;
  width: min(1200px, 92vw);
  max-height: none;
  overflow: visible;
}

.lb-grid{
  column-count: 3;
  column-gap: 12px;
}

.lb-grid a{
  display: block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 12px;
}

.lb-grid img{
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 1024px){
  .lb-grid{
    column-count: 2;
  }
}

@media (max-width: 640px){
  .lb-grid{
    column-count: 1;
  }
}

/* =====================
   Fancybox styles
===================== */
.ai-lightbox .fancybox__backdrop{
  background: rgba(40,40,40,.70) !important;
}

.ai-lightbox .fancybox__slide{
  background: transparent !important;
}

.ai-lightbox .fancybox__content{
  background: transparent !important;
  padding: 0 !important;
}

.ai-lightbox .fancybox__viewport,
.ai-lightbox .fancybox__container{
  overflow: auto !important;
}

.ai-lightbox .fancybox__toolbar,
.ai-lightbox .fancybox__infobar,
.ai-lightbox .fancybox__caption,
.ai-lightbox .fancybox__footer{
  display: none !important;
}

.ai-lightbox .fancybox__content,
#ai-lightbox-grid{
  scrollbar-width: thin;
}

.fralst-lightbox .fancybox__backdrop{
  background: rgba(40,40,40,.70) !important;
}

.fralst-lightbox .fancybox__slide{
  background: transparent !important;
  padding: 0 !important;
}

.fralst-lightbox .fancybox__container{
  --fancybox-content-bg: transparent !important;
}

.fralst-lightbox .fancybox__content{
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-bottom: 240px !important;
}

.fralst-lightbox .fancybox__image{
  max-height: calc(100vh - 280px) !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
  pointer-events: none !important;
  transform: none !important;
}

.fralst-lightbox .fancybox__slide.has-video .fancybox__content,
.fralst-lightbox .fancybox__slide.has-iframe .fancybox__content{
  width: min(95vw, 1500px) !important;
  height: auto !important;
}

.fralst-lightbox .fralst-video,
.fralst-lightbox .fancybox__iframe{
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: calc(100vh - 280px) !important;
  object-fit: contain !important;
  background: #000;
}

.fralst-lightbox .fancybox__toolbar,
.fralst-lightbox .fancybox__infobar,
.fralst-lightbox .fancybox__caption,
.fralst-lightbox .fancybox__footer{
  display: none !important;
}

.fralst-lightbox .static-caption{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  margin: 0 auto;
  max-width: 900px;
  padding: 16px 24px;
  background: transparent;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
  z-index: 12000;
  pointer-events: none;
}

.fralst-lightbox .static-caption h3{
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.fralst-lightbox .static-caption p{
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

/* =====================
   Utilities
===================== */
.sr-only{
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =====================
   Contact modal
===================== */
.contact-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  overflow-y: auto;
}

.contact-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}

.contact-modal__backdrop{
  position: fixed;
  inset: 0;
  background: rgba(15,15,15,.42);
  backdrop-filter: blur(4px);
}

.contact-modal__panel{
  position: relative;
  width: min(980px, 92vw);
  margin: 0 auto;
  background: #f4eddf;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  transform: translateY(18px) scale(.985);
  opacity: 0;
  transition:
    transform .34s cubic-bezier(.2,.7,.2,1),
    opacity .24s ease;
  z-index: 2;
}

.contact-modal.is-open .contact-modal__panel{
  transform: translateY(0) scale(1);
  opacity: 1;
}

.contact-modal__close{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  color: #222;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.contact-modal__close:hover{
  background: rgba(0,0,0,.12);
}

.contact-modal__header{
  padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #f4eddf;
  border-radius: 24px 24px 0 0;
}

.contact-modal__header h2{
  margin: 0;
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 2rem;
}

.contact-modal__body{
  height: auto;
  background: #f4eddf;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
}

.contact-modal__body iframe{
  width: 100%;
  height: 0;
  border: 0;
  display: block;
  background: #f4eddf;
}

body.contact-modal-open{
  overflow: hidden;
}

/* =====================
   Desktop contact section
===================== */
.contact-section-desktop{
  display: none;
}

@media (min-width: 1025px){
  .contact-section-desktop{
    display: block;
    background: #f4eddf;
    padding: 0 40px 110px;
  }

  .contact-section-desktop__inner{
    max-width: 1320px;
    margin: 0 auto;
  }

  .contact-section-desktop__intro{
    max-width: 760px;
    margin: 0 auto 12px;
    text-align: center;
  }

  .contact-section-desktop__intro h2{
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: .95;
    margin-bottom: 10px;
  }

  .contact-section-desktop__intro p{
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: .78;
  }

  .contact-section-desktop__form{
    max-width: 1100px;
    margin: 0 auto;
    background: #f4eddf;
    overflow: visible;
  }

  .contact-section-desktop__form iframe{
    display: block;
    width: 100%;
    height: 0;
    border: 0;
    background: #f4eddf;
    overflow: hidden;
  }
}

/* =====================
   Hide modal on desktop
===================== */
@media (min-width: 1025px){
  .contact-modal{
    display: none !important;
  }
}

/* =====================
   Home page desktop overrides
===================== */
@media (min-width: 1025px){
  .home-page .home-header{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: 20;
    padding: 28px 34px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  .home-page .home-header .logo{
    display: none;
  }

  .home-page .home-header nav{
    margin: 0;
  }

  .home-page .home-header nav ul{
    display: flex;
    gap: 0;
    justify-content: flex-start;
  }

  .home-page .home-header nav a{
    display: inline-block;
    padding: 0;
    margin: 0;
    min-height: 0;
    border-radius: 0;
    background: transparent;
    color: #f4eddf;
    line-height: 1;
    letter-spacing: .01em;
    cursor: pointer;
    transition:
      transform .18s ease,
      text-shadow .18s ease,
      opacity .18s ease;
  }

  .home-page .home-header nav a::before,
  .home-page .home-header nav a::after{
    content: none;
    display: none;
  }

  .home-page .home-header nav a:hover{
    transform: scale(1.08);
    text-shadow: 0 0 10px rgba(244, 237, 223, 0.22);
  }

  .home-page .home-header nav a:active{
    transform: scale(.98);
  }

  .home-page .home-hero{
    min-height: 0;
    height: auto;
    aspect-ratio: 1920 / 1080;
    padding: 0;
    display: block;
    position: relative;
    overflow: hidden;
    background: #f4eddf;
  }

  .home-page .home-hero::before{
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("img/1.png");
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease;
    z-index: 1;
  }

  body.page-ready.home-page .home-hero::before{
    opacity: 1;
  }

  .home-page .home-hero h1,
  .home-page .home-hero p{
    display: none !important;
  }

  .home-page .horizontal-section{
    position: relative;
    background: #f4eddf;
    color: #1f1f1b;
    overflow: hidden;
  }
}

/* =====================
   Mobile
===================== */
@media (max-width: 1024px){
  body{
    background: #f4eddf;
  }

  header{
    padding: 18px 20px;
  }

  nav ul{
    gap: 18px;
  }

  .hero{
    min-height: auto;
    padding: 84px 20px 56px;
  }

  .horizontal-section{
    background: transparent;
    color: #3c4842;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .horizontal-pin{
    min-height: 0;
    height: auto;
    display: block;
    padding: 10px 16px 0;
    overflow: visible;
  }

  .horizontal-track{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 0 0 28px;
    overflow: visible;
    transform: none !important;
  }

  .horizontal-panel{
    width: 100%;
    min-width: 0;
    flex: none;
  }


.horizontal-text{
  width: 100%;
  min-width: 0;
  padding: 0 6px 4px;
  text-align: right;
}

.horizontal-text h3,
.horizontal-text p{
  display: block;
  text-align: right;
  margin-left: auto;
  color: #f4eddf;
}

.horizontal-text h3{
  max-width: 68%;
  font-size: clamp(2.2rem, 10vw, 4rem);
  line-height: .95;
  margin-bottom: .45rem;
}

.horizontal-text p{
  max-width: 78%;
  font-size: 1.2rem;
  line-height: 1.2;
}
  .card-panel{
    width: 100%;
    min-width: 0;
  }

  .project-card{
    width: 100%;
    max-width: none;
  }

  .card-hit{
    padding: 0;
  }

  .flip-card{
    aspect-ratio: 1 / 1;
    border-radius: 14px;
  }

  .flip-card-front,
  .flip-card-back{
    border-radius: 14px;
  }

  .flip-card-back{
  opacity: 1;
  background: linear-gradient(
    to top,
    rgba(20,20,20,.42) 0%,
    rgba(20,20,20,.22) 24%,
    rgba(20,20,20,.08) 46%,
    rgba(20,20,20,0) 68%
  );
  align-items: flex-end;
  justify-content: flex-start;
  text-align: left;
  padding: 16px;
}

  .flip-back-content{
    max-width: 100%;
    text-align: left;
  }

  .flip-card-back h3{
    font-size: 1.15rem;
    margin-bottom: .35rem;
  }

  .flip-card-back p{
    font-size: .92rem;
    line-height: 1.4;
  }

  .fralst-lightbox .fancybox__content{
    padding-bottom: 160px !important;
  }

  .fralst-lightbox .fancybox__image,
  .fralst-lightbox .fralst-video,
  .fralst-lightbox .fancybox__iframe{
    max-height: calc(100vh - 210px) !important;
  }

  .fralst-lightbox .static-caption{
    bottom: 10px;
    padding: 10px 16px;
    max-width: calc(100vw - 24px);
  }

  .fralst-lightbox .static-caption h3{
    font-size: .98rem;
    margin-bottom: 8px;
  }

  .fralst-lightbox .static-caption p{
    font-size: .88rem;
    line-height: 1.45;
  }

  .contact-section-desktop{
    display: none !important;
  }

  .contact-modal{
    padding: 10px;
  }

  .contact-modal__panel{
    width: 100%;
    border-radius: 18px;
  }

  .contact-modal__header{
    padding: 18px 18px 12px;
    border-radius: 18px 18px 0 0;
  }

  .contact-modal__header h2{
    font-size: 1.6rem;
  }

  .contact-modal__body{
    border-radius: 0 0 18px 18px;
    overflow: hidden;
  }

  .contact-modal__close{
    top: 10px;
    right: 10px;
  }

  #ai-lightbox-grid{
    width: min(94vw, 1200px);
    max-height: 82dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .ai-lightbox .fancybox__slide{
    padding: 0 !important;
    overflow: visible !important;
  }

  .ai-lightbox .fancybox__content{
    width: min(94vw, 1200px) !important;
    max-height: 82dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .ai-lightbox .fancybox__viewport,
  .ai-lightbox .fancybox__container{
    overflow: hidden !important;
  }



.home-page{
  position: relative;
  background-color: #f4eddf;
}

.home-page::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(
      to bottom,
       rgba(8, 14, 12, 0) 0%,
  rgba(8, 14, 12, 0) 15%,
  rgba(8, 14, 12, 0.34) 25%,
  rgba(8, 14, 12, 0.56) 42%,
  rgba(8, 14, 12, 0.80) 68%,
  rgba(8, 14, 12, 1) 100%
    ),
    url("img/5.png");
  background-repeat: no-repeat, no-repeat;
  background-position: top center, top center;
  background-size: 100% 100%, 100% 100%;
}

.home-page .home-hero{
  min-height: 78vw;
  padding: 280px 20px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  text-align: right;
  background: transparent;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.home-page .home-hero::before{
  content: none;
  display: none;
}

.home-page .home-hero h1,
.home-page .home-hero p{
  display: none !important;
}

.home-page .horizontal-section{
  position: relative;
  z-index: 1;
  background: transparent;
}
}