/* ─── Shared case-study styles ───────────────────────────── */

/* ─── Canela fonts (self-hosted) ─────────────────────────── */
@font-face {
  font-family: 'Canela Deck Trial';
  src: url('assets/fonts/CanelaDeck-Bold-Trial.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Canela Text Trial';
  src: url('assets/fonts/CanelaText-Bold-Trial.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: #fff;
  color: #000;
  font-family: 'Public Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --serif-deck: 'Canela Deck Trial', Georgia, serif;
  --serif-text: 'Canela Text Trial', Georgia, serif;
  --sans:    'Public Sans', system-ui, sans-serif;
  --ui:      'Public Sans', system-ui, sans-serif;

  --black:   #000;
  --body:    #1A1A1A;
  --muted:   #8D8D8D;
  --rule:    #EBEBEA;

  --max:     1400px;
  --px:      clamp(20px, 3.43vw, 48px);
}

/* ─── Page shell ─────────────────────────────────────────── */
.page {
  max-width: calc(var(--max) + var(--px) * 2);
  margin: 0 auto;
  padding: 0 var(--px);
}

/* ─── Navigation ─────────────────────────────────────────── */
.cs-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 0;
  border-bottom: 2px solid #F2F2F2;
  margin-bottom: 64px;
}

.cs-nav-identity {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
}

.cs-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.cs-nav-link {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  color: var(--body);
  text-decoration: underline;
  text-decoration-thickness: 2.5%;
  text-underline-offset: 15%;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  transition: color 0.15s ease;
}
.cs-nav-link:hover { color: #444444; text-decoration-color: #000000; }
.cs-nav-link[data-letstalk] { color: var(--body); text-decoration: underline; text-decoration-thickness: 2.5%; text-underline-offset: 15%; text-decoration-color: rgba(0, 0, 0, 0.25); }
.cs-nav-link[data-letstalk]:hover { color: #444444; text-decoration-color: #000000; }

/* ─── Body text ───────────────────────────────────────────── */
.cs-body {
  font-family: var(--ui);
  font-size: 18px;
  line-height: 27px;
  font-weight: 400;
  color: var(--body);
}

.cs-body + .cs-body { margin-top: 10px; }

/* ─── Section heading ─────────────────────────────────────── */
.cs-h2 {
  font-family: var(--serif-text);
  font-size: clamp(28px, 2.86vw, 40px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--black);
}

@media (max-width: 600px) {
  .cs-body { font-size: 16px; line-height: 22px; }
}

/* ─── Hero bottom ────────────────────────────────────────── */
.cs-hero-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-intro {
  font-family: var(--sans);
  font-size: clamp(18px, 1.71vw, 24px);
  line-height: 36px;
  font-weight: 400;
  color: var(--body);
  max-width: 940px;
}

.cs-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  background-image: url('assets/tag-light.svg');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  font-family: var(--ui);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: var(--body);
  white-space: nowrap;
}
.tag--primary { background-image: url('assets/tag-light.svg'); }

/* ─── Footer ─────────────────────────────────────────────── */
.cs-footer-line {
  font-family: var(--ui);
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: var(--body);
}

.cs-footer-line a {
  color: var(--black);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 2.5%;
  text-underline-offset: 15%;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}

.cs-footer-avatar {
  width: 102px;
  height: 102px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.cs-footer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.cs-footer-credit {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cs-footer-credit-info {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: var(--black);
}

.cs-footer-credit-info p { margin: 0; }
.cs-footer-credit-info p + p { margin-top: 4px; }

.cs-footer-credit-info a {
  color: inherit;
  text-decoration: none;
}

.cs-copy-email {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: baseline;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--black);
  font-weight: 400;
  cursor: pointer;
  transition: color 0.15s ease;
}
.cs-copy-email span {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2.5%;
  text-underline-offset: 15%;
}
.cs-copy-email:hover,
.cs-copy-email:focus-visible {
  color: #444444;
  outline: none;
}
.cs-copy-icon {
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.cs-copy-email:hover .cs-copy-icon,
.cs-copy-email:focus-visible .cs-copy-icon {
  opacity: 1;
}

/* ─── Toast ──────────────────────────────────────────────── */
.cs-copy-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #000;
  color: #fff;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 999;
}

.cs-copy-toast--visible {
  opacity: 1;
  visibility: visible;
}

/* ─── Sticky bar ─────────────────────────────────────────── */
.sticky-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sticky-bar--visible {
  opacity: 1;
  pointer-events: auto;
}
.sticky-bar-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.sticky-bar-link:hover { color: #444; text-decoration-color: #000000; }
.sticky-bar-link[data-letstalk] { color: #000000; text-decoration: underline; text-decoration-thickness: 2.5%; text-underline-offset: 15%; text-decoration-color: rgba(0, 0, 0, 0.25); }
.sticky-bar-link[data-letstalk]:hover { color: #444444; text-decoration-color: #000000; }

/* ─── Popup ──────────────────────────────────────────────── */
.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.popup-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}
.popup {
  background: #fff;
  box-shadow: 0px 4px 80px 0px rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  padding: 24px 32px 32px;
  width: 440px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.popup-hgroup {
  display: flex;
  flex-direction: column;
}
.popup-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 0 8px 0;
}
.popup-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  border-radius: 96px;
  padding: 0;
  cursor: pointer;
  color: #8D8D8D;
  transition: color 0.15s ease;
}
.popup-close:hover { color: #000; }
.popup-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.popup-title {
  font-family: var(--serif-text);
  font-size: 40px;
  font-weight: 700;
  line-height: 54px;
  color: #000;
  margin: 0;
}
.popup-body-text {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  color: #1A1A1A;
  margin: 0;
}
.popup-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.popup-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.popup-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.popup-input {
  width: 100%;
  height: 40px;
  border: 1px solid #EDEDF0;
  background: #fff;
  padding: 0 16px;
  font-family: var(--ui);
  font-size: 16px;
  line-height: 24px;
  color: #1A1A1A;
  outline: none;
  transition: border-color 0.15s ease;
}
.popup-input::placeholder { color: #8D8D8D; }
.popup-input:focus { border-color: #8D8D8D; }
.popup-input--error { border-color: #ED3C56; }
.popup-input--error:focus { border-color: #ED3C56; }
.popup-textarea {
  width: 100%;
  height: 100px;
  border: 1px solid #EDEDF0;
  background: #fff;
  padding: 16px;
  resize: none;
  font-family: var(--ui);
  font-size: 16px;
  line-height: 24px;
  color: #1A1A1A;
  outline: none;
  transition: border-color 0.15s ease;
}
.popup-textarea::placeholder { color: #8D8D8D; }
.popup-textarea:focus { border-color: #8D8D8D; }
.popup-textarea--error { border-color: #ED3C56; }
.popup-textarea--error:focus { border-color: #ED3C56; }
.popup-send {
  align-self: flex-start;
  background: #000;
  color: #fff;
  font-family: var(--ui);
  font-size: 18px;
  font-weight: 400;
  line-height: 30px;
  padding: 8px 16px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.popup-send:hover { background: #444; }

/* ─── Testimonials ───────────────────────────────────────── */
.testimonials {
  padding-top: 120px;
  max-width: var(--max);
}

.testimonials-heading {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 30px;
  font-weight: 600;
  color: #000;
  margin-bottom: 24px;
}

.testimonials-grid {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.testimonial-row {
  display: flex;
  gap: 64px;
}

.testimonial {
  flex: 0 0 calc(50% - 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.testimonial-quote {
  font-family: var(--ui);
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
  color: #000;
  max-width: 540px;
}

.testimonial-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.testimonial-name {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: #000;
}

.testimonial-role {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: #3B3B3B;
}

/* ─── Work with me (case study wrapper) ─────────────────── */
.cs-work-with-me-section {
  margin-top: 48px;
  padding-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: var(--max);
  width: 100%;
}

.cs-section-rule {
  width: 100%;
  height: 1px;
  background: #EBEBEA;
  border: none;
}

.cs-more-work {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: #1A1A1A;
}

.cs-more-work a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2.5%;
  text-underline-offset: 15%;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}

/* ─── Work with me ───────────────────────────────────────── */
.work-with-me {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--rule);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #fff;
}

.work-with-me-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-with-me-title {
  font-family: var(--serif-text);
  font-size: clamp(28px, 2.78vw, 40px);
  line-height: 1.35;
  font-weight: 700;
  color: #000;
}

.work-with-me-body {
  font-family: var(--ui);
  font-size: 24px;
  line-height: 36px;
  font-weight: 400;
  color: #000;
}

.work-with-me-btn {
  align-self: flex-start;
  background: #000;
  color: #fff;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  padding: 8px 16px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.work-with-me-btn:hover { background: #444; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .testimonial-row { gap: 40px; }
}

@media (max-width: 700px) {
  .testimonial-row { flex-direction: column; gap: 40px; }
  .testimonial { flex: none; }
  .testimonial-quote { max-width: none; }
  .work-with-me-body { font-size: 20px; line-height: 30px; }
}

@media (max-width: 720px) {
  .cs-work-with-me-section { gap: 24px; }
  .cs-nav { flex-wrap: wrap; gap: 16px; }
  .cs-tags { gap: 8px 0px; }
  .tag {
    background-image: url('assets/tag-mobile.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border-radius: 0;
    height: 33px;
    padding: 0 18px;
  }
  .tag--primary {
    background-image: url('assets/tag-mobile.svg');
    background-color: transparent;
  }
}

@media (max-width: 600px) {
  .testimonials { padding-top: 48px; }
  .work-with-me { margin-top: 48px; }
  .work-with-me-btn { align-self: stretch; text-align: center; }
}

@media (max-width: 600px) {
  :root { --px: 10px; }
  .sticky-bar-inner { padding: 0 10px; }
  .cs-intro { font-size: 16px; line-height: 22px; }
  .popup-backdrop {
    align-items: flex-start;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .popup {
    width: 100%;
    max-height: none;
    padding: 16px 20px 24px;
  }
  .work-with-me { padding: 16px 20px 24px; }
  .popup-send {
    width: 100%;
    text-align: center;
  }
}

/* ── Custom cursor ─────────────────────────────────────────── */
@media (pointer: fine) {
  html * { cursor: none; }

  .custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 40px; height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    background: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, width 0.15s ease, height 0.15s ease, margin 0.15s ease;
    will-change: transform;
  }
  .custom-cursor--visible { opacity: 1; }
  .custom-cursor--large {
    width: 72px; height: 72px;
    margin: -36px 0 0 -36px;
  }
}
