/* Mori Fonts (for accents) */
@font-face {
  font-family: "Mori";
  font-weight: 400;
  src: url("/assets/MoriR.woff2") format("woff2"),
    url("/assets/MoriR-Regular.woff") format("woff"),
    url("/assets/MoriR.ttf") format("truetype");
  font-display: swap;
}

/* -------------------------------
   RESET + BASE
-------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  background: #fbfbf9;
  color: #080812;
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------
   LAYOUT
-------------------------------- */

.case-study {
  max-width: 860px;
  margin-inline: auto;
  padding: 2rem;
}

section {
  margin-bottom: 3rem;
}

.subsection {
  margin-top: 1.5rem;
}

.case-study p,
.case-study ul,
.case-study ol {
  max-width: 70ch; /* paragraphs now fill the container */
}

.case-study ul {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.subsection a {
  color: inherit;
  transition: opacity 0.2s ease;
}

.subsection a:hover {
  opacity: 0.65;
}

@media (max-width: 800px) {
  .case-study ul {
    margin-left: 0;
    margin-right: 0;
  }
}

/* -------------------------------
   TYPOGRAPHY
-------------------------------- */

/* Headings — System UI for clarity and consistency */
h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.005em;
}

/* H1 — Case Study Title */
h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

/* H2 — Section Titles */
h2 {
  font-size: 1.9rem;
  margin-top: 3rem; /* was 2.5rem */
  margin-bottom: 1.25rem; /* a little more breathing room */
}

h3 {
  font-size: 1.4rem;
  margin-top: 2.25rem; /* was 1.75rem */
  margin-bottom: 1rem;
}

section > h2:first-child {
  margin-top: 0;
}

/* Body Text */
p,
ul,
ol {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  /* max-width: 65ch; */
}

/* Lists */
ul,
ol {
  padding-left: 1.25rem;
  list-style-type: disc;
}

li {
  margin-bottom: 0.5rem;
}

/* Small text / captions */
small {
  font-size: 0.875rem;
  color: #5a5a5f;
}

/* -------------------------------
   INTRO / HERO SECTION
-------------------------------- */

.intro-bg {
  /* background: #f3f3f1; */
  width: 100%;
  /* border-bottom: 1px solid #d0d0d0; */
}

.intro {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem;
}

.external-link {
  color: inherit; /* keep same color as text */
  text-decoration: underline; /* keep underline */
  text-underline-offset: 2px; /* slightly lower underline for style */
  transition: opacity 0.2s ease;
}

.external-link:hover {
  opacity: 0.7; /* subtle hover feedback */
}

/* .intro-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
} */

.intro-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Larger screens: display side by side */
@media (min-width: 768px) {
  .intro-meta {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgb(195, 195, 197);
  }

  .meta-item {
    flex: 1;
  }
}

.meta-label {
  font-family: "Mori", "Inter", "Helvetica Neue", sans-serif;

  text-transform: uppercase;
  letter-spacing: 0.04em;
  /* color: #3f3f42; */
  color: #080812;
  font-size: 0.9rem;
  line-height: 1.4;
  flex-shrink: 0;
  font-weight: 700;
}

.meta-content {
  font-family: "Mori", "Inter", "Helvetica Neue", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  /* color: #080812; */
  color: #474747;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-width: 45ch;
  font-weight: 400;
}

/* BODY */

.highlight-bg h3 {
  margin-top: 0;
}
.highlight-bg {
  /* background: #f3f3f1; */
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 2.5rem 0;
  /* border: 1px solid #d0d0d0;  */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  background: #fff; /* optional: keeps text crisp on any page background */
  border: 1px solid rgb(195, 195, 197);
}

.case-nav {
  margin-top: 7rem;
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.case-nav a {
  text-decoration: none;
  font-family: "Mori", "Inter", "Helvetica Neue", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #080812;
  border-bottom: 1px solid #080812;
  transition: opacity 0.2s ease;
}

.case-nav a:hover {
  opacity: 0.65;
}



/* Full-width before/after section */
.before-after-wide {
  /* width: 100vw; 
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw; */
  width: 100%;
  background: #11161b; /* matches your card background */
  padding: 3rem 0; /* space above and below */
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 5rem;
  margin-bottom: 5rem;

  border-radius: 1rem;
}

/* Inner frame now simplified */
.desktop-pair-wide {
  background: transparent; /* remove duplicate dark bg */
  border-radius: 0;
  box-shadow: none;
  display: flex;
  justify-content: center;
}

/* Images stretch wider */
.desktop-pair-wide img {
  width: 55vw; /* near full width */
  max-width: 620px; /* prevent over-expansion on huge screens */
  height: auto;
  border-radius: 1rem;
  object-fit: contain;
  background: #f8f8f8;
}

/* Captions */
.before-after-wide figcaption {
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 70ch;
  margin: 0 auto 1.25rem;
  text-align: center;
  color: #ddd; /* optional for contrast */
}

/* Mobile refinement */
@media (min-width: 1600px) {
  .desktop-pair-wide img {
    width: 50vw;
    max-width: 1000px;
  }
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .desktop-pair-wide {
    padding: 1.25rem 0.75rem;
  }

  .desktop-pair-wide img {
    width: 95vw;
    height: auto;
  }

  .case-nav a {
    max-width: 100px;
  }
}
@media (max-width: 700px) {
  .before-after-wide {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-radius: 0;      /* remove rounding for clean edge-to-edge bg */
    padding: 2rem 1rem;
  }

}


/* Main process card */

.home-screen {
  background: #11161b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-block: 1.5rem;
}

/* Center the figure and control image size */
.home-screen figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0; /* remove default figure margins */
}

