/* ============================================================
   project.css — Shared styles for all project detail pages
   Matches the new index.html design system exactly
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Pinyon+Script&display=swap');

/* ---------- TOKENS ---------- */
:root {
  --bg: #0B0B0A;
  --bg-rgb: 11,11,10;
  --bg-alt: #141412;
  --ink: #F4F3EF;
  --ink-dim: #98978F;
  --ink-faint: #5C5B55;
  --line: #28271F;
  --line-soft: #1B1A16;
  --serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --grot: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --script: 'Pinyon Script', cursive;
}
html[data-theme="light"] {
  --bg: #F7F6F1;
  --bg-rgb: 247,246,241;
  --bg-alt: #EDEBE3;
  --ink: #0B0B0A;
  --ink-dim: #5C5B55;
  --ink-faint: #9A988E;
  --line: #DEDBD0;
  --line-soft: #E9E7DF;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { transition: background-color .45s ease, color .45s ease; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body, 'Helvetica Neue', Helvetica, Arial, sans-serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
img { max-width: 100%; display: block; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 700px) { .wrap { padding: 0 22px; } }

/* ---------- HEADER / NAV ---------- */
.pd-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 22px 40px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  transition: background-color .45s ease;
}
@media (max-width: 700px) { .pd-header { padding: 18px 22px; } }

.pd-logo {
  font-family: var(--script);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.pd-logo:hover { opacity: .7; }

.pd-nav { display: flex; align-items: center; gap: 28px; }
@media (max-width: 860px) { .pd-nav { display: none; } }

.pd-nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  position: relative;
  padding-bottom: 3px;
  transition: color .25s ease;
}
.pd-nav a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width .35s cubic-bezier(.65,0,.35,1);
}
.pd-nav a:hover { color: var(--ink); }
.pd-nav a:hover::after { width: 100%; }

.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center;
}
.theme-toggle-track {
  width: 48px; height: 24px;
  border: 1px solid var(--ink); border-radius: 20px;
  position: relative; display: block;
  transition: background-color .3s ease;
}
.theme-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink);
  transition: transform .35s cubic-bezier(.65,0,.35,1);
}
html[data-theme="light"] .theme-toggle-thumb { transform: translateX(24px); }

/* ---------- MAIN CONTENT ---------- */
.pd-main { padding-top: 80px; }

/* ---------- HERO BLOCK ---------- */
.pd-hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--line);
}
.pd-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 48px;
  transition: color .25s ease;
}
.pd-back:hover { color: var(--ink); }
.pd-back svg { width: 14px; height: 14px; }

.pd-eyebrow {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
}
.pd-title {
  font-family: var(--grot); font-weight: 900;
  font-size: clamp(38px, 6vw, 80px);
  line-height: 0.96; letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.pd-subtitle {
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-dim); letter-spacing: 0.04em;
  margin-bottom: 36px;
}
.pd-links {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.pd-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 10px 18px;
  transition: border-color .25s ease, background .25s ease, color .25s ease;
}
.pd-link:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.pd-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- STATS BAR ---------- */
.pd-stats {
  display: flex; gap: 0;
  border: 1px solid var(--line);
  margin-bottom: 0;
}
.pd-stat {
  flex: 1; padding: 24px 28px;
  border-right: 1px solid var(--line);
}
.pd-stat:last-child { border-right: none; }
.pd-stat-num {
  font-family: var(--grot); font-weight: 800;
  font-size: clamp(22px, 2.8vw, 32px);
  letter-spacing: -0.01em; margin-bottom: 6px;
}
.pd-stat-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
@media (max-width: 700px) {
  .pd-stats { flex-wrap: wrap; }
  .pd-stat { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
}

/* ---------- CONTENT SECTIONS ---------- */
.pd-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}
.pd-section:last-child { border-bottom: none; }

