/* ── PROJECT PAGE — full-width gallery + side panel ── */

/* ── OVERVIEW TAB (fixed right edge) ── */
.ov-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;
  background: var(--color-navy);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 12px;
  border-radius: 12px 0 0 12px;
  transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.2s;
}
.ov-tab:hover { background: #021e3a; }

.ov-tab__label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.ov-tab__arrow {
  transition: transform 0.35s ease;
}
.ov-tab.is-open {
  right: 440px;
}
.ov-tab.is-open .ov-tab__arrow {
  transform: rotate(180deg);
}

/* ── OVERVIEW PANEL ── */
.ov-panel {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  height: 100vh;
  background: #fff;
  z-index: 290;
  box-shadow: -4px 0 48px rgba(0,0,0,0.12);
  overflow-y: auto;
  transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.ov-panel.is-open {
  right: 0;
}

.ov-panel__close {
  position: sticky;
  top: 0;
  left: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 24px 24px 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
  z-index: 1;
}
.ov-panel__close:hover { color: var(--color-text); }

.ov-panel__inner {
  padding: 0 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* back link inside panel */
.ov-back {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #aaa;
  transition: color 0.2s;
  display: inline-block;
}
.ov-back:hover { color: var(--color-text); }

/* tag */
.ov-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--color-navy);
  border: 1px solid var(--color-navy);
  border-radius: 100px;
  padding: 4px 12px;
}

/* project name */
.ov-name {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--color-navy);
  line-height: 1;
}

/* meta rows */
.ov-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid #ebebeb;
  border-bottom: 1px solid #ebebeb;
}
.ov-meta__row {
  display: flex;
  justify-content: space-between;
}
.ov-meta__row span:first-child {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #aaa;
  letter-spacing: 0.04em;
}
.ov-meta__row span:last-child {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}

/* content blocks */
.ov-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ov-block__label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbb;
}
.ov-block__sublabel {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.ov-block__text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text);
}

/* numbered design decisions */
.ov-decisions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
  margin: 0;
}

.ov-decisions li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ov-decisions__num {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-navy);
  flex-shrink: 0;
  padding-top: 2px;
}

.ov-decisions__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.ov-decisions__body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.7;
  color: #666;
}

/* ── DIM OVERLAY ── */
.ov-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 280;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.ov-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── GALLERY ── */
.pg-gallery {
  padding-top: 0; /* nav is transparent + fixed — images go full bleed to top */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── HERO IMAGE WITH OVERLAID TITLE ── */
.pg-hero {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  flex-shrink: 0;
}

.pg-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.pg-back {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #999;
  transition: color 0.2s;
}
.pg-back:hover { color: var(--color-text); }

/* images */
.pg-img {
  margin: 0;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.pg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.6s ease;
}
.pg-img:hover img {
  transform: scale(1.02);
}

.pg-img--tall  { aspect-ratio: 4 / 3; }
.pg-img--wide  { aspect-ratio: 21 / 9; }
.pg-img        { aspect-ratio: 16 / 10; } /* default */

/* video — not full bleed, 40px margin each side */
.pg-img--video {
  margin: 0 40px;
  width: calc(100% - 80px);
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
}
.pg-img--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* two images side by side */
.pg-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pg-duo .pg-img { aspect-ratio: 3 / 4; }

/* next project */
.pg-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 40px;
  border-top: 1px solid #ebebeb;
  margin-top: 40px;
}
.pg-next span {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbb;
}
.pg-next a {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 56px);
  color: var(--color-navy);
  transition: letter-spacing 0.4s ease;
}
.pg-next a:hover { letter-spacing: 0.04em; }

