/* =========================================================
   MOBILE RESPONSIVE FIX - PROJECT CASE STUDIES
   ========================================================= */

/* Prevent grid children from causing horizontal overflow */
.case,
.case-visual,
.case-body,
.browser,
.frame,
.slider,
.slides {
  min-width: 0;
  max-width: 100%;
}

/* Main case layout */
.case {
  width: 100%;
  box-sizing: border-box;
}

/* Visual section */
.case-visual {
  width: 100%;
  box-sizing: border-box;
}

/* Browser mockup */
.case-visual .browser {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Browser top bar */
.case-visual .bar {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.case-visual .bar span {
  min-width: 0;
  max-width: calc(100% - 60px);
}

/* Slider */
.case-visual .frame {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Slides wrapper */
.slider .slides {
  width: 100%;
  min-width: 0;
  display: flex;
}

/* Images */
.slider .slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 860px) {
  .case {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 32px;
    padding: 45px 0;
  }

  .case-visual,
  .case-body {
    width: 100%;
    max-width: 100%;
  }

  .case-visual .frame {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    max-height: 360px;
  }

  .case.flip .case-visual,
  .case.flip .case-body {
    order: unset;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .section-light {
    width: 100%;
    overflow: hidden;
  }

  .section-light > .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .case {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 0;
    box-sizing: border-box;
  }

  .case-visual,
  .case-body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Browser */
  .case-visual .browser {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    box-sizing: border-box;
  }

  /* Browser header */
  .case-visual .bar {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    box-sizing: border-box;
  }

  .case-visual .bar i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
  }

  .case-visual .bar span {
    min-width: 0;
    max-width: calc(100% - 52px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.62rem;
  }

  /* Screenshot area */
  .case-visual .frame {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    box-sizing: border-box;
  }

  .slider {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .slider .slides {
    width: 100%;
    height: 100%;
    display: flex;
  }

  .slider .slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  /* Mobile arrows */
  .slider-nav {
    opacity: 1;
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .slider-nav.prev {
    left: 6px;
  }

  .slider-nav.next {
    right: 6px;
  }

  /* Floating chip */
  .case-visual .chip {
    right: 10px;
    bottom: -12px;
    max-width: calc(100% - 20px);
    padding: 7px 11px;
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  /* Content */
  .case-body {
    padding: 0 !important;
  }

  .case-body .case-num {
    font-size: 2.3rem;
    line-height: 1;
  }

  .case-body .tag {
    font-size: 0.64rem;
    padding: 5px 10px;
    max-width: 100%;
  }

  .case-body h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .case-body p.desc {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .case-pills {
    width: 100%;
    max-width: 100%;
    gap: 6px;
  }

  .case-pills li {
    font-size: 0.7rem;
    padding: 5px 9px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .case-link {
    font-size: 0.88rem;
  }
}

/* =========================================================
   SMALL PHONES
   ========================================================= */
@media (max-width: 400px) {
  .section-light > .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .case {
    gap: 24px;
    padding: 28px 0;
  }

  .case-visual .frame {
    aspect-ratio: 16 / 10;
  }

  .case-visual .bar {
    padding: 7px 8px;
  }

  .case-body h3 {
    font-size: 1.15rem;
  }

  .case-body p.desc {
    font-size: 0.84rem;
  }

  .case-visual .chip {
    font-size: 0.63rem;
    padding: 6px 9px;
  }
}

.slider .slide {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}
/* ===== Projects page v2 — editorial case-study layout, built on the existing .showcase pattern ===== */
.projects-hero {
  padding: 150px 0 60px;
  text-align: center;
}

.projects-hero .container {
  max-width: 720px;
}

.projects-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 14px 0 16px;
}

.proj-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.proj-index a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text, #16142b);
  background: #f3f2fb;
  text-decoration: none;
  transition: 0.25s ease;
}

.proj-index a:hover {
  background: linear-gradient(135deg, #7c5cff, #4f7cff);
  color: #fff;
  transform: translateY(-3px);
}

.case {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 70px 0;
  border-bottom: 1px solid #ece9fb;
  scroll-margin-top: 100px;
}

.case:last-child {
  border-bottom: none;
}

.case.flip .case-visual {
  order: 2;
}

.case.flip .case-body {
  order: 1;
}

.case-body .case-num {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 3.4rem;
  line-height: 1;
  background: linear-gradient(135deg, #7c5cff, #4f7cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.35;
  display: block;
  margin-bottom: 6px;
}

.case-body .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a4cff;
  background: #f1ecff;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.case-body h3 {
  font-size: 1.55rem;
  margin-bottom: 14px;
  line-height: 1.25;
}

.case-body p.desc {
  color: #5c5a72;
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 22px;
}

.case-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
  list-style: none;
  padding: 0;
}

.case-pills li {
  font-size: 0.8rem;
  color: #34324a;
  background: #f6f5fc;
  border: 1px solid #e9e7f8;
  padding: 7px 13px;
  border-radius: 999px;
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #4f34d9;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: 0.25s ease;
}

.case-link:hover {
  border-bottom-color: #4f34d9;
  gap: 12px;
}

.case-visual {
  position: relative;
}

.case-visual .browser {
  border-radius: 14px;
  overflow: hidden;
  background: #eef0fb;
  box-shadow: 0 20px 50px rgba(30, 20, 80, 0.12);
  border: 1px solid #e6e4f7;
}

.case-visual .bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f3f2fb;
  border-bottom: 1px solid #e6e4f7;
}

.case-visual .bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #d9d7ef;
}

.case-visual .bar i:nth-child(1) {
  background: #ff5f57;
}

.case-visual .bar i:nth-child(2) {
  background: #febc2e;
}

.case-visual .bar i:nth-child(3) {
  background: #28c840;
}

.case-visual .bar span {
  margin-left: 8px;
  font-size: 0.72rem;
  color: #7b7997;
  font-family: "Inter", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-visual .frame {
  position: relative;
  width: 100%;
  height: 330px;
  overflow: hidden;
}

/* ===== Screenshot slider (replaces live iframe embed) ===== */
.slider {
  width: 100%;
  height: 100%;
}

.slider .slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.slider .slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #12101f;
}

/* Add data-fit="fill" on an <img> to force cover/crop instead of contain */
.slider .slide[data-fit="fill"] {
  object-fit: cover;
  object-position: top center;
  background: #eef0fb;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(22, 20, 43, 0.55);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: 0.2s ease;
}

.slider:hover .slider-nav {
  opacity: 1;
}

.slider-nav:hover {
  background: #4f34d9;
}

.slider-nav.prev {
  left: 10px;
}

.slider-nav.next {
  right: 10px;
}

.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 3;
}

.slider-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: 0.2s ease;
}

.slider-dots .dot.active {
  background: #fff;
  width: 18px;
  border-radius: 4px;
}

.case-visual .chip {
  position: absolute;
  bottom: -16px;
  right: 20px;
  background: #fff;
  border: 1px solid #ece9fb;
  box-shadow: 0 10px 24px rgba(30, 20, 80, 0.1);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #16142b;
}

@media (max-width: 860px) {
  .case {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 46px 0;
  }

  .case.flip .case-visual,
  .case.flip .case-body {
    order: unset;
  }

  .case-visual .frame {
    height: 260px;
  }

  .case-body {
    padding: 0 4px;
  }

  /* touch devices have no hover — keep nav arrows reachable */
  .slider-nav {
    opacity: 1;
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .projects-hero {
    padding: 120px 0 36px;
  }

  .projects-hero .container {
    max-width: 100%;
    padding: 0 20px;
  }

  .projects-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
    margin: 10px 0 12px;
  }

  .projects-hero p {
    font-size: 0.95rem;
  }

  .proj-index {
    gap: 8px;
    margin-top: 24px;
  }

  .proj-index a {
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
  }

  .case {
    padding: 36px 0;
    gap: 22px;
  }

  .case-visual .frame {
    height: 200px;
  }

  .case-visual .bar span {
    font-size: 0.65rem;
  }

  .case-visual .chip {
    right: 12px;
    bottom: -14px;
    font-size: 0.7rem;
    padding: 7px 12px;
  }

  .case-body .case-num {
    font-size: 2.4rem;
    margin-bottom: 2px;
  }

  .case-body .tag {
    font-size: 0.66rem;
    margin-bottom: 10px;
  }

  .case-body h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
  }

  .case-body p.desc {
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 18px;
  }

  .case-pills {
    gap: 6px;
    margin-bottom: 22px;
  }

  .case-pills li {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .case-link {
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .case-visual .frame {
    height: 170px;
  }
}

/* ===== Floating action buttons (WhatsApp / chatbot / back-to-top) =====
         Positioned/sized here with !important because their base rules live
         in css/style.css, which this page doesn't control. On mobile they're
         stacked bottom-right with fixed spacing so none of them overlap and
         none sit under the thumb-reach edge of the screen. */
@media (max-width: 768px) {
  #whatsappBtn,
  #kbotToggle,
  #toTop {
    right: 14px !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    border-radius: 50% !important;
    box-shadow: 0 6px 18px rgba(20, 15, 50, 0.25) !important;
    z-index: 999 !important;
  }

  #kbotToggle {
    bottom: 16px !important;
  }

  #whatsappBtn {
    bottom: 76px !important;
  }

  #toTop {
    bottom: 138px !important;
    font-size: 1.1rem !important;
  }

  .kbot-dot {
    top: 2px !important;
    right: 2px !important;
  }

  #kbotPanel {
    right: 12px !important;
    left: 12px !important;
    bottom: 76px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 70vh !important;
  }
}

@media (max-width: 380px) {
  #whatsappBtn,
  #kbotToggle,
  #toTop {
    width: 44px !important;
    height: 44px !important;
    right: 10px !important;
  }

  #kbotToggle {
    bottom: 12px !important;
  }

  #whatsappBtn {
    bottom: 66px !important;
  }

  #toTop {
    bottom: 120px !important;
  }

  #kbotPanel {
    right: 8px !important;
    left: 8px !important;
    bottom: 66px !important;
  }
}
