/* ═══════════════════════════════════════════════════════════
   project-detail.css  v1  — BK SOFTWARE CO.
   Shared styles for all project detail pages
   Each page sets --pd-accent and --pd-accent2 on :root
   ═══════════════════════════════════════════════════════════ */

:root {
  --pd-bg:      #080a10;
  --pd-card-bg: rgba(255,255,255,0.035);
  --pd-border:  rgba(255,255,255,0.07);
  --pd-accent:  #00d9ff;   /* override per page */
  --pd-accent2: #8b5cf6;   /* override per page */
  --pd-text:    #e8eaf0;
  --pd-muted:   rgba(232,234,240,0.5);
  --pd-radius:  20px;
  --pd-max:     860px;
}

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

body {
  margin: 0;
  background: var(--pd-bg);
  color: var(--pd-text);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.pd-container {
  width: 100%;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 0 24px;
}
.pd-container--wide {
  max-width: 1100px;
}


/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.pd-hero {
  position: relative;
  height: 70vh;
  min-height: 440px;
  max-height: 700px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.pd-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
}

.pd-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,10,16,0.2) 0%,
    rgba(8,10,16,0.55) 50%,
    rgba(8,10,16,0.92) 100%
  );
}

.pd-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 0 52px;
}

.pd-hero__inner .pd-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Breadcrumb */
.pd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pd-muted);
  flex-wrap: wrap;
}
.pd-breadcrumb a {
  color: var(--pd-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.pd-breadcrumb a:hover { color: var(--pd-accent); }
.pd-breadcrumb__sep { font-size: 0.7rem; opacity: 0.5; }
.pd-breadcrumb__cur { color: var(--pd-accent); }

/* Category badge */
.pd-hero__cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(var(--pd-accent-r,0),var(--pd-accent-g,217),var(--pd-accent-b,255),0.1);
  border: 1px solid rgba(var(--pd-accent-r,0),var(--pd-accent-g,217),var(--pd-accent-b,255),0.25);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pd-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  align-self: flex-start;
}

/* Title */
.pd-hero__title {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
  max-width: 700px;
  word-break: break-word;
}

/* Sub */
.pd-hero__sub {
  font-size: 1rem;
  color: rgba(232,234,240,0.7);
  margin: 0;
  max-width: 560px;
  line-height: 1.55;
}


/* ═══════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════ */
.pd-content {
  padding: 64px 0 100px;
}

/* Stats bar */
.pd-stats {
  display: flex;
  gap: 0;
  border-radius: var(--pd-radius);
  overflow: hidden;
  border: 1px solid var(--pd-border);
  margin-bottom: 52px;
}
.pd-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px;
  background: var(--pd-card-bg);
  gap: 4px;
  border-right: 1px solid var(--pd-border);
}
.pd-stat:last-child { border-right: none; }
.pd-stat__val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--pd-accent);
  line-height: 1;
}
.pd-stat__label {
  font-size: 0.78rem;
  color: var(--pd-muted);
  font-weight: 500;
  text-align: center;
}

/* Text content */
.pd-section {
  margin-bottom: 48px;
}
.pd-section__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pd-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pd-section__title::before {
  content: '';
  display: block;
  width: 3px;
  height: 1.2em;
  border-radius: 2px;
  background: var(--pd-accent);
  flex-shrink: 0;
}
.pd-section p {
  font-size: 1rem;
  color: var(--pd-muted);
  line-height: 1.75;
  margin: 0 0 1rem;
}
.pd-section p:last-child { margin-bottom: 0; }
.pd-section ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-section ul li {
  position: relative;
  padding-left: 22px;
  font-size: 0.95rem;
  color: var(--pd-muted);
  line-height: 1.6;
}
.pd-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pd-accent);
  opacity: 0.8;
}
.pd-section strong { color: var(--pd-text); }

/* Glass card */
.pd-glass {
  background: var(--pd-card-bg);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* 2-col layout */
.pd-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}


/* ═══════════════════════════════════════
   INTERACTIVE WIDGET AREA
   ═══════════════════════════════════════ */
