/* ── Case Study Shared Styles ── */

.page-cs { background: var(--ivory); }

/* Hero */
.cs-hero { padding: 8rem 0 4rem; }
.cs-back { display: inline-block; font-size: 0.8rem; color: var(--slate); text-decoration: none; margin-bottom: 2rem; transition: color 0.2s; letter-spacing: 0.03em; }
.cs-back:hover { color: var(--charcoal); }
.cs-hero__meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cs-tag { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.75rem; border-radius: 20px; background: var(--charcoal); color: #fff; }
.cs-hero__title { font-family: var(--font-serif); font-size: clamp(3rem, 8vw, 6rem); font-weight: 300; color: var(--charcoal); line-height: 1.05; margin: 0.5rem 0 1.5rem; }
.cs-hero__sub { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--slate); max-width: 620px; line-height: 1.7; margin-bottom: 3rem; }
.cs-hero__stats { display: flex; gap: 3rem; flex-wrap: wrap; padding-top: 2rem; border-top: 1px solid var(--border); }
.cs-stat { display: flex; flex-direction: column; gap: 0.25rem; }
.cs-stat strong { font-family: var(--font-serif); font-size: 2rem; color: var(--charcoal); font-weight: 400; }
.cs-stat span { font-size: 0.78rem; color: var(--slate); letter-spacing: 0.04em; }

/* Cover image */
.cs-cover { height: 55vh; min-height: 320px; overflow: hidden; }
.cs-cover__img { width: 100%; height: 100%; background-size: cover; background-position: center; }

/* Body */
.cs-body { padding: 5rem 0 6rem; }
.cs-body__inner { display: grid; grid-template-columns: 240px 1fr; gap: 5rem; align-items: start; }
.cs-sidebar { position: sticky; top: 7rem; }
.cs-sidebar__block { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.cs-sidebar__block:last-child { border-bottom: none; }
.cs-sidebar__block h4 { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); margin-bottom: 0.5rem; }
.cs-sidebar__block p { font-size: 0.85rem; color: var(--charcoal); line-height: 1.6; }

/* Content sections */
.cs-content { min-width: 0; }
.cs-section { margin-bottom: 4rem; padding-bottom: 4rem; border-bottom: 1px solid var(--border); }
.cs-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cs-section h2 { font-family: var(--font-serif); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 400; color: var(--charcoal); margin-bottom: 1.5rem; line-height: 1.2; }
.cs-section p { font-size: 0.95rem; color: var(--slate); line-height: 1.85; margin-bottom: 1.2rem; }
.cs-section p:last-child { margin-bottom: 0; }

/* Images */
.cs-img-block { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16/10; }
.cs-img-block--tall { aspect-ratio: 4/3; margin: 2rem 0; }
.cs-img-block img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.cs-img-grid .cs-img-block { aspect-ratio: 4/3; }

/* Phone showcase */
.cs-phone-showcase { display: flex; justify-content: center; padding: 3rem 0; }

/* Quote */
.cs-quote { font-family: var(--font-serif); font-size: clamp(1.1rem, 2vw, 1.5rem); font-style: italic; color: var(--charcoal); border-left: 3px solid var(--charcoal); padding: 1.5rem 2rem; margin: 2.5rem 0 0; line-height: 1.6; }
.cs-quote cite { display: block; font-family: var(--font-sans); font-size: 0.78rem; font-style: normal; color: var(--slate); letter-spacing: 0.05em; margin-top: 1rem; }

/* Process list */
.cs-process { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-direction: column; gap: 1.5rem; }
.cs-process li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; align-items: start; }
.cs-process__num { font-family: var(--font-serif); font-size: 1.2rem; color: var(--charcoal); opacity: 0.3; font-weight: 300; }
.cs-process__text strong { display: block; font-size: 0.9rem; font-weight: 600; color: var(--charcoal); margin-bottom: 0.25rem; }
.cs-process__text span { font-size: 0.85rem; color: var(--slate); line-height: 1.6; }

/* Deliverables grid */
.cs-deliverables { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 2rem 0 0; }
.cs-deliverable { background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1.25rem; }
.cs-deliverable strong { display: block; font-size: 0.85rem; color: var(--charcoal); margin-bottom: 0.3rem; }
.cs-deliverable span { font-size: 0.8rem; color: var(--slate); line-height: 1.5; }

