/* =========================================================
   GLOBAL TOKENS + BASE
   ========================================================= */
   :root{
    --bg:#ffffff;
    --text:#111111;
    --muted:#666666;
    --inactive-grey: rgba(0,0,0,0.35);
    --line:#e8e8e8;
    --overlay: rgba(0,0,0,0.65);
    --accent:#c1121f;
  
    /* Universal layout rhythm */
    --page-max: 1200px;
    --page-pad: 18px;
    --grid-gap: 18px;
    --nav-grid-max: 760px;
  
    /* Home mosaic tuning */
    --tile-radius: 10px;
    --tile-fade: 2800ms;
  }
  
  *{ box-sizing:border-box; }
  html,body{ height:100%; }
  
  html{
    overflow-y: scroll;
  }

  body{
    margin:0;
    font-family: "Bookman Old Style", Bookman, Georgia, "Times New Roman", serif;
    background:var(--bg);
    color:var(--text);
  }
  
  a{ color:inherit; text-decoration:none; }
  img{ max-width:100%; display:block; }
  
  /* Standard page width wrapper (optional helper) */
  .page-wrap{
    width: min(var(--page-max), calc(100% - (var(--page-pad) * 2)));
    margin: 0 auto;
  }
  
  /* =========================================================
     SITE CHROME (LOGO + MAIN NAV)
     ========================================================= */
  .site-page{
    min-height:100vh;
    display:flex;
    flex-direction:column;
    background:#fff;
  }
  
  /* For home: wrapper around logo+nav (hidden initially during intro) */
  .header-wrap{
    position: relative;
    z-index: 5; /* sits above mosaic */
  }
  
  /* Top logo */
  .top-logo{
    padding: 28px 16px 10px;
    display:flex;
    justify-content:center;
  }
  
  .top-logo-link{
    display:inline-flex;
    justify-content:center;
  }
  
  .logo-img--top{
    width:min(320px, 56vw);
    transition: transform 520ms ease, opacity 520ms ease;
    transform-origin: top center;
  }
  
  /* Main nav (under logo everywhere) */
  .main-nav{
    width: min(var(--nav-grid-max), calc(100% - (var(--page-pad) * 2)));
    margin: 0 auto;
    display:grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items:center;
    padding: 8px 18px 14px;
  }
  
  .main-nav a{
    position:relative;
    padding: 6px 8px;
    font-weight: 600;
    font-size: clamp(14px, 1.6vw, 20px);
    color: var(--inactive-grey);
    transition: color .15s ease;
  }
  
  .main-nav a:hover{ color:#111; }
  .main-nav a.active{ color:#111; }
  
  .main-nav a::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:0px;
    height:3px;
    background:#111;
    transform: scaleX(0);
    transform-origin:left;
    transition: transform 160ms ease;
  }
  .main-nav a:hover::after{ transform: scaleX(1); }
  .main-nav a.active::after{ transform: scaleX(1); }
  
/* =========================================================
   HOME (MOSAIC WALL + LANDING INTRO)
   ========================================================= */

   body.landing-intro.site-page{
    position: relative;
  }
  
  body.landing-intro .header-wrap{
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    z-index: 30;
  
    width: min(760px, 62vw);
    text-align: center;
  
    opacity: 0;
    pointer-events: none;
    transition: opacity 2200ms cubic-bezier(0.4, 0, 0.2, 1), transform 2200ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  body.landing-intro .header-wrap .top-logo{
    padding: 0 0 4px;
  }
  
  body.landing-intro .header-wrap .main-nav{
    padding: 2px 0 0;
  }
  
  body.landing-intro.landing-intro-done .header-wrap{
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }
  
  .home-mosaic-stage{
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px var(--page-pad) 24px;
  }
  
  .mosaic{
    width: min(var(--page-max), calc(100% - (var(--page-pad) * 2)));
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--grid-gap);
    align-content: start;
  }
  
  @media (max-width: 1100px){
    .mosaic{
      grid-template-columns: repeat(4, 1fr);
    }
  
    body.landing-intro .header-wrap{
      top: 18px;
      width: min(620px, 72vw);
    }
  }
  
  @media (max-width: 700px){
    .mosaic{
      grid-template-columns: repeat(2, 1fr);
    }
  
    body.landing-intro .header-wrap{
      top: 12px;
      width: min(92vw, 520px);
    }
  }
  
  /* Desktop: fade out middle four tiles in top row */
  body.landing-intro.landing-intro-done .mosaic .tile:nth-child(2),
  body.landing-intro.landing-intro-done .mosaic .tile:nth-child(3),
  body.landing-intro.landing-intro-done .mosaic .tile:nth-child(4),
  body.landing-intro.landing-intro-done .mosaic .tile:nth-child(5){
    opacity: 0;
    transform: scale(0.96);
    filter: blur(2px);
    pointer-events: none;
  }
  
  /* Tablet: fade middle two tiles in top row; reset tiles 4-5 which were hidden at desktop */
  @media (max-width: 1100px){
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(2),
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(3){
      opacity: 0;
      transform: scale(0.96);
      filter: blur(2px);
      pointer-events: none;
    }
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(4),
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(5){
      opacity: 1;
      transform: scale(1);
      filter: none;
      pointer-events: auto;
    }
  }
  
  @media (max-width: 700px){
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(1),
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(2){
      opacity: 0;
      transform: scale(0.96);
      filter: blur(2px);
      pointer-events: none;
    }
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(3),
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(4),
    body.landing-intro.landing-intro-done .mosaic .tile:nth-child(5){
      opacity: 1;
      transform: scale(1);
      filter: none;
      pointer-events: auto;
    }
  }
  
  .tile{
    display: block;
    border-radius: var(--tile-radius);
    overflow: hidden;
    background: #f3f3f3;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    aspect-ratio: 1 / 1;
    transition: opacity 1100ms ease, transform 1100ms ease, filter 1100ms ease;
  }
  
  .tile img{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 1;
    transition: opacity var(--tile-fade) ease-in-out, transform 260ms ease;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: opacity, transform;
  }
  
  .tile img.swap-out{ opacity: 0; }
  .tile:hover img{ transform: scale(1.03); }
  
  .mosaic-empty{
    color: rgba(0,0,0,0.55);
    font-size: 14px;
    padding: 40px 0;
  }
  /* =========================================================
     PROJECTS LIST PAGE (projects.html)
     ========================================================= */
  .projects-stage{
    flex: 1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    padding: 0 var(--page-pad) 28px;
  
    /* This controls the gap under filters before the hero */
    gap: 32px;
  }
  
.projects-filters{
  display:flex;
  gap: 32px;
  justify-content:center;
  align-items:center;
  font-weight:700;
  margin-top: 6px;

  flex-wrap: wrap;
  row-gap: 10px;
  column-gap: 18px;
  padding: 0 10px;
}

@media (max-width: 640px){
  .projects-filters{ column-gap: 14px; }
  .filter-btn{
    font-size: 16px;
    padding: 6px 6px;
    white-space: nowrap;
  }
}
  
  .filter-btn{
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: var(--inactive-grey);
    padding: 8px 6px;
    position: relative;
  }
  .filter-btn.active{ color:#111; }
  .filter-btn.active::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:2px;
    height:3px;
    background:#111;
  }
  
  /* hero carousel section */
  .project-hero{
    display:grid;
    grid-template-columns: 72px minmax(260px, 980px) 72px;
    align-items:center;
    gap: var(--grid-gap);
    width: min(1100px, 100%);
  }
  
  .hero-card{
    position: relative;
    display:block;
    border-radius: 18px;
    overflow:hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    background:#f3f3f3;
  }
  
  .hero-img{
    width:100%;
    height: clamp(320px, 52vh, 520px);
    object-fit: cover;
    object-position: center;
    display:block;
  }
  
  .hero-arrow{
    border:none;
    background:transparent;
    font-size: 42px;
    font-weight: 400;
    color:#111;
    cursor:pointer;
    padding:0 6px;
    display:flex;
    align-items:center;
    justify-content:center;
    transition: opacity .2s ease;
  }
  .hero-arrow:hover{ opacity:0.55; }
  
  .hero-overlay{
    position:absolute;
    left: 18px;
    bottom: 16px;
    color: #fff;
    max-width: min(520px, calc(100% - 36px));
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
  }
  .hero-overlay .hero-title{
    margin:0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
  }
  .hero-overlay .hero-sub{
    margin:6px 0 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0.95;
  }
  
  /* =========================================================
     PROJECT DETAIL PAGE (project.html)
     4-column system: copy = 1 col, hero = 3 cols
     gallery = 4 cols so hero = 3 thumbs wide
     ========================================================= */
  .project-stage{
    flex: 1;
    padding: 10px var(--page-pad) 60px;
  }
  
  .project-layout,
  .project-gallery-wrap{
    width: min(var(--page-max), 100%);
    margin: 0 auto;
  }
  
  .project-layout{
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
    align-items:start;
  }
  
  /* left copy */
  .project-copy{
    grid-column: 1 / span 1;
  }
  
  .project-copy .proj-h{
    margin:0 0 10px;
    font-size: 44px;
    line-height: 1.05;
  }
  .project-copy .proj-sub{
    margin:0 0 10px;
    color:#222;
    font-weight:700;
    font-size: 18px;
  }
  .project-copy .proj-text{
    margin:0;
    color: rgba(0,0,0,0.65);
    line-height:1.6;
    font-size: 16px;
  }
  
  /* hero image area */
  .project-lead{
    grid-column: 2 / span 3;
    border-radius: 18px;
    overflow:hidden;
    background:#f3f3f3;
  }
  .project-lead img{
    width:100%;
    height: min(56vh, 520px);
    object-fit: cover;
    display:block;
  }
  
  /* gallery spacing */
  .project-gallery-wrap{
    margin-top: var(--grid-gap);
  }
  
  /* gallery grid: 4 columns (thumbs) */
  .gallery{
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
  }
  
  .gallery button{
    padding:0;
    border:none;
    background:none;
    cursor:pointer;
  }
  
  .gallery .gimg{
    border-radius:14px;
    overflow:hidden;
    border:1px solid var(--line);
    aspect-ratio: 1 / 1;
    background:#f3f3f3;
  }
  
  .gallery img{
    width:100%;
    height:100%;
    object-fit:cover;
  }
  
  /* =========================================================
     PROJECT NAV (next project)
     ========================================================= */
  .project-nav{
    width: min(var(--page-max), 100%);
    margin: 48px auto 0;
  }

  .project-nav-link{
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 28px 0 0;
    color: var(--text);
    text-align: center;
    transition: opacity 200ms ease;
  }
  .project-nav-link:hover{ opacity: 0.5; }

  .project-nav-info{
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .project-nav-label{
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .project-nav-title{
    font-size: 22px;
    font-weight: 700;
    line-height: 1.05;
  }

  .project-nav-arrow{
    font-size: 24px;
    color: var(--muted);
    margin-top: 10px;
  }

  /* =========================================================
     LIGHTBOX
     ========================================================= */
  .lightbox{
    position:fixed;
    inset:0;
    background:var(--overlay);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:100;
    padding:18px;
  }
  .lightbox.open{ display:flex; }
  
  .lightbox-inner{
    width:min(980px, 100%);
    position:relative;
  }
  
  .lightbox-img{
    width:100%;
    max-height:80vh;
    object-fit:contain;
    border-radius:14px;
    background:#111;
  }
  
  .lb-top{
    position:absolute;
    inset: -10px 0 auto 0;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:0 6px;
    color:#fff;
    font-weight:700;
  }
  
  .lb-close{
    border:1px solid rgba(255,255,255,0.6);
    background:rgba(0,0,0,0.2);
    color:#fff;
    width:40px;
    height:40px;
    border-radius:999px;
    cursor:pointer;
  }
  
  .lb-nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:46px;
    height:46px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,0.5);
    background:rgba(0,0,0,0.2);
    color:#fff;
    display:grid;
    place-items:center;
    cursor:pointer;
  }
  .lb-prev{ left:-10px; }
  .lb-next{ right:-10px; }
  
  /* =========================================================
   SIMPLE PAGES (services/about/contact)
   ========================================================= */
   .simple-stage{
    flex: 1;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding: clamp(90px, 10vh, 140px) var(--page-pad) 92px;
  }

.columns4{
  width: min(var(--page-max), calc(100% - (var(--page-pad) * 2)));
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(26px, 5vw, 80px);
  align-items:start;
}

.columns4--two-up{
  width: min(980px, calc(100% - (var(--page-pad) * 2)));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: clamp(46px, 7vw, 74px);
  column-gap: clamp(72px, 11vw, 160px);
}

.columns4 > div{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}

.tabbed-stage{
  flex: 1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  padding: 0 var(--page-pad) 92px;
  gap: clamp(82px, 12vh, 150px);
}

.tabbed-nav{
  margin-top: 6px;
}

.tabbed-copy{
  width: min(360px, calc(100% - (var(--page-pad) * 2)));
}

.tabbed-copy--services{
  width: min(760px, calc(100% - (var(--page-pad) * 2)));
}

.tabbed-panel[hidden]{
  display:none;
}

.service-panel{
  display:grid;
  grid-template-columns: minmax(0, 360px) minmax(180px, 260px);
  gap: clamp(34px, 6vw, 72px);
  align-items:start;
}

.service-project-link{
  display:block;
  width:100%;
  aspect-ratio: 4 / 3;
  background: var(--inactive-grey);
  opacity: 0.18;
  transition: opacity 160ms ease;
}

.service-project-link:hover{
  opacity: 0.3;
}

.simple-carousel{
  width: min(1260px, calc(100% - (var(--page-pad) * 2)));
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: clamp(34px, 4vw, 56px);
  justify-content: center;
  align-items: start;
  position: relative;
}

.simple-carousel-track{
  display: contents;
}

.simple-carousel-item{
  display: none;
  flex-direction: column;
  align-items: flex-start;
  min-height: 150px;
  opacity: 0.24;
  transform: scale(0.94);
  transform-origin: top left;
  transition: opacity 220ms ease, transform 220ms ease;
}

.simple-carousel-item.is-prev,
.simple-carousel-item.is-active,
.simple-carousel-item.is-next{
  display: flex;
  grid-row: 1;
}

.simple-carousel-item.is-prev{
  grid-column: 1 / span 3;
  justify-self: end;
}

.simple-carousel-item.is-active{
  grid-column: 4 / span 3;
  opacity: 1;
  transform: scale(1);
  margin-left: -10px;
}

.simple-carousel-item.is-active .col-text{
  max-width: 320px;
}

.simple-carousel-item.is-next{
  grid-column: 6 / span 3;
  width: 340px;
  margin-left: clamp(26px, 2.4vw, 38px);
}

.simple-carousel-item.is-prev{
  width: 340px;
}

.simple-carousel-item.is-prev .col-text,
.simple-carousel-item.is-next .col-text{
  max-width: 340px;
}

.simple-carousel-arrow{
  border: none;
  background: transparent;
  color: #111;
  cursor: pointer;
  font: inherit;
  font-size: 38px;
  line-height: 1;
  padding: 8px 6px;
  position: absolute;
  top: 42px;
  z-index: 2;
  transition: opacity 160ms ease;
}

.simple-carousel-arrow[data-carousel-prev]{
  right: calc(100% + 28px);
}

.simple-carousel-arrow[data-carousel-next]{
  left: calc(100% + 28px);
}

.simple-carousel-arrow:hover{
  opacity: 0.5;
}

.col-title{
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 14px;
  min-height: 32px;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.col-text{
  width: 100%;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: rgba(0,0,0,0.75);
}

.contact-center{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.8;
}

.contact-link{
  display:block;
  color:#111;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

  
  /* =========================================================
     RESPONSIVE
     ========================================================= */
  @media (max-width: 1000px){
    .columns4:not(.columns4--two-up){
      grid-template-columns: 1fr 1fr;
      gap: 30px;
    }
  }
  
  @media (max-width: 900px){
    /* projects list hero */
    .project-hero{
      grid-template-columns: 56px 1fr 56px;
    }
    .hero-img{
      height: 44vh;
    }
  
    /* project detail stacks */
    .project-layout{
      grid-template-columns: 1fr;
    }
    .project-copy,
    .project-lead{
      grid-column: auto;
    }
  
    /* gallery becomes 2 columns */
    .gallery{
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (max-width: 640px){
    .columns4{
      grid-template-columns: 1fr;
    }
    .simple-stage{
      padding-top: clamp(64px, 9vh, 90px);
    }
    .tabbed-stage{
      gap: clamp(56px, 9vh, 86px);
    }
    .tabbed-copy--services{
      width: min(360px, calc(100% - (var(--page-pad) * 2)));
    }
    .service-panel{
      grid-template-columns: 1fr;
      gap: 24px;
    }
    .simple-carousel{
      width: min(100%, calc(100% - (var(--page-pad) * 2)));
      grid-template-columns: 72px minmax(0, 1fr) 72px;
      column-gap: 0;
    }
    .simple-carousel-arrow{
      font-size: 32px;
      padding-inline: 2px;
      top: 40px;
    }
    .simple-carousel-arrow[data-carousel-prev]{
      left: 0;
      right: auto;
    }
    .simple-carousel-arrow[data-carousel-next]{
      right: 0;
      left: auto;
    }
    .simple-carousel-item.is-prev,
    .simple-carousel-item.is-next{
      max-width: 72px;
      overflow: hidden;
      white-space: nowrap;
    }
    .simple-carousel-item.is-prev{
      grid-column: 1;
    }
    .simple-carousel-item.is-active{
      grid-column: 2;
    }
    .simple-carousel-item.is-next{
      grid-column: 3;
    }
    .simple-carousel-item.is-prev .col-text,
    .simple-carousel-item.is-next .col-text{
      display: none;
    }
    .col-title{ font-size: 20px; }
    .col-text{ font-size: 14px; }
    .contact-center{ font-size: 14px; }
  
    /* keep gallery 2 columns on mobile */
    .gallery{
      grid-template-columns: repeat(2, 1fr);
    }
  }
