/* ══════════════════════════════════════════════════
   Case Study Components
   Shared across all project pages.
   Loaded after style.css — overrides base spacing.
   ══════════════════════════════════════════════════ */

/* ── Prevent horizontal scroll on mobile ── */
body {
  overflow-x: hidden;
}

/* ── Site navigation (fixed, black pill) ── */
.site-nav {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  font-family: "Apercu Light", sans-serif;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
  background: #111;
  padding: 14px 28px;
  border-radius: 100px;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.645, 0.045, 0.355, 1) 900ms,
              transform 900ms cubic-bezier(0.645, 0.045, 0.355, 1) 900ms;
}
body.loaded:not(.loading) .site-nav {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.site-nav a {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  text-decoration: none;
  transition: opacity 200ms ease;
  line-height: 1;
  display: block;
  white-space: nowrap;
}
.site-nav a:hover {
  opacity: 0.5;
}
@media (max-width: 1024px) {
  .site-nav {
    top: 28px;
    gap: 24px;
    padding: 12px 24px;
  }
  .site-nav a {
    font-size: 12px;
  }
}
@media (max-width: 767px) {
  .site-nav {
    top: 16px;
    left: 16px;
    right: 16px;
    transform: translateY(20px);
    width: auto;
    gap: 20px;
    padding: 12px 24px;
    justify-content: space-between;
  }
  body.loaded:not(.loading) .site-nav {
    transform: translateY(0);
  }
  .site-nav a {
    font-size: 13px;
    letter-spacing: 1.5px;
  }
  .site-nav a:nth-child(2),
  .site-nav a:nth-child(3) {
    margin-left: auto;
  }
  .site-nav a:nth-child(2) {
    margin-right: 0;
  }
}

/* ── Spacing overrides ── */
#container p {
  margin: 24px 0;
}
#container p:nth-of-type(1) {
  margin-top: 24px;
}
#container h2 {
  margin: 60px 0 24px;
}
#container h1 {
  max-width: 780px;
  margin-bottom: 40px;
  background: none !important;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #111;
}

/* ── Case study videos ── */
#content video {
  display: block;
}

/* ── Bordered media (benchmark GIFs etc.) ── */
.bordered {
  border: 1px solid #e8e8e8;
}

/* ── Glance (metadata grid) ── */
.glance {
  max-width: 780px;
  margin: 0 0 20px;
}
.glance dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  margin: 0;
}
.glance dt,
.glance dd {
  padding: 18px 0;
  font-family: "Apercu Light", sans-serif;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}
.glance dt:last-of-type,
.glance dd:last-of-type {
  border-bottom: none;
}
.glance dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
}
.glance dd {
  font-size: clamp(15px, 1.1vw, 17px);
  color: #111;
  padding-left: 20px;
  line-height: 1.5;
}
@media (max-width: 600px) {
  .glance {
    margin-bottom: 40px;
  }
  
  .glance dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .glance dt,
  .glance dd {
    border-bottom: none;
    padding: 0;
  }
  
  .glance dt {
    margin-bottom: 4px;
    font-size: 10px;
  }
  
  .glance dd {
    padding-left: 0;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
  }
  
  .glance dd:last-of-type {
    margin-bottom: 0;
  }
}

/* ── Layers (clean list, no borders) ── */
.layers {
  max-width: 780px;
  margin: 0;
  padding: 0;
}
.layers li,
.layers li:nth-of-type(2),
.layers li:nth-of-type(3) {
  display: block  !important;
  width:   100%   !important;
  float:   none   !important;
  list-style: none !important;
  padding: 20px 0;
  font-size: clamp(18px, 1.5vw, 22px);
  font-family: "Apercu Light", sans-serif;
  line-height: 1.7;
  color: #666;
  margin: 0;
}
.layers li strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 8px;
  font-weight: normal;
}

