/**
 * AI Typography Art - Case Study Styles
 * Awwwards-level aesthetics with smooth animations
 */

/* ===========================
   HERO SECTION
   =========================== */
.ai-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: var(--space-4xl) 0;
  overflow: hidden;
}

.ai-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
  opacity: 0;
  animation: heroGlow 2s ease forwards 0.5s;
}

@keyframes heroGlow {
  to {
    opacity: 1;
  }
}

.ai-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards 0.3s;
}

.ai-hero__badge-dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.ai-hero__title {
  font-size: clamp(3rem, 15vw, 12rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2xl);
}

.ai-hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(100px);
  animation: revealLine 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ai-hero__title-line:nth-child(1) {
  animation-delay: 0.4s;
}

.ai-hero__title-line:nth-child(2) {
  animation-delay: 0.6s;
}

.ai-hero__title-line--accent {
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: revealLine 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.6s, gradientFlow 8s ease infinite 1.6s;
}

@keyframes revealLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientFlow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-hero__meta {
  display: flex;
  gap: var(--space-3xl);
  margin-top: var(--space-2xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards 1s;
}

.ai-hero__stat {
  text-align: left;
}

.ai-hero__stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-primary);
}

.ai-hero__stat-label {
  font-size: var(--text-small);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.ai-hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-micro);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards 1.5s;
}

.ai-hero__scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }

  50% {
    transform: scaleY(0.5);
    opacity: 0.5;
  }
}

/* ===========================
   CASE INTRO SECTION
   =========================== */
.case-intro {
  padding: var(--space-4xl) 0;
  background: var(--bg-secondary);
}

.case-intro__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

@media (min-width: 768px) {
  .case-intro__grid {
    grid-template-columns: 2fr 1fr;
  }
}

.case-intro__heading {
  font-size: var(--text-h2);
  font-weight: 700;
  margin-bottom: var(--space-xl);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.case-intro__text {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

.case-intro__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.case-intro__visual {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
}

.case-intro__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-slow);
}

.case-intro__card:hover {
  transform: translateY(-10px);
}

.case-intro__card--error {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.1) 0%, rgba(255, 71, 87, 0.05) 100%);
  border-color: rgba(255, 71, 87, 0.3);
}

.case-intro__card--error:hover {
  box-shadow: 0 20px 40px rgba(255, 71, 87, 0.2);
}

.case-intro__card--success {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 255, 136, 0.05) 100%);
  border-color: rgba(0, 255, 136, 0.3);
}

.case-intro__card--success:hover {
  box-shadow: 0 20px 40px rgba(0, 255, 136, 0.2);
}

.case-intro__card-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.case-intro__card--error .case-intro__card-icon {
  color: #ff4757;
}

.case-intro__card--success .case-intro__card-icon {
  color: #00ff88;
}

.case-intro__card-text {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--text-muted);
}

/* ===========================
   PROCESS SECTION
   =========================== */
.process {
  padding: var(--space-4xl) 0;
  overflow: hidden;
}

.process__title {
  font-size: var(--text-h2);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-4xl);
}

.process__timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.process__timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--text-muted), transparent);
  opacity: 0.3;
}

@media (min-width: 768px) {
  .process__timeline::before {
    left: 50px;
  }
}

.process__step {
  position: relative;
  padding-left: 60px;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.process__step.visible {
  opacity: 1;
  transform: translateX(0);
}

@media (min-width: 768px) {
  .process__step {
    padding-left: 100px;
  }
}

.process__step::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 700;
  color: var(--accent);
}

@media (min-width: 768px) {
  .process__step::before {
    width: 60px;
    height: 60px;
    font-size: var(--text-small);
  }
}

.process__step-header {
  margin-bottom: var(--space-md);
}

.process__step-number {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  display: none;
}

.process__step-title {
  font-size: var(--text-h4);
  font-weight: 600;
  color: var(--text-primary);
}