.pd-widget {
  background: var(--pd-card-bg);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 52px;
  position: relative;
  overflow: hidden;
}
.pd-widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pd-accent), var(--pd-accent2));
  border-radius: 2px 2px 0 0;
}
.pd-widget__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-align: center;
}
.pd-widget__sub {
  font-size: 0.85rem;
  color: var(--pd-muted);
  margin: -8px 0 0;
  text-align: center;
}
.pd-widget__btn {
  padding: 11px 26px;
  background: linear-gradient(135deg, var(--pd-accent), var(--pd-accent2));
  border: none;
  border-radius: 100px;
  color: #080a10;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(0,217,255,0.2);
}
.pd-widget__btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,217,255,0.3);
}
.pd-widget__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}


/* ═══════════════════════════════════════
   COUNTER CARD
   ═══════════════════════════════════════ */
.pd-counter-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--pd-card-bg);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  padding: 28px 32px;
  margin-bottom: 52px;
  flex-wrap: wrap;
}
.pd-counter-card__icon {
  font-size: 3rem;
  flex-shrink: 0;
}
.pd-counter-card__nums {
  flex: 1;
}
.pd-counter-card__num {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  color: var(--pd-accent);
  line-height: 1;
}
.pd-counter-card__unit {
  font-size: 0.9rem;
  color: var(--pd-muted);
  margin-top: 4px;
}
.pd-counter-card__label {
  font-size: 0.85rem;
  color: var(--pd-muted);
  margin-top: 6px;
}
.pd-counter-card__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--pd-accent), var(--pd-accent2));
  border-radius: 100px;
  color: #080a10;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,217,255,0.2);
  white-space: nowrap;
}
.pd-counter-card__cta:hover { opacity: 0.88; transform: translateY(-2px); }


/* ═══════════════════════════════════════
   BACK NAVIGATION
   ═══════════════════════════════════════ */
.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pd-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s, gap 0.2s;
}
.pd-back:hover { color: var(--pd-accent); gap: 12px; }
.pd-back svg { width: 16px; height: 16px; }


/* ═══════════════════════════════════════
   PLANT SVG (Project 1)
   ═══════════════════════════════════════ */
.pd-plant-wrap {
  width: 100%;
  max-width: 260px;
  position: relative;
}
.pd-plant-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Keep original plant animation styles */
#plant-svg .guide {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 2;
}
#flow-line {
  fill: none;
  stroke: rgba(0,217,255,0.5);
  stroke-width: 2.5;
  stroke-dasharray: 600;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s ease, opacity 0.5s ease;
}
#flow-line.hide { opacity: 0; stroke-dashoffset: 600; }
#fill-line {
  fill: none;
  stroke: #00d9ff;
  stroke-width: 3;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 1.5s ease;
  filter: drop-shadow(0 0 6px rgba(0,217,255,0.6));
}
#fill-line.done { stroke-dashoffset: 0; }
.leaf {
  fill: #4ade80;
  opacity: 0;
  transform-origin: 0 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  filter: drop-shadow(0 0 4px rgba(74,222,128,0.4));
}
.leaf-group { transform: translate(var(--x), var(--y)) rotate(var(--aci)); }
.leaf-group.opening .leaf {
  opacity: 1;
  transform: scale(1.2);
  transition-delay: var(--dly);
}


/* ═══════════════════════════════════════
   PANDA / FOREST (Project 2)
   ═══════════════════════════════════════ */
.pd-forest-wrap {
  width: 100%;
}

.forest-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.scene {
  width: 100%;
  max-width: 420px;
  height: 280px;
  background: linear-gradient(to bottom, rgba(0,60,20,0.2), rgba(0,80,30,0.3));
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(74,222,128,0.15);
}

