/* ============================================================
   THEME PREVIEW SECTION — UPGRADED
   ID: #themePreview
   Uses ONLY theme variables: --bg, --fg, --accent, etc.
============================================================ */

#themePreview {
  background: var(--bg-primary);
  padding: calc(var(--sp-6) * 1.5) var(--sp-5);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

/* Optional subtle background glow (theme‑friendly) */
#themePreview::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.preview-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ---------- LEFT COLUMN ---------- */
.preview-left {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.preview-badge {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent);
  background: var(--bg-elev);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  align-self: flex-start;
  animation: fadeInDown 0.8s var(--ease-out) both;
}

.preview-title {
  font-family: var(--ff-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  line-height: 1.05;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.preview-title .highlight {
  color: var(--accent);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 3px;
  display: inline-block;
}

.preview-desc {
  font-size: var(--fs-18);
  line-height: var(--lh-loose);
  color: var(--fg-soft);
  max-width: 520px;
  margin: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.preview-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2) var(--sp-3);
  list-style: none;
  padding: 0;
  margin: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.preview-features li {
  font-size: var(--fs-14);
  color: var(--fg-mute);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: color 300ms var(--ease-out);
}

.preview-features li:hover {
  color: var(--fg);
}

.feat-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
}

.preview-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: var(--fs-14);
  border-radius: 40px;
  text-decoration: none;
  transition: all 350ms var(--ease-out);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}


.btn-secondary {
  background: transparent;
  color: var(--fg-soft);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--bg-elev);
  color: var(--fg);
  border-color: var(--fg-soft);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.btn svg {
  flex-shrink: 0;
  transition: transform 300ms var(--ease-out);
}

.btn:hover svg {
  transform: translateX(4px);
}

.btn-secondary:hover svg {
  transform: translateX(4px);
}

/* ---------- RIGHT COLUMN (Image Mockup) ---------- */
.preview-right {
  position: relative;
}

.preview-frame-wrapper {
  background: var(--bg-sunk);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  transition: transform 450ms var(--ease-out), box-shadow 450ms var(--ease-out);
  max-height: 500px;
}

.preview-frame-wrapper:hover {
  transform: scale(1.01) translateY(-4px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.frame-mock-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dot-1 {
  background: var(--fg-mute);
}

.dot-2 {
  background: var(--fg-soft);
}

.dot-3 {
  background: var(--accent);
}

.frame-url {
  font-family: var(--ff-mono);
  font-size: var(--fs-12);
  color: var(--fg-mute);
  margin-left: auto;
  background: var(--bg-primary);
  padding: 2px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  letter-spacing: 0.5px;
}

.preview-images-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  will-change: transform;
}

.preview-image {
  width: 100%;
  height: auto;
  display: block;
  flex-shrink: 0;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

 /* ── Article Styles ── */
       .breadcrumb {
           display: flex;
           align-items: center;
           gap: var(--sp-2);
           font-size: var(--fs-14);
           color: var(--fg-mute);
           padding: var(--sp-6);
           flex-wrap: wrap;
           border-top: 1px solid var(--line);
       }

       .breadcrumb a {
           color: var(--fg-soft);
           transition: color 300ms;
       }

       .breadcrumb a:hover {
           color: var(--accent);
       }

       .breadcrumb [aria-current="page"] {
           color: var(--fg);
           font-weight: 500;
       }

/* ── FAQ Section ── */
.faq-section {
  padding-top: var(--sp-6);
  padding-bottom: 0;
}

.faq-header {
  margin-bottom: var(--sp-6);
}

.faq-header h2 {
  margin-bottom: var(--sp-2);
}

/* ── FAQ List ── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  transition: all var(--d-fast) var(--ease-out);
  overflow: hidden;
  height: max-content;
  max-height: 60px;
}

.faq-item:hover {
  border-color: var(--line-strong);
}

.faq-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  height: max-content;
  max-height: 500px;
  transition: all var(--d-fast) var(--ease-out);

}

/* ── Question Button ── */
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--ff-display);
  font-size: var(--fs-18);
  font-weight: 700;
  line-height: var(--lh-snug);
  text-align: left;
  color: var(--fg);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color var(--d-fast) var(--ease-out);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-question:focus-visible {
  outline-offset: -2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  transition: background var(--d-fast) var(--ease-out),
    transform var(--d-base) var(--ease-out),
    border-color var(--d-fast) var(--ease-out);
}

.faq-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--fg-mute);
  transition: stroke var(--d-fast) var(--ease-out),
    transform var(--d-base) var(--ease-out);
}