.pd-section-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 40px;
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px;
}
.pd-section-title {
  font-family: var(--grot); font-weight: 900;
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.pd-text {
  color: var(--ink-dim);
  font-size: 15px; line-height: 1.8;
  max-width: 720px;
  margin-bottom: 18px;
}
.pd-text:last-child { margin-bottom: 0; }
.pd-text strong { color: var(--ink); font-weight: 600; }

/* ---------- TWO-COL LAYOUT ---------- */
.pd-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
}
@media (max-width: 860px) { .pd-two-col { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- TECH GRID ---------- */
.pd-tech-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 8px;
}
.pd-tech-tag {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 8px 14px; color: var(--ink-dim);
  transition: border-color .25s ease, color .25s ease;
}
.pd-tech-tag:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- FEATURES LIST ---------- */
.pd-features {
  display: flex; flex-direction: column; gap: 0;
}
.pd-feature {
  display: grid; grid-template-columns: 24px 1fr;
  gap: 16px; align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14.5px; line-height: 1.7;
  color: var(--ink-dim);
}
.pd-feature:last-child { border-bottom: 1px solid var(--line-soft); }
.pd-feature strong { color: var(--ink); }
.pd-feature-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint); margin-top: 8px;
  justify-self: center;
}

/* ---------- CHALLENGES ---------- */
.pd-challenge {
  padding: 32px 0;
  border-top: 1px solid var(--line-soft);
}
.pd-challenge:last-child { border-bottom: 1px solid var(--line-soft); }
.pd-challenge-title {
  font-family: var(--grot); font-weight: 700;
  font-size: 16px; margin-bottom: 10px; color: var(--ink);
}
.pd-challenge-desc { font-size: 14px; line-height: 1.75; color: var(--ink-dim); margin-bottom: 10px; }
.pd-challenge-solution {
  font-size: 14px; line-height: 1.75; color: var(--ink-dim);
  border-left: 2px solid var(--ink-faint); padding-left: 16px;
}
.pd-challenge-solution strong { color: var(--ink); }

/* ---------- GALLERY GRID ---------- */
.pd-gallery-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  margin-top: 8px;
}
.pd-gallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pd-gallery-item {
  overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-alt);
}
.pd-gallery-item img {
  width: 100%; aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .3s ease;
  opacity: .85;
}
.pd-gallery-item:hover img { transform: scale(1.03); opacity: 1; }
.pd-gallery-caption {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); padding: 10px 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .pd-gallery-grid { grid-template-columns: 1fr; }
  .pd-gallery-grid.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- LEARNED LIST ---------- */
.pd-learned {
  display: flex; flex-direction: column; gap: 0;
}
.pd-learned-item {
  display: grid; grid-template-columns: 24px 1fr;
  gap: 14px; align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14.5px; line-height: 1.7;
  color: var(--ink-dim);
}
.pd-learned-item:last-child { border-bottom: 1px solid var(--line-soft); }
.pd-learned-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-faint); margin-top: 9px;
  justify-self: center;
}

/* ---------- CASE STUDY BLOCK ---------- */
.pd-casestudy-grid {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 40px; padding: 32px 0;
  border-top: 1px solid var(--line-soft);
}
.pd-casestudy-grid:last-child { border-bottom: 1px solid var(--line-soft); }
@media (max-width: 700px) { .pd-casestudy-grid { grid-template-columns: 1fr; gap: 14px; } }
.pd-casestudy-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); padding-top: 4px;
}
.pd-casestudy-body { font-size: 15px; line-height: 1.8; color: var(--ink-dim); }
.pd-casestudy-body strong { color: var(--ink); }

/* ---------- SINGLE PREVIEW IMAGE ---------- */
.pd-preview-wrap {
  border: 1px solid var(--line); overflow: hidden;
  background: var(--bg-alt);
}
.pd-preview-wrap img {
  width: 100%;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
  cursor: zoom-in;
}
.pd-preview-wrap:hover img { transform: scale(1.015); }

/* ---------- COLOR PALETTE ---------- */
.pd-palette {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px;
}
.pd-swatch { display: flex; flex-direction: column; gap: 8px; }
.pd-swatch-color { width: 64px; height: 64px; border: 1px solid var(--line); }
.pd-swatch-hex { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); letter-spacing: 0.04em; }
.pd-swatch-name { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- FIGMA SCREENS (Organic Shop) ---------- */
.figma-section-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px; margin-top: 40px;
  border-left: 2px solid var(--ink-faint); padding-left: 12px;
}
.figma-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.figma-scroll::-webkit-scrollbar { height: 4px; }
.figma-scroll::-webkit-scrollbar-track { background: transparent; }
.figma-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.figma-screen {
  flex-shrink: 0; width: 140px;
  border: 1px solid var(--line); background: var(--bg-alt);
  cursor: pointer; overflow: hidden;
  transition: border-color .25s ease;
}
.figma-screen:hover { border-color: var(--ink); }
.figma-screen img { width: 100%; aspect-ratio: 9/16; object-fit: cover; }
.figma-screen-label {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); padding: 7px 8px;
  border-top: 1px solid var(--line);
}

