/* ═══════════════════════════════════════════════
   JONIEL DA SILVA — BAUHAUS MODERNIST
   Case Study Page
   ═══════════════════════════════════════════════ */

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:      #000000;
  --white:      #FFFFFF;
  --light-bg:   #F5F5F5;
  --gray-mid:   #666666;
  --gray-light: #999999;
  --accent:     #D32F2F;

  --futura: 'Futura', 'Century Gothic', 'Avenir Next', 'Trebuchet MS', sans-serif;

  --unit: 8px;
  --grid-gap: calc(var(--unit) * 3);
  --nav-h: 80px;
}

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

body {
  font-family: var(--futura);
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  text-transform: uppercase;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--grid-gap);
}
.nav-logo {
  font-family: var(--futura);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--black);
  display: flex;
  align-items: center;
}
.nav-logo img {
  display: block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-right: 10px;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: calc(var(--unit) * 5);
  justify-content: center;
}
.nav-links a {
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-mid);
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--accent);
}
.nav-cta {
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--black);
  padding: calc(var(--unit) * 2) calc(var(--unit) * 4);
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--white);
}
.nav-toggle {
  display: none;
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--black);
  color: var(--white);
  border: none;
  padding: calc(var(--unit) * 2) calc(var(--unit) * 3);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-toggle:hover {
  background: var(--accent);
  color: var(--white);
}

/* Mobile overlay menu */
.nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: var(--white);
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}
.nav-overlay.active {
  transform: translateX(0);
}
.nav-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}
.nav-overlay-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.nav-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--unit) * 3) var(--grid-gap);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.nav-overlay-close {
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--black);
  color: var(--white);
  border: none;
  padding: calc(var(--unit) * 2) calc(var(--unit) * 3);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-overlay-close:hover {
  background: var(--accent);
  color: var(--white);
}
.nav-overlay-links {
  list-style: none;
  padding: calc(var(--unit) * 6) var(--grid-gap);
}
.nav-overlay-links li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.nav-overlay-links a {
  display: block;
  font-family: var(--futura);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--black);
  padding: calc(var(--unit) * 3) 0;
  transition: color 0.2s, padding-left 0.2s;
}
.nav-overlay-links a:hover {
  color: var(--accent);
  padding-left: calc(var(--unit) * 2);
}
.nav-overlay-cta {
  margin: 0 var(--grid-gap) calc(var(--unit) * 4);
}
.nav-overlay-cta a {
  display: block;
  text-align: center;
  font-family: var(--futura);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: var(--black);
  padding: calc(var(--unit) * 3) calc(var(--unit) * 4);
  transition: background 0.2s, color 0.2s;
}
.nav-overlay-cta a:hover {
  background: var(--accent);
  color: var(--white);
}

/* ─── CASE STUDY HERO ─── */
.case-hero {
  padding-top: calc(var(--nav-h) + calc(var(--unit) * 8));
  padding-bottom: calc(var(--unit) * 8);
  background: var(--white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.case-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
}
.back-link {
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-mid);
  display: inline-flex;
  align-items: center;
  gap: calc(var(--unit));
  margin-bottom: calc(var(--unit) * 4);
  transition: color 0.2s, gap 0.2s;
}
.back-link::before {
  content: '←';
  font-size: 1.125rem;
}
.back-link:hover {
  color: var(--accent);
  gap: calc(var(--unit) * 2);
}
.case-sector {
  font-family: var(--futura);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gray-mid);
  margin-bottom: calc(var(--unit) * 3);
}
.case-hero h1 {
  font-family: var(--futura);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--black);
  max-width: 900px;
}

/* ─── CASE IMAGE ─── */
.case-image-section {
  background: var(--white);
  padding: calc(var(--unit) * 6) 0;
}
.case-image-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
}
.case-image-inner img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #E0E0E0;
}

/* ─── META FIELDS ─── */
.meta-section {
  padding: calc(var(--unit) * 10) 0;
  background: var(--light-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.meta-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.meta-item {
  background: var(--white);
  padding: calc(var(--unit) * 4);
}
.meta-label {
  font-family: var(--futura);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  margin-bottom: calc(var(--unit) * 2);
}
.meta-value {
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.4;
}

/* ─── CONTENT SECTION ─── */
.content-section {
  padding: calc(var(--unit) * 12) 0;
  background: var(--white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.content-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: calc(var(--unit) * 10);
}
.content-label {
  font-family: var(--futura);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gray-light);
}
.content-main h2 {
  font-family: var(--futura);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--black);
  margin-bottom: calc(var(--unit) * 5);
  max-width: 700px;
}
.content-main p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-mid);
  margin-bottom: calc(var(--unit) * 3);
  max-width: 700px;
  text-transform: none;
}
.content-main p em {
  font-style: italic;
}
.content-main p strong {
  font-weight: 600;
  color: var(--black);
}

