/* =========================================================
   START OF CASE STUDY PAGE
   Layout only. Tokens, buttons, header, footer, cursor and
   context menu all come from style.css.
   ========================================================= */

/* Prose measure. The outer container is 1140px, which is far too wide to read
   18px body copy across, so single-column blocks get their own limit. */
.case { --measure: 68ch; }

/* ---------------------------------------------------------
   START OF HERO
   --------------------------------------------------------- */
.case-hero {
  margin-top: calc(var(--header-h) * -1);
  padding: calc(var(--header-h) + 96px) 20px 72px;
  text-align: center;
}

.case-eyebrow {
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-blue);
}

.case-title {
  max-width: 18ch;
  margin-inline: auto;
  font-size: clamp(34px, 5.6vw, 68px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--c-white);
}

.case-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  font-size: 1rem;
  color: var(--c-muted);
}
.case-meta__sep {
  width: 1px;
  height: 14px;
  background: var(--c-line);
}
.case-meta a {
  color: var(--c-blue);
  transition: color .3s var(--ease);
}
.case-meta a:hover { color: var(--c-white); }

/* ---------------------------------------------------------
   END OF HERO
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF TEXT BLOCKS
   --------------------------------------------------------- */
.case-block { padding-block: 56px; }

.case-block h2 {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--c-white);
  margin-bottom: 20px;
}
.case-block h3 {
  margin-top: 36px;
  margin-bottom: 12px;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-white);
}
.case-block p,
.case-block li {
  max-width: var(--measure);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--c-muted);
}
.case-block p + p { margin-top: 18px; }

.case-block ul {
  margin-block: 20px;
  padding-left: 22px;
  list-style: disc;
}
.case-block li { margin-bottom: 12px; }
.case-block li::marker { color: var(--c-blue); }
.case-block li strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: var(--c-white);
}

/* Challenge / Solution, side by side */
.case-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.case-split > div { min-width: 0; }
.case-split p { max-width: none; }

/* ---------------------------------------------------------
   END OF TEXT BLOCKS
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF IMAGERY
   --------------------------------------------------------- */
.case-figure { margin-block: 16px; }
.case-figure img {
  width: 100%;
  height: clamp(220px, 30vw, 440px);
  object-fit: cover;
  border-radius: 20px;
}
.case-figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--c-muted);
  text-align: center;
}

/* Asymmetric grid: a stack of two beside one tall frame. */
.case-bento {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(300px, 2fr);
  gap: 20px;
  align-items: stretch;
  margin-block: 32px;
}
.case-bento__col {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.case-bento__item {
  overflow: hidden;
  border-radius: 16px;
  background: var(--c-surface);
  min-height: 150px;
}
.case-bento__item img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
}

.case-devices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-block: 32px;
}
.case-devices--pair { grid-template-columns: repeat(2, 1fr); }
.case-devices img {
  width: 100%;
  height: clamp(160px, 20vw, 260px);
  object-fit: cover;
  border-radius: 16px;
  background: var(--c-surface);
}
/* Desktop and mobile captures have opposite aspect ratios, so `cover` would
   crop one of them to nonsense. `contain` shows each layout whole. */
.case-devices--pair img {
  height: clamp(240px, 28vw, 400px);
  object-fit: contain;
  padding: 10px;
}

/* ---------------------------------------------------------
   END OF IMAGERY
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF OUTCOME STATS
   --------------------------------------------------------- */
.case-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 32px;
  margin-block: 32px;
  padding: 40px 32px;
  border-radius: 20px;
  background: var(--c-surface);
}
.case-stat { text-align: center; }
.case-stat__figure {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--c-blue);
}
.case-stat__label {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 300;
  color: var(--c-muted);
}

/* ---------------------------------------------------------
   END OF OUTCOME STATS
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF OTHER WORKS
   --------------------------------------------------------- */
.case-more { padding-block: 80px; }
.case-more h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 32px;
}
.case-more__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.case-more__card {
  display: block;
  overflow: hidden;
  border-radius: 20px;
  background: var(--c-surface);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.case-more__card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.case-more__card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.case-more__body { padding: 20px; }
.case-more__kind {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-blue);
}
.case-more__name {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-white);
}

/* Back to the index */
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 40px;
  font-size: 1rem;
  color: var(--c-muted);
  transition: color .3s var(--ease);
}
.case-back:hover { color: var(--c-blue); }

