/* Shared case study styles — loaded after each page's inline styles so the
   project pages share the homepage's type scale, motion and atmosphere. */

:root { --ease: cubic-bezier(0.16, 1, 0.3, 1); }

/* ── Reset theme-era transitions and old reveal systems ──────────────── */
body * { transition: none; }
a, button, .btn, .nav-links a, .nav-dropdown-trigger, .dropdown-menu a {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.2s, transform 0.2s !important;
}
.scroll-fade, .fade-up { opacity: 1; transform: none; animation: none !important; }

h1, h2, h3, .serif { font-weight: 400; }
:where(img) { max-width: 100%; height: auto; }
.content-wrap { max-width: 1680px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 72px); }

/* ── Loader ──────────────────────────────────────────────────────────── */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--bg);
  transition: opacity 0.9s var(--ease), visibility 0s linear 0.9s !important;
}
html:not(.js) .loader, html:not(.is-loading) .loader { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-star { width: 28px; height: 28px; color: var(--pink); animation: loaderStar 1.6s var(--ease) infinite; }
.loader-star svg { width: 100%; height: 100%; display: block; }
@keyframes loaderStar { 0% { transform: rotate(0) scale(0.8); } 50% { transform: rotate(90deg) scale(1); } 100% { transform: rotate(180deg) scale(0.8); } }
.loader-bar { width: 120px; height: 1px; background: rgba(255,255,255,0.1); overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: rgba(255,255,255,0.7); transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform 0.6s var(--ease) !important; }

/* ── Background glow + grain ─────────────────────────────────────────── */
@property --c1 { syntax: '<color>'; inherits: false; initial-value: rgba(255,107,53,0.16); }
@property --c2 { syntax: '<color>'; inherits: false; initial-value: rgba(42,138,90,0.10); }
.bg-glow {
  position: fixed; inset: -10%; z-index: 0; pointer-events: none;
  --p: 0;
  background:
    radial-gradient(55% 45% at calc(12% + var(--p) * 18%) calc(8% + var(--p) * 10%), var(--c1), transparent 70%),
    radial-gradient(50% 50% at calc(92% - var(--p) * 14%) calc(88% - var(--p) * 12%), var(--c2), transparent 70%);
  transition: --c1 1.6s ease, --c2 1.6s ease !important;
}
.js .bg-glow { opacity: 0; }
.js.is-ready .bg-glow { opacity: 1; transition: opacity 2.4s ease 0.2s, --c1 1.6s ease, --c2 1.6s ease !important; }
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cs-header, .cs-hero-wrap, .cs-main, .site-footer { position: relative; z-index: 1; }

/* ── Nav entrance ────────────────────────────────────────────────────── */
#main-nav { transition: opacity 0.8s var(--ease), transform 1s var(--ease) !important; }
.js:not(.nav-ready) #main-nav { opacity: 0; transform: translateX(-50%) translateY(-12px); }

/* ── Reveals ─────────────────────────────────────────────────────────── */
.js [data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1.3s var(--ease) !important;
  transition-delay: var(--d, 0s) !important;
}
.js .in [data-reveal], .js [data-reveal].in { opacity: 1; transform: none; }

.word-reveal .wr-word { display: inline-block; }
.js .word-reveal .wr-word {
  opacity: 0; transform: translateY(0.3em); filter: blur(8px); animation: none;
  transition: opacity 0.9s var(--ease), transform 1.1s var(--ease), filter 0.9s var(--ease) !important;
}
.js .in .word-reveal .wr-word, .js .word-reveal.in .wr-word { opacity: 1; transform: none; filter: blur(0); }

/* Images open out of an inset frame and settle from a slight zoom */
.js .cs-hero-img, .js [data-reveal] .img-frame {
  clip-path: inset(8% 4% 0% 4% round 16px);
  transition: clip-path 1.5s var(--ease) !important;
  transition-delay: var(--d, 0s) !important;
}
.js .in .cs-hero-img, .js .in .img-frame { clip-path: inset(-10% -10% -10% -10% round 16px); }
.js .cs-hero-img img, .js [data-reveal] .img-frame img {
  transform: scale(1.1);
  transition: transform 1.8s var(--ease) !important;
  transition-delay: var(--d, 0s) !important;
}
.js .in .cs-hero-img img, .js .in .img-frame img { transform: none; }

/* ── Small labels ────────────────────────────────────────────────────── */
.label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--pink)); box-shadow: 0 0 10px var(--dot, var(--pink)); }
.cs-kicker { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); opacity: 0.55; }

