/* =============================================
   DeliverFund Case Study — Design Tokens
   Brand: Dark navy, black, gold accent, warm grays
   ============================================= */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* =============================================
   Light Mode (default) — DeliverFund brand
   ============================================= */
:root {
  --color-bg:             #f5f4f0;
  --color-surface:        #ffffff;
  --color-surface-2:      #fafaf8;
  --color-border:         #d6d4ce;
  --color-divider:        #e2e0db;

  --color-text:           #1a1a1a;
  --color-text-muted:     #5a5a5a;
  --color-text-faint:     #9a9a94;

  --color-primary:        #1a2744;     /* DeliverFund dark navy */
  --color-primary-hover:  #0f1a2e;
  --color-accent:         #c8960c;     /* DeliverFund gold */
  --color-accent-hover:   #a67c00;
  --color-accent-light:   #f5ecd2;

  --color-navy-deep:      #0d1b2a;
  --color-navy-mid:       #1b2838;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* Text selection — gold highlight, always readable */
::selection {
  background: rgba(200, 150, 12, 0.35);
  color: #1a1a1a;
}

/* Dark sections need white text on selection */
.hero ::selection,
.section--dark ::selection,
.footer ::selection {
  background: rgba(200, 150, 12, 0.45);
  color: #ffffff;
}



/* =============================================
   Header
   ============================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
}

.header__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.header__logo-img {
  height: 36px;
  width: auto;
}

.header__nav {
  display: flex;
  gap: var(--space-6);
}

.header__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.header__link:hover,
.header__link--active {
  color: var(--color-text);
}

.header__link--active {
  position: relative;
}

.header__link--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}


@media (max-width: 768px) {
  .header__nav {
    display: none;
  }
}

/* =============================================
   Hero
   ============================================= */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-navy-deep);
  overflow: hidden;
}

.hero__bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(26,39,68,0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 70%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-24) var(--space-6);
  text-align: center;
  color: #e6e1dc;
}

.hero__eyebrow {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230,225,220,0.6);
  margin-bottom: var(--space-6);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: var(--space-6);
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.hero__accent {
  color: var(--color-accent);
}


.hero__subtitle {
  font-size: var(--text-lg);
  color: rgba(230,225,220,0.7);
  max-width: 52ch;
  margin: 0 auto var(--space-12);
  line-height: 1.5;
}

.hero__outcomes-header {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: #f0c040;
  text-transform: none;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-6);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

.hero__stat {
  text-align: center;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: #ffffff;
  font-variant-numeric: tabular-nums lining-nums;
}

.hero__stat-suffix {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-accent);
}


.hero__stat-label {
  display: block;
  font-size: var(--text-xs);
  color: rgba(230,225,220,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-1);
}

.hero__scroll-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  color: rgba(230,225,220,0.4);
  animation: bounce 2.5s ease-in-out infinite;
}

.hero__scroll-cue:hover {
  color: rgba(230,225,220,0.7);
}

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

/* =============================================
   Sections
   ============================================= */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-32)) 0;
}

.section--light {
  background: var(--color-surface-2);
}

.section--dark {
  background: var(--color-navy-deep);
  color: #e6e1dc;
}

.container {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-tag {
  display: inline-block;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.section-tag--light {
  color: #f0c040;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.15;
  max-width: 24ch;
  margin: 0 auto;
}

.section--dark .section-title {
  color: #ffffff;
}

.section-desc {
  font-size: var(--text-base);
  color: rgba(230,225,220,0.65);
  max-width: 56ch;
  margin: var(--space-4) auto 0;
}

/* =============================================
   Client Overview Cards
   ============================================= */
.client-section-header {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  margin-bottom: var(--space-10);
  color: var(--color-text);
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
}

.client-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
}

.client-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-accent-light);
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.client-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  margin-bottom: var(--space-2);
}

.client-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* =============================================
   Problem Section
   ============================================= */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.problem-narrative p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

.problem-narrative p:last-child {
  margin-bottom: 0;
}

