/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f9f8f6;
  --fg: #111;
  --muted: #666;
  --border: #e5e3df;
  --accent: #111;
  --card-bg: #fff;
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 900px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  background: rgba(249, 248, 246, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-color: var(--border); }
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }

/* ── Homepage Hero ───────────────────────────────────────── */
.hero {
  padding: 160px 0 80px;
}
.hero-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 700px;
  color: var(--fg);
}
.hero h1 em {
  font-style: normal;
  color: var(--muted);
}

/* ── Projects Grid ───────────────────────────────────────── */
.projects {
  padding: 0 0 120px;
}
.projects-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.project-grid {
  display: grid;
  gap: 16px;
}

/* ── Project Card ────────────────────────────────────────── */
.project-card {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.project-card-image {
  width: 100%;
  aspect-ratio: 16/7;
  overflow: hidden;
  background: #f0efed;
}
.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-card-image img {
  transform: scale(1.03);
}
.project-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card-body {
  padding: 24px 28px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.project-card-info {}
.project-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
}
.project-card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 6px;
}
.project-card-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.project-card-arrow {
  font-size: 20px;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}
.project-card:hover .project-card-arrow {
  transform: translate(3px, -3px);
  color: var(--fg);
}

/* ── Case Study ──────────────────────────────────────────── */
.case-hero {
  padding: 140px 0 64px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 80px;
}
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s;
}
.case-back:hover { color: var(--fg); }
.case-back svg { transition: transform 0.2s; }
.case-back:hover svg { transform: translateX(-3px); }
.case-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.case-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 24px;
  max-width: 640px;
}
.case-subtitle {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 580px;
  margin-bottom: 40px;
}
.case-meta {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.case-meta-item {}
.case-meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.case-meta-value {
  font-size: 14px;
  color: var(--fg);
}
.case-cover {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 80px;
  border: 1px solid var(--border);
}
.case-cover img {
  width: 100%;
  display: block;
}
.case-cover img.banner-padded {
  width: 86%;
  margin: 0 auto;
  display: block;
  padding: 20px 0;
}
.case-cover:has(.banner-no-border) {
  border: none;
}

/* ── Case Study Body ─────────────────────────────────────── */
.case-body {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 120px;
}
.case-section {
  margin-bottom: 72px;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.case-h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--fg);
}
.case-p {
  font-size: 16px;
  color: #333;
  line-height: 1.75;
  margin-bottom: 16px;
}
.case-p:last-child { margin-bottom: 0; }
.case-img {
  width: 100%;
  border-radius: 12px;
  margin: 32px 0;
  border: 1px solid var(--border);
  display: block;
}
.case-img-wide {
  width: calc(100% + 80px);
  margin-left: -40px;
  border-radius: 12px;
  margin-top: 32px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  display: block;
}
.case-callout {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin: 32px 0;
  font-size: 16px;
  color: var(--fg);
  line-height: 1.65;
}
.case-callout strong { font-weight: 600; }
.case-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.case-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.case-stat-num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 4px;
}
.case-stat-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Impact Row (MS hero) ────────────────────────────────── */
.case-impact-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.case-impact-item {
  flex: 1;
  text-align: center;
}
.case-impact-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1.1;
}
.case-impact-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}
.case-impact-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── MS Hybrid Banner ────────────────────────────────────── */
.ms-hybrid-banner {
  display: flex;
  min-height: 380px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 80px;
}
.ms-banner-logo-panel {
  flex: 0 0 38%;
  background: #002B5C;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 32px 36px;
  gap: 6px;
}
.ms-wordmark {
  width: 100%;
  max-width: 220px;
}
.ms-banner-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.04em;
}
.ms-banner-mockup-panel {
  flex: 1;
  background: #f0efed;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-banner-mockup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}

/* ── BlackBerry Custom Banner ────────────────────────────── */
.bb-custom-banner {
  background: #000;
  border-color: #222;
  margin-bottom: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
}
.bb-banner-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  gap: 40px;
}
.bb-logo-lockup {
  flex: 0 0 auto;
}
.bb-wordmark {
  width: 240px;
  height: auto;
  display: block;
}
.bb-banner-phone {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bb-banner-phone-img {
  max-height: 280px;
  width: auto;
  display: block;
  border-radius: 12px;
}

/* ── Phone-sized case image ──────────────────────────────── */
.case-img-phone {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Card Carousel ────────────────────────────────────────── */
.card-carousel {
  position: relative;
  margin: 28px 0;
  user-select: none;
}
.card-carousel-track {
  display: flex;
  gap: 0;
  overflow: hidden;
}
.carousel-card {
  min-width: 100%;
  max-width: 100%;
  height: 420px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  transition: opacity 0.3s;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  z-index: 2;
  padding: 0;
}
.carousel-btn:hover { border-color: var(--fg); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
  background: var(--fg);
  transform: scale(1.3);
}

/* ── CTA Link Button (Vancouver Survivor) ────────────────── */
.vs-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 32px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.vs-cta-link:hover {
  border-color: var(--fg);
  background: var(--bg);
}
.vs-cta-link svg {
  flex-shrink: 0;
  color: var(--muted);
}

/* ── Inline Links ─────────────────────────────────────────── */
.case-link {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.2s;
}
.case-link:hover { text-decoration-color: var(--fg); }

/* ── GIF sizing ───────────────────────────────────────────── */
.case-img-gif {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Video Grid ──────────────────────────────────────────── */
.case-video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}
.case-video-thumb {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
}
.case-video-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.case-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 40px;
  transition: background 0.2s;
}
.case-video-thumb:hover .case-video-play {
  background: rgba(0,0,0,0.5);
}
@media (max-width: 600px) {
  .case-video-grid { grid-template-columns: 1fr; }
}

/* ── Problem Diagram ─────────────────────────────────────── */
.problem-diagram {
  margin: 40px 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
}
.problem-diagram-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}
.problem-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 560px) {
  .problem-cards { grid-template-columns: 1fr; }
}
.problem-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.problem-card-icon {
  margin-bottom: 14px;
}
.problem-card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}
.problem-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Pillar Icons ─────────────────────────────────────────── */
.pillar-icon {
  margin-bottom: 14px;
}

/* ── Case H3 ──────────────────────────────────────────────── */
.case-h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 40px 0 12px;
}

/* ── Next Project ────────────────────────────────────────── */
.next-project {
  border-top: 1px solid var(--border);
  padding: 64px 0 80px;
}
.next-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.next-card {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.3s cubic-bezier(0.16,1,0.3,1);
}
.next-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.07);
}
.next-card-img {
  width: 100%;
  aspect-ratio: 16/5;
  overflow: hidden;
  background: #f0efed;
}
.next-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.next-card:hover .next-card-img img { transform: scale(1.03); }
.next-card-body {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.next-card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.next-card-arrow { font-size: 18px; color: var(--muted); }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}
.footer-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--fg); }

/* ── Animations ──────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1),
              transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up:nth-child(1) { transition-delay: 0ms; }
.fade-up:nth-child(2) { transition-delay: 80ms; }
.fade-up:nth-child(3) { transition-delay: 160ms; }
.fade-up:nth-child(4) { transition-delay: 240ms; }
.fade-up:nth-child(5) { transition-delay: 320ms; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .case-img-wide { width: 100%; margin-left: 0; }
  .case-meta { gap: 24px; }
  .nav-links { gap: 16px; }
}
