/* ============================================================
   Rich case-study styling — shared across all FanCode / portfolio
   case studies. Extracted from the renewals.html system so every
   page reads as one family. Palette: warm paper + cobalt + lime.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:#f0eee7; --bg-2:#e7e4db; --bg-3:#fbfbf8; --bg-4:#eeebe3;
  --border:#ddd9cf;
  --text:#15161c; --text-muted:#5c5e6a; --text-faint:#8a8c98;
  --green:#2746e3; --green-dim:#e6eafe;
  --orange:#b8860b; --orange-dim:#f6efda;
  --blue:#2746e3; --blue-dim:#e6eafe;
  --accent:#2746e3; --lime:#cdf24e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── BACK LINK ──────────────────────────────────────── */
.cs-back {
  position: fixed; top: 16px; left: 16px; z-index: 400;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(251,251,248,.92); backdrop-filter: blur(10px);
  border: 1px solid var(--border); color: var(--text);
  font: 600 13px/1 'Outfit', system-ui, sans-serif;
  padding: 10px 15px; border-radius: 100px; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.10); transition: transform .2s ease, border-color .2s ease;
}
.cs-back:hover { transform: translateY(-2px); border-color: var(--green); }

#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 300;
  background: linear-gradient(90deg, var(--accent), var(--lime)); transition: width .08s linear; }

/* ── HERO ───────────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center; padding: 80px;
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse 90% 70% at 78% 42%, #e6eafe 0%, #f0eee7 60%), #f0eee7;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(39,70,227,0.22), transparent 65%);
  right: 8%; top: 18%; filter: blur(20px); pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(21,22,28,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(21,22,28,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 30% 50%, #000, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 70% at 30% 50%, #000, transparent 75%);
}
.hero-inner {
  max-width: 1280px; margin: 0 auto; width: 100%; position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.hero-left { animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* device collage (doubles as the thumbnail) */
.collage { position: relative; height: 600px; animation: rise 1.1s cubic-bezier(.2,.7,.2,1) .15s both; }
.device { position: absolute; border-radius: 30px; overflow: hidden; background: #000;
  border: 1px solid rgba(21,22,28,0.14); box-shadow: 0 40px 90px rgba(0,0,0,0.45), 0 0 0 1px rgba(21,22,28,0.04); }
.device img { display: block; width: 100%; height: auto; }
.device.d1 { width: 208px; left: 2%;  top: 86px;  transform: rotate(-8deg); z-index: 1; }
.device.d2 { width: 270px; left: 30%; top: 8px;   z-index: 3; animation: float 6s ease-in-out infinite; }
.device.d3 { width: 198px; right: 2%; top: 110px; transform: rotate(8deg);  z-index: 2; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.badge-float {
  position: absolute; z-index: 4; background: var(--green); color: #fff; font-weight: 800;
  font-size: 13px; padding: 8px 14px; border-radius: 100px; box-shadow: 0 12px 30px rgba(39,70,227,0.4);
  left: 22%; bottom: 40px; animation: float 5s ease-in-out infinite .5s;
}
@media (max-width: 980px) {
  .hero { padding: 100px 24px 60px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .collage { height: 440px; order: 2; }
  .device.d1 { width: 150px; } .device.d2 { width: 196px; } .device.d3 { width: 142px; }
}

.hero-meta { display: flex; gap: 10px; margin-bottom: 28px; position: relative; flex-wrap: wrap; }
.hero-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); margin-bottom: 18px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 100px; border: 1px solid;
}
.tag-green  { color: var(--green);  border-color: var(--green);  background: var(--green-dim); }
.tag-orange { color: var(--orange); border-color: var(--orange); background: var(--orange-dim); }
.tag-blue   { color: var(--blue);   border-color: var(--blue);   background: var(--blue-dim); }
.tag-muted  { color: var(--text-muted); border-color: var(--border); background: transparent; }

.hero-title {
  font-family: 'DM Serif Display', Georgia, serif; font-weight: 400;
  font-size: clamp(40px, 6vw, 76px); line-height: 1.05; letter-spacing: -0.012em;
  max-width: 980px; position: relative;
}
.hero-title span { color: var(--green); font-style: italic; }
.hero-sub { margin-top: 24px; font-size: 18px; color: var(--text-muted); max-width: 660px; position: relative; }
.hero-stats { display: flex; gap: 48px; margin-top: 56px; position: relative; flex-wrap: wrap; }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--green); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; max-width: 180px; }