/* ── Levels (numbered list, no borders) ── */
.levels {
  max-width: 780px;
  margin: 0;
  padding: 0;
  counter-reset: level;
}
.levels li,
.levels li:nth-of-type(2),
.levels li:nth-of-type(3) {
  display: block  !important;
  width:   100%   !important;
  float:   none   !important;
  list-style: none !important;
  counter-increment: level;
  padding: 20px 0 20px 64px;
  font-size: clamp(18px, 1.5vw, 22px);
  font-family: "Apercu Light", sans-serif;
  line-height: 1.7;
  color: #666;
  position: relative;
  margin: 0;
}
.levels li::before {
  content: "0" counter(level);
  position: absolute;
  left: 0;
  top: 24px;
  font-size: 14px;
  letter-spacing: 2px;
  color: #bbb;
  font-family: "Apercu Light", sans-serif;
}
.levels li strong {
  display: block;
  font-size: clamp(18px, 1.4vw, 22px);
  color: #111;
  margin-bottom: 8px;
  font-weight: normal;
  letter-spacing: -0.01em;
}
.levels li strong:only-child {
  color: #666;
}

/* ── Decision number prefix ── */
.n {
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #bbb;
  margin-bottom: 12px;
}

/* ── Pull quote ── */
.pullquote {
  max-width: 780px;
  margin: 40px 0;
  padding: 0;
  font-size: clamp(22px, 2.2vw, 34px);
  font-family: "Apercu Light", sans-serif;
  line-height: 1.35;
  letter-spacing: -0.025em;
  color: #111;
}

/* ── Visual placeholder ── */
.visual {
  background: #f7f7f7;
  border: 1px dashed #ccc;
  padding: 80px 40px;
  box-sizing: border-box;
  text-align: center;
  font-family: "Apercu Light", sans-serif;
  margin: 40px 0;
}
.visual.fullbleed {
  width: calc(100% + 160px);
  margin-left: -80px;
}
.visual span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #bbb;
  margin-bottom: 10px;
}
.visual p {
  font-size: 14px !important;
  color: #999 !important;
  margin: 0 !important;
  max-width: none !important;
  line-height: 1.5 !important;
}

/* ── Carousel images ── */
.owl-carousel img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* ── Zoomable images ── */
.zoom-img {
  cursor: zoom-in;
}

/* ── Project navigation (footer) ──
   Specificity: #container prefix to beat base style.css rules
   that set #container a { display: inline-block } and
   #container a span { display: block; height: 2px; background: #111 }
   ── */
#container .project-nav {
  margin-top: 120px;
  padding: 0;
  font-family: "Apercu Light", sans-serif;
}
#container .project-nav a {
  display: flex;
  align-items: baseline;
  gap: 40px;
  padding: 36px 0;
  border-bottom: 1px solid #e0e0e0;
  text-decoration: none;
  transition: opacity 200ms ease;
  position: relative;
}
#container .project-nav a:first-child {
  border-top: 1px solid #e0e0e0;
}
#container .project-nav a:hover {
  opacity: 0.5;
}
/* Override base #container a span underline effect */
#container .project-nav a .nav-name,
#container .project-nav a .nav-desc {
  position: static;
  display: block;
  width: auto;
  height: auto;
  background: transparent;
  z-index: auto;
  bottom: auto;
}
#container .project-nav a .nav-name {
  font-size: clamp(22px, 2.5vw, 32px);
  color: #FF5A33;
  letter-spacing: -0.02em;
  flex: 0 0 38%;
  line-height: 1.2;
  -webkit-text-fill-color: #FF5A33;
}
#container .project-nav a .nav-desc {
  font-size: clamp(14px, 1.1vw, 17px);
  color: #999;
  line-height: 1.5;
  flex: 1;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  #container {
    padding-top: 100px;
  }
  .visual.fullbleed {
    width: calc(100% + 120px);
    margin-left: -60px;
  }
}
@media (max-width: 767px) {
  #container {
    padding-top: 100px;
  }
  #container h2 {
    margin: 40px 0 16px;
  }
  #container h1 {
    margin-bottom: 24px;
  }
  .pullquote {
    margin: 24px 0;
    font-size: 18px;
    font-family: "Apercu Medium", sans-serif;
    line-height: 1.7;
    letter-spacing: 0;
  }
  .visual {
    margin: 32px 0;
  }
  .visual.fullbleed {
    width: 100%;
    margin-left: 0;
  }
  .pullquote {
    font-size: clamp(18px, 4vw, 24px);
  }
  .levels li,
  .levels li:nth-of-type(2),
  .levels li:nth-of-type(3) {
    padding-left: 0;
    padding-top: 40px;
  }
  .levels li::before {
    position: absolute;
    left: 0;
    top: 0;
  }
  #container .project-nav a {
    flex-direction: column;
    gap: 8px;
    padding: 28px 0;
  }
  #container .project-nav a .nav-name {
    font-size: clamp(28px, 7vw, 36px);
  }
}

