/* ── Tokens ─────────────────────────────────────────── */
:root {
  --bg: #fff;
  --bg-secondary: #f5f5f7;
  --text: #1d1d1f;
  /* Apple-like body copy: darker than typical “muted” grey */
  --text-secondary: #424245;
  --text-tertiary: #6e6e73;
  --accent: #192BC2;
  --accent-hover: #2438d4;
  --accent-active: #1424a8;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 980px;
  --max-wide: 1024px;
  /* Case-study column width aligned with seanhalpin.xyz/work (e.g. /work/docs) */
  --case-column: 740px;
  /* Wider media strip (Halpin-style breakout from prose) */
  --case-breakout-max: 1280px;
  --space: clamp(1rem, 5vw, 2.5rem);
  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space);
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  z-index: 200;
  border-radius: 0 0 8px 8px;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* ── Client-side password gate (auth.js) ───────────── */
html.auth-locked {
  overflow: hidden;
}

html.auth-locked .skip-link {
  display: none;
}

#site-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-auth-panel {
  width: 100%;
  max-width: 380px;
  padding: 2rem 1.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.site-auth-title {
  margin: 0 0 0.5rem;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.site-auth-desc {
  margin: 0 0 1.5rem;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.site-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-auth-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.site-auth-input {
  font: inherit;
  font-size: 17px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--bg);
}

.site-auth-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-auth-error {
  margin: 0;
  font-size: 14px;
  color: #b00020;
}

.site-auth-submit {
  margin-top: 0.25rem;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}

.site-auth-submit:hover {
  background: var(--accent-hover);
}

.site-auth-submit:active {
  background: var(--accent-active);
}

.wrap {
  width: min(100% - var(--space) * 2, var(--max));
  margin-inline: auto;
}

.wrap-wide {
  width: min(100% - var(--space) * 2, var(--max-wide));
  margin-inline: auto;
}

/* ── Header (apple.com nav) ────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}

.logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.022em;
}

.logo:hover {
  color: var(--text);
  text-decoration: none;
  opacity: 0.7;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover { background: var(--bg-secondary); }

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 15px;
  height: 1px;
  background: var(--text);
  position: relative;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bar::before { top: -5px; }
.nav-toggle-bar::after  { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(251, 251, 253, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space) 1rem;
    display: none;
  }

  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: 0.6rem 0; font-size: 17px; }
}

/* ── Link CTAs (apple.com style text links) ────────── */
.link-cta {
  font-size: 21px;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

.link-cta::after {
  content: " >";
  font-family: system-ui;
  font-weight: 300;
}

.link-cta:hover {
  text-decoration: underline;
}

.link-cta-sm {
  font-size: 17px;
}

.contact-links .link-cta {
  font-size: 15px;
}

.contact-links .link-cta::after {
  content: none;
}

/* ── Pill button (used sparingly) ──────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  letter-spacing: -0.022em;
}

.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

/* ── Intro hero (top of home) ─────────────────────── */
.intro-hero {
  position: relative;
  padding: clamp(5rem, 14vw, 10rem) 0 clamp(4rem, 10vw, 8rem);
  overflow: hidden;
}

.intro-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 80% at 15% 0%, rgba(25, 43, 194, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 60% at 85% 20%, rgba(25, 43, 194, 0.04), transparent 50%),
    linear-gradient(180deg, #fafafa 0%, #fff 45%);
  pointer-events: none;
  z-index: 0;
}

.intro-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.intro-hi {
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.intro-greeting {
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  margin: 0 0 clamp(2rem, 4vw, 3.5rem);
  color: var(--text);
}

.intro-dot {
  color: var(--accent);
}

.intro-statements {
  list-style: none;
  padding: 0;
  margin: 0 0 clamp(2.5rem, 5vw, 4rem);
  position: relative;
  height: 1.45em;
}

.intro-statements li {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.45;
  color: var(--text-secondary);
  letter-spacing: -0.015em;
  position: absolute;
  inset: 0;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  animation: statement-cycle 9s ease infinite;
}

.intro-statements li:nth-child(1) { animation-delay: 0s; }
.intro-statements li:nth-child(2) { animation-delay: 3s; }
.intro-statements li:nth-child(3) { animation-delay: 6s; }

@keyframes statement-cycle {
  0%       { opacity: 0; transform: translateY(10px); }
  5%       { opacity: 1; transform: translateY(0); }
  28%      { opacity: 1; transform: translateY(0); }
  33%      { opacity: 0; transform: translateY(-10px); }
  100%     { opacity: 0; transform: translateY(-10px); }
}

.intro-statements strong {
  color: var(--text);
  font-weight: 600;
}

.intro-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: gap var(--transition), color var(--transition);
}

.intro-cta:hover {
  text-decoration: none;
  gap: 0.65rem;
  color: var(--accent-hover);
}

.intro-cta-icon {
  display: inline-block;
  font-size: 1.1em;
  line-height: 1;
  animation: intro-bounce 2.2s ease-in-out infinite;
}

@keyframes intro-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-cta-icon {
    animation: none;
  }
  .intro-statements li {
    animation: none;
    transform: none;
    opacity: 0;
  }
  .intro-statements li:first-child {
    opacity: 1;
  }
}

/* ── Project grid ──────────────────────────────────── */
.project-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 2.5rem;
}