/* ---------- DESIGN TOGGLE (Organic Shop) ---------- */
.pd-toggle-row { display: flex; gap: 10px; margin-bottom: 32px; }
.pd-toggle-btn {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); background: none;
  color: var(--ink-dim); padding: 10px 18px;
  cursor: pointer; transition: all .25s ease;
}
.pd-toggle-btn.active, .pd-toggle-btn:hover {
  border-color: var(--ink); color: var(--ink); background: var(--bg-alt);
}

/* ---------- LIGHTBOX ---------- */
.pd-lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 999;
  align-items: center; justify-content: center;
  padding: 20px;
}
.pd-lightbox.open { display: flex; }
.pd-lightbox img {
  max-height: 90vh; max-width: 90vw;
  object-fit: contain; border-radius: 4px;
}
.pd-lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,255,255,.1); border: none;
  color: #fff; font-size: 20px; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s ease;
}
.pd-lightbox-close:hover { background: rgba(255,255,255,.2); }

/* ---------- FOOTER ---------- */
.pd-footer {
  padding: 60px 0 36px;
  border-top: 1px solid var(--line);
  margin-top: 0;
}
.pd-foot-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px;
}
.pd-foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.pd-foot-links a {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); transition: color .25s ease;
}
.pd-foot-links a:hover { color: var(--ink); }
.pd-foot-note {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.04em;
}

/* ---------- REVEAL ANIMATION ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
  .pd-title { font-size: clamp(32px, 9vw, 54px); }
  .pd-stats { flex-direction: column; }
  .pd-stat { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ---------- FRAMER-STYLE PROJECT LAYOUT ---------- */
.pd-framer-hero {
  padding: 100px 0 60px;
  text-align: center;
}
.pd-framer-title {
  font-family: var(--grot); font-weight: 900;
  font-size: clamp(48px, 10vw, 110px);
  line-height: 0.9; letter-spacing: -0.03em;
  margin-bottom: 20px; text-transform: uppercase;
}
.pd-framer-subtitle {
  font-family: var(--mono); font-size: 14px;
  color: var(--ink-dim); letter-spacing: 0.04em;
  margin-bottom: 64px; text-transform: uppercase;
}
.pd-framer-cover {
  width: 100%; border-radius: 32px; overflow: hidden;
  margin-bottom: 64px;
  background: var(--bg-alt);
}
.pd-framer-cover img {
  width: 100%; height: auto; display: block;
}
.pd-framer-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; padding: 40px 0; text-align: left;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 860px) {
  .pd-framer-meta { grid-template-columns: 1fr 1fr; }
}
.meta-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 10px;
}
.meta-val {
  font-family: var(--grot); font-weight: 600;
  font-size: 16px; color: var(--ink); line-height: 1.4;
}

.pd-framer-content {
  padding: 60px 0 100px;
}
.content-block {
  margin-bottom: 80px;
}
.text-block {
  max-width: 720px; margin: 0 auto 80px; text-align: left;
}
.text-block h2 {
  font-family: var(--grot); font-size: 32px; font-weight: 800;
  margin-bottom: 24px; letter-spacing: -0.01em;
}
.text-block p {
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 20px;
}
.text-block p:last-child { margin-bottom: 0; }
.text-block strong { color: var(--ink); }

.img-block {
  width: 100%; margin-bottom: 80px;
}
.img-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
@media (max-width: 860px) {
  .img-grid { grid-template-columns: 1fr; }
}
.pd-framer-next {
  text-align: center; padding: 120px 0 60px;
  border-top: 1px solid var(--line);
}
.next-link {
  display: inline-block; transition: opacity .3s ease;
}
.next-link:hover { opacity: .7; }
.next-label {
  display: block; font-family: var(--mono); font-size: 12px;
  color: var(--ink-faint); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 16px;
}
.next-title {
  display: block; font-family: var(--grot); font-weight: 900;
  font-size: clamp(36px, 6vw, 72px); letter-spacing: -0.02em;
}

/* --- ORGANIC SHOP CUSTOM STYLES --- */
/*==========================================
  ORGANIC SHOP — FIGMA UI SHOWCASE
  Styles for assets/projects/organic-shop.html
==========================================*/