/* ─── QUOTE ─── */
.quote-section {
  padding: calc(var(--unit) * 12) 0;
  background: var(--light-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.quote-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
  text-align: center;
}
.quote-text {
  font-family: var(--futura);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--black);
}
.quote-text::before {
  content: '\201C';
}
.quote-text::after {
  content: '\201D';
}
.quote-attribution {
  margin-top: calc(var(--unit) * 3);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
}

/* ─── RESULTS ─── */
.results-section {
  padding: calc(var(--unit) * 12) 0;
  background: var(--white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.results-header {
  max-width: 1280px;
  margin: 0 auto calc(var(--unit) * 8);
  padding: 0 var(--grid-gap);
}
.results-label {
  font-family: var(--futura);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gray-light);
  margin-bottom: calc(var(--unit) * 3);
}
.results-header h2 {
  font-family: var(--futura);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--black);
}
.results-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.result-card {
  background: var(--light-bg);
  padding: calc(var(--unit) * 6);
  text-align: center;
}
.result-number {
  font-family: var(--futura);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin-bottom: calc(var(--unit) * 3);
}
.result-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--gray-mid);
  text-transform: none;
}

/* ─── PROJECT NAV ─── */
.project-nav {
  padding: calc(var(--unit) * 8) 0;
  background: var(--light-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.project-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--unit) * 4);
}
.project-nav-link {
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-mid);
  display: inline-flex;
  align-items: center;
  gap: calc(var(--unit));
  transition: color 0.2s, gap 0.2s;
}
.project-nav-prev::before {
  content: '←';
  font-size: 1.125rem;
}
.project-nav-next::after {
  content: '→';
  font-size: 1.125rem;
}
.project-nav-link:hover {
  color: var(--accent);
}
.project-nav-prev:hover {
  gap: calc(var(--unit) * 2);
}
.project-nav-next:hover {
  gap: calc(var(--unit) * 2);
}
.project-nav-disabled {
  color: rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* ─── CTA SECTION ─── */
.cta-section {
  background: var(--accent);
  color: var(--white);
  padding: calc(var(--unit) * 15) var(--grid-gap);
  text-align: center;
}
.cta-label {
  font-family: var(--futura);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: calc(var(--unit) * 3);
}
.cta-section h2 {
  font-family: var(--futura);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--white);
  margin: 0 auto calc(var(--unit) * 6);
  max-width: 800px;
}
.btn-white {
  display: inline-block;
  font-family: var(--futura);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--white);
  padding: calc(var(--unit) * 2.5) calc(var(--unit) * 5);
  transition: background 0.2s, color 0.2s;
}
.btn-white:hover {
  background: var(--black);
  color: var(--white);
}

/* ─── FOOTER ─── */
.footer {
  background: var(--white);
  padding: calc(var(--unit) * 4) var(--grid-gap);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-logo {
  font-family: var(--futura);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  color: var(--black);
  display: flex;
  align-items: center;
}
.footer-logo img {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-right: 8px;
}
.footer-links {
  display: flex;
  gap: calc(var(--unit) * 3);
  align-items: center;
}
.footer-links a {
  font-size: 0.75rem;
  color: var(--gray-mid);
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--gray-mid);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .content-inner {
    grid-template-columns: 1fr;
    gap: calc(var(--unit) * 4);
  }
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }

  .nav-inner {
    grid-template-columns: 1fr auto;
  }
  .nav-links {
    display: none;
  }
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: block;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .project-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-inner {
    flex-direction: column;
    gap: calc(var(--unit) * 2);
    text-align: center;
  }
}

/* ─── CASE GALLERY ─── */
.case-gallery {
  padding: calc(var(--unit) * 2) 0;
  background: var(--white);
}
.case-gallery-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--grid-gap);
}

/* Full-width single image */
.case-gallery-full img,
.case-gallery-full .case-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Two-column asymmetric: large left + tall right */
.case-gallery-duo {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: calc(var(--unit) * 2);
}
.case-gallery-duo img,
.case-gallery-duo .case-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-gallery-duo img:first-child,
.case-gallery-duo .case-placeholder:first-child {
  aspect-ratio: 4 / 3;
}
.case-gallery-duo img:last-child,
.case-gallery-duo .case-placeholder:last-child {
  aspect-ratio: 3 / 4;
}