@media (max-width: 720px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card {
  display: flex;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg, #f5f5f7);
  border: 1px solid var(--border);
  min-height: 400px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  text-decoration: none;
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.project-card--soon {
  cursor: default;
  color: inherit;
}

.project-card--soon:hover {
  transform: none;
  box-shadow: none;
}

.project-card-badge {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin: 0;
}

#credit-card-origination {
  scroll-margin-top: 5.5rem;
}

.project-card-dark {
  color: #f5f5f7;
}

.project-card-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem;
  width: 100%;
  flex: 1;
  min-height: 0;
  background-color: rgba(255, 255, 255, 1);
  text-align: left; /* override .section-center so labels + copy align with titles */
}

/* Personal Loan card: UI screenshot top half + gradient into text */
.project-card-inner--thumb-top {
  padding: 0;
  background-color: transparent;
  justify-content: flex-start;
}

.project-card-thumb {
  flex: 0 0 58%;
  min-height: 180px;
  position: relative;
  overflow: hidden;
}

/* Shorter image strip so the copy block sits higher (e.g. Product Transfer in grid) */
.project-card--thumb-compact .project-card-thumb {
  flex: 0 0 50%;
  min-height: 160px;
}

.project-card--thumb-compact .project-card-thumb img {
  top: 0%;
}

.project-card-thumb img {
  position: absolute;
  left: 0;
  /* Negative top pulls the crop up so more of the top of each UI sits in the thumb */
  top: -6%;
  width: 100%;
  height: 158%;
  object-fit: cover;
  object-position: center top;
}

.project-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 55%,
    rgba(255, 255, 255, 0.35) 82%,
    rgba(255, 255, 255, 0.82) 94%,
    #ffffff 100%
  );
  pointer-events: none;
}

.project-card-thumb--soon-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  background: var(--bg-secondary);
}

.project-card-thumb--soon-msg::after {
  display: none;
}

.project-card-soon-msg {
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-tertiary);
}

.project-card-copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem;
  padding-top: 1.75rem;
  background: #fff;
  position: relative;
  z-index: 1;
}

.project-card--thumb-compact .project-card-copy {
  padding-bottom: 1.5rem;
  padding-top: 1.5rem;
}

.project-card--thumb-compact .project-desc {
  margin-bottom: 0.7rem;
}

.project-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin: 0 0 0.5rem;
}

.project-card-dark .project-label {
  color: rgba(245, 245, 247, 0.5);
}

.project-card h3 {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
  text-align: left;
  color: var(--text);
}

.project-card-dark h3 {
  color: #f5f5f7;
}

.project-desc {
  font-size: 14px;
  line-height: 1.47;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  text-align: left;
}

.project-card-dark .project-desc {
  color: rgba(245, 245, 247, 0.6);
}

.project-card .link-cta {
  text-align: left;
}

.project-card-dark .link-cta {
  color: #6eaaff;
}

.project-card-dark .link-cta:hover {
  color: #9dc4ff;
}