/* ── Fix bd-grid inside gallery so it doesn't break flex children ── */
.project-detail__gallery.bd-grid {
  display: block;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
  margin-bottom: 3rem;
}

/* ── Stats container: fix bd-grid wrapper ── */
.figma-stats-wrapper.bd-grid {
  display: block;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}

/* ── Video: portrait phone recording, full-content-width container ── */
.organic-shop-video.project-detail__video-wrapper {
  position: static;
  padding-bottom: 0;
  height: auto;
  overflow: hidden;
  background-color: #0a0a0a;
  border-radius: 1.25rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  min-height: 480px;
}

.project-detail__video-wrapper video {
  width: auto;
  max-width: 100%;
  height: 520px;
  border-radius: 0;
  display: block;
  margin: 0 auto;
  box-shadow: none;
}

/* Mobile: let it fill width naturally */
@media screen and (max-width: 768px) {
  .organic-shop-video.project-detail__video-wrapper {
    min-height: unset;
    border-radius: 0.75rem;
  }

  .project-detail__video-wrapper video {
    height: auto;
    width: 100%;
    max-height: 70vw;
  }
}

/* ── Stats row ── */
.figma-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 0.5rem auto 2rem;
}

.figma-stat {
  text-align: center;
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.figma-stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.figma-stat__number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--first-color);
  display: block;
  line-height: 1.2;
}

.figma-stat__label {
  font-size: 0.7rem;
  color: var(--second-color);
  margin-top: 0.25rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Dark mode stats */
body.dark-mode .figma-stat {
  background: #2a2a2a;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.06);
}

body.dark-mode .figma-stat:hover {
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
}

body.dark-mode .figma-stat__label {
  color: #bbb;
}

/* ── Category label above each screen group ── */
.figma-category-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--first-color);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 1.2rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}

/* ── Screen section wrapper ── */
.figma-screens-section {
  margin-bottom: 2.5rem;
  overflow: visible;
}

/* ── Horizontal scroll row ── */
.figma-screens-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 1.25rem;      /* space so scrollbar doesn't overlap cards */
  padding-top: 1rem;            /* room for upward hover lift */
  padding-left: 0.25rem;        /* stop edge cards clipping */
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--first-color) rgba(0, 0, 0, 0.06);
  -webkit-overflow-scrolling: touch;
}

.figma-screens-scroll::-webkit-scrollbar {
  height: 3px;
  margin-top: 8px;
}

.figma-screens-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.figma-screens-scroll::-webkit-scrollbar-thumb {
  background: var(--first-color);
  border-radius: 10px;
}

/* ── Individual screen card ── */
.figma-screen-item {
  flex: 0 0 auto;
  width: 160px;
  text-align: center;
  cursor: pointer;
}

.figma-screen-item img {
  width: 160px;
  height: 346px;              /* exact 390:844 ratio → 160 × (844/390) = 346px */
  object-fit: cover;
  object-position: center top;
  background-color: #f5f5f5;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  border: 2px solid rgba(0, 0, 0, 0.06);
}

.figma-screen-item img:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
  border-color: var(--first-color);
}

.figma-screen-item p {
  font-size: 0.7rem;
  color: var(--second-color);
  margin-top: 0.5rem;
  line-height: 1.3;
  opacity: 0.8;
}

/* Dark mode screen captions & borders */
body.dark-mode .figma-screen-item img {
  background-color: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .figma-screen-item img:hover {
  border-color: var(--first-color);
}

body.dark-mode .figma-screen-item p {
  color: #bbb;
}

/* ── Spacing & Grid System ── */
.project-detail__spacing.bd-grid {
  margin-top: 2rem;
  margin-bottom: 2rem;
  display: block;
}

.spacing-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.spacing-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.spacing-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.spacing-square-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spacing-square {
  background: #ff0000;
  border-radius: 0;
  flex-shrink: 0;
}

.sq-4  { width: 4px;  height: 4px; }
.sq-8  { width: 8px;  height: 8px; }
.sq-16 { width: 16px; height: 16px; }
.sq-24 { width: 24px; height: 24px; }
.sq-32 { width: 32px; height: 32px; }
.sq-48 { width: 48px; height: 48px; }

.spacing-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.spacing-size {
  font-size: 1rem;
  font-weight: 700;
  color: var(--first-color);
  letter-spacing: 0.03em;
}

.spacing-desc {
  font-size: 0.8rem;
  color: var(--second-color);
  opacity: 0.75;
  line-height: 1.5;
}

body.dark-mode .spacing-row {
  background: #2a2a2a;
  box-shadow: 0 2px 12px rgba(255,255,255,0.05);
}

body.dark-mode .spacing-row:hover {
  box-shadow: 0 6px 24px rgba(255,255,255,0.09);
}

body.dark-mode .spacing-desc {
  color: #bbb;
  opacity: 1;
}

@media screen and (max-width: 576px) {
  .spacing-square-wrap {
    width: 48px;
    height: 48px;
  }

  .spacing-row {
    gap: 1rem;
    padding: 0.85rem 1rem;
  }

  .spacing-size {
    font-size: 0.9rem;
  }

  .spacing-desc {
    font-size: 0.75rem;
  }
}

/* ── Color Palette ── */
.project-detail__palette.bd-grid {
  margin-top: 2rem;
  margin-bottom: 2rem;
  display: block;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto 0;
}

.palette-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border-radius: 20px;
  padding: 1.2rem 1rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line);
  width: 100%;
  gap: 0.6rem;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: default;
}

