/* Case study pages (project-*.html). Per-project accent: html[data-case]. Light theme overrides live at the bottom of this file. */

.case-study-doc {
  --line: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.82);
  --mute: rgba(255, 255, 255, 0.48);
  --max: 1200px;
}

html[data-case="open-osi"] {
  --brand: #5b8fff;
}
html[data-case="enande"] {
  --brand: #5ec4b4;
}
html[data-case="dovgan-shop"] {
  --brand: #ff9f5b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: transparent;
  color: var(--text);
  font-family: "Cabinet Grotesk", system-ui, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}
a {
  color: var(--brand);
  text-underline-offset: 3px;
}
img {
  display: block;
  max-width: 100%;
}

#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--brand);
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

.cs-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--hd-h) + 32px) 32px 48px;
}
.cs-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
  margin-bottom: 16px;
}
.case-study-doc .cs-title {
  font-family: "Instrument Serif", serif;
  font-size: clamp(52px, 9vw, 110px);
  line-height: 0.9;
  font-weight: 400;
  color: #fff;
  margin-bottom: 24px;
}
html[data-case="open-osi"] .cs-title {
  font-size: clamp(60px, 10vw, 120px);
}
.cs-lede {
  font-size: clamp(17px, 2vw, 22px);
  color: rgba(255, 255, 255, 0.65);
  max-width: 760px;
  line-height: 1.55;
}
.cs-cover {
  margin: 36px 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.cs-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-meta {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--line);
}
.cs-meta__cell {
  padding: 20px 32px 20px 0;
  margin-right: 32px;
  border-right: 1px solid var(--line);
}
.cs-meta__cell:last-child {
  border-right: 0;
}
.cs-meta__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  margin-bottom: 5px;
}
.cs-meta__val {
  font-size: 15px;
  color: var(--text);
}

.cs-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 32px;
  border-top: 1px solid var(--line);
}
.cs-section-num {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.cs-h2 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
  font-weight: 400;
  color: #fff;
  margin-bottom: 20px;
}
.cs-h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
  margin: 36px 0 16px;
}
.cs-p {
  color: rgba(255, 255, 255, 0.68);
  max-width: 720px;
  margin-bottom: 14px;
}
.cs-pull {
  border-left: 2px solid var(--brand);
  padding-left: 22px;
  margin: 28px 0;
  font-style: italic;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 640px;
}
.cs-list {
  margin: 16px 0 24px;
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 720px;
}
.cs-list li {
  margin-bottom: 12px;
}
.cs-list strong {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.brand-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 28px;
}
.brand-logo-wrap {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-wrap img {
  width: 260px;
  height: 260px;
  object-fit: contain;
}
.swatches {
  display: flex;
  gap: 14px;
  margin: 20px 0;
}
.swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mute);
}
.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex-shrink: 0;
}

.g2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.g3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.g4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.polls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.poll {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.poll__title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
}
.poll__lede {
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 16px;
}
.poll-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.poll-row:last-child {
  margin-bottom: 0;
}
.poll-pct {
  font-family: "Instrument Serif", serif;
  font-size: 36px;
  line-height: 1;
  color: #fff;
  flex-shrink: 0;
  min-width: 64px;
}
.poll-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

.gphone {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.gphone::-webkit-scrollbar {
  height: 4px;
}
.gphone::-webkit-scrollbar-track {
  background: transparent;
}
.gphone::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.gphone .gi {
  flex: 0 0 220px;
  scroll-snap-align: start;
}

.gi {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
}
.gi__frame {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}
.gi__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}
.gi:hover .gi__frame img {
  transform: scale(1.02);
}
.gi__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.2));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.gi:hover .gi__frame::after {
  opacity: 1;
}
.gi__cap {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--mute);
}
.gi__zoom {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}
.gi:hover .gi__zoom {
  opacity: 1;
}

.ar-land .gi__frame {
  aspect-ratio: 4 / 3;
}
.ar-slide .gi__frame {
  aspect-ratio: 16 / 9;
}
.ar-phone .gi__frame {
  aspect-ratio: 9 / 19;
}
.ar-wide .gi__frame {
  aspect-ratio: 21 / 9;
}
.ar-sq .gi__frame {
  aspect-ratio: 1 / 1;
}
.ar-desk .gi__frame {
  aspect-ratio: 4 / 3;
}

.carousel-track .gi {
  flex: 0 0 min(320px, 85vw);
}
.carousel-track .gi.ar-slide {
  flex: 0 0 min(420px, 85vw);
}
.carousel-track .gi.ar-phone {
  flex: 0 0 min(200px, 50vw);
}
.carousel-track .gi.ar-wide {
  flex: 0 0 min(500px, 90vw);
}

html[data-case="dovgan-shop"] .carousel-track .gi {
  flex: 0 0 min(380px, 85vw);
}
html[data-case="dovgan-shop"] .carousel-track .gi.ar-phone {
  flex: 0 0 min(200px, 50vw);
}
html[data-case="dovgan-shop"] .carousel-track .gi.ar-desk {
  flex: 0 0 min(450px, 85vw);
}

