/* ===================================================================
   TECHSPACR — PORTFOLIO STYLES (v4)
   Generic bento-style cards (icon box + title + description + tags),
   NOT the big device-mockup "case study" card layout. The icon box
   itself carries the interaction: loads tilted ~7deg, straightens on
   click with a spring ease, hint fades out, and the "View Case Study"
   button fades in about 0.3s later. Same box/animation whether it
   holds a real screenshot or the abstract per-category fallback.
   Relies on tokens/fonts already defined in style.css — load that
   first, then this file.
=================================================================== */

/* ===================================================================
   FILTER TABS — sliding underline
=================================================================== */
.ts-portfolio-filter-section{ background: var(--ts-void); padding: 2rem 0 0; }

.ts-filter-tabs{
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  border-bottom: 1px solid var(--ts-border);
}
.ts-filter-btn{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ts-text-soft);
  background: transparent;
  border: none;
  padding: 0 0 1.1rem;
  cursor: pointer;
  transition: color 0.25s ease;
  position: relative;
}
.ts-filter-btn:hover{ color: var(--ts-text); }
.ts-filter-btn.active{ color: #fff; }

.ts-filter-indicator{
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ts-blue), var(--ts-gold));
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(.65,0,.35,1), width 0.35s cubic-bezier(.65,0,.35,1);
}

/* ===================================================================
   PROJECT GRID — plain uniform grid of generic cards
=================================================================== */
.ts-portfolio-grid-section{ background: var(--ts-void); padding-top: 3.5rem; }

.ts-portfolio-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
@media (max-width: 991px){ .ts-portfolio-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .ts-portfolio-grid{ grid-template-columns: 1fr; } }

/* ===================================================================
   GENERIC BENTO CARD
=================================================================== */
.case-card{
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
}
.case-card.pf-hidden{ display: none; }

[data-aos="case-reveal"]{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.16,1,.3,1);
}
[data-aos="case-reveal"].aos-animate{ opacity: 1; transform: translateY(0); }

.case-card h3{ font-size: 1.05rem; font-weight: 700; color: var(--ts-text); margin: 1rem 0 0.55rem; }
.case-card p{ font-size: 0.88rem; color: var(--ts-text-soft); margin-bottom: 0.85rem; }
.case-meta{ display: flex; flex-wrap: wrap; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.76rem; color: var(--ts-text-soft); margin-top: auto; }
.case-meta i{ font-style: normal; color: var(--ts-gold-soft); }
.case-tag-label{
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ts-gold-soft);
}