.palette-swatch:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--ink-faint);
}

.palette-color {
  width: 100%;
  height: 120px;
  border-radius: 12px;
}

.palette-hex {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.5px;
  font-family: monospace;
}

.palette-name {
  font-size: 0.72rem;
  color: var(--ink-dim);
  text-align: center;
}

@media screen and (max-width: 500px) {
  .palette-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    max-width: 100%;
  }

  .palette-color {
    height: 90px;
  }
}

/* ── Lightbox overlay ── */
#figma-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
}

#figma-lightbox.active {
  display: flex;
}

#figma-lightbox img {
  max-height: 88vh;
  max-width: 88vw;
  border-radius: 1.25rem;
  object-fit: contain;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  animation: figmaLightboxIn 0.22s ease;
}

@keyframes figmaLightboxIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#figma-lightbox-caption {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  margin-top: 0.85rem;
  letter-spacing: 0.03em;
}

#figma-lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

#figma-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

#figma-lightbox-prev,
#figma-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.13);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

#figma-lightbox-prev { left: 1rem; }
#figma-lightbox-next { right: 1rem; }

#figma-lightbox-prev:hover,
#figma-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Responsive tweaks ── */
@media screen and (max-width: 768px) {
  .project-detail__gallery.bd-grid {
    padding: 0 1rem;
  }

  .figma-stats-wrapper.bd-grid {
    padding: 0 1rem;
  }
}

@media screen and (max-width: 576px) {
  .figma-screen-item {
    width: 130px;
  }

  .figma-screen-item img {
    width: 130px;
    height: 281px;              /* 130 × (844/390) = 281px */
    object-fit: cover;
    object-position: center top;
  }

  .figma-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .figma-stat {
    padding: 0.75rem 1rem;
    min-width: 68px;
  }

  .figma-stat__number {
    font-size: 1.25rem;
  }

  #figma-lightbox-prev,
  #figma-lightbox-next {
    font-size: 1.3rem;
    padding: 0.35rem 0.6rem;
  }
}



/* ==========================================
   DESIGN TYPE TOGGLE (Simple UI / High Fidelity)
   Used on organic-shop.html gallery section
==========================================*/

.design-toggle-wrap {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.design-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.75rem;
  border: 2px solid var(--first-color);
  border-radius: 2rem;
  background: transparent;
  color: var(--first-color);
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease,
              transform 0.2s ease, box-shadow 0.25s ease;
}

.design-toggle-btn i {
  font-size: 1.1rem;
}