/* ── Sections ──────────────────────────────────────── */
.section {
  padding: clamp(4rem, 12vw, 7rem) 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-center {
  text-align: center;
}

.section h2 {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  color: var(--text);
}

/* ── About ─────────────────────────────────────────── */
.about-text {
  max-width: 520px;
  margin-inline: auto;
}

.about-text p {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.47;
}

.skill-tags {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.skill-tags li {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  background: #fff;
  border-radius: 980px;
  color: var(--text-secondary);
}

/* ── Contact ───────────────────────────────────────── */
.contact-block {
  max-width: 520px;
  margin-inline: auto;
}

.contact-block p {
  font-size: 19px;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

/* ── Case study pages ──────────────────────────────── */
.case-hero {
  padding: clamp(5rem, 16vw, 10rem) 0 clamp(2rem, 4vw, 3rem);
  text-align: center;
}

.case-hero .wrap {
  max-width: var(--case-column);
}

.case-hero .eyebrow {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin: 0 0 0.75rem;
}

.case-hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
}

.case-hero .lead {
  font-size: 21px;
  line-height: 1.38;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.case-meta dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.case-meta dd {
  margin: 0 0 0.5rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.case-banner-wrap {
  margin-bottom: clamp(2rem, 6vw, 4rem);
}

.case-banner {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  border-radius: var(--radius);
}

/* ── Showcase (Apple-style screen gallery) ─────────── */
.showcase-section {
  background: var(--bg-secondary);
  padding: clamp(3rem, 8vw, 6rem) 0;
  margin-bottom: clamp(2rem, 6vw, 4rem);
}

/* Same visual width as Halpin work pages: media column matches prose (740px) */
.showcase-section .wrap-wide {
  width: min(var(--case-breakout-max), calc(100vw - 2 * var(--space)));
  max-width: none;
  margin-inline: auto;
  box-sizing: border-box;
}

.showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

.showcase.showcase--one {
  grid-template-columns: 1fr;
}

.showcase.showcase--row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.showcase-screen {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.showcase-screen:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.showcase-screen img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .showcase {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .showcase.showcase--row {
    grid-template-columns: unset;
    grid-auto-flow: column;
    grid-auto-columns: min(72vw, 260px);
    gap: 0.65rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
}

.case-section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.case-section + .case-section {
  border-top: 1px solid var(--border);
}

.case-section {
  max-width: var(--case-column);
  margin-inline: auto;
}

.case-section h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  line-height: 1.08;
}

.case-section h3 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 3rem 0 1rem;
  line-height: 1.12;
}

.case-section h3:first-of-type {
  margin-top: 1.5rem;
}

.case-section-subtitle {
  font-size: 21px;
  color: var(--text-tertiary);
  margin: -0.25rem 0 1rem;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.case-section p {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.47;
}

.case-section .case-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.25rem 0;
}

.case-image {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  background: #fff;
}

.case-image img {
  display: block;
  width: 100%;
  height: auto;
}

.case-image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
  align-items: start;
}

/* Vertical rhythm for figures in prose column */
.case-section > .case-image {
  margin: 2rem 0;
}

/* Wider than 740px prose: almost full viewport, capped (cf. seanhalpin.xyz wide blocks ~1280px) */
.case-section .case-image-pair:not(.case-image-pair--prose),
.case-section .case-gallery:not(.case-gallery--prose),
.case-section > .case-image--wide {
  width: min(var(--case-breakout-max), calc(100vw - 2 * var(--space)));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  margin: 2rem 0;
}

@media (max-width: 640px) {
  .case-image-pair {
    grid-template-columns: 1fr;
  }
}

/* Old / New compare (Halpin-style toggle, e.g. seanhalpin.xyz/work/docs) */
.case-section > .case-compare {
  margin: 2rem 0;
}

.case-compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.case-compare-label-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-tertiary);
  background: none;
  border: none;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.case-compare-label-btn:hover {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.04);
}

.case-compare-label-btn.is-active {
  color: var(--text);
  font-weight: 600;
}

.case-compare-switch {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 999px;
}

.case-compare-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.case-compare-switch-track {
  display: block;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  position: relative;
  transition: background var(--transition);
}

.case-compare.is-after .case-compare-switch-track {
  background: var(--accent);
}

.case-compare-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition);
}