@media (max-width: 768px) {
  .ov-panel { right: -100%; width: 100%; height: 100dvh; z-index: 310; overscroll-behavior: contain; }
  .ov-panel.is-open { right: 0; }
  .ov-tab { top: auto; bottom: 20px; right: 16px; transform: none; flex-direction: row; padding: 14px 18px; border-radius: 100px; min-height: 48px; }
  .ov-tab__label { writing-mode: horizontal-tb; transform: none; font-size: 12px; }
  .ov-tab.is-open { right: 16px; visibility: hidden; }
  .ov-panel__close { width: 44px; height: 44px; margin: 12px 16px 0 auto; background: white; color: var(--color-navy); border-radius: 50%; }
  .ov-panel__inner { padding: 0 20px 40px; gap: 24px; }
  .ov-name { font-size: clamp(30px, 9vw, 48px); overflow-wrap: anywhere; }
  .ov-meta__row { gap: 16px; align-items: baseline; }
  .ov-meta__row span:last-child { text-align: right; max-width: 68%; overflow-wrap: anywhere; }
  .pg-gallery { padding-top: var(--nav-height); gap: 12px; }
  .pg-hero { height: auto; }
  .pg-hero img { height: auto; object-fit: contain; }
  .pg-img, .pg-duo .pg-img { aspect-ratio: auto; }
  .pg-img img { height: auto; object-fit: contain; }
  .pg-duo { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pg-img--video { width: calc(100% - 32px); margin: 0 16px; border-radius: 10px; aspect-ratio: 16 / 9; }
  .pg-next { padding: 32px 20px 96px; margin-top: 12px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .pg-next a { font-size: clamp(26px, 7vw, 48px); overflow-wrap: anywhere; }
}

/* Essential context is readable before opening the full case study. */
.case-intro { padding: calc(var(--nav-height) + 72px) 40px 56px; max-width: 1440px; width: 100%; margin: 0 auto; }
.case-back { color: #515d7a; margin-bottom: 24px; }
.case-intro h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 80px); line-height: 1.15; color: var(--color-navy); margin: 12px 0 24px; overflow-wrap: anywhere; }
.case-intro__lead { max-width: 850px; font-size: clamp(24px, 3vw, 40px); line-height: 1.25; letter-spacing: -.025em; margin-bottom: 20px; }
.case-intro__description { max-width: 760px; font-size: 17px; line-height: 1.7; color: #515d7a; }
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; margin: 40px 0 32px; padding: 24px 0; border-block: 1px solid #dce1eb; }
.case-meta dt { font-size: 12px; color: #515d7a; margin-bottom: 8px; }
.case-meta dd { font-size: 15px; line-height: 1.5; }
.case-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 32px; }
.case-summary h2 { font-size: 14px; margin-bottom: 12px; color: var(--color-navy); }
.case-summary p { font-size: 15px; line-height: 1.65; color: #515d7a; }
.pg-hero { height: auto; }
.pg-hero img { height: auto; }
.case-comparison { background: #f5f6fa; padding: 56px 40px; }
.case-comparison > h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.2; margin: 12px 0 28px; letter-spacing: -.02em; color: var(--color-navy); }
.case-comparison__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.case-comparison__grid > div { padding: 28px; background: white; border: 1px solid #dce1eb; border-radius: 16px; }
.case-comparison__grid > div:last-child { border-color: #6b7fd7; }
.case-comparison h3 { color: var(--color-navy); font-size: 15px; margin-bottom: 12px; }
.case-comparison p { font-size: 16px; line-height: 1.7; }
.case-comparison .case-evidence { max-width: 850px; font-size: 13px; color: #515d7a; margin-top: 24px; }
.pg-img--video { aspect-ratio: auto; margin-block: 24px; overflow: visible; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #eef0f7; }
.walkthrough-play { position: absolute; bottom: 20px; left: 20px; border: 1px solid white; background: var(--color-navy); color: white; border-radius: 100px; padding: 14px 20px; min-height: 48px; cursor: pointer; font: inherit; font-size: 14px; }
.walkthrough-play[hidden] { display: none; }
.pg-img--video figcaption { font-size: 13px; line-height: 1.6; color: #515d7a; padding-top: 12px; }
.case-contact { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px 40px 0; }
.case-contact p { color: #515d7a; font-size: 16px; }
@media (max-width: 768px) {
  .case-intro { padding: 32px 20px; }
  .case-back { margin-bottom: 16px; }
  .case-meta { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 28px; }
  .case-summary { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .case-intro__description { font-size: 16px; }
  .case-comparison { padding: 32px 20px; }
  .case-comparison__grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .case-comparison__grid > div { padding: 24px; }
  .walkthrough-play { bottom: 12px; left: 12px; padding: 12px 16px; }
  .case-contact { padding: 24px 20px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
}
.case-actions { margin-top: 20px; }
.pg-img { aspect-ratio: auto; }
.pg-img img { height: auto; }
.pg-duo { align-items: start; }
.pg-duo .pg-img { aspect-ratio: auto; }

/* The full story is a normal reading action, leaving mobile text unobscured. */
.case-intro .ov-tab { position: static; transform: none; flex-direction: row; padding: 14px 20px; gap: 12px; min-height: 48px; width: fit-content; border-radius: 100px; margin-top: 28px; visibility: visible; }
.case-intro .ov-tab__label { writing-mode: horizontal-tb; transform: none; font-size: 12px; letter-spacing: .08em; }
.pg-img--video video { object-fit: contain; }