.problem-pain-points {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pain-point {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.pain-point__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
}

.pain-point__icon--clock { background: #fde8e8; color: #c0392b; }
.pain-point__icon--alert { background: #fde8e8; color: #c0392b; }
.pain-point__icon--docs  { background: #fde8e8; color: #c0392b; }
.pain-point__icon--stress { background: #fde8e8; color: #c0392b; }


.pain-point__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.pain-point__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .problem-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* =============================================
   Solution Section
   ============================================= */
.solution-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-16);
}

.solution-feature {
  padding: var(--space-8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
}

.solution-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(200,150,12,0.15);
  color: #c8960c;
  margin-bottom: var(--space-4);
}

.solution-feature__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #ffffff;
  margin-bottom: var(--space-3);
}

.solution-feature__text {
  font-size: var(--text-sm);
  color: rgba(230,225,220,0.65);
  line-height: 1.6;
}

/* Flow Diagram */
.flow-diagram {
  padding: var(--space-10);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.02);
}

.flow-diagram__title {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: #ffffff;
  margin-bottom: var(--space-8);
}

.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  flex: 0 1 160px;
}

.flow-step__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(200,150,12,0.15);
  color: #c8960c;
}

.flow-step__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #ffffff;
}

.flow-step__detail {
  font-size: var(--text-xs);
  color: rgba(230,225,220,0.5);
}

.flow-arrow {
  color: rgba(230,225,220,0.3);
  flex-shrink: 0;
}

.flow-arrow svg {
  display: block;
}

@media (max-width: 768px) {
  .flow-steps {
    flex-direction: column;
  }
  .flow-arrow {
    transform: rotate(90deg);
  }
}

/* =============================================
   Charts / Results
   ============================================= */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.chart-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.chart-card__subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.chart-card__canvas-wrap {
  position: relative;
  height: 240px;
}

.chart-card__canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

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

/* Quality Cards */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.quality-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.quality-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.quality-card__icon--shield { background: #d4edda; color: #155724; }
.quality-card__icon--file   { background: #d1ecf1; color: #0c5460; }
.quality-card__icon--heart  { background: #f5ecd2; color: #8a6d00; }


.quality-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.quality-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* =============================================
   Case Timeline
   ============================================= */
.case-timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding-left: var(--space-10);
}

.case-timeline__line {
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(200,150,12,0.25);
}

.case-step {
  position: relative;
  padding-bottom: var(--space-10);
}

.case-step:last-child {
  padding-bottom: 0;
}

.case-step__marker {
  position: absolute;
  left: calc(-1 * var(--space-10) + 2px);
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  z-index: 1;
}


.case-step__content {
  padding: var(--space-5) var(--space-6);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
}

.case-step__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #ffffff;
  margin-bottom: var(--space-2);
}

.case-step__date {
  font-size: var(--text-xs);
  color: rgba(230,225,220,0.5);
  margin-bottom: var(--space-2);
}

.case-step__text {
  font-size: var(--text-sm);
  color: rgba(230,225,220,0.7);
  line-height: 1.6;
}

/* =============================================
   Impact Section
   ============================================= */
.pull-quote {
  max-width: 48ch;
  margin: 0 auto var(--space-12);
  padding: var(--space-8);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  max-width: none;
}

.pull-quote cite {
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.impact-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.impact-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}

.impact-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.closing-statement {
  text-align: center;
  max-width: 56ch;
  margin: 0 auto;
  padding: var(--space-10);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
}

.closing-statement p {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text);
  max-width: none;
}

.closing-statement strong {
  color: var(--color-accent);
}

/* =============================================
   Footer
   ============================================= */
.footer {
  background: var(--color-navy-deep);
  padding: var(--space-12) 0 var(--space-6);
}

.footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
  text-align: center;
}

.footer__logo {
  height: 60px;
  width: auto;
  display: block;
  margin: 0 auto var(--space-3);
  opacity: 1;
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(230,225,220,0.5);
  margin: 0 auto var(--space-6);
  text-align: center;
  max-width: none;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.footer__links a {
  font-size: var(--text-sm);
  color: rgba(230,225,220,0.5);
  text-decoration: none;
}

.footer__links a:hover {
  color: rgba(230,225,220,0.8);
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-4);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: rgba(230,225,220,0.35);
  text-align: center;
  max-width: none;
}

/* =============================================
   Scroll Animations
   ============================================= */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .fade-in.is-visible {
    opacity: 1;
  }
}