/* ── LAYOUT ─────────────────────────────────────────── */
.section { padding: 100px 80px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }
.section-inner { max-width: 1200px; margin: 0 auto; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.section-label.orange { color: var(--orange); }
.section-label.blue { color: var(--blue); }
.section-label::after { content: ''; display: block; height: 1px; width: 40px; background: currentColor; opacity: 0.5; }
.section-title { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.012em; line-height: 1.15; margin-bottom: 16px; color: var(--text); }
.section-body { font-size: 17px; color: var(--text-muted); max-width: 760px; line-height: 1.7; }
.section-body + .section-body { margin-top: 16px; }
.divider { height: 1px; background: var(--border); margin: 56px 0; }

/* ── OVERVIEW GRID ──────────────────────────────────── */
.overview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: 56px;
}
.overview-cell { background: var(--bg-2); padding: 32px 28px; }
.overview-cell-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.overview-cell-value { font-size: 17px; font-weight: 500; color: var(--text); }

/* ── PROBLEM / CARD GRID ────────────────────────────── */
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.problem-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.problem-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 28px 28px 32px; }
.problem-card-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; }
.problem-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.problem-card .who { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; display: inline-block; }
.problem-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ── DATA STAT STRIP ────────────────────────────────── */
.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.insights.four { grid-template-columns: repeat(4, 1fr); }
.insights.two  { grid-template-columns: repeat(2, 1fr); }
.insight-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.insight-card .num { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; color: var(--green); line-height: 1; margin-bottom: 8px; }
.insight-card .num.orange { color: var(--orange); }
.insight-card .num.small { font-size: 24px; }
.insight-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.insight-card p { font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.insight-card p strong { color: var(--text); }

/* ── FULL-WIDTH IMAGE ───────────────────────────────── */
.full-img-wrap { margin-top: 48px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-3); }
.full-img-wrap img { width: 100%; height: auto; display: block; }
.img-caption { padding: 16px 24px; font-size: 13px; color: var(--text-faint); background: var(--bg-2); border-top: 1px solid var(--border); }
.img-caption b { color: var(--text-muted); }

/* ── CUTOUT DEVICE SHOTS (transparent PNGs, no card chrome) ── */
.full-img-wrap.bare { border: none; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
.full-img-wrap.bare img { filter: drop-shadow(0 26px 46px rgba(0,0,0,0.22)); }
.full-img-wrap.bare:hover { transform: none; box-shadow: none; }
.full-img-wrap.bare .img-caption { background: transparent; border-top: none; padding: 18px 0 0; text-align: center; }

.shots-row { display: flex; gap: 24px; justify-content: center; align-items: flex-end; flex-wrap: wrap; margin-top: 48px; }
.shots-row .shot { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.shots-row img { height: 480px; width: auto; max-width: 100%; display: block; filter: drop-shadow(0 28px 48px rgba(0,0,0,0.24)); transition: transform .25s ease; }
.shots-row .shot:hover img { transform: translateY(-6px); }
.shots-row .shot .cap { font-size: 12px; color: var(--text-faint); letter-spacing: 0.02em; }
.shots-row.tall img { height: 540px; }
@media (max-width: 900px) { .shots-row img, .shots-row.tall img { height: 320px; } }

/* ── PHONE MOCKUP ROW ───────────────────────────────── */
.phones-row { display: flex; gap: 20px; margin-top: 48px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.phone-wrap { position: relative; flex-shrink: 0; }
.phone-frame { width: 220px; border-radius: 32px; overflow: hidden; border: 1px solid rgba(21,22,28,0.12); background: #000; box-shadow: 0 32px 64px rgba(0,0,0,0.45), 0 0 0 1px rgba(21,22,28,0.05); }
.phone-frame img { width: 100%; height: auto; display: block; }
.phone-label { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 12px; letter-spacing: 0.02em; }

/* ── TWO-COL LAYOUT ─────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; align-items: center; }
.two-col-text h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 14px; }
.two-col-text p { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.two-col-text ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.two-col-text ul li { font-size: 14px; color: var(--text-muted); padding-left: 20px; position: relative; }
.two-col-text ul li::before { content: '→'; position: absolute; left: 0; color: var(--green); font-size: 13px; }

/* ── FLOW STEP ──────────────────────────────────────── */
.process-steps { display: flex; flex-direction: column; gap: 0; margin-top: 56px; }
.process-step { display: grid; grid-template-columns: 56px 1fr; gap: 28px; padding-bottom: 48px; position: relative; }
.process-step:not(:last-child)::before { content: ''; position: absolute; left: 27px; top: 56px; bottom: 0; width: 1px; background: var(--border); }
.step-num { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: var(--green); flex-shrink: 0; }
.step-body h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 8px; padding-top: 14px; }
.step-body p { font-size: 15px; color: var(--text-muted); max-width: 720px; line-height: 1.7; }
.step-body p strong { color: var(--text); }

/* ── PHASE / WINDOW CARDS ───────────────────────────── */
.flow-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.flow-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.flow-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.flow-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: 14px; padding: 20px; position: relative; border-top: 3px solid var(--green); }
.flow-card.orange-top { border-top-color: var(--orange); }
.flow-card .stg { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.flow-card .of { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 8px 0 6px; color: var(--green); }
.flow-card .of.orange { color: var(--orange); }
.flow-card .of.full { color: var(--text-muted); }
.flow-card .dc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── HIGHLIGHT BOX ──────────────────────────────────── */
.highlight-box { background: linear-gradient(135deg, var(--orange-dim), transparent); border: 1px solid rgba(184,134,11,0.25); border-radius: 16px; padding: 32px 36px; margin-top: 40px; }
.highlight-box.green { background: linear-gradient(135deg, var(--green-dim), transparent); border-color: rgba(39,70,227,0.2); }
.highlight-box h3 { font-size: 20px; font-weight: 600; color: var(--orange); margin-bottom: 10px; }
.highlight-box.green h3 { color: var(--green); }
.highlight-box p { font-size: 15px; color: var(--text-muted); line-height: 1.7; }
.highlight-box p strong { color: var(--text); }

/* ── WORD CLOUD / CHIP CLOUD ────────────────────────── */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.chip-cloud .chip { font-size: 15px; font-weight: 600; padding: 9px 18px; border-radius: 100px; border: 1px solid var(--border); background: var(--bg-3); color: var(--text-muted); transition: transform .2s ease, color .2s ease, border-color .2s ease; }
.chip-cloud .chip.on { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.chip-cloud .chip.amber { color: var(--orange); border-color: var(--orange); background: var(--orange-dim); }
.chip-cloud .chip:hover { transform: translateY(-3px); }

/* logos row */
.logo-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.logo-row .lg { font-size: 14px; font-weight: 600; color: var(--text-muted); padding: 10px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-3); }

/* ── OUTCOMES ───────────────────────────────────────── */
.outcomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: 48px; }
.outcomes.three { grid-template-columns: repeat(3, 1fr); }
.outcome-cell { background: var(--bg-2); padding: 32px 24px; text-align: center; }
.outcome-cell .val { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; color: var(--green); }
.outcome-cell .sub { font-size: 12px; color: var(--orange); font-weight: 700; margin-top: 2px; }
.outcome-cell .label { font-size: 13px; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }

/* ── NEXT / LIST GRID ───────────────────────────────── */
.next-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 40px; }
.next-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; display: flex; gap: 16px; align-items: flex-start; }
.next-item .ic { font-size: 22px; flex-shrink: 0; }
.next-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.next-item p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