.faq-question[aria-expanded="true"] .faq-icon {
  background: var(--accent);
  border-color: var(--accent);
}

.faq-question[aria-expanded="true"] .faq-icon svg {
  stroke: #fff;
  transform: rotate(180deg);
}

/* ── Answer ── */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--d-slow) var(--ease-out);
  will-change: grid-template-rows;
}

.faq-answer>div {
  overflow: hidden;
  color: var(--fg-soft);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  padding: 0 var(--sp-5) var(--sp-4);
}

.faq-item.is-active .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer p {
  margin-bottom: var(--sp-3);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .faq-question {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-16);
  }

  .faq-answer>div {
    padding: 0 var(--sp-4) var(--sp-3);
    font-size: var(--fs-14);
  }
}

@media (max-width: 480px) {
  .faq-question {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-14);
  }

  .faq-answer>div {
    padding: 0 var(--sp-3) var(--sp-2);
  }

  .faq-icon {
    width: 24px;
    height: 24px;
  }

  .faq-icon svg {
    width: 14px;
    height: 14px;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .preview-container {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .preview-left {
    order: 1;
  }

  .preview-right {
    order: 2;
  }

  .preview-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #themePreview {
    padding: var(--sp-5) var(--sp-3);
  }

  .preview-title {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .preview-features {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
  }

  .preview-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }

  .frame-url {
    font-size: 10px;
    padding: 0 8px;
  }
}

/* Theme Details */

/* ---------- 2. SCROLLBAR STYLING (same as before, uses tokens) ---------- */
.detail-media {
  position: relative;
  overflow-y: scroll;
  margin: var(--sp-3);
  box-sizing: border-box;
}

.detail-media::-webkit-scrollbar,
.gt-menu.is-open::-webkit-scrollbar,
.mobile-menu::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: block;
  width: 8px;
  padding: 2px;
}

.code-block::-webkit-scrollbar {
  display: block;
  height: 4px;
  padding: 2px;
}

.detail-media::-webkit-scrollbar-track,
.code-block::-webkit-scrollbar-track,
.gt-menu.is-open::-webkit-scrollbar-track,
.mobile-menu::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background-color: transparent;
}

.detail-media::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb,
.gt-menu.is-open::-webkit-scrollbar-thumb,
.mobile-menu::-webkit-scrollbar-thumb {
  background-color: var(--c-ink-300);
  border-radius: 20px;
  border: 1px solid var(--c-ink-500);
}

.detail-media:hover::-webkit-scrollbar-thumb,
.code-block:hover::-webkit-scrollbar-thumb,
.gt-menu.is-open::-webkit-scrollbar-thumb,
.mobile-menu:hover::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background-color: var(--c-ink-500);
  border-radius: 20px;
  border: 1px solid var(--c-ink-900);
}

/* ---------- 3. DETAIL LIST (row styles – unchanged, but uses tokens) ---------- */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  list-style: none;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 400ms var(--ease-out);
}

.detail-row:hover,
.detail-row.active,
.detail-row:focus {
  background: var(--bg-elev);
  border-color: var(--line);
  outline: none;
}

.detail-num {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-24);
  color: var(--fg-mute);
  transition: color 400ms;
}

.detail-row-body {
  flex: 1;
}

.detail-row-body .row-section-title {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-24);
  font-weight: 500;
  margin-bottom: 3px;
  transition: transform 400ms var(--ease-out), color 400ms;
}

.detail-row-body p {
  font-size: var(--fs-14);
  color: var(--fg-soft);
}

.detail-cta {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 400ms var(--ease-out);
}

