/* ===========================
Base & Reset
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Lexend', sans-serif;
  background-color: #ffffff;
  color: #111111;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===========================
Landing Page
=========================== */
.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #ffffff;
}

.landing-content {
  text-align: center;
  max-width: 790px;
  padding: 0 24px;
}

.landing-intro {
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #111111;
}

.landing-sub {
  font-size: 1.34rem;
  font-weight: 300;
  color: #555555;
  line-height: 1.5;
  margin-bottom: 36px;
}

.landing-btn {
  display: inline-block;
  padding: 12px 40px;
  background: #111111;
  color: #ffffff;
  font-family: 'Lexend', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.landing-btn:hover {
  background: #333333;
}

/* ===========================
Password Page
=========================== */
.password-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #ffffff;
}

.password-box {
  text-align: center;
  width: 100%;
  max-width: 320px;
  padding: 0 24px;
}

.password-box .site-name {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 48px;
  color: #111111;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.password-form input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  font-family: 'Lexend', sans-serif;
  font-size: 0.875rem;
  color: #111111;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 0.1em;
}

.password-form input[type="password"]:focus {
  border-color: #111111;
}

.password-form input[type="password"]::placeholder {
  color: #aaaaaa;
  letter-spacing: 0.1em;
}

.password-form button {
  width: 100%;
  padding: 12px 16px;
  background: #111111;
  color: #ffffff;
  border: none;
  border-radius: 0;
  font-family: 'Lexend', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.password-form button:hover {
  background: #333333;
}

.error-msg {
  font-size: 0.75rem;
  color: #999999;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.2s;
  margin-top: 4px;
}

/* ===========================
Site Header
=========================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.site-header.scrolled {
  border-color: #e8e8e8;
  /*background: #f7f7f7;*/
}

.header-logo {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  gap: 32px;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666666;
}

.header-nav a:hover {
  color: #111111;
}

/* ===========================
Portfolio Page
=========================== */
.portfolio-main {
  padding: 0 0 80px;
}

/* 2x2 Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1536px;
  margin: 0 auto;
}

.pg-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  border-right: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
}

.pg-item:nth-child(even) {
  border-right: none;
}

.pg-item:nth-child(3),
.pg-item:nth-child(4) {
  border-bottom: none;
}

/* Images */
.pg-images {
  position: absolute;
  inset: 0;
}

.bottom-image {
  margin-top: -8rem;
  z-index: -1;
  position: relative;
}


.pg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.pg-img--default {
  z-index: 1;
  transform: scale(1);
}

.pg-item:hover .pg-img--default {
  transform: scale(1.06);
}

/* Hover image: diagonal clip-path wipe from bottom-left */
.pg-img--hover {
  z-index: 2;
  clip-path: polygon(0% 100%, 0% 100%, 0% 100%);
  transform: scale(1.04);
  transition:
  clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1),
  transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.pg-item:hover .pg-img--hover {
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  transform: scale(1);
}

/* Dark gradient overlay — only visible on hover */
.pg-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.70);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.pg-item:hover .pg-overlay {
  opacity: 1;
}

/* Info bar — centered, appears on hover */
.pg-info {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.pg-item:hover .pg-info {
  opacity: 1;
  transform: translateY(0);
}

.pg-number {
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.65);
}

.pg-title {
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #ffffff;
}

.pg-category {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.85);
}

/* Various link */
.various-link-wrap {
  padding: 40px 0;
  max-width: 1536px;
  margin: 0 auto;
}

.various-item {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e8e8e8;
}

