/* ================================================
   SCROLL REVEAL
   ================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ================================================
   PAGE TRANSITIONS
   ================================================ */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fade-out 0.4s ease-in forwards;
}

::view-transition-new(root) {
  animation: fade-in 0.4s ease-out forwards;
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ================================================
   RESET
   ================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
 
/* ================================================
   BASE
   ================================================ */
body {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(0, 0, 0, 0.9);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
 
/* ================================================
   NAV
   ================================================ */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 40px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 100;
}
 
.nav-logo {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
}
 
.nav-links {
  display: flex;
  gap: 24px;
}
 
.nav-link {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
}
 
.nav-link:hover {
  opacity: 0.5;
}
 
.nav-link.active {
  text-decoration: underline;
  text-underline-offset: 2px;
}
 
/* ================================================
   FOOTER (case study pages only)
   ================================================ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 0 40px 40px;
}
 
.footer-item {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
}
 
/* ================================================
   CASE STUDY WRAP
   ================================================ */
.cs-wrap {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 40px 80px;
}
 
.cs-header {
  padding: 40px 0;
}
 
.cs-eyebrow {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
}
 
.cs-title {
  font-size: 64px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: rgba(0, 0, 0, 0.9);
  margin-bottom: 12px;
}
 
/* ================================================
   CASE STUDY HERO
   ================================================ */
.cs-hero {
  width: 100%;
  height: 640px;
  background: #ddd;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 32px;
}
 
.cs-placeholder {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.2);
}
 
/* ================================================
   CASE STUDY META
   ================================================ */
.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.2);
}
 
.cs-meta__label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 4px;
}
 
.cs-meta__value {
  font-size: 16px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.9);
}
 
/* ================================================
   CASE STUDY SECTIONS
   ================================================ */
.cs-section {
  padding: 64px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.2);
}

.cs-inline-img + .cs-section {
  padding-top: 80px;
}
 
.cs-section:last-of-type {
  border-bottom: none;
}
 
.cs-section--no-border {
  border-bottom: none;
}
 
.cs-section__label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
}
 
.cs-section--statement .cs-section__heading {
  font-size: 64px;
}

.cs-section--statement .cs-section__body {
  color: rgba(0, 0, 0, 0.4);
}

.cs-section__heading {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: rgba(0, 0, 0, 0.9);
  margin-bottom: 16px;
}
 
.cs-section__body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.6);
}
 
.cs-section__body p + p {
  margin-top: 1em;
}
 
.cs-section__body ul {
  margin: 0.75em 0;
  list-style: none;
}
 
.cs-section__body li {
  position: relative;
  padding-left: 1.25em;
  margin-bottom: 0.4em;
}
 
.cs-section__body li::before {
  content: "—";
  position: absolute;
  left: 0;
  opacity: 0.4;
}
 
.cs-section__body strong {
  font-weight: 400;
  color: rgba(0, 0, 0, 0.9);
}
 
/* ================================================
   CASE STUDY CARDS
   ================================================ */
.cs-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.cs-card {
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.9);
  padding: 10px 0 0 0;
}

.cs-card__headline {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.9);
  margin-bottom: 6px;
}

.cs-card__subheadline {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.9);
}

/* ================================================
   RESEARCH INSIGHT IMAGE PLACEHOLDERS
   ================================================ */
.cs-research-img-left,
.cs-research-img-right {
  width: 25%;
  aspect-ratio: 1 / 1;
  background: #ddd;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.cs-research-img-left {
  margin-right: auto;
}

.cs-research-img-right {
  margin-left: auto;
}

.cs-section__heading--right,
.cs-section__body--right {
  text-align: right;
}

.cs-quote {
  font-style: italic;
  color: rgba(0, 0, 0, 0.9);
}

.cs-quote__attribution {
  font-style: normal;
}

/* ================================================
   CASE STUDY INLINE IMAGE
   ================================================ */
.cs-inline-img {
  width: 100%;
  height: 300px;
  background: #ddd;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
}
 
/* ================================================
   CASE STUDY NAV ROW
   ================================================ */
.cs-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0 0;
}

 
.cs-nav-row a {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
}
 
.cs-nav-row a:hover {
  opacity: 0.5;
}
 
/* ================================================
   ABOUT PAGE
   ================================================ */
.about-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 40px 60px;
}
 
