/* ==========================================================================
   Base / Reset
   ========================================================================== */

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

html, body { margin: 0; padding: 0; }

:root{
  --bg: #111;
  --text: #dadbd5;
  --muted: #9e9e9e;
  --muted2: #6e6e6e;
  --accent: #ff00cc;
  --radius: 20px;
}

body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Google Sans', sans-serif;
  line-height: 1.2;
  overflow-x: hidden;
  cursor: none; /* custom cursor */
}

::selection{ background: var(--accent); color: #000; }

a{
  color: var(--text);
  text-decoration: none;
}

a:hover{
  cursor: none;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

button:hover{ cursor: none; }

strong{
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
}

small{ font-size: 0.9rem; color: var(--muted2); }

sup{ font-size: 0.9rem; padding-right: 12%; }



/* ==========================================================================
   Header / Footer
   ========================================================================== */

.top-header,
footer{
  display: flex;
  justify-content: space-between;
  padding: 1vh 1%;
  font-size: 0.9rem;
}

.top-header .col,
footer .col{
  flex: 1;
  text-align: left;
}

footer{ margin-top: 10%; }

/* ==========================================================================
   About (Hero)
   ========================================================================== */

.hero{
  min-height: auto;
  padding-top: 0;
  position: relative;
}

.intro-container{
  position: relative;
  margin-top: 0;
  text-align: center;
  padding: 0 1%;

  /* About starts closed */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.4s ease, margin-top 0.6s ease;
}

body.about-open .intro-container{
  margin-top: 1vh;
  max-height: 3000px; /* big enough for content */
  opacity: 1;
}

.intro,
#intro-expand{
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 3%;
  text-align: left;
}

#intro-expand{
  overflow: hidden;
  transition: height 0.6s ease, opacity 0.6s ease;
}

.intro-extra{
  margin-bottom: 4%;
  margin-left: auto;
  margin-right: auto;
  line-height: 1;
}

.intro-columns{
  display: flex;
  flex-wrap: wrap;
  gap: 2%;
  justify-content: center;
}

.intro-columns .col-text{
  flex: 1 1 22%;
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--muted);
}

#toggle-button{
  margin-top: 40px;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
}

#toggle-button:hover{
  background: var(--accent) !important;
  color: #000 !important;
  transition: all 0.3s ease;
  cursor: none !important;
}

/* ==========================================================================
   Home Gallery (Masonry)
   ========================================================================== */

.gallery{
  width: 100%;
  padding: 2vh 0 0 1%;
  position: relative;
  transition: margin-top 0.6s ease;
}

.grid-sizer{ width: 25%; } /* 4 columns */

.project{
  width: 24%;
  margin-bottom: 1%;
}

.project.wide{ width: 48.7%; }

.project-title{
  font-size: 3rem;
  margin-top: 2vh;
  line-height: 1;
  margin-bottom: 2vh;
}

.project a{
  display: block;
  perspective: 1000px; /* 3D context */
  overflow: visible;  /* allow tilt to overflow */
}

.project img,
.project video{
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: var(--radius);
  max-width: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 120ms ease;
}

/* hover scale */
.project:hover img,
.project:hover video{
  transform: scale(0.98);
}

/* Wide hover stacking */
.project.wide:hover{ z-index: 20; }

/* Meta text */
.meta{
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.2;
}

.project a:hover .meta::first-letter{ color: var(--accent); }