/* Sketch image */
.home-screen figure img {
  width: 70%; /* smaller overall size */
  max-width: 520px; /* cap size on large screens */
  height: auto;
  border-radius: 0.5rem;
  object-fit: contain;
}

/* Main process card */

.process-card {
  background: #11161b;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-block: 1.5rem; /* slightly tighter spacing */
}

/* Sketch image */
.process-card figure img {
  width: 100%;
  /* max-width: 380px;  */
  height: auto;
  border-radius: 0.5rem;
  /* background: #f8f8f8; */
  object-fit: contain;
}

/* Final pair container */
.process-pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem; /* slightly less gap */
  width: 100%;
}

/* Each sub-card (final screen) */
.pair-card {
  background: #0e1317;
  border-radius: 0.5rem;
  padding: 0.75rem 0; /* smaller padding */
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  flex: 1 1 300px; /* smaller base size */
  max-width: 360px; /* was 420px */
  display: flex;
  justify-content: center;
  align-items: center;
}

.pair-card img {
  width: 100%;
  max-height: 380px; /* limits height directly */
  object-fit: contain;
  border-radius: 0.4rem;
}

/* Caption text */
.process-card figcaption,
.process-card .caption {
  font-size: 0.85rem;
  color: #cacaca;
  line-height: 1.4;
  text-align: center;
  max-width: 100ch;
  padding-top: 1rem;
}

/* Responsive stacking */
@media (max-width: 800px) {
  .process-pair {
    flex-direction: row; /* side-by-side again */
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .pair-card {
    flex: 1 1 48%; /* two per row */
    max-width: 48%;
    padding: 0.5rem;
  }

  .pair-card img {
    max-height: none;
    width: 100%;
    height: auto;
  }
}

/* experiment */

/* Two-image layout */

/* Card wrapper (same as your existing .process-card) */
.process-card {
  background: #11161b;
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-block: 1.5rem;
}

/* Grid layout */
.process-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 220px; /* adjust height baseline */
  gap: 1rem;
  width: 100%;
  max-width: 800px;
}

/* Each grid item */
.grid-item {
  /* background: #0e1317; */
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* or contain for non-cropped images */
  border-radius: 0.5rem;
}

/* Left tall image */
.grid-item.large {
  grid-row: span 2; /* makes it taller */
}

/* Right top image (normal) */
.grid-item.main-right {
  grid-row: span 1;
}

/* Right bottom smaller tile */
.grid-item.small-tile {
  grid-row: span 1;
  max-width: 80%;
  justify-self: center;
}

/* Responsive */
@media (max-width: 700px) {
  .process-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 3rem;
  }
  .grid-item.large {
    grid-row: auto;
  }
}

/* Final UI Screens */

/* Full-width wrapper */
.final-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #0e1317;
  padding-block: 2.5rem;
  text-align: center;
  overflow-x: hidden;
  margin-top: 100px;
  margin-bottom: 100px;
}

/* Horizontal row of screens */
.final-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  padding-inline: 1rem;
  overflow: hidden; /* prevent overflow scroll */
}

/* Each screen (desktop) */
.final-row img {
  display: block;
  height: auto;
  width: auto;
  max-height: 500px;
  max-width: 22vw; /* ✅ keeps them aligned and visible */
  border-radius: 1rem;
  object-fit: contain;
  padding: 0.5rem;
  flex-shrink: 0;
}

/* Caption */
.final-full .caption {
  font-size: 0.9rem;
  color: #cacaca;
  max-width: 50ch;
  margin-inline: auto;
  margin-top: 1.5rem;
  line-height: 1.5;
}

.caption-final {
  color: #cacaca;
}

/* --- Tablet (≤1026px) --- */
@media (max-width: 1026px) {
  .final-row img {
    max-width: 24vw;
    max-height: 420px;
  }
}

/* --- Mobile (≤700px) --- */
@media (max-width: 700px) {
  .final-full {
    overflow: hidden;
    padding-block: 1.5rem;
  }

  .final-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
    width: 100vw;
    max-width: 100vw;
  }

  .final-row img {
    display: block;
    width: 100vw;
    height: auto;
    max-width: 100vw;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
    margin: 0;
    padding: 0;
  }
}

.metrics {
  margin: 2rem auto 3rem;
  text-align: center;
}

.metrics ul {
  display: inline-grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem 1.5rem;
  list-style: none;
  padding: 0;
  font-family: "Mori", "Inter", "Helvetica Neue", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.metrics li {
  /* background: #e3e3d4; */
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  background: #f1f2f3;
  border: 1px solid #e0e0e0;
  color: #080812;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive only — no other changes */
@media (max-width: 700px) {
  .metrics ul {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 420px) {
  .metrics ul {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------
   RESPONSIVE
-------------------------------- */

@media (max-width: 700px) {
  .case-study {
    padding: 3rem 1rem;
  }

  .intro {
    padding: 3rem 1.5rem;
  }

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

  .meta-label {
    margin-bottom: 0.25rem;
  }

  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.6rem; /* scaled down but still distinct */
    margin-top: 1.75rem;
    margin-bottom: 0.9rem;
    line-height: 1.3;
  }
  h3 {
    font-size: 1.2rem; /* good for sub-sections */
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
    line-height: 1.35;
  }
}