/* CTA */
.cs-cta { background: var(--charcoal); padding: 5rem 0; text-align: center; }
.cs-cta__inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.cs-cta h2 { font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 300; color: #fff; }
.cs-cta p { color: rgba(255,255,255,0.55); font-size: 0.95rem; line-height: 1.7; }
.cs-cta__back { font-size: 0.85rem; color: rgba(255,255,255,0.45); text-decoration: none; transition: color 0.2s; }
.cs-cta__back:hover { color: #fff; }

/* Responsive */
@media (max-width: 900px) {
  .cs-body__inner { grid-template-columns: 1fr; gap: 3rem; }
  .cs-sidebar { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .cs-sidebar__block { border-bottom: none; padding-bottom: 0; margin-bottom: 0; border: 1px solid var(--border); padding: 1rem; border-radius: var(--r-sm); }
  .cs-hero__stats { gap: 2rem; }
}

@media (max-width: 640px) {
  .cs-img-grid { grid-template-columns: 1fr; }
  .cs-deliverables { grid-template-columns: 1fr; }
  .cs-sidebar { grid-template-columns: 1fr; }
}

/* ── Live site iframe frame ── */
.cs-live-frame { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); box-shadow: 0 8px 40px rgba(0,0,0,0.08); margin: 2rem 0 0; }
.cs-live-frame__bar { display: flex; align-items: center; gap: 0.75rem; background: #f0eeeb; padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.cs-live-frame__dots { display: flex; gap: 5px; }
.cs-live-frame__dots span { width: 11px; height: 11px; border-radius: 50%; background: #ddd; }
.cs-live-frame__dots span:nth-child(1) { background: #ff5f57; }
.cs-live-frame__dots span:nth-child(2) { background: #febc2e; }
.cs-live-frame__dots span:nth-child(3) { background: #28c840; }
.cs-live-frame__url { font-size: 0.75rem; color: var(--slate); flex: 1; text-align: center; }
.cs-live-badge { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: var(--charcoal); color: #fff; padding: 0.2rem 0.5rem; border-radius: 4px; }
.cs-live-frame__viewport { height: 480px; overflow: hidden; position: relative; }
.cs-live-frame__viewport--app { height: 680px; }
.cs-live-frame__viewport iframe { width: 100%; height: 100%; border: none; display: block; transform-origin: top left; }

/* ── Every Birth brand showcase ── */
.cs-eb-brand { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; margin: 2rem 0 0; align-items: start; }
.cs-eb-brand__logo { background: #fdf6f0; border-radius: var(--r-md); padding: 2.5rem; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; }
.cs-eb-brand__logo img { max-width: 120px; width: 100%; }
.cs-eb-brand__swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cs-eb-swatch { border-radius: var(--r-sm); aspect-ratio: 1; display: flex; align-items: flex-end; padding: 0.5rem; }
.cs-eb-swatch span { font-size: 0.7rem; font-weight: 600; color: #fff; letter-spacing: 0.04em; }
.cs-eb-brand__type { display: flex; flex-direction: column; gap: 1rem; justify-content: center; background: var(--charcoal); border-radius: var(--r-md); padding: 2rem; }
.cs-eb-type-serif { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 300; font-style: italic; color: #fff; line-height: 1; }
.cs-eb-type-sans { font-size: 0.75rem; color: rgba(255,255,255,0.4); letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-width: 700px) {
  .cs-eb-brand { grid-template-columns: 1fr 1fr; }
  .cs-eb-brand__type { grid-column: 1 / -1; }
}

/* ── iPhone phone showcase ── */
.cs-phone-showcase {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0 1rem;
}

/* The outer wrapper scales the whole phone down to fit the column */
.cs-iphone {
  /* Phone native size: 375×812 + shell padding ~28px each side → ~431×868 */
  width: 431px;
  height: 868px;
  transform: scale(0.72);
  transform-origin: top center;
  /* Collapse the visual space consumed after scaling */
  margin-bottom: calc((868px * 0.72 - 868px));
}

.cs-iphone__shell {
  width: 375px;
  background: #0e0e0e;
  border-radius: 50px;
  padding: 14px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 0 0 4px #111,
    0 40px 80px rgba(0,0,0,0.45);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cs-iphone__notch {
  width: 120px;
  height: 30px;
  background: #000;
  border-radius: 0 0 22px 22px;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.cs-iphone__screen {
  width: 100%;
  height: 780px;
  background: #fff;
  border-radius: 38px;
  overflow: hidden;
}

.cs-iphone__screen iframe {
  width: 375px;
  height: 780px;
  border: none;
  display: block;
}

.cs-iphone__home {
  width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  margin-top: 10px;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .cs-iphone { transform: scale(0.55); margin-bottom: calc((868px * 0.55 - 868px)); }
}

/* ── Mobile improvements for case study pages ── */
@media (max-width: 640px) {
  .cs-hero { padding: 5rem 0 3rem; }
  .cs-hero__title { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .cs-hero__sub { font-size: 1rem; }
  .cs-hero__stats {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
  }
  .cs-stat strong { font-size: 1.6rem; }
  .cs-section h2 { font-size: clamp(1.4rem, 5vw, 2rem); }
  .cs-quote { margin: 2rem 0; padding: 1.25rem 1.5rem; font-size: 1rem; }
  .cs-deliverable { padding: 1rem; }
  .cs-cta__inner { padding: 3rem 1.5rem; }
  .cs-cta__inner h2 { font-size: 1.8rem; }
}