.process__step-text {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================
   GALLERY SECTION
   =========================== */
.ai-gallery {
  padding: var(--space-4xl) 0;
  background: var(--bg-secondary);
}

.ai-gallery__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.ai-gallery__title {
  font-size: var(--text-h2);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.ai-gallery__subtitle {
  font-size: var(--text-body);
  color: var(--text-muted);
}

.ai-gallery__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.ai-gallery__filter {
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.ai-gallery__filter:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.ai-gallery__filter.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-primary);
}

.ai-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .ai-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
}

@media (min-width: 1024px) {
  .ai-gallery__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .ai-gallery__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.ai-gallery__item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  position: relative;
  cursor: pointer;
  background: var(--bg-primary);
}

.ai-gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.ai-gallery__item:hover::after {
  opacity: 1;
}

.ai-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.ai-gallery__item:hover img {
  transform: scale(1.1);
}

.ai-gallery__item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
  z-index: 1;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--duration-fast), transform var(--duration-fast);
}

.ai-gallery__item:hover .ai-gallery__item-overlay {
  opacity: 1;
  transform: translateY(0);
}

.ai-gallery__item-title {
  font-size: var(--text-small);
  font-weight: 600;
  color: #fff;
}

.ai-gallery__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  color: var(--text-muted);
  font-size: var(--text-small);
}

.ai-gallery__loading.hidden {
  display: none;
}

.ai-gallery__spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===========================
   TAKEAWAY SECTION
   =========================== */
.takeaway {
  padding: var(--space-4xl) 0;
}

.takeaway__title {
  font-size: var(--text-h2);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.takeaway__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .takeaway__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.takeaway__card {
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--duration-slow) var(--ease-out), border-color var(--duration-fast);
}

.takeaway__card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
}

.takeaway__card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  display: block;
}

.takeaway__card-title {
  font-size: var(--text-h4);
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.takeaway__card-text {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================
   CTA SECTION
   =========================== */
.ai-cta {
  padding: var(--space-4xl) 0;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(0, 255, 255, 0.1) 100%);
}

.ai-cta__content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.ai-cta__label {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-md);
}

.ai-cta__title {
  font-size: var(--text-h2);
  font-weight: 700;
  margin-bottom: var(--space-xl);
}

.ai-cta__btn {
  display: inline-block;
  padding: var(--space-lg) var(--space-2xl);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-radius: 0;
  border: 1px solid var(--text-primary);
  transition: all var(--duration-fast);
}

.ai-cta__btn:hover {
  background: transparent;
  color: var(--text-primary);
}

/* ===========================
   LIGHTBOX ENHANCEMENTS
   =========================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  backdrop-filter: blur(10px);
}

.lightbox.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox__close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--duration-fast), transform var(--duration-fast);
}

.lightbox__close:hover {
  border-color: #fff;
  transform: rotate(90deg);
}

.lightbox__image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--duration-fast);
}

.lightbox__nav:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lightbox__nav--prev {
  left: var(--space-xl);
}

.lightbox__nav--next {
  right: var(--space-xl);
}

.lightbox__counter {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: rgba(255, 255, 255, 0.6);
}

/* ===========================
   BREADCRUMBS
   =========================== */
