/* ============================================
   Work Well With Us – shared styles
   index + creative-leaders
   ============================================ */

:root {
  /* JPEG = fallback; script switches to WebP when supported */
  --bg-image: url('/assets/background.jpg');
  --bg-end-offset: -60vh;
  --color-text: #1a1a1a;
  --color-text-soft: #444;
  --color-accent: #04202f;
  --color-bg-overlay: rgba(255, 255, 255, 0.92);
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --slide-padding: clamp(1.5rem, 5vw, 3rem);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.8vw, 22px);
  line-height: 1.45;
  color: var(--color-text);
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ----- Background ----- */
.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(200vh - var(--bg-end-offset, 0px));
  min-height: calc(200vh - var(--bg-end-offset, 0px));
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: translateY(calc(var(--bg-progress, 0) * (-100vh + var(--bg-end-offset, 0px))));
}

/* ----- Scroll container ----- */
.scroll-container {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

/* ----- Slides ----- */
.slide {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--slide-padding);
}

.slide-inner {
  width: 100%;
  max-width: 900px;
  background: var(--color-bg-overlay);
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* First slide: two panels stacked (landing page) */
#the-problem {
  flex-direction: column;
  gap: 1rem;
}

#the-problem .slide-inner {
  position: relative;
}

/* Hero-style panel (white, centred – landing + thank-you CTA) */
.slide-inner--hero {
  background: #fff;
  text-align: center;
}

.slide-inner--hero-compact {
  padding: 0.5rem 1rem;
}

/* Last slide: stack image above text */
.slide-last {
  flex-direction: column;
  gap: 1rem;
}

.slide-last .pre-inner-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.slide-last .pre-inner-container img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.slide-last .slide-inner {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Thank-you footer panel (dark) */
.slide-inner--dark {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 1.5rem;
}

.slide-inner--dark a {
  text-decoration: underline;
}

/* ----- Substack embed ----- */
.substack-embed-wrap {
  width: 100%;
  margin: 1rem auto 0;
}

.substack-embed-wrap iframe {
  display: block;
  width: 100% !important;
  min-width: 0;
  height: 150px;
  margin: 0 auto;
  border: 1px solid #eee;
  background: #fff;
  box-sizing: border-box;
}

/* ----- Scroll hint (first slide) ----- */
.scroll-hint {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--color-text-soft);
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  animation: scroll-hint-bounce 2s ease-in-out infinite;
}

.scroll-hint svg {
  width: 1.25rem;
  height: 1.25rem;
}

@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ----- Typography ----- */
.slide-inner .lead {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1rem;
}

.slide-inner .lead:last-of-type {
  margin-bottom: 0;
}

.slide-inner .body {
  font-size: 1em;
  color: var(--color-text-soft);
  margin: 0 0 0.85rem;
  margin-top: 50px;
}

.slide-inner .body:last-child {
  margin-bottom: 0;
}

.slide-inner > p:not([class]) {
  font-weight: 400;
}

.slide-inner .stat {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--color-text-soft);
  margin: 0.5rem 0;
}

.slide-inner .source {
  font-size: 70%;
  color: var(--color-text-soft);
  margin-top: 1rem;
  opacity: 0.9;
}

.smaller {
  font-size: 80%;
  font-weight: 400;
}

.smaller.mt-50 {
  margin-top: 50px;
}

.slide-inner h1 {
  font-size: clamp(1.75rem, 5vw, 6rem);
  font-weight: 400;
  margin: 0 0 1rem;
  line-height: 1.1;
}

.slide-inner h1.lead {
  margin-bottom: 50px;
}

.slide-inner h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 400;
  margin: 0 0 1rem;
  line-height: 1.1;
}

.slide-inner h2.nobum,
h2.nobum {
  margin-bottom: 0;
}

#principles h2.nobum {
  margin-bottom: 0;
}

.slide-inner h3 {
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  color: var(--color-accent);
}

.highlight {
  font-weight: 600;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  margin: 0.5rem 0 0;
}

/* ----- Lists ----- */
.impact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.impact-list li {
  padding: 0.35rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.impact-list .arrow {
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.impact-list .arrow.up {
  color: #c45c26;
}

.steps-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-weight: 400;
}

.steps-list.steps-list--spaced {
  margin-top: 50px;
}

.steps-list li {
  margin: 0.4rem 0;
  cursor: pointer;
}

.steps-list li:focus {
  outline: none;
}

.steps-list .body {
  display: none;
}

.steps-list.compact {
  font-size: 1em;
}

.steps-list.compact li {
  margin: 0.25rem 0;
}

/* ----- Principles (A/B/C click to expand) ----- */
.principles-list .body {
  display: none;
}

.principles-list .principle-item {
  display: block;
  margin: 0.5rem 0;
}

.principles-list .principle-trigger {
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.principles-list .principle-trigger:hover {
  opacity: 0.85;
}

.principles-list .principle-trigger:focus {
  outline: none;
}

/* ----- Links & CTA ----- */
.cta-link {
  margin: 1rem 0 0;
}

.cta-link a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}

.cta-link a:hover {
  opacity: 0.85;
}

.slide-inner a {
  color: var(--color-accent);
  text-decoration: underline;
}

.slide-inner a:hover {
  opacity: 0.85;
}

.slide-inner--dark a {
  color: #fff;
}

.slide-inner--dark a:hover {
  color: #fff;
  opacity: 0.9;
}

/* ----- Modal (steps + principles) ----- */
.steps-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.steps-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.steps-modal {
  background: var(--color-bg-overlay);
  color: var(--color-text);
  max-width: 28rem;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.steps-modal-overlay.is-open .steps-modal {
  transform: scale(1);
}

.steps-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.steps-modal-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
}

.steps-modal-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.steps-modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.steps-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.95em;
  color: var(--color-text-soft);
  line-height: 1.5;
}

.steps-modal-body p:first-child {
  margin-top: 0;
}

.steps-modal-body p:last-child {
  margin-bottom: 0;
}

/* ----- Utility ----- */
.framework-block {
  margin-bottom: 1.25rem;
}

.framework-block:last-of-type {
  margin-bottom: 0;
}

.framework-block p {
  margin: 0.25rem 0;
  font-size: 0.95em;
  color: var(--color-text-soft);
}

.one-thing {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.95em;
}

/* ----- Progress indicator ----- */
.progress {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 2;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-soft);
  background: var(--color-bg-overlay);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.progress-sep {
  opacity: 0.6;
}

/* ----- Safe areas & mobile ----- */
@supports (padding: max(0px)) {
  .slide {
    padding-left: max(var(--slide-padding), env(safe-area-inset-left));
    padding-right: max(var(--slide-padding), env(safe-area-inset-right));
    padding-bottom: max(var(--slide-padding), env(safe-area-inset-bottom));
  }
  .progress {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .slide-inner {
    padding: 1.25rem;
  }
}