.detail-row:hover .detail-cta,
.detail-row.active .detail-cta {
  opacity: 1;
  transform: none;
  background: var(--fg);
  color: var(--bg-primary);
  border-color: var(--fg);
}

.detail-row:hover h3,
.detail-row.active h3 {
  color: var(--accent);
  transform: translateX(4px);
}

/* ---------- 4. DOCUMENT CONTENT (new & upgraded styles) ---------- */
.doc-content {
  overflow-y: auto;
  padding: var(--sp-5);
}

/* ---- Section container ---- */
.doc-section {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.doc-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ---- Section titles with numbered badge ---- */
.doc-section .case-section-title {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 700;
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
  color: var(--fg);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.doc-section .case-section-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--ff-sans);
  font-size: var(--fs-12);
  font-weight: 700;
  font-style: normal;
  flex-shrink: 0;
}

/* ---- Subsection titles ---- */
.doc-section .case-subsection-title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-20);
  color: var(--fg-soft);
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-1);
}

/* ---- Body text & lists ---- */
.doc-section p,
.doc-section li {
  color: var(--fg-mute);
  line-height: var(--lh-loose);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-14);
}

.doc-section ul {
  list-style: disc;
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-3);
}

.doc-section ul li {
  padding-left: var(--sp-1);
}

/* ---- Code blocks (upgraded with language tag) ---- */
.code-block {
  background: var(--c-ink-800);
  color: #e8e4d8;
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-3) 0;
  overflow-x: auto;
  font-family: var(--ff-mono);
  font-size: var(--fs-12);
  line-height: 160%;
  border: 1px solid var(--c-ink-700);
  position: relative;
}

.code-block .lang-tag {
  position: absolute;
  top: var(--sp-1);
  right: var(--sp-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--c-ink-400);
  font-family: var(--ff-sans);
  font-weight: 600;
  background: var(--c-ink-700);
  padding: 2px 6px;
  border-radius: var(--r-xs);
}

.code-block code {
  display: block;
  white-space: pre;
}

/* ---- Ratings table ---- */
.ratings-table-wrap {
  overflow-x: auto;
  margin: var(--sp-3) 0;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

.ratings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}

.ratings-table thead th {
  background: var(--c-ink-800);
  color: #e8e4d8;
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-12);
  text-transform: uppercase;
}

.ratings-table tbody td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  color: var(--fg-mute);
}

.ratings-table tbody tr:last-child td {
  border-bottom: none;
  font-weight: 700;
  color: var(--fg);
  background: var(--bg-sunk);
}

.rating-val {
  font-weight: 700;
  color: var(--accent);
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-18);
}

.ratings-table tbody tr:last-child .rating-val {
  font-size: var(--fs-24);
  color: var(--accent);
}

/* ---- Highlight box (accent left border) ---- */
.highlight-box {
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: var(--sp-4) 0;
  font-size: var(--fs-14);
  color: var(--fg-soft);
}

/* ---- Inline code styling ---- */
.inline-code {
  background: var(--bg-sunk);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-family: var(--ff-mono);
  font-size: 88%;
  color: var(--accent);
  border: 1px solid var(--line);
}

/* ---- Document footer ---- */
.doc-footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  font-size: var(--fs-16);
  color: var(--fg-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.doc-footer .accent-mark {
  color: var(--accent);
  font-weight: 700;
  font-size: var(--sp-6);
  line-height: 100%;
  flex-shrink: 0;
}

.doc-footer p {
  text-align: center;
}

.project-title-link {
  color: inherit;
  text-decoration: none;
}

.project-title-link:hover {
  color: var(--accent);
  /* optional hover effect */
}

/* ============================================================
   RELATED PROJECTS CAROUSEL
   ============================================================ */
/* ── Carousel Wrapper ── */
.carousel-wrapper {
  position: relative;
  padding: 0 20px;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--r-lg);
}

.carousel-track {
  display: flex;
  /* REMOVED: gap: var(--sp-5); – we use margin on items instead */
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
  width: 100%;
  padding: 20px 0px;
}