/* Two-column asymmetric reversed: tall left + large right */
.case-gallery-duo-reverse {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: calc(var(--unit) * 2);
}
.case-gallery-duo-reverse img,
.case-gallery-duo-reverse .case-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-gallery-duo-reverse img:first-child,
.case-gallery-duo-reverse .case-placeholder:first-child {
  aspect-ratio: 3 / 4;
}
.case-gallery-duo-reverse img:last-child,
.case-gallery-duo-reverse .case-placeholder:last-child {
  aspect-ratio: 4 / 3;
}

/* Full-width top + two-column bottom */
.case-gallery-trio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--unit) * 2);
}
.case-gallery-trio img,
.case-gallery-trio .case-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 4;
}
.case-gallery-trio img:first-child,
.case-gallery-trio .case-placeholder:first-child {
  aspect-ratio: 16 / 9;
  grid-column: 1 / -1;
}

/* Placeholder block */
.case-placeholder {
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.case-placeholder-label {
  font-family: var(--futura);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  padding: calc(var(--unit) * 2);
  line-height: 1.5;
}

/* Cinematic full-width (21:9) */
.case-gallery-cinema img,
.case-gallery-cinema .case-placeholder {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

/* Three equal columns */
.case-gallery-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: calc(var(--unit) * 2);
}
.case-gallery-three img,
.case-gallery-three .case-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* Sidebar: large portrait left + two stacked landscape right */
.case-gallery-sidebar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: calc(var(--unit) * 2);
}
.case-gallery-sidebar img:first-child,
.case-gallery-sidebar .case-placeholder:first-child {
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-gallery-sidebar img:nth-child(2),
.case-gallery-sidebar .case-placeholder:nth-child(2),
.case-gallery-sidebar img:nth-child(3),
.case-gallery-sidebar .case-placeholder:nth-child(3) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Two equal square columns */
.case-gallery-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--unit) * 2);
}
.case-gallery-equal img,
.case-gallery-equal .case-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Gallery image (replaces placeholder when real images arrive) */
.case-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  /* Let real images show at natural proportions — prevents cropping of logos and brand visuals */
  .case-gallery img {
    height: auto !important;
    aspect-ratio: unset !important;
    object-fit: unset !important;
  }

  .case-gallery-duo {
    grid-template-columns: 1fr;
  }
  .case-gallery-duo img:first-child,
  .case-gallery-duo .case-placeholder:first-child,
  .case-gallery-duo img:last-child,
  .case-gallery-duo .case-placeholder:last-child {
    aspect-ratio: 16 / 10;
  }
  .case-gallery-duo-reverse {
    grid-template-columns: 1fr;
  }
  .case-gallery-duo-reverse img:first-child,
  .case-gallery-duo-reverse .case-placeholder:first-child,
  .case-gallery-duo-reverse img:last-child,
  .case-gallery-duo-reverse .case-placeholder:last-child {
    aspect-ratio: 16 / 10;
  }
  .case-gallery-trio {
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--unit) * 1.5);
  }
  .case-gallery-trio img:first-child,
  .case-gallery-trio .case-placeholder:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }
  .case-gallery-trio img,
  .case-gallery-trio .case-placeholder {
    aspect-ratio: 1 / 1;
  }
  .case-gallery-three {
    grid-template-columns: 1fr;
  }
  .case-gallery-three img,
  .case-gallery-three .case-placeholder {
    aspect-ratio: 4 / 3;
  }
  .case-gallery-sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .case-gallery-sidebar img:first-child,
  .case-gallery-sidebar .case-placeholder:first-child {
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
  .case-gallery-sidebar img:nth-child(2),
  .case-gallery-sidebar .case-placeholder:nth-child(2),
  .case-gallery-sidebar img:nth-child(3),
  .case-gallery-sidebar .case-placeholder:nth-child(3) {
    aspect-ratio: 16 / 10;
  }
  .case-gallery-equal {
    grid-template-columns: 1fr;
  }
  .case-gallery-equal img,
  .case-gallery-equal .case-placeholder {
    aspect-ratio: 4 / 3;
  }
}

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 900ms cubic-bezier(0.25, 1, 0.4, 1),
              transform 900ms cubic-bezier(0.25, 1, 0.4, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