.various-img-wrap {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.various-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.various-item:hover .various-image {
  transform: scale(1.06);
}

.various-item .pg-overlay {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.various-item:hover .pg-overlay {
  opacity: 1;
}

.various-item .pg-info {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.various-item:hover .pg-info {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
Case Study Page
=========================== */
.cs-page-main {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0;
}

.cs-page-header {
  padding: 40px 48px 56px;
  margin-bottom: 0;
}

.cs-page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888888;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.cs-page-back:hover {
  color: #111111;
}

/* Two-column header body */
.cs-ph-body {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

.cs-ph-left {
  flex: 0 0 52%;
  max-width: 52%;
}

.cs-ph-number {
  display: block;
  font-size: 9rem;
  font-weight: 900;
  color: #d4d4d4;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.cs-page-title {
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.link-ext {
  font-size: 0.75rem;
  color: #999999;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  display: block;
  transition: color 0.2s;
}

.with-bg{
  background: url('../img/cs3/bottom.jpg') no-repeat center center;
  background-size: 100%;
  min-height: 91vh;
  margin-top: 36px;
  
}

.intro-text {
  font-size: .9rem;
  font-weight: 300;
  width: 100%;
  margin: 24px 0 0;
  line-height: 1.6;
}

.intro-text p {
  margin: 36px auto 0;
}

.link-ext a {
  color: #999999;
  transition: color 0.2s;
}

.link-ext a:hover {
  color: #111111;
}

.cs-ph-description {
  font-size: 1.25rem;
  font-weight: 500;
  color: #555555;
  line-height: 1.7;
  max-width: 563px;
}

/* Right metadata column */
.cs-ph-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 12px;
}

.cs-ph-meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-ph-label {
  font-size: 1.18rem;
  font-weight: 500;
  color: #00B5A0;
  letter-spacing: 0.01em;
}

.cs-ph-value {
  font-size: 1.08rem;
  font-weight: 400;
  color: #333333;
  line-height: 1.6;
}

.cs-page-meta {
  font-size: 0.75rem;
  color: #999999;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===========================
Case Study Content Sections
=========================== */
.cs-sections-wrapper {
  background: #f6f6f6;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 80px;
}

.cs-sections {
  max-width: 1536px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: ;
}

.cs-section-text{
  max-width: 80%;
}

.cs-closure {
  position: relative;
  max-width: 680px;
  margin: 120px auto;
  padding: 80px 48px;
  background: #ffffff;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 400;
  color: #555555;
  line-height: 1.8;
  letter-spacing: -0.01em;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
  box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1),
  color 0.3s ease;
  cursor: default;
}

.cs-closure:hover {
  color: #333333;
}

.centered-note {
  font-size: 1.05rem;
  font-family: 'Lexend', sans-serif;
  margin: 24px auto;
  text-align: center;
}


/* SVG animated border frame */
.cs-closure-frame {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  pointer-events: none;
  overflow: visible;
}

.cs-closure-frame rect {
  fill: none;
  stroke: #a2a1a1;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 1s cubic-bezier(0.77, 0, 0.18, 1);
}

.cs-closure:hover .cs-closure-frame rect {
  stroke-dashoffset: 0;
}

.cs-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 60px 48px;
}

.cs-section-rule {
  width: 48px;
  height: 2px;
  background: #a2a1a1;
  margin-bottom: 24px;
}

.cs-section-subtitle{ 
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 24px;
  font-family: '';
}

.cs-section-title {
  font-size: 2.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 24px;
  color: #111111;
}

.cs-section-body {
  font-size: 1.14rem;
  font-weight: 300;
  color: #444444;
  padding-bottom: 16px;
  line-height: 1.8;
}

.cs-section-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-section-media-card {
  width: 100%;
}

/* Type 2: image is first in DOM but visually left — already correct */
.cs-section--image-text .cs-section-media {
  order: -1;
}

@media (max-width: 768px) {
  .cs-section {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 56px 24px;
  }
  
  .cs-section--image-text .cs-section-media {
    order: 0;
  }
  
  .cs-section-title {
    font-size: 1.7rem;
  }
  
  .cs-section-media-card {
    aspect-ratio: 3 / 2;
  }
}

/* Images inside case study */
.cs-images {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-image-block {
  width: 100%;
  overflow: hidden;
  background: #f5f5f5;
}

.cs-image-block.full-width {
  height: 70vh;
  min-height: 400px;
}

.cs-image-block.half-width {
  height: 50vh;
  min-height: 300px;
}

.cs-images-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cs-images-row .cs-image-block {
  height: 55vh;
  min-height: 320px;
}

/* ===========================
Various Projects Page
=========================== */
.various-page-main {
  padding: 0 0 80px;
}

.various-header {
  padding: 48px 48px 40px;
  border-bottom: 1px solid #e8e8e8;
  max-width: 1536px;
  margin: 0 auto;
}

.various-title {
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.various-subtitle {
  font-size: 0.8rem;
  color: #999999;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.various-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.various-item {
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
  border-right: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
}

.various-item:nth-child(3n) {
  border-right: none;
}

.various-item-image {
  position: relative;
  width: 100%;
  height: 40vh;
  min-height: 260px;
  overflow: hidden;
}

.various-item-image img,
.various-item-image .placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.various-item:hover .various-item-image img,
.various-item:hover .various-item-image .placeholder-img {
  transform: scale(1.04);
}

.various-item-info {
  padding: 16px 24px;
}

.various-item-title {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.various-item-type {
  font-size: 0.7rem;
  color: #999999;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ===========================
Placeholder Images (CSS gradients)
Replace with <img> tags pointing to
your actual image files.
=========================== */
.placeholder-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Case study 1 */
.ph-cs1-a { background: linear-gradient(135deg, #e8e0d8 0%, #c9bfb3 100%); }
.ph-cs1-b { background: linear-gradient(135deg, #d4cfc9 0%, #a89f96 100%); }
/* Case study 2 */
.ph-cs2-a { background: linear-gradient(135deg, #d8dfe8 0%, #b3bfc9 100%); }
.ph-cs2-b { background: linear-gradient(135deg, #c9d4df 0%, #96a8b8 100%); }
/* Case study 3 */
.ph-cs3-a { background: linear-gradient(135deg, #e8e4d8 0%, #c9c4b3 100%); }
.ph-cs3-b { background: linear-gradient(135deg, #dfd8c9 0%, #b8af9a 100%); }
/* Case study 4 */
.ph-cs4-a { background: linear-gradient(135deg, #dfe8e0 0%, #b3c9b8 100%); }
.ph-cs4-b { background: linear-gradient(135deg, #d4dfdb 0%, #a0b8b0 100%); }
/* Various items */
.ph-v1 { background: linear-gradient(160deg, #e8dfd4 0%, #c9b8a8 100%); }
.ph-v2 { background: linear-gradient(160deg, #d4d8e8 0%, #a8aec9 100%); }
.ph-v3 { background: linear-gradient(160deg, #e8e8d4 0%, #c9c9a8 100%); }
.ph-v4 { background: linear-gradient(160deg, #d8e8e4 0%, #a8c9c4 100%); }
.ph-v5 { background: linear-gradient(160deg, #e4d8e8 0%, #c4a8c9 100%); }
.ph-v6 { background: linear-gradient(160deg, #e8d8d8 0%, #c9a8a8 100%); }

/* ===========================
Responsive
=========================== */
@media (max-width: 768px) {
  .site-header {
    padding: 20px 24px;
  }
  
  .cs-info {
    padding: 16px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .cs-category {
    text-align: left;
  }
  
  .cs-page-header {
    padding: 28px 24px 40px;
  }
  
  .cs-ph-body {
    flex-direction: column;
    gap: 40px;
  }
  
  .cs-ph-left {
    flex: none;
    max-width: 100%;
  }
  
  .cs-ph-number {
    font-size: 6rem;
  }
  
  .cs-page-title {
    font-size: 2.64rem;
  }
  
  .cs-ph-right {
    padding-top: 0;
    gap: 24px;
  }
  
  .cs-image-block.full-width {
    height: 50vw;
    min-height: 240px;
  }
  
  .cs-images-row {
    grid-template-columns: 1fr;
  }
  
  .various-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .various-header {
    padding: 32px 24px 28px;
  }
  
  .various-title {
    font-size: 1.8rem;
  }
  
 
  .cs-title {
    font-size: 1.2rem;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  
  .pg-item {
    border-right: none;
    aspect-ratio: 3 / 2;
  }
  
  .pg-item:nth-child(3) {
    border-bottom: 1px solid #e8e8e8;
  }
  
  .pg-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .various-grid {
    grid-template-columns: 1fr;
  }
  
  .various-item {
    border-right: none;
  }
  
  .cs-image-wrap {
    height: 55vw;
    min-height: 220px;
  }
}

/* ===========================
Mosaic Gallery
=========================== */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  grid-auto-flow: dense;
  gap: 3px;
  background: #e0e0e0;
  max-width: 1536px;
  margin: 0 auto;
}

.mosaic-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #f0f0f0;
}

.mosaic-item.col-2 { grid-column: span 2; }
.mosaic-item.col-3 { grid-column: span 3; }
.mosaic-item.col-4 { grid-column: span 4; }
.mosaic-item.row-2 { grid-row: span 2; }

.mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mosaic-item:hover img {
  transform: scale(1.05);
}

/* Gallery Modal */
.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.gallery-modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.gallery-modal img {
  max-width: min(90vw, 1200px);
  max-height: 80vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.modal-caption {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: 'Lexend', sans-serif;
  font-weight: 400;
}

.modal-close-btn {
  position: fixed;
  top: 28px;
  right: 36px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.modal-close-btn:hover { color: #ffffff; }

.modal-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 20px 16px;
  transition: color 0.2s;
  user-select: none;
}

.modal-nav-btn:hover { color: rgba(255,255,255,0.9); }
.modal-nav-btn.prev { left: 20px; }
.modal-nav-btn.next { right: 20px; }

@media (max-width: 900px) {
  .mosaic-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
}

@media (max-width: 500px) {
  .mosaic-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 160px;
  }
  .mosaic-item.col-2 { grid-column: span 2; }
  .modal-nav-btn { display: none; }
}
