/**
 * Work Showcase Page Stylesheet - 3x3 Website Cards Grid
 *
 * Theme: Code1001
 * Follows exact frosted glass card overlay architecture from user reference
 * Dual theme support & responsive design
 *
 * @package Code1001
 */

/* ==========================================================================
   1. Page Shell & Hero Section
   ========================================================================== */
.work-page-wrapper {
  position: relative;
  width: 100%;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--text);
  overflow: visible !important;
  overflow-x: clip !important;
  padding-bottom: 80px;
}

html,
body {
  overflow-x: clip !important;
}

.work-hero-section {
  position: relative;
  padding: 80px 0 40px;
  background: transparent !important;
}

.work-hero-ambient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 900px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 100%);
}

.ambient-glow.work-glow-1 {
  position: absolute;
  top: -100px;
  left: 15%;
  width: 650px;
  height: 520px;
  background: radial-gradient(circle, rgba(19, 165, 127, 0.14) 0%, transparent 70%);
  filter: blur(100px);
}

.ambient-glow.work-glow-2 {
  position: absolute;
  top: -40px;
  right: 10%;
  width: 550px;
  height: 480px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
  filter: blur(100px);
}

.work-hero-content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.work-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  margin-bottom: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.wkp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #13a57f;
  box-shadow: 0 0 8px rgba(19, 165, 127, 0.8);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.work-hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 20px;
}

.work-gradient-text {
  background: linear-gradient(135deg, var(--text) 0%, #13a57f 60%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.work-hero-subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 780px;
  margin: 0 auto 32px;
}

/* Category Filter Tabs */
.work-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 20px;
}

.work-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

.work-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.work-filter-btn:hover {
  color: var(--text);
  background: var(--card-2);
}

.work-filter-btn.is-active {
  background: var(--card-2);
  border-color: rgba(19, 165, 127, 0.4);
  color: #13a57f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .work-filter-btn.is-active {
  background: #ffffff;
  border-color: rgba(19, 165, 127, 0.5);
  color: #0d8a68;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--card-3);
  color: var(--text-dim);
}

.work-filter-btn.is-active .filter-count {
  background: rgba(19, 165, 127, 0.18);
  color: #13a57f;
}

/* ==========================================================================
   2. Projects Grid (Continuous 4-Column Architectural Grid Reference Match)
   ========================================================================== */
.work-grid-section {
  position: relative;
  z-index: 1;
  padding: 0;
  background: transparent !important;
  background-color: transparent !important;
}

.work-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--bg);
  box-sizing: border-box;
}

/* Individual Grid Card */
.pw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 24px 24px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.22s ease, border-color 0.22s ease;
  box-sizing: border-box;
}

.pw-card:hover,
.pw-card:focus-visible {
  background: var(--card);
}

.pw-card:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: -2px;
}

/* Top Header Row: Project Title Left, Action Indicator Right */
.pw-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pw-card-title,
.pw-card-metric {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.pw-card:hover .pw-card-title,
.pw-card:hover .pw-card-metric {
  color: var(--text);
}

.pw-card-action-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.pw-card-cs-arrow,
.pw-card-modal-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.pw-card:hover .pw-card-cs-arrow,
.pw-card:hover .pw-card-modal-arrow {
  transform: translate(2px, -2px);
  color: #10b981;
}

/* Impact Statement Directly Below Metric */
.pw-card-impact {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-dim);
  margin: 0 0 24px 0;
  min-height: 2.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.pw-card:hover .pw-card-impact {
  color: var(--text);
}

/* Card Visual Mockup Showcase Container */
.pw-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  margin-top: auto;
}

.pw-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pw-card:hover .pw-card-img {
  transform: scale(1.035);
}

/* Case Study Badge Overlay */
.pw-card-badge-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.pw-card:hover .pw-card-badge-overlay {
  opacity: 1;
  transform: translateY(0);
}

.pw-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.94);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.pw-card-badge svg {
  width: 11px;
  height: 11px;
}
}

/* ==========================================================================
   3. CTA Section
   (Styled by landing.css: .cta-section / .cta-outer-frame / .cta-card / .cta-mosaic-bg)
   ========================================================================== */

/* ==========================================================================
   4. Case Study Detail Modal
   ========================================================================== */
.work-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.work-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 14, 0.78);
  backdrop-filter: blur(8px);
}

.work-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.6);
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  0% { transform: scale(0.96) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.work-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.work-modal-close:hover {
  background: var(--card-3);
  color: var(--text);
}

.work-modal-close svg {
  width: 18px;
  height: 18px;
}

.work-modal-header {
  margin-bottom: 24px;
  padding-right: 40px;
}

.wm-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.wm-sep {
  color: var(--text-faint);
}

.wm-category-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.work-modal-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
}

.wm-metric-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(19, 165, 127, 0.14);
  color: #13a57f;
}

.work-modal-media {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  background: var(--bg-soft);
}

.wm-preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.work-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wm-section h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.wm-section p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0;
}

.wm-impact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-impact-list li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.wm-impact-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #13a57f;
  font-weight: 800;
}

.wm-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wm-tags-row span {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

.wm-services-text {
  font-size: 13px !important;
  color: var(--text-faint) !important;
}

.work-modal-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  text-align: right;
}

/* ==========================================================================
   5. Responsive Design Breakpoints
   ========================================================================== */

/* Tablets (Landscape) */
@media (max-width: 992px) {
  .work-hero-title {
    font-size: 42px;
  }

  .pw-card {
    padding: 26px 20px 20px;
  }
}

/* Tablets (Portrait) & Mobile */
@media (max-width: 768px) {
  .work-hero-section {
    padding: 55px 0 25px;
  }

  .work-hero-title {
    font-size: 32px;
  }

  .work-hero-subtitle {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .work-grid-section {
    padding: 0;
  }

  .work-projects-grid {
    grid-template-columns: 1fr;
  }

  .pw-card {
    padding: 22px 18px 18px;
  }

  .pw-card-title,
  .pw-card-metric {
    min-height: auto;
  }

  .pw-card-impact {
    font-size: 13px;
    margin-bottom: 18px;
  }
}

/* Small Smartphones (Single Column) */
@media (max-width: 640px) {
  .work-hero-section {
    padding: 40px 0 20px;
  }

  .work-hero-title {
    font-size: 27px;
  }

  .work-hero-subtitle {
    font-size: 14px;
  }

  .work-projects-grid {
    grid-template-columns: 1fr;
  }

  .pw-card {
    padding: 22px 16px 18px;
  }

  .pw-card-impact {
    min-height: auto;
  }

  .work-modal-dialog {
    padding: 22px 18px;
  }
}