/* ── Header ──────────────────────────────────────────────────────────── */
.cs-header { padding-top: clamp(130px, 18vh, 200px); padding-bottom: clamp(48px, 7vw, 96px); }
.cs-header-top { display: flex; align-items: center; gap: 20px; margin-bottom: clamp(20px, 2.4vw, 32px); }
.cs-h1 {
  font-size: clamp(2.5rem, 6vw, 6.25rem); line-height: 1.02; letter-spacing: -0.03em;
  margin: 0 0 clamp(40px, 5vw, 72px); max-width: 14em; color: #f6f2ec;
}
.cs-header-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start;
  padding-top: clamp(24px, 3vw, 40px); border-top: 1px solid rgba(255,255,255,0.08);
}
.cs-intro-col { grid-column: 1 / span 6; }
.cs-intro { font-size: clamp(1.1rem, 1.4vw, 1.3rem); line-height: 1.65; color: var(--ink); margin: 0; max-width: 34em; }
.cs-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  font-size: 0.875rem; font-weight: 500; color: var(--ink); text-decoration: none;
  padding: 11px 20px; border-radius: 100px; border: 1px solid rgba(255,255,255,0.15);
}
.cs-cta:hover { border-color: rgba(255,255,255,0.4); }
.cs-facts { grid-column: 8 / span 5; margin: 0; display: grid; gap: 18px; }
.cs-facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cs-facts div:last-child { border-bottom: none; padding-bottom: 0; }
.cs-facts dt { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); opacity: 0.6; padding-top: 0.2em; }
.cs-facts dd { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--ink); }

.cs-hero-img {
  width: 100%; height: 84vh; min-height: 420px; max-height: 1000px; overflow: hidden;
  border-radius: clamp(12px, 1.4vw, 22px);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.cs-hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

/* ── Body: editorial grid ────────────────────────────────────────────── */
.cs-main { padding-top: clamp(80px, 11vw, 160px); }
.cs-main > .divider:first-child { display: none; }
.cs-main section {
  max-width: 40em;
  font-size: clamp(1.1rem, 0.4rem + 0.875vw, 1.4rem);
  margin-bottom: clamp(72px, 9vw, 140px) !important;
}
.cs-main section > .section-title {
  font-size: clamp(1.75rem, 2.8vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 clamp(20px, 2vw, 28px); color: var(--ink);
}
.cs-main .cs-note { max-width: none; margin: 0 0 clamp(64px, 8vw, 120px) !important; }
.cs-main .cs-note > div { max-width: 880px; }
/* Text grows a little on larger screens so the column widens with the page
   while lines stay around 80 characters — a comfortable reading measure. */
.body-text { font-size: clamp(1.1rem, 0.4rem + 0.875vw, 1.4rem); line-height: 1.75; color: var(--muted); margin: 0 0 1.5rem; max-width: 40em; }

.highlight-block {
  background: none !important; border-left: 1px solid var(--accent, var(--pink)) !important;
  padding: 4px 0 4px clamp(20px, 2.4vw, 36px) !important; margin: 40px 0 !important;
}
.highlight-block p {
  font-family: 'DM Serif Display', serif; font-style: normal !important;
  font-size: clamp(1.35rem, 2vw, 1.85rem) !important; line-height: 1.35 !important; color: var(--ink) !important;
  letter-spacing: -0.01em;
}

.divider { background: rgba(255,255,255,0.07) !important; margin: clamp(48px, 6vw, 96px) 0 !important; }

/* Images */
.img-frame { border-radius: clamp(12px, 1.2vw, 18px) !important; border: none !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 30px 60px -40px rgba(0,0,0,0.6); }
.img-frame img { border-radius: 0 !important; }
.img-grid { gap: clamp(12px, 1.4vw, 24px) !important; margin: 0 0 clamp(72px, 9vw, 140px) !important; }
.cs-main > .img-block, .cs-main > div[data-reveal]:not(.img-grid):not(.cs-note) { margin: 0 0 clamp(72px, 9vw, 140px) !important; }
.img-caption { text-align: left !important; font-size: 0.72rem !important; letter-spacing: 0.1em !important; margin-top: 14px !important; opacity: 0.6 !important; }

/* Stats and cards */
.outcome-grid { gap: 16px !important; margin-top: 48px !important; }
.cs-main section .outcome-grid { grid-template-columns: repeat(2, 1fr) !important; }
.cs-main section .outcome-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr) !important; }
.cs-main > .outcome-grid { margin-top: 0 !important; margin-bottom: clamp(72px, 9vw, 140px) !important; }
.outcome-card {
  border-radius: 16px !important; border: 1px solid rgba(255,255,255,0.07) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)) !important;
}
.outcome-card-inner { padding: clamp(24px, 2.4vw, 36px) !important; }
.outcome-card .stat, .stat { font-weight: 400 !important; font-size: clamp(2.75rem, 4.4vw, 4rem) !important; letter-spacing: -0.03em !important; margin-bottom: 14px !important; }
.two-col-card { border-color: rgba(255,255,255,0.07) !important; background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)); border-radius: 16px !important; }
.two-col-card h4 { font-family: 'DM Serif Display', serif; font-weight: 400 !important; font-size: 1.3rem !important; }