.project a:hover .meta{
  font-family: 'Google Sans', sans-serif;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

/* keep <small> normal on hover */
.project a:hover .meta small{
  font-family: 'Google Sans', sans-serif;
  font-weight: normal;
  text-decoration: none;
}

/* === "Soon" overlay === */
.project a.soon{
  position: relative;
  cursor: none; /* custom cursor */
}

.project a.soon::after{
  content: "Soon";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Google Sans', sans-serif;
  font-size: 1rem;
  color: var(--accent);
  background: rgba(0,0,0,0.6);
  padding: 8px 16px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project a.soon:hover img,
.project a.soon:hover video{
  opacity: 0.5;
}

.project a.soon:hover::after{ opacity: 1; }

/* ==========================================================================
   Custom Cursor
   ========================================================================== */

.cursor{
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
  z-index: 9999;
}

.cursor-label{
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--accent);
  color: #000;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  white-space: nowrap;
  font-family: 'Google Sans', sans-serif;
  display: none;
}

.cursor.change-logo .cursor-label{ display: block; }

.link-hover .cursor{
  width: 30px;
  height: 30px;
}

/* Arrow ↓ on first fold */
.cursor.arrow-down::after{
  content: "↓";
  position: absolute;
  top: -10px;
  left: -2px;
  font-size: 2rem;
  color: var(--accent);
  font-family: 'Google Sans', sans-serif;
  pointer-events: none;
}

/* Hide dot when arrow is active */
.cursor.arrow-down{ background: transparent; }

/* Pink X cursor on "Soon" */
body.cursor-x .cursor::after{
  content: "✕";
  position: absolute;
  top: -14px;
  left: -8px;
  font-size: 2rem;
  color: var(--accent);
  font-family: 'Google Sans', sans-serif;
}

body.cursor-x .cursor{
  background: transparent;
  width: 40px;
  height: 40px;
}

/* ==========================================================================
   Project pages layout (sticky left column + media grid)
   ========================================================================== */

.project-header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 1vh 1%;
}

.project-layout{
  display: grid;
  grid-template-columns: 24% 76%;
  gap: 1%;
  margin: 5vh 1% 0 1%;
}

.project-info{
  position: sticky;
  top: 0vh;
  align-self: flex-start;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text);
  width: 95%;
}

.project-credits{
  font-size: 0.7rem;
  color: var(--muted2);
}

.project-gallery{
  display: flex;
  flex-wrap: wrap;
  gap: 1%;
}

.project-gallery img,
.project-gallery video{
  display: block;
  width: 99%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 1%;
}

.project-media{
  overflow: hidden;
  border-radius: var(--radius);
}

.project-media.full{ flex: 0 0 99%; }
.half{
  width: 45% !important;
  flex: 0 0 calc(50% - 1%);
  margin-bottom: 0.5%;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablets / small desktops */
@media (max-width: 1024px){
  .project-layout{ grid-template-columns: 1fr; }
  .project-info{
    position: relative;
    top: auto;
    margin-bottom: -8vh;
  }
}

/* Masonry 4 -> 2 columns and header simplification */
@media (max-width: 990px){
  .grid-sizer{ width: 50%; }
  .project{ width: 48.5%; box-sizing: border-box; }
  .project.wide{ width: 98%; }
  .project.tall{ width: 48%; }

  .intro,
  #intro-expand{ font-size: 2rem; }

  header.top-header .col:nth-child(2),
  header.top-header .col:nth-child(3){ display: none; }

  footer.top-header .col:nth-child(1),
  footer.top-header .col:nth-child(2){ display: none; }
}

/* About columns stack */
@media (max-width: 768px){
  .intro-columns{
    flex-direction: column;
    align-items: center;
  }
  .intro-columns .col-text{
    width: 98%;
    margin-bottom: 20px;
  }
}

/* Mobile */
@media (max-width: 768px), (pointer: coarse) {
  .cursor,
  .cursor-follower {
    display: none !important;
  }

  * {
    cursor: auto !important;
  }
}



@media (max-width: 768px){


  .project-layout{
    display: flex;
    flex-direction: column;
    gap: 2vh;
  }

  .project-info{
    position: static; /* remove sticky */
    width: 100%;
    margin-bottom: 0;
  }

  .project-gallery{
    order: 2;
  }

  .project-gallery img, .project-gallery video {margin-bottom: 1%;padding-bottom: 0}

  .project-credits{
    order: 3;
    margin: 2vh 0 0 0;
  }


.meta {margin-top:2%;margin-bottom: 2%}
.meta, .meta small {font-size: 0.7rem}
/* Project pages (internal) — ensure media stacks and keeps aspect ratio on mobile */




  .intro,
  #intro-expand{ font-size: 1.5rem !important; }

  header.top-header .col:nth-child(2),
  header.top-header .col:nth-child(3){ display: none; }

  footer.top-header .col:nth-child(1),
  footer.top-header .col:nth-child(2){ display: none; }

  footer {margin-top:20%}
}

/* Prevent Masonry overlap flash on first paint */
.gallery.masonry-loading{ opacity: 0; }
.gallery.masonry-ready{ opacity: 1; transition: opacity 200ms ease; }