/* ===================================================================
   THE ANIMATED ICON BOX — the only thing that carries the
   slant / click / straighten / reveal-button interaction
=================================================================== */
.case-icon-box{
  position: relative;
  display: block;
  aspect-ratio: 16 / 11;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--ts-border);
}
.case-icon-blue{ background: linear-gradient(150deg, #17337a, #0d1130); }
.case-icon-red{ background: linear-gradient(150deg, #6a1e2b, #0d1130); }
.case-icon-green{ background: linear-gradient(150deg, #14603a, #0d1130); }
.case-icon-gold{ background: linear-gradient(150deg, #6a4f16, #0d1130); }

/* the tilted content — straightens on .is-open */
.case-icon-visual{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 34px -12px rgba(0,0,0,0.55);
  transform: translate(-50%, -50%) rotate(-7deg);
  transform-origin: center;
  transition: transform 0.6s cubic-bezier(.22,1.35,.4,1);
}
.case-icon-box.is-open .case-icon-visual{
  transform: translate(-50%, -50%) rotate(0deg) scale(1.02);
}
.case-icon-visual img{ display: block; width: 100%; height: auto; }

.case-hint{
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  transition: opacity 0.25s ease;
}
.case-icon-box.is-open .case-hint{ opacity: 0; pointer-events: none; }

.case-cta-btn{
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  transform: translate(-50%, 10px);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  color: var(--ts-void);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.35s ease 0.3s, transform 0.35s ease 0.3s;
}
.case-icon-box.is-open .case-cta-btn{
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.case-cta-btn i{ transition: transform 0.2s ease; }
.case-cta-btn:hover i{ transform: translateX(3px); }

/* ===================================================================
   ABSTRACT DEFAULT VISUAL (used only when no real screenshot exists —
   soft drifting color-blobs, color-keyed per category, no literal
   UI chrome of any kind)
=================================================================== */
.abstract-visual{
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0d1130;
}
.abstract-blob{
  position: absolute;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.85;
  animation: blobDrift 7s ease-in-out infinite alternate;
}
@keyframes blobDrift{
  0%{ transform: translate(0,0) scale(1); }
  100%{ transform: translate(8%, -6%) scale(1.15); }
}

.abstract-web .blob-a{ width: 65%; height: 65%; top: -10%; left: -10%; background: var(--ts-blue); }
.abstract-web .blob-b{ width: 50%; height: 50%; bottom: -12%; right: -8%; background: var(--ts-blue-soft); animation-delay: 1.2s; }

.abstract-mobile .blob-a{ width: 60%; height: 60%; top: -8%; right: -10%; background: var(--ts-red); }
.abstract-mobile .blob-b{ width: 45%; height: 45%; bottom: -10%; left: -8%; background: #ff7a86; animation-delay: 1.6s; }

.abstract-design .blob-a{ width: 58%; height: 58%; top: -6%; left: 10%; background: var(--ts-green); }
.abstract-design .blob-b{ width: 48%; height: 48%; bottom: -14%; right: -6%; background: #55e0a0; animation-delay: 0.8s; }

.abstract-ai .blob-a{ width: 62%; height: 62%; top: -10%; left: -6%; background: var(--ts-gold); }
.abstract-ai .blob-b{ width: 46%; height: 46%; bottom: -10%; right: -4%; background: var(--ts-gold-soft); animation-delay: 2s; }

/* ===================================================================
   HOMEPAGE "FEATURED WORK" SECTION
=================================================================== */
.ts-featured-work{ background: var(--ts-panel); }
@media (max-width: 991px){ .ts-featured-work .ts-portfolio-grid{ grid-template-columns: 1fr; } }

/* ===================================================================
   CASE STUDY DETAIL PAGE
=================================================================== */
.ts-case-hero{ position: relative; padding: 9.5rem 0 3rem; background: var(--ts-void); overflow: hidden; }
.case-breadcrumb{ font-family: var(--font-mono); font-size: 0.8rem; color: var(--ts-text-soft); margin-bottom: 1.2rem; display: inline-flex; align-items: center; gap: 0.5rem; }
.case-breadcrumb a{ color: var(--ts-text-soft); text-decoration: none; transition: color 0.2s ease; }
.case-breadcrumb a:hover{ color: #fff; }

.case-hero-visual{ position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--ts-border); margin-top: 2.5rem; }
.case-hero-visual img{ display: block; width: 100%; height: auto; }
.case-hero-visual .abstract-visual{ aspect-ratio: 21 / 8; }

.ts-case-body{ background: var(--ts-void); padding: 4rem 0; }
.case-desc p{ color: var(--ts-text-soft); font-size: 1.02rem; margin-bottom: 1.3rem; max-width: 720px; }
.case-tech-list{ display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.case-tech-list span{ font-family: var(--font-mono); font-size: 0.8rem; padding: 0.4rem 0.95rem; border-radius: 100px; background: rgba(255,255,255,0.05); border: 1px solid var(--ts-border); color: var(--ts-text); }
.case-sidebar{ background: rgba(255,255,255,0.03); border: 1px solid var(--ts-border); border-radius: 16px; padding: 1.75rem; }
.case-sidebar dt{ font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ts-gold-soft); margin-top: 1.1rem; }
.case-sidebar dt:first-child{ margin-top: 0; }
.case-sidebar dd{ margin: 0.35rem 0 0; color: var(--ts-text); font-weight: 600; }

/* ===================================================================
   RELATED PROJECTS CAROUSEL — simple static thumbnails, no
   slant/click interaction here (already secondary navigation)
=================================================================== */
.ts-related-section{ background: var(--ts-panel); padding: 4.5rem 0; }
.related-header{ display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.related-nav{ display: flex; gap: 0.6rem; }
.related-nav-btn{ width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ts-border); background: rgba(255,255,255,0.03); color: var(--ts-text); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; }
.related-nav-btn:hover{ background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); }
.related-nav-btn:disabled{ opacity: 0.35; cursor: default; }

.related-track{ display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 0.5rem; -ms-overflow-style: none; scrollbar-width: none; }
.related-track::-webkit-scrollbar{ display: none; }

.related-card{ flex: 0 0 auto; width: 260px; scroll-snap-align: start; text-decoration: none; display: block; transition: transform 0.25s ease; }
.related-card:hover{ transform: translateY(-4px); }
.related-card .related-thumb{ border-radius: 12px; overflow: hidden; border: 1px solid var(--ts-border); margin-bottom: 0.9rem; }
.related-card .related-thumb img{ display: block; width: 100%; height: auto; }
.related-card h4{ font-size: 1rem; font-weight: 700; color: var(--ts-text); margin-bottom: 0.4rem; }
.related-card span.related-tag{ font-family: var(--font-mono); font-size: 0.72rem; color: var(--ts-text-soft); }