/* ---------------------------------------------------------
   END OF OTHER WORKS
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF SECTION NAV

   These pages are long, so each phase gets an anchor and the
   nav rides under the header. Its own `top` is the header
   height, which is what keeps it clear of the sticky bar.
   --------------------------------------------------------- */
.case-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  margin-bottom: 8px;
  padding-block: 12px;
  background: rgba(11, 13, 18, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-surface-2);
}
.case-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}
.case-nav a {
  font-size: 14px;
  color: var(--c-muted);
  transition: color .3s var(--ease);
}
.case-nav a:hover,
.case-nav a:focus-visible { color: var(--c-blue); }

/* ---------------------------------------------------------
   END OF SECTION NAV
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF PROJECT FACTS — DURATION, TYPE, ROLE
   --------------------------------------------------------- */
.case-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-block: 36px;
  padding: 32px;
  border-radius: 20px;
  background: var(--c-surface);
}
.case-fact__label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-blue);
}
.case-fact__value {
  margin-top: 8px;
  font-size: 1.125rem;
  color: var(--c-white);
}

/* ---------------------------------------------------------
   END OF PROJECT FACTS — DURATION, TYPE, ROLE
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF TIMELINE STEPS — THE PHASES THE PROJECT RAN THROUGH
   --------------------------------------------------------- */
.case-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-block: 32px;
  /* Counter-based numbering, so reordering the markup renumbers itself. */
  counter-reset: step;
}
.case-step {
  padding: 24px;
  border-radius: 16px;
  background: var(--c-surface);
  border-top: 3px solid var(--c-blue);
}
.case-step__name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--c-white);
}
.case-step__name::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-blue);
}
.case-step p {
  margin-top: 10px;
  font-size: 1rem;
  color: var(--c-muted);
}

/* ---------------------------------------------------------
   END OF TIMELINE STEPS — THE PHASES THE PROJECT RAN THROUGH
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF TEAM
   --------------------------------------------------------- */
.case-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin-block: 32px;
}
.case-member { text-align: center; }
.case-member img {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-surface);
}
.case-member__name {
  margin-top: 12px;
  font-size: 14px;
  color: var(--c-muted);
}

/* ---------------------------------------------------------
   END OF TEAM
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF IMAGERY THAT MUST NOT BE CROPPED

   .case-figure crops to a fixed height, which suits a hero
   shot but destroys a flow chart or a style guide. These
   keep the whole frame and let the height follow the source.
   --------------------------------------------------------- */
.case-figure--full img {
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  background: var(--c-surface);
}
/* Very tall artboards — guidelines, whole user flows — would otherwise run
   for several screens, so they scroll inside their own frame instead. */
.case-figure--tall {
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--c-surface);
}
.case-figure--tall img { border-radius: 0; }

/* Screen gallery — many small captures, laid out dense. */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-block: 32px;
}
.case-gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--c-surface);
}

/* ---------------------------------------------------------
   END OF IMAGERY THAT MUST NOT BE CROPPED
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF PROTOTYPE EMBED
   --------------------------------------------------------- */
.case-embed {
  margin-block: 32px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--c-surface);
}
.case-embed iframe {
  display: block;
  width: 100%;
  height: min(75vh, 680px);
  border: 0;
}

/* ---------------------------------------------------------
   END OF PROTOTYPE EMBED
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF FEATURE CALL-OUTS — A LEAD LINE ABOVE THE EXPLANATION
   --------------------------------------------------------- */
.case-feature { margin-top: 36px; }
.case-feature__lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--c-blue);
}

/* ---------------------------------------------------------
   END OF FEATURE CALL-OUTS — A LEAD LINE ABOVE THE EXPLANATION
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   START OF RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 880px) {
  .case-hero { padding-top: calc(var(--header-h) + 56px); padding-bottom: 48px; }
  .case-block { padding-block: 40px; }
  .case-split { grid-template-columns: 1fr; gap: 36px; }
  .case-bento { grid-template-columns: 1fr; }
  .case-devices { grid-template-columns: 1fr; }
  .case-stats { padding: 32px 24px; }
  .case-facts { padding: 24px; }
  .case-nav { top: 0; }
  .case-nav ul { gap: 8px 18px; }
  .case-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ---------------------------------------------------------
   END OF RESPONSIVE
   --------------------------------------------------------- */

/* =========================================================
   END OF CASE STUDY PAGE
   ========================================================= */