.design-toggle-btn:hover {
  background: var(--first-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(64, 112, 244, 0.3);
}

.design-toggle-btn.active {
  background: var(--first-color);
  color: #fff;
  box-shadow: 0 4px 16px rgba(64, 112, 244, 0.35);
}

.design-toggle-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

/* Dark mode */
body.dark-mode .design-toggle-btn {
  border-color: #4d90fe;
  color: #4d90fe;
}

body.dark-mode .design-toggle-btn:hover,
body.dark-mode .design-toggle-btn.active {
  background: #4d90fe;
  color: #fff;
  box-shadow: 0 4px 18px rgba(77, 144, 254, 0.4);
}

/* Panel */
.design-panel {
  width: 100%;
}

@media screen and (max-width: 576px) {
  .design-toggle-wrap {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .design-toggle-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* ── Mockup screens — wider aspect ratio ── */
[data-category="hifi-mockups"] .figma-screen-item {
  width: 260px;
}

[data-category="hifi-mockups"] .figma-screen-item img {
  width: 260px;
  height: 180px;
  object-fit: cover;
  object-position: center;
  border-radius: 0.75rem;
}

@media screen and (max-width: 576px) {
  [data-category="hifi-mockups"] .figma-screen-item {
    width: 200px;
  }

  [data-category="hifi-mockups"] .figma-screen-item img {
    width: 200px;
    height: 140px;
  }
}

/* ── figma-screens-section: simple CSS fade-in (not ScrollReveal) ── */
.figma-screens-section {
  animation: screenSectionFadeIn 0.5s ease both;
}

@keyframes screenSectionFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* stagger each section */
.figma-screens-section:nth-child(1)  { animation-delay: 0.05s; }
.figma-screens-section:nth-child(2)  { animation-delay: 0.10s; }
.figma-screens-section:nth-child(3)  { animation-delay: 0.15s; }
.figma-screens-section:nth-child(4)  { animation-delay: 0.20s; }
.figma-screens-section:nth-child(5)  { animation-delay: 0.25s; }
.figma-screens-section:nth-child(6)  { animation-delay: 0.30s; }
.figma-screens-section:nth-child(7)  { animation-delay: 0.35s; }

/* ── Premium Screens Grid ── */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 32px;
  margin-top: 32px;
}

.screen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.screen-card:hover {
  transform: translateY(-8px);
}

.screen-card img {
  width: 100%;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
  background: var(--bg);
  object-fit: cover;
}

.screen-caption {
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.7;
  text-align: center;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .screens-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }
}

/* ── Horizontal Scrolling Gallery ── */
.screens-row-container {
  margin-top: 64px;
  text-align: left;
  max-width: 100%;
}

.screens-category-pill {
  display: inline-block;
  background-color: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.screens-horizontal-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 24px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.screens-horizontal-scroll::-webkit-scrollbar {
  height: 6px;
}

.screens-horizontal-scroll::-webkit-scrollbar-track {
  background: var(--line);
  border-radius: 10px;
}

.screens-horizontal-scroll::-webkit-scrollbar-thumb {
  background-color: var(--ink-faint);
  border-radius: 10px;
}

.screens-horizontal-scroll .screen-card {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
}

.screens-horizontal-scroll .screen-card img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  background: var(--bg);
  object-fit: cover;
}

.screens-horizontal-scroll .screen-caption {
  margin-top: 12px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-dim);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Design Highlights Grid ── */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.highlight-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--ink-faint);
}

.highlight-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.highlight-icon svg {
  width: 14px;
  height: 14px;
  color: var(--bg);
}

.highlight-text {
  font-family: var(--grot);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.5;
  font-weight: 500;
}

.pd-link.active {
  background: var(--ink) !important;
  color: var(--bg) !important;
  border-color: var(--ink) !important;
}

/* ── Lightbox Gallery ── */
.pd-lightbox {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.pd-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.pd-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  object-fit: contain;
}
.pd-lightbox-close,
.pd-lightbox-prev,
.pd-lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2;
}
.pd-lightbox-close:hover,
.pd-lightbox-prev:hover,
.pd-lightbox-next:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}
.pd-lightbox-close { top: 24px; right: 24px; position: fixed; }
.pd-lightbox-prev { left: 24px; position: fixed; top: 50%; transform: translateY(-50%); }
.pd-lightbox-next { right: 24px; position: fixed; top: 50%; transform: translateY(-50%); }
.pd-lightbox-prev:hover, .pd-lightbox-next:hover { transform: translateY(-50%) scale(1.05); }

/* Add pointer to screen cards */
.screens-grid img {
  cursor: zoom-in;
  transition: transform 0.3s ease;
}
.screens-grid img:hover {
  transform: scale(1.02);
}

/* ---------- LIVE DESIGN LINK ---------- */
.pd-live-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  margin-bottom: 36px;
}

.pd-live-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.pd-live-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .22s ease, border-color .22s ease, color .22s ease, transform .18s ease;
  cursor: pointer;
  text-decoration: none;
}

.pd-live-link:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.pd-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .55; transform: scale(0.8); }
}

.pd-live-link svg {
  flex-shrink: 0;
  transition: transform .18s ease;
}
.pd-live-link:hover svg {
  transform: translate(2px, -2px);
}