/* ── Product toggle ── */
.product-toggle {
  max-width: 780px;
  margin: 32px 0 48px;
}

/* ── Product visual images ── */
.product-visual img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

.toggle-controls {
  display: inline-flex;
  gap: 0;
  margin-bottom: 48px;
  border: 1px solid #e0e0e0;
  border-radius: 100px;
  padding: 2px;
  background: #fff;
  position: relative;
}

.toggle-slider {
  position: absolute;
  background: #111;
  border-radius: 100px;
  transition: all 400ms cubic-bezier(0.645, 0.045, 0.355, 1);
  pointer-events: none;
  z-index: 0;
  top: 2px;
  left: 2px;
}

.toggle-btn {
  background: transparent;
  border: none;
  font-family: "Apercu Light", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #111;
  cursor: pointer;
  transition: color 300ms cubic-bezier(0.645, 0.045, 0.355, 1);
  padding: 10px 24px;
  border-radius: 100px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.toggle-btn.active {
  color: #fff;
}

.toggle-btn:not(.active):hover {
  opacity: 0.5;
}

.product-content-wrapper {
  position: relative;
}

.product-content {
  display: none;
}

.product-content.active {
  display: block;
  animation: fadeIn 400ms cubic-bezier(0.645, 0.045, 0.355, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-description {
  margin-bottom: 40px;
}

.product-description p {
  font-size: clamp(16px, 1.2vw, 18px);
  font-family: "Apercu Light", sans-serif;
  line-height: 1.65;
  color: #111;
  margin: 0 !important;
}

.product-visual {
  width: calc(100% + 160px);
  margin-left: -80px;
  box-sizing: border-box;
}

.product-visual img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 1024px) {
  .product-visual {
    width: calc(100% + 120px);
    margin-left: -60px;
  }
}

@media (max-width: 1024px) {
  .toggle-btn {
    font-size: 10px;
    padding: 10px 18px;
    letter-spacing: 1.8px;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .product-toggle {
    overflow-x: visible;
  }
  
  .toggle-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 16px;
  }
  
  .toggle-slider {
    border-radius: 14px;
  }
  
  .toggle-btn {
    font-size: 10px;
    padding: 14px 20px;
    letter-spacing: 1.8px;
    width: 100%;
    text-align: center;
    border-radius: 14px;
  }
  
  .product-visual {
    width: 100%;
    margin-left: 0;
  }
  
  .product-description p {
    font-size: 15px !important;
  }
}


/* ── Architecture fade effect ── */
.architecture-fade {
  position: relative;
  width: calc(100% + 160px);
  margin-left: -80px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.architecture-fade img {
  width: 100%;
  height: auto;
  display: block;
  grid-column: 1;
  grid-row: 1;
}

.architecture-base {
  z-index: 1;
}

.architecture-overlay {
  z-index: 2;
  animation: fadeInOut 8s ease-in-out infinite;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  3% { opacity: 1; }
  47% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 0; }
}

@media (max-width: 1024px) {
  .architecture-fade {
    width: calc(100% + 120px);
    margin-left: -60px;
  }
}

@media (max-width: 767px) {
  .architecture-fade {
    width: 100%;
    margin-left: 0;
  }
}