/* Panda */
.panda {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
}
.body {
  width: 60px; height: 60px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  bottom: 0; left: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ear {
  width: 22px; height: 22px;
  background: #111;
  border-radius: 50%;
  position: absolute;
  top: -4px;
}
.ear.left  { left: 6px; }
.ear.right { right: 6px; }
.face {
  width: 48px; height: 48px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 4px; left: 16px;
  z-index: 2;
}
.eye {
  width: 12px; height: 12px;
  background: #111;
  border-radius: 50%;
  position: absolute;
  top: 12px;
}
.eye.left  { left: 7px; }
.eye.right { right: 7px; }
.nose {
  width: 8px; height: 5px;
  background: #555;
  border-radius: 50%;
  position: absolute;
  top: 25px; left: 50%; transform: translateX(-50%);
}
.mouth {
  width: 16px; height: 6px;
  border-bottom: 2px solid #555;
  border-radius: 0 0 8px 8px;
  position: absolute;
  top: 30px; left: 50%; transform: translateX(-50%);
}
.arm {
  width: 16px; height: 28px;
  background: #fff;
  border-radius: 8px;
  position: absolute;
  bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.arm.left  { left: 0; transform: rotate(-20deg); }
.arm.right { right: 0; transform: rotate(20deg); }
.leg {
  width: 18px; height: 20px;
  background: #111;
  border-radius: 8px;
  position: absolute;
  bottom: -6px;
}
.leg.left  { left: 14px; }
.leg.right { right: 14px; }

/* Panda happy state */
.panda.happy { animation: pandaHappy 0.5s ease-in-out 3; }
@keyframes pandaHappy {
  0%,100%{ transform: translateX(-50%) translateY(0); }
  50%{ transform: translateX(-50%) translateY(-12px); }
}

/* Bamboo */
.bamboo {
  position: absolute;
  bottom: 30px;
  left: var(--bamboo-left, 30%);
  width: 14px;
  height: 0;
  background: linear-gradient(to right, #4ade80, #22c55e);
  border-radius: 4px;
  transition: height 1s ease calc(var(--bamboo-delay, 0s));
}
.bamboo.new { left: var(--bamboo-left, 70%); }
.bamboo.grown { height: 130px; }
.ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: linear-gradient(to top, rgba(34,197,94,0.3), transparent);
  border-radius: 0 0 16px 16px;
}


/* ═══════════════════════════════════════
   IMPACT CARDS GRID
   ═══════════════════════════════════════ */
.pd-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.pd-impact-card {
  background: var(--pd-card-bg);
  border: 1px solid var(--pd-border);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.25s, background 0.25s;
}
.pd-impact-card:hover {
  background: rgba(var(--pd-accent-r,0),var(--pd-accent-g,217),var(--pd-accent-b,255),0.04);
  border-color: rgba(var(--pd-accent-r,0),var(--pd-accent-g,217),var(--pd-accent-b,255),0.18);
}
.pd-impact-card__icon { font-size: 1.8rem; }
.pd-impact-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.pd-impact-card__desc {
  font-size: 0.8rem;
  color: var(--pd-muted);
  line-height: 1.5;
  margin: 0;
}


/* ═══════════════════════════════════════
   QUOTE CALLOUT
   ═══════════════════════════════════════ */
.pd-quote {
  border-left: 3px solid var(--pd-accent);
  padding: 16px 20px;
  background: rgba(var(--pd-accent-r,0),var(--pd-accent-g,217),var(--pd-accent-b,255),0.04);
  border-radius: 0 12px 12px 0;
  margin-bottom: 48px;
}
.pd-quote p {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--pd-text) !important;
  margin: 0 !important;
  line-height: 1.6;
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .pd-hero { height: 55vh; min-height: 380px; }
  .pd-hero__title { font-size: clamp(1.7rem, 6vw, 2.4rem); }

  .pd-stats { flex-wrap: wrap; border-radius: 16px; }
  .pd-stat { flex: 1 1 45%; border-right: none; border-bottom: 1px solid var(--pd-border); }
  .pd-stat:nth-last-child(-n+2) { border-bottom: none; }

  .pd-two-col { grid-template-columns: 1fr; }

  .pd-counter-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }
}

@media (max-width: 640px) {
  .pd-container { padding: 0 16px; }

  .pd-hero { height: 50vh; min-height: 320px; }
  .pd-hero__inner { padding: 0 0 36px; }
  .pd-hero__title { font-size: clamp(1.4rem, 7.5vw, 2rem); }
  .pd-hero__sub { font-size: 0.88rem; display: none; }

  .pd-content { padding: 40px 0 72px; }
  .pd-section__title { font-size: 1.2rem; }

  .pd-stats { flex-direction: column; border-radius: 14px; }
  .pd-stat { flex: unset; border-bottom: 1px solid var(--pd-border); border-right: none; }
  .pd-stat:last-child { border-bottom: none; }

  .pd-widget { padding: 24px 20px; }
  .pd-glass { padding: 20px; }

  .pd-impact-grid { grid-template-columns: 1fr; }
}