.gi--mobile-full {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.gi--mobile-full .gi__frame {
  width: 300px;
  max-width: 100%;
  aspect-ratio: auto;
  height: auto;
}
.gi--mobile-full .gi__frame img {
  width: 300px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
}
.gi--mobile-full:hover .gi__frame img {
  transform: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin: 28px 0;
}
.stats--4 {
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  background: var(--bg);
  padding: 28px 24px;
}
.stat__n {
  font-family: "Instrument Serif", serif;
  font-size: 52px;
  line-height: 1;
  color: #fff;
}
.stat__l {
  font-size: 13px;
  color: var(--mute);
  margin-top: 6px;
}

.ba {
  margin: 28px 0 8px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  touch-action: none;
  user-select: none;
}
.ba__track {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0a0f12;
  --ba-pct: 50%;
  cursor: ew-resize;
}
.ba__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
}
.ba__img--before {
  clip-path: inset(0 calc(100% - var(--ba-pct, 50%)) 0 0);
}
.ba__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-pct, 50%);
  transform: translateX(-50%);
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 2;
}
.ba__handle {
  position: absolute;
  top: 50%;
  left: var(--ba-pct, 50%);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ba__knob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lb[hidden] {
  display: none;
}
.lb__inner {
  position: relative;
  max-width: min(1300px, 96vw);
  width: 100%;
}
.lb__img {
  max-height: 82vh;
  object-fit: contain;
  width: 100%;
  border-radius: 10px;
}
.lb__cap {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}
.lb__count {
  position: absolute;
  top: -36px;
  left: 0;
  font-size: 13px;
  color: var(--mute);
}
#lbX {
  top: 20px;
  right: 20px;
}
#lbPrev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}
#lbNext {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 980px) {
  .brand-split {
    grid-template-columns: 1fr;
  }
  .polls,
  .g3,
  .g4 {
    grid-template-columns: 1fr 1fr;
  }
  .stats:not(.stats--4) {
    grid-template-columns: 1fr 1fr;
  }
  .stats.stats--4 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .cs-hero,
  .cs-section,
  .cs-meta {
    padding-left: 20px;
    padding-right: 20px;
  }
  .polls,
  .g2,
  .g3,
  .g4 {
    grid-template-columns: 1fr;
  }
  .stats:not(.stats--4) {
    grid-template-columns: 1fr;
  }
  .stats.stats--4 {
    grid-template-columns: 1fr 1fr;
  }
  .cs-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding-bottom: 40px;
  }
  .cs-meta__cell {
    border-right: none !important;
    margin-right: 0;
    padding: 14px 12px 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .cs-meta__cell:last-child {
    border-bottom: none;
  }
  .cs-meta__cell:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .carousel-btn--prev {
    left: 4px;
  }
  .carousel-btn--next {
    right: 4px;
  }
}

.reveal-hd {
  opacity: 0;
  transform: translateY(52px);
  filter: blur(18px);
  will-change: opacity, transform, filter;
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1), transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.1s cubic-bezier(0.25, 1, 0.5, 1);
}
.reveal-hd.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal-hd {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* Light theme overrides for case-study pages. */
[data-theme="light"] {
  --bg: #ffffff;
  --line: rgba(0, 0, 0, .08);
  --text: rgba(10, 10, 10, .82);
  --mute: rgba(10, 10, 10, .48);
}

[data-theme="light"] body {
  background: #ffffff;
  color: rgba(10, 10, 10, .82);
}

[data-theme="light"] .cs-title,
[data-theme="light"] .cs-h2,
[data-theme="light"] .stat__n,
[data-theme="light"] .poll-pct {
  color: #0a0a0a;
}

[data-theme="light"] .cs-lede {
  color: rgba(10, 10, 10, 0.68);
}

[data-theme="light"] .cs-p,
[data-theme="light"] .poll-text,
[data-theme="light"] .cs-pull {
  color: rgba(10, 10, 10, 0.72);
}

[data-theme="light"] .cs-eyebrow,
[data-theme="light"] .cs-meta__label,
[data-theme="light"] .cs-h3,
[data-theme="light"] .stat__l,
[data-theme="light"] .poll__lede,
[data-theme="light"] .gi__cap {
  color: rgba(10, 10, 10, 0.48);
}

[data-theme="light"] .cs-meta__val {
  color: rgba(10, 10, 10, 0.88);
}

[data-theme="light"] .poll__title {
  color: rgba(10, 10, 10, 0.82);
}

[data-theme="light"] .cs-cover,
[data-theme="light"] .brand-logo-wrap,
[data-theme="light"] .gi__frame,
[data-theme="light"] .ba {
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .brand-logo-wrap {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .gi__frame {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .gi__frame img {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .carousel-track::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .carousel-track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .carousel-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #111;
}

[data-theme="light"] .carousel-btn:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .gphone::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .cs-list {
  color: rgba(10, 10, 10, 0.72);
}

[data-theme="light"] .cs-list strong {
  color: rgba(10, 10, 10, 0.9);
}
