/* === tokens === */
:root {
  --bg:        #000000;
  --fg:        #ffffff;
  --mute:      #555555;
  --accent:    #4a9e8e;
  --glow:      #c8ddd9;

  --pad-x: clamp(20px, 5vw, 64px);
  --grid-gap: clamp(24px, 3vw, 48px);
  --gap-y: clamp(120px, 14vh, 220px);

  --type-body: 'Space Grotesk', system-ui, sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--type-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--glow); }
img { display: block; max-width: 100%; height: auto; }

/* === header === */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 20px var(--pad-x);
  z-index: 10;
  mix-blend-mode: difference;  /* keeps nav legible over any tile */
  font-size: 14px;
  letter-spacing: 0.04em;
}

.site-header nav { display: flex; gap: 28px; }

/* === hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad-x);
  padding-bottom: clamp(40px, 8vh, 80px);
  overflow: hidden;
  z-index: 1; /* establishes stacking context */
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}
.hero-video-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -2; /* Sits behind the video */
  background: #050505;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-content {
  position: relative;
  z-index: 2;
}

/* === work / tiles === */
.work {
  display: flex; flex-direction: column;
  gap: var(--gap-y);
  padding: var(--gap-y) var(--grid-gap);
}
.tile {
  display: block;
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tile figure {
  background: #050505;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.82);
  transition: filter .4s ease, transform .6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, filter;
}
.tile:hover img {
  filter: brightness(1.1);
  transform: scale(1.02);
}
.tile .caption {
  display: flex; align-items: baseline; gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.tile .dot {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.2em;
}
.tile h2 {
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: -0.005em;
}
.tile .loc {
  color: var(--mute);
  font-size: 14px;
}

/* pending placeholder */
.placeholder {
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,0.025), transparent 70%),
    #050505;
}
.project-placeholder {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  gap: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
.ph-title {
  color: var(--fg);
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}
.ph-annotation {
  color: var(--accent);
  font-size: 14px;
  line-height: 1.6;
  max-width: 460px;
  text-transform: none;
  letter-spacing: normal;
}

/* === about === */
.about {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--gap-y) var(--pad-x);
  text-align: center;
}
.about h3,
.contact h3 {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 28px;
}
.about p {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
}
.about .tools {
  margin-top: 24px;
  color: var(--mute);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* === contact === */
.contact {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--gap-y) var(--pad-x);
  text-align: center;
}
.contact p {
  font-size: clamp(16px, 1.8vw, 22px);
  margin: 6px 0;
}
.contact a {
  transition: color .25s ease;
}
.contact a:hover {
  color: var(--accent);
}

/* === footer === */
.site-footer {
  padding: 40px var(--pad-x);
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: center;
}

/* === project page === */
.project-hero {
  padding-top: 72px;            /* clear fixed header */
  padding-inline: var(--pad-x);
  max-width: 1100px;
  margin: 0 auto;
}
.project-hero img,
.project-hero .hero-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: brightness(0.9);
}
.project-hero .hero-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #050505;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.project-meta {
  max-width: 900px; /* Increased for better balance on wide screens */
  width: 90%;
  margin: 0 auto;
  padding: clamp(60px, 10vh, 120px) var(--pad-x) 24px;
  text-align: left;
}
.project-meta .dot {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 12px;
}
.project-meta h1 {
  font-weight: 500;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.project-meta .loc {
  color: var(--mute);
  font-size: 14px;
  margin-top: 10px;
  letter-spacing: 0.04em;
}
.project-text {
  max-width: 800px; /* Increased to allow the text to breathe on larger screens */
  width: 90%;
  margin: 0 auto;
  padding: 0 var(--pad-x) clamp(60px, 10vh, 120px);
}
.project-text p {
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.65;
}
.project-gallery {
  padding: 0 var(--pad-x) clamp(60px, 10vh, 120px);
}
.gallery-placeholder {
  color: var(--mute);
  text-align: center;
  padding: 80px 20px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.project-back {
  text-align: center;
  padding: 0 var(--pad-x) 80px;
}
.project-back a {
  color: var(--mute);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.project-back a:hover { color: var(--glow); }

/* === mobile === */
@media (max-width: 640px) {
  .site-header { padding: 14px var(--pad-x); }
  .site-header nav { gap: 18px; font-size: 13px; }
  .tile figure { aspect-ratio: 1 / 1; }
  .overlay-close { font-size: 28px; padding: 10px; } /* larger touch target */
}


/* === dynamic grid layout === */
.work-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  justify-content: center;
  gap: var(--grid-gap);
  max-width: 1800px;
  margin: 0 auto;
}
.tile {
  max-width: none;
  margin: 0;
  width: 100%;
}

/* === project overlay === */
.project-overlay {
  position: fixed;
  inset: 0;
  margin: 0;
  border: none;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  background: rgba(0, 0, 0, 0.7); /* Semi-transparent */
  backdrop-filter: blur(12px);    /* The requested blur effect */
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none; 
  overflow-y: auto;
  padding: var(--pad-x);
  color: var(--fg);
}
.project-overlay::backdrop {
  background: transparent;
}
.project-overlay[open], .project-overlay.active {
  display: block;
  animation: overlayFade 0.3s ease;
}
@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.overlay-close {
  position: fixed;
  top: 20px;
  right: var(--pad-x);
  font-size: 24px;
  cursor: pointer;
  z-index: 1100;
  color: var(--fg);
  transition: color .2s ease;
}
.overlay-close:hover {
  color: var(--accent);
}
.overlay-content {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 40px;
  padding-bottom: 80px;
}
.expansion {
  display: none; /* hide all expansions, only show active one */
}
.expansion.active {
  display: block;
}

/* Update Project Overlay Layout */
.project-layout-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.project-header-left {
  margin-bottom: 60px;
  width: 100%;
}

.project-header-left h1 {
  font-weight: 500;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin-bottom: 10px;
  color: var(--fg);
}

.project-header-left .loc {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.project-description-left p {
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.65;
  color: #ddd;
}

.project-scroll-gallery {
  display: flex;
  flex-direction: column;
  gap: 80px;
  width: 100%;
}

.scroll-image-container {
  width: 100%;
}

.scroll-image-container img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.scroll-image-caption {
  margin-top: 20px;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.6;
  color: #ddd;
  letter-spacing: 0.01em;
}

.expansion-footer.left-align {
  margin-top: 80px;
  text-align: left;
}
.expansion-footer.left-align a {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}
.expansion-footer.left-align a:hover {
  opacity: 0.7;
}

/* === lock screen === */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
.lock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.lock-content label {
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.2em;
  font-size: 14px;
}
.lock-content input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--mute);
  color: var(--fg);
  font-family: var(--type-body);
  font-size: 24px;
  text-align: center;
  padding: 10px;
  outline: none;
  width: 250px;
  transition: border-color 0.3s;
}
.lock-content input:focus {
  border-color: var(--fg);
}
.lock-content input::placeholder {
  color: var(--mute);
  font-size: 14px;
  letter-spacing: 0.1em;
}
.lock-error {
  color: #ff5555;
  font-size: 12px;
  height: 15px;
  opacity: 0;
  transition: opacity 0.3s;
}
.lock-error.visible {
  opacity: 1;
}