/* ── Carousel Items ── */
.carousel-item {
  flex: 0 0 auto;
  /* will be overwritten by media queries */
  min-width: 0;
  margin-right: var(--sp-5);
  /* 24px gap between items */
  transition: opacity 0.3s;
}

.carousel-item:last-child {
  padding-right: 0;
}

.carousel-item {
  flex: 0 0 calc(100% - 0px);
  /* fallback for 1 slide */
}

@media (min-width: 640px) {
  .carousel-item {
    flex: 0 0 calc((100% - 24px) / 2);
    /* 2 items, 1 gap of 24px */
  }
}

@media (min-width: 1024px) {
  .carousel-item {
    flex: 0 0 calc((100% - 48px) / 3);
    /* 3 items, 2 gaps */
  }
}

@media (min-width: 1280px) {
  .carousel-item {
    flex: 0 0 calc((100% - 72px) / 4);
    /* 4 items, 3 gaps */
  }
}

/* ── Card Styles ── */
.carousel-card {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.carousel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-2);
  border-color: var(--accent);
}

.carousel-card picture {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-sunk);
}

.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s var(--ease-out);
}

.carousel-card:hover img {
  transform: scale(1.02);
}

.carousel-card .card-body {
  padding: var(--sp-2);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.carousel-card .card-tag {
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.carousel-card h3 {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  font-weight: 500;
}

.carousel-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.carousel-card h3 a:hover {
  color: var(--accent);
}

.carousel-card h3 a span {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.carousel-card .card-desc {
  font-size: var(--fs-14);
  color: var(--fg-soft);
  line-height: var(--lh-normal);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel-card .card-link {
  align-self: flex-start;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s var(--ease-out);
}

.carousel-card .card-link:hover {
  gap: 12px;
}

/* ── Controls ── */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  padding: 0 var(--sp-2);
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 300ms var(--ease-out), color 300ms var(--ease-out),
    border-color 300ms var(--ease-out), transform 300ms var(--ease-out);
  flex-shrink: 0;
}

.carousel-btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  transform: scale(1.05);
}

.carousel-btn:active {
  transform: scale(0.92);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

.carousel-btn:disabled:hover {
  background: var(--bg-elev);
  color: var(--fg);
  border-color: var(--line);
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 600px) {
  .carousel-btn {
    width: 38px;
    height: 38px;
  }

  .carousel-btn svg {
    width: 16px;
    height: 16px;
  }

  .carousel-controls {
    gap: var(--sp-3);
  }
}

/* ── Dots ── */
.carousel-dots {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 400ms var(--ease-out), width 400ms var(--ease-out),
    transform 300ms var(--ease-out);
  padding: 0;
  flex-shrink: 0;
}

.carousel-dot:hover {
  transform: scale(1.2);
  background: var(--fg-mute);
}

.carousel-dot.is-active {
  background: var(--accent);
  width: 24px;
  border-radius: var(--r-pill);
}

/* ── Progress Bar ── */
.carousel-progress {
  width: 100%;
  height: 2px;
  background: var(--line);
  border-radius: var(--r-pill);
  margin-top: var(--sp-4);
  overflow: hidden;
  position: relative;
}

.carousel-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--c-accent-hi));
  border-radius: var(--r-pill);
  transition: width 0.4s var(--ease-out);
  will-change: width;
}

/* ── Counter ── */
.carousel-counter {
  font-size: var(--fs-14);
  color: var(--fg-mute);
  text-align: center;
  margin-top: var(--sp-3);
  letter-spacing: var(--tracking-wide);
}

.carousel-counter span {
  font-weight: 600;
}

/* ── Section Head ── */
#related .section-head {
  margin-bottom: var(--sp-6);
}

/* ── Responsive tweaks ── */
@media (max-width: 400px) {
  .carousel-card h3 {
    font-size: var(--fs-18);
  }

  .carousel-card .card-desc {
    font-size: var(--fs-13);
    -webkit-line-clamp: 2;
  }

  .carousel-dot {
    width: 6px;
    height: 6px;
  }

  .carousel-dot.is-active {
    width: 18px;
  }

  .carousel-controls {
    gap: var(--sp-2);
  }
}