.breadcrumbs {
  padding: var(--space-xl) 0;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breadcrumbs a {
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.breadcrumbs a:hover {
  color: var(--text-primary);
}

/* ===========================
   MOBILE ADJUSTMENTS
   =========================== */
@media (max-width: 640px) {
  .ai-hero__meta {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .ai-hero__stat {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
  }

  .case-intro__visual {
    flex-direction: row;
  }

  .case-intro__card {
    width: 120px;
    height: 120px;
  }

  .process__timeline::before {
    left: 15px;
  }

  .process__step {
    padding-left: 50px;
  }

  .process__step::before {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .lightbox__nav {
    width: 44px;
    height: 44px;
  }

  .lightbox__nav--prev {
    left: var(--space-sm);
  }

  .lightbox__nav--next {
    right: var(--space-sm);
  }
}

/* ===========================
   INSIGHT CARDS - PURE TEXT NEO-BRUTALIST
   =========================== */
.ai-gallery__insight-card {
  grid-column: span 2;
  aspect-ratio: auto;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: none;
  padding: var(--space-lg) var(--space-md);
  position: relative;
}

@media (min-width: 640px) {
  .ai-gallery__insight-card {
    grid-column: span 3;
    min-height: 160px;
    padding: var(--space-xl) var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .ai-gallery__insight-card {
    grid-column: span 2;
    min-height: 180px;
    padding: var(--space-2xl);
  }
}

@media (min-width: 1280px) {
  .ai-gallery__insight-card {
    grid-column: span 2;
  }
}

.insight-card__text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-width: 320px;
  margin: 0;
}

@media (min-width: 640px) {
  .insight-card__text {
    font-size: 11px;
    line-height: 1.8;
    letter-spacing: 0.03em;
    max-width: 400px;
  }
}

@media (min-width: 1024px) {
  .insight-card__text {
    font-size: 12px;
    max-width: 450px;
  }
}


/* ===========================
   ENHANCED MOBILE OPTIMIZATION
   =========================== */
@media (max-width: 480px) {
  .ai-hero {
    min-height: 85vh;
    padding: var(--space-2xl) 0;
  }

  .ai-hero__title {
    font-size: clamp(2.5rem, 18vw, 6rem);
    margin-bottom: var(--space-lg);
  }

  .ai-hero__badge {
    padding: var(--space-xs) var(--space-md);
    font-size: 10px;
    margin-bottom: var(--space-lg);
  }

  .ai-hero__scroll-indicator {
    display: none;
  }

  .case-intro {
    padding: var(--space-2xl) 0;
  }

  .case-intro__heading {
    font-size: var(--text-h3);
  }

  .case-intro__text {
    font-size: var(--text-small);
    line-height: 1.7;
  }

  .case-intro__card {
    width: 100px;
    height: 100px;
  }

  .case-intro__card-icon {
    font-size: 2rem;
  }

  .case-intro__card-text {
    font-size: 11px;
  }

  .process {
    padding: var(--space-2xl) 0;
  }

  .process__title {
    font-size: var(--text-h3);
    margin-bottom: var(--space-2xl);
  }

  .process__timeline {
    gap: var(--space-xl);
  }

  .process__step-title {
    font-size: var(--text-body);
  }

  .process__step-text {
    font-size: var(--text-small);
  }

  .ai-gallery {
    padding: var(--space-2xl) 0;
  }

  .ai-gallery__header {
    margin-bottom: var(--space-xl);
  }

  .ai-gallery__title {
    font-size: var(--text-h3);
  }

  .ai-gallery__subtitle {
    font-size: var(--text-small);
  }

  .ai-gallery__grid {
    gap: 6px;
  }

  .ai-gallery__item {
    border-radius: var(--radius-sm);
  }

  .ai-gallery__insight-card {
    min-height: 160px;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
  }

  .insight-card__icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
  }

  .insight-card__title {
    font-size: var(--text-body);
    margin-bottom: var(--space-xs);
  }

  .insight-card__text {
    font-size: 12px;
    line-height: 1.5;
  }

  .lightbox {
    padding: var(--space-md);
  }

  .lightbox__close {
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .lightbox__image {
    max-width: 95vw;
    max-height: 75vh;
    border-radius: var(--radius-sm);
  }

  .lightbox__counter {
    bottom: var(--space-md);
    font-size: 12px;
  }

  .breadcrumbs {
    padding: var(--space-md) 0;
    font-size: 11px;
    gap: 4px;
    flex-wrap: wrap;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .ai-gallery__item {
    -webkit-tap-highlight-color: transparent;
  }

  .ai-gallery__item::after {
    display: none;
  }

  .lightbox__nav {
    width: 50px;
    height: 50px;
  }
}