/* ── NEXT CASE STUDY + FOOTER ───────────────────────── */
.cs-next { display: flex; justify-content: space-between; align-items: center; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 40px 0; text-decoration: none; }
.cs-next-wrap { padding: 0 80px; border-bottom: 1px solid var(--border); }
.cs-next-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.cs-next-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 28px; color: var(--text); transition: color .2s ease; }
.cs-next:hover .cs-next-title { color: var(--green); }
.cs-next-arrow { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--green); flex-shrink: 0; transition: transform .2s ease, background .2s ease; }
.cs-next:hover .cs-next-arrow { transform: translateX(6px); background: var(--green-dim); }

footer { padding: 56px 80px; display: flex; justify-content: space-between; align-items: center; }
footer .brand { font-size: 14px; color: var(--text-faint); }
footer .links { display: flex; gap: 24px; }
footer .links a { font-size: 13px; color: var(--text-faint); text-decoration: none; transition: color 0.15s; }
footer .links a:hover { color: var(--green); }

.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.note { font-size: 13px; color: var(--text-faint); margin-top: 16px; max-width: 760px; }

/* ── SCROLL REVEAL ──────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.16,.84,.3,1), transform .8s cubic-bezier(.16,.84,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } .device.d2, .badge-float { animation: none !important; } }

/* ── HOVER POLISH ───────────────────────────────────── */
.problem-card, .insight-card, .outcome-cell, .next-item, .flow-card, .overview-cell, .full-img-wrap, .phone-frame, .panel {
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.problem-card:hover, .insight-card:hover, .next-item:hover { transform: translateY(-4px); border-color: rgba(39,70,227,0.4); }
.flow-card:hover { transform: translateY(-4px); }
.outcome-cell:hover, .overview-cell:hover { background: var(--bg-3); }
.full-img-wrap:hover { transform: translateY(-4px); box-shadow: 0 30px 70px rgba(0,0,0,0.35); border-color: rgba(39,70,227,0.3); }
.phone-frame:hover { transform: translateY(-6px); box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 40px rgba(39,70,227,0.12); }

@media (max-width: 900px) {
  .hero, .section, footer, .cs-next-wrap { padding-left: 24px; padding-right: 24px; }
  .hero-stats { gap: 28px; }
  .overview-grid { grid-template-columns: 1fr; }
  .problem-grid, .problem-grid.cols-2 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .insights, .insights.four, .insights.two { grid-template-columns: 1fr 1fr; }
  .outcomes, .outcomes.three { grid-template-columns: 1fr 1fr; }
  .flow-row, .flow-row.cols-3, .flow-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .next-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 16px; text-align: center; }
}