/* ── Next project ────────────────────────────────────────────────────── */
.cs-next {
  display: block; text-decoration: none; color: var(--ink);
  padding: clamp(48px, 7vw, 112px) 0; border-top: 1px solid rgba(255,255,255,0.08);
}
.cs-next-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.cs-next-title { display: block; font-size: clamp(2.5rem, 6.4vw, 6.5rem); line-height: 1.02; letter-spacing: -0.03em; margin-top: 18px; max-width: 12em; }
.cs-next-arrow {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: clamp(56px, 6vw, 88px); height: clamp(56px, 6vw, 88px); border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15); font-size: clamp(1.25rem, 2vw, 1.75rem);
}
.cs-next-arrow span { display: inline-block; transition: transform 0.6s var(--ease) !important; }
.cs-next:hover .cs-next-arrow span { transform: translateX(4px); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { display: block !important; border-top: none !important; padding: clamp(48px, 8vw, 120px) 0 40px !important; text-align: left !important; }
.footer-cta { font-size: clamp(2.5rem, 8vw, 7rem); line-height: 1; letter-spacing: -0.03em; margin: 0 0 clamp(32px, 5vw, 64px); font-weight: 400; color: var(--muted); }
.footer-cta a { color: var(--ink) !important; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.6s var(--ease) !important; }
.footer-cta a:hover { background-size: 100% 1px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.875rem; color: var(--muted); }
.footer-row a { color: var(--muted); text-decoration: none; margin-left: 24px; }
.footer-row a:first-child { margin-left: 0; }
.footer-row a:hover { color: var(--ink); }
@media (max-width: 768px) {
  .footer-name { display: none; }
  .footer-row { justify-content: flex-start; }
  .footer-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 24px; }
  .footer-links a { margin-left: 0 !important; }
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cs-header { padding-top: 112px; }
  .cs-header-grid { grid-template-columns: 1fr; gap: 32px; }
  .cs-intro-col, .cs-facts { grid-column: auto; }
  .cs-facts div { grid-template-columns: 6rem 1fr; }
  .cs-hero-img { height: 62vw; min-height: 240px; }
  .cs-main .cs-note > div { max-width: none; }
  .outcome-grid,
  .cs-main section .outcome-grid,
  .cs-main section .outcome-grid:has(> :nth-child(3):last-child) { grid-template-columns: 1fr !important; }
  .cs-next-row { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-star { animation: none !important; }
  .js [data-reveal], .js .wr-word, .js .cs-hero-img, .js .cs-hero-img img, .js .img-frame, .js .img-frame img, .js .bg-glow {
    opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important;
  }
  .js #main-nav { opacity: 1 !important; transform: translateX(-50%) !important; }
}

/* ── Image placeholders (filler until real images are added) ─────────── */
.ph {
  width: 100%; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(60% 80% at 30% 20%, rgba(230,160,80,0.14), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
}
.ph span { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); opacity: 0.7; }
.cs-hero-ph .ph { height: 100%; aspect-ratio: auto !important; }

/* Feature image grid: main image fills its column so every caption lines up
   along the same baseline as the stacked images beside it */
@media (min-width: 769px) {
  .img-feature .feature-main { display: flex; flex-direction: column; }
  .img-feature .feature-main .img-frame { flex: 1; position: relative; min-height: 0; height: auto !important; }
  .img-feature .feature-main .img-frame img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; object-position: top left; }
}

/* Avoid single words left on the last line of a paragraph */
p, li, .cs-intro, .img-caption { text-wrap: pretty; }