.about-heading {
  flex-shrink: 0;
  margin-top: 40px;
  font-size: clamp(100px, 18vw, 390px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.88;
  color: #000;
  position: relative;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}
 
.about-body {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 40px;
  margin-top: -120px;
  position: relative;
  z-index: 1;
}
 
.about-col-spacer {
  grid-column: 1;
  grid-row: 1 / 3;
}
 
.about-contact {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.about-contact a {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}
 
.about-photo {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 100%;
  aspect-ratio: 4 / 4.5;
  background: #2c2c2c;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  align-self: end;
}
 
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
 
.about-bio-col3 {
  grid-column: 3;
  grid-row: 3;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
 
.about-col4 {
  grid-column: 4;
  grid-row: 3;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
 
.about-bio-col3 p,
.about-col4 p {
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.9);
}
 
/* ================================================
   WORK PAGE
   ================================================ */
.work-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px;
  gap: 20px;
  overflow: hidden;
}
 
.work-nav {
  padding: 0;
}
 
/* Full-bleed: break out of the 40px page padding on both sides */
.cs-grid {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex: 1;
  margin-left: -40px;
  margin-right: -40px;
}
 
/*
  JS adds .is-expanded to the active item and .is-collapsed to the others.
  Expanded: 676px (380px × 16/9)
  Collapsed: (100vw - 676px - 40px) / 2  [subtract expanded + 2 gaps]
  Default (no JS state yet): equal thirds
*/
.cs-item {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  width: calc((100vw - 40px) / 3);
  flex: 0 0 calc((100vw - 40px) / 3);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              flex  0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-item.is-expanded {
  width: 676px;
  flex: 0 0 676px;
}

.cs-item.is-collapsed {
  width: calc((100vw - 716px) / 2);
  flex: 0 0 calc((100vw - 716px) / 2);
}

@media (max-width: 1244px) {
  .cs-item.is-expanded {
    flex: 1 1 0;
    width: auto;
    min-width: 264px;
  }

  .cs-item.is-collapsed {
    flex: 0 0 264px;
    width: 264px;
  }
}
 
.cs-img {
  width: 100%;
  height: 380px;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
 
.cs-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
 
.cs-img video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.35);
}
 
.cs-img.bg-1,
.cs-img.bg-2,
.cs-img.bg-3 {
  background: #2c2c2c;
}
 
.cs-img__placeholder {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}
 
.cs-meta-work {
  margin-top: 20px;
  padding-left: 0;
}
 
/* First item is flush to viewport left; inset label to match page padding */
.cs-item:first-child .cs-meta-work {
  padding-left: 40px;
}
 
/* Last item: inset label from right to match page padding */
.cs-item:last-child .cs-meta-work {
  padding-right: 40px;
}
 
.cs-meta-work__title {
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.17;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.9);
}
 
.cs-meta-work__year {
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.17;
  letter-spacing: -0.01em;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 2px;
}
 
.work-page-title {
  flex-shrink: 0;
  font-size: clamp(100px, 18vw, 390px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.85;
  color: rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  align-self: flex-end;
  margin-left: auto;
  margin-right: -6px;
  text-align: right;
}
 
/* ================================================
   WORK PAGE — DARK MODE
   ================================================ */
body:has(.work-page) {
  background: #1a1a1a;
}

.work-page .nav {
  background: #1a1a1a;
}

.work-page .nav-logo,
.work-page .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.work-page .cs-meta-work__title {
  color: rgba(255, 255, 255, 0.9);
}

.work-page .cs-meta-work__year {
  color: rgba(255, 255, 255, 0.5);
}

.work-page .work-page-title {
  color: rgba(255, 255, 255, 0.9);
}

/* ================================================
   RESPONSIVE — ABOUT
   ================================================ */
@media (max-width: 900px) {
  .about-page {
    overflow: visible;
    padding-bottom: 40px;
  }
 
  body {
    height: auto;
    overflow-y: auto;
  }
 
  .about-heading {
    font-size: clamp(60px, 14vw, 160px);
    margin-bottom: 24px;
  }
 
  .about-body {
    display: flex;
    flex-direction: column;
    margin-top: 0;
    gap: 0;
  }
 
  .about-col-spacer {
    display: none;
  }
 
  .about-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    grid-column: unset;
    grid-row: unset;
    order: 1;
    align-self: flex-end;
  }
 
  .about-photo img {
    object-position: center 50%;
  }
 
  .about-contact {
    grid-column: unset;
    grid-row: unset;
    padding-top: 24px;
    order: 2;
  }
 
  .about-bio-col3 {
    grid-column: unset;
    grid-row: unset;
    padding-top: 24px;
    gap: 12px;
    order: 3;
  }
 
  .about-col4 {
    grid-column: unset;
    grid-row: unset;
    padding-top: 12px;
    gap: 12px;
    order: 4;
  }
}
 
/* ================================================
   RESPONSIVE — WORK
   ================================================ */
@media (max-width: 832px) {
  .work-page {
    overflow: auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .cs-grid {
    flex-direction: column;
    flex: none;
    margin-left: 0;
    margin-right: 0;
  }

  .cs-item,
  .cs-item:first-child,
  .cs-item.is-expanded,
  .cs-item.is-collapsed,
  .cs-grid:hover .cs-item,
  .cs-grid:hover .cs-item:hover {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .cs-meta-work,
  .cs-item:first-child .cs-meta-work,
  .cs-item:last-child .cs-meta-work {
    padding-left: 0;
    padding-right: 0;
  }

  .work-page-title {
    margin-right: 0;
  }

  .cs-img {
    height: 260px;
    border-radius: 0;
  }

  .cs-meta-work__title,
  .cs-meta-work__year {
    font-size: 16px;
  }
}
 
/* ================================================
   RESPONSIVE — SHARED
   ================================================ */
@media (max-width: 768px) {
  .cs-meta {
    grid-template-columns: repeat(2, 1fr);
    justify-content: unset;
    gap: 16px 32px;
  }
}

@media (max-width: 600px) {
  .about-page {
    padding: 0 20px 40px;
  }

  .nav {
    padding: 24px 20px 0;
  }

  .about-heading {
    font-size: clamp(52px, 18vw, 100px);
  }

  .about-photo {
    aspect-ratio: 4 / 2.5;
  }

  .footer {
    padding: 0 20px 40px;
    flex-wrap: wrap;
    gap: 8px;
  }
}
 
@media (max-width: 300px) {
  .about-bio-col3 p,
  .about-col4 p {
    font-size: 12px;
    line-height: 1.6;
  }
 
  .about-contact a {
    font-size: 12px;
  }
}
/* ================================================
   PASSWORD GATE
   ================================================ */
.gate-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
 
.gate {
  width: 100%;
  max-width: 400px;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
 
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
 
.gate-heading {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: rgba(0, 0, 0, 0.9);
  margin-bottom: 32px;
}
 
.gate .field { margin-bottom: 1rem; }
 
.gate .field label {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 8px;
}
 
.input-wrap { position: relative; display: flex; align-items: center; }
 
.gate .field input {
  width: 100%;
  background: transparent;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  color: rgba(0, 0, 0, 0.9);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 12px 40px 12px 14px;
  outline: none;
  transition: border-color 0.2s;
}
 
.gate .field input::placeholder { color: rgba(0, 0, 0, 0.2); }
.gate .field input:focus   { border-color: rgba(0, 0, 0, 0.5); }
.gate .field input.error   { border-color: rgba(180, 40, 40, 0.6); }
.gate .field input.success { border-color: rgba(40, 140, 80, 0.6); }
 
.toggle-vis {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.toggle-vis:hover { color: rgba(0, 0, 0, 0.7); }
 
.error-msg {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 40, 40, 0.9);
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.error-msg.visible { opacity: 1; }
 
.attempts {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s;
}
.attempts.visible { opacity: 1; }
 
.gate .btn {
  margin-top: 12px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.9);
  border: none;
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}
.gate .btn:hover  { opacity: 0.6; }
.gate .btn:active { opacity: 0.4; }
.gate .btn.loading { pointer-events: none; opacity: 0.4; }
 
.success-banner {
  display: none;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(40, 140, 80, 0.9);
  margin-top: 16px;
}
.gate.unlocked .success-banner { display: block; }
 
.hint {
  margin-top: 32px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
}
.hint a {
  color: rgba(0, 0, 0, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hint a:hover { opacity: 0.5; }
 
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
 
@media (max-width: 600px) {
  .gate-page { padding: 40px 20px; }
}