.case-compare.is-after .case-compare-switch-thumb {
  transform: translateX(22px);
}

@media (prefers-reduced-motion: reduce) {
  .case-compare-switch-track,
  .case-compare-switch-thumb {
    transition: none;
  }
}

.case-compare-viewport {
  margin: 0;
}

.case-compare-stack {
  position: relative;
}

.case-compare-img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.case-compare-img:not(.is-shown) {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.case-compare-img.is-shown {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .case-compare-img {
    transition: none;
  }
}

.case-section ul {
  color: var(--text-secondary);
  padding-left: 1.25rem;
  line-height: 1.47;
}

.case-section li {
  margin-bottom: 0.5rem;
}

/* ── Goal cards (Apple-style widgets) ───────────────── */
.goal-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 1.5rem 0 0;
}

@media (max-width: 640px) {
  .goal-cards { grid-template-columns: 1fr; }
}

.goal-cards--quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 2.25rem;
}

.goal-cards--quad .goal-card {
  padding: 1.75rem 0.85rem;
}

.goal-cards--quad .goal-card p {
  font-size: 14px;
}

.goal-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 2.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.875rem;
}

.goal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.goal-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.goal-card p {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  font-weight: 400;
  margin: 0;
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  gap: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 2rem);
  margin: 2rem 0;
}

/* Five tiles: full-width row of three, then two centered (Product Transfer approach sketches) */
.case-gallery.case-gallery--3-2 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto auto;
}

.case-gallery.case-gallery--3-2 .case-gallery-item:nth-child(1) {
  grid-column: 1 / 5;
}

.case-gallery.case-gallery--3-2 .case-gallery-item:nth-child(2) {
  grid-column: 5 / 9;
}

.case-gallery.case-gallery--3-2 .case-gallery-item:nth-child(3) {
  grid-column: 9 / 13;
}

.case-gallery.case-gallery--3-2 .case-gallery-item:nth-child(4) {
  grid-column: 3 / 7;
}

.case-gallery.case-gallery--3-2 .case-gallery-item:nth-child(5) {
  grid-column: 7 / 11;
}

@media (max-width: 640px) {
  .case-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: clamp(1.25rem, 4vw, 1.75rem);
  }

  .case-gallery.case-gallery--3-2 .case-gallery-item:nth-child(n) {
    grid-column: auto;
  }
}

.case-gallery-item {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
}

.case-gallery-item--screen {
  aspect-ratio: auto;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.case-gallery-item--screen img {
  display: block;
  width: 100%;
  height: auto;
}

img.image-expand {
  cursor: zoom-in;
}

img.image-expand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.image-expand-open {
  overflow: hidden;
}

.image-expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
}

.image-expand-overlay[hidden] {
  display: none;
}

.image-expand-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.image-expand-frame {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: min(96vw, calc(100vw - 3rem));
  margin: auto;
}

.image-expand-full {
  display: block;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.image-expand-close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  transform: translateY(-100%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: background var(--transition), transform var(--transition);
}

.image-expand-close:hover {
  background: #fff;
}

@media (max-width: 640px) {
  .image-expand-close {
    top: 0.5rem;
    right: 0.5rem;
    transform: none;
  }
}

.case-outcomes {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
  margin: 2.5rem 0 0;
}

@media (max-width: 640px) {
  .case-outcomes { grid-template-columns: repeat(2, 1fr); }
}

.outcome-card {
  padding: 2rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  text-align: center;
}

.outcome-card .big-number {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.outcome-card span:last-child {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

.case-nav {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.case-nav .wrap {
  max-width: var(--case-column);
}

.case-nav-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.case-nav a {
  font-size: 17px;
  font-weight: 400;
  color: var(--accent);
}

.case-nav a:hover {
  text-decoration: underline;
}

/* ── Footer (apple.com style) ──────────────────────── */
.site-footer {
  padding: 0;
  background: var(--bg-secondary);
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-top {
  display: flex;
  gap: 4rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.25rem;
  font-size: 12px;
  color: var(--text);
}

.footer-soon {
  color: var(--text-tertiary);
  font-weight: 400;
}

.footer-col a {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-bottom {
  padding: 1rem 0;
}

.footer-bottom p {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── Animations ────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
