/* ---- Styles Showcase (pure CSS/JS animations) ---- */

.styles-showcase {
  position: relative;
  overflow: hidden;
}

.styles-showcase::before {
  display: none;
}

.styles-showcase__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
}

.style-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  border: none;
  background: #141414;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease;
}

.style-card:hover,
.style-card.is-intense {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

.style-card__preview {
  position: relative;
  flex: 3 1 0;
  min-height: 168px;
  overflow: hidden;
  isolation: isolate;
}

.style-card__info {
  flex: 2 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px 22px;
  border-top: none;
}

.style-card__info h3 {
  font-family: 'Barlow Condensed', var(--font-display), sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #fff;
}

.style-card__tag {
  display: block;
  font-family: 'Barlow', var(--font-body), sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #999;
}

.style-card.is-intense .style-card__preview,
.style-card:hover .style-card__preview {
  --anim-speed: 0.55;
}

.style-card__preview {
  --anim-speed: 1;
}

/* 1 — Cinematic parallax */
.style-preview--cinematic {
  background: linear-gradient(180deg, #050810 0%, #0a0a0a 100%);
}

.style-cinematic__layer {
  position: absolute;
  inset: 0;
}

.style-cinematic__layer--sky {
  z-index: 0;
  animation: cinematicDrift calc(18s * var(--anim-speed)) ease-in-out infinite alternate;
}

.style-cinematic__lights {
  position: absolute;
  inset: 0;
}

.style-cinematic__light {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 2px);
  height: var(--s, 2px);
  border-radius: 50%;
  background: #ffb347;
  box-shadow: 0 0 6px rgba(255, 179, 71, 0.8);
  animation: cinematicTwinkle calc(var(--dur, 3s) * var(--anim-speed)) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.style-cinematic__light--warm {
  background: #ff6b35;
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.9);
}

.style-cinematic__layer--city {
  z-index: 1;
  bottom: 0;
  top: auto;
  height: 62%;
  animation: cinematicDriftMid calc(14s * var(--anim-speed)) ease-in-out infinite alternate-reverse;
}

.style-cinematic__bld {
  position: absolute;
  bottom: 0;
  left: var(--l);
  width: var(--w);
  height: var(--h);
  background: #000;
  border-radius: 2px 2px 0 0;
}

.style-cinematic__bld::before {
  content: '';
  position: absolute;
  inset: 8% 18% auto;
  height: 8%;
  background: rgba(255, 180, 80, 0.35);
  box-shadow:
    0 14px 0 rgba(255, 180, 80, 0.25),
    0 28px 0 rgba(255, 180, 80, 0.18);
}

.style-cinematic__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
}

@keyframes cinematicDrift {
  from { transform: translateX(-4%); }
  to { transform: translateX(4%); }
}

@keyframes cinematicDriftMid {
  from { transform: translateX(-6%); }
  to { transform: translateX(6%); }
}

@keyframes cinematicTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 2 — Minimal */
.style-preview--minimal {
  background: #f2f2f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.style-minimal__text {
  margin: 0;
  font-family: 'Barlow Condensed', Georgia, serif;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #111;
}

.style-minimal__text span {
  display: inline-block;
  opacity: 0;
  animation: minimalLetter calc(4.5s * var(--anim-speed)) ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}

.style-minimal__line {
  display: block;
  width: 0;
  height: 1px;
  background: #111;
  animation: minimalLine calc(4.5s * var(--anim-speed)) ease-in-out infinite;
  animation-delay: 0.6s;
}

@keyframes minimalLetter {
  0%, 12% { opacity: 0; transform: translateY(6px); }
  22%, 72% { opacity: 1; transform: translateY(0); }
  82%, 100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes minimalLine {
  0%, 20% { width: 0; opacity: 0; }
  35%, 70% { width: 56px; opacity: 1; }
  85%, 100% { width: 56px; opacity: 0; }
}

/* 3 — Dark luxury canvas */
.style-preview--luxury {
  background: #000;
}

.style-luxury__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* 4 — 3D wireframe */
.style-preview--3d {
  background: #000;
  perspective: 520px;
}

.style-3d__scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 520px;
}

.style-3d__cube {
  position: relative;
  width: 64px;
  height: 64px;
  transform-style: preserve-3d;
  animation: cubeSpin3d calc(10s * var(--anim-speed)) linear infinite;
}

.style-3d__edge {
  position: absolute;
  inset: 0;
  border: 1.5px solid #e03030;
  background: transparent;
  box-shadow: 0 0 12px rgba(224, 48, 48, 0.25);
}

.style-3d__edge--f  { transform: translateZ(32px); }
.style-3d__edge--b  { transform: rotateY(180deg) translateZ(32px); }
.style-3d__edge--r  { transform: rotateY(90deg) translateZ(32px); }
.style-3d__edge--l  { transform: rotateY(-90deg) translateZ(32px); }
.style-3d__edge--t  { transform: rotateX(90deg) translateZ(32px); }
.style-3d__edge--bt { transform: rotateX(-90deg) translateZ(32px); }

.style-card.is-intense .style-3d__cube,
.style-card[data-style="3d"]:hover .style-3d__cube {
  animation-duration: calc(4s * var(--anim-speed));
}

@keyframes cubeSpin3d {
  from { transform: rotateX(-18deg) rotateY(0deg) rotateZ(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg) rotateZ(360deg); }
}

/* 5 — Scroll storytelling */
.style-preview--scroll {
  background: #0a0a0a;
}

.style-scroll__progress {
  position: absolute;
  left: 14px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  z-index: 2;
}

.style-scroll__progress span {
  display: block;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, #ffb347, #e03030);
  border-radius: inherit;
  animation: scrollProgress calc(5s * var(--anim-speed)) ease-in-out infinite;
}

.style-scroll__blocks {
  position: absolute;
  inset: 16px 16px 16px 32px;
}

.style-scroll__block {
  position: absolute;
  left: 0;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.35), rgba(224, 48, 48, 0.25));
  opacity: 0;
  transform: translateY(24px);
}

.style-scroll__block--1 { top: 18%; width: 68%; animation: scrollBlock calc(5s * var(--anim-speed)) ease-in-out infinite; animation-delay: 0.4s; }
.style-scroll__block--2 { top: 36%; width: 82%; animation: scrollBlock calc(5s * var(--anim-speed)) ease-in-out infinite; animation-delay: 0.9s; }
.style-scroll__block--3 { top: 54%; width: 55%; animation: scrollBlock calc(5s * var(--anim-speed)) ease-in-out infinite; animation-delay: 1.4s; }
.style-scroll__block--4 { top: 72%; width: 74%; animation: scrollBlock calc(5s * var(--anim-speed)) ease-in-out infinite; animation-delay: 1.9s; }

@keyframes scrollProgress {
  0%, 8% { height: 0; }
  70%, 88% { height: 100%; }
  100% { height: 0; }
}

@keyframes scrollBlock {
  0%, 10% { opacity: 0; transform: translateY(28px); }
  22%, 62% { opacity: 1; transform: translateY(0); }
  72%, 100% { opacity: 0; transform: translateY(-20px); }
}

/* 6 — Neumorphic */
.style-preview--neumorphic {
  background: #2a2a2a;
}

.style-neu__surface {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.style-neu__card {
  width: 72px;
  height: 48px;
  border-radius: 12px;
  background: #2a2a2a;
  animation: neuPulse calc(3s * var(--anim-speed)) ease-in-out infinite;
}

.style-neu__card--raised {
  box-shadow:
    8px 8px 16px #1f1f1f,
    -8px -8px 16px #353535;
}

.style-neu__btn {
  width: 88px;
  height: 26px;
  border-radius: 99px;
  background: #2a2a2a;
  animation: neuBtnPulse calc(3s * var(--anim-speed)) ease-in-out infinite;
  animation-delay: 0.4s;
  box-shadow:
    inset 5px 5px 10px #1f1f1f,
    inset -5px -5px 10px #353535;
}

@keyframes neuPulse {
  0%, 100% {
    box-shadow:
      8px 8px 16px #1f1f1f,
      -8px -8px 16px #353535;
    transform: translateY(0);
  }
  50% {
    box-shadow:
      inset 6px 6px 12px #1f1f1f,
      inset -6px -6px 12px #353535;
    transform: translateY(2px);
  }
}

@keyframes neuBtnPulse {
  0%, 100% {
    box-shadow:
      inset 5px 5px 10px #1f1f1f,
      inset -5px -5px 10px #353535;
  }
  50% {
    box-shadow:
      5px 5px 12px #1f1f1f,
      -5px -5px 12px #353535;
  }
}

/* 7 — Glitch */
.style-preview--glitch {
  background: #030303;
  display: flex;
  align-items: center;
  justify-content: center;
}

.style-glitch__scanlines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.35) 2px,
    rgba(0, 0, 0, 0.35) 4px
  );
  opacity: 0.5;
}

.style-glitch__text {
  position: relative;
  margin: 0;
  font-family: 'Barlow Condensed', var(--font-display), sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  z-index: 3;
  animation: glitchMain calc(0.5s * var(--anim-speed)) steps(2) infinite;
}

.style-glitch__text::before,
.style-glitch__text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.75;
}

.style-glitch__text::before {
  color: #ff0040;
  clip-path: inset(0 0 55% 0);
  animation: glitchA calc(0.35s * var(--anim-speed)) steps(2) infinite;
}

.style-glitch__text::after {
  color: #00d4ff;
  clip-path: inset(45% 0 0 0);
  animation: glitchB calc(0.35s * var(--anim-speed)) steps(2) infinite reverse;
}

.style-card.is-intense .style-glitch__text,
.style-card.is-intense .style-glitch__text::before,
.style-card.is-intense .style-glitch__text::after {
  animation-duration: calc(0.22s * var(--anim-speed));
}

@keyframes glitchMain {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -1px); }
}

@keyframes glitchA {
  0%, 100% { transform: translate(0); }
  50% { transform: translate(3px, 0); }
}

@keyframes glitchB {
  0%, 100% { transform: translate(0); }
  50% { transform: translate(-3px, 0); }
}

/* 8 — Glassmorphism */
.style-preview--glass {
  background: #080810;
  overflow: hidden;
}

.style-glass__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.75;
}

.style-glass__blob--1 {
  width: 55%;
  height: 55%;
  top: -10%;
  left: -8%;
  background: #4f46e5;
  animation: glassBlob1 calc(8s * var(--anim-speed)) ease-in-out infinite alternate;
}

.style-glass__blob--2 {
  width: 45%;
  height: 45%;
  bottom: -12%;
  right: -6%;
  background: #7c3aed;
  animation: glassBlob2 calc(9s * var(--anim-speed)) ease-in-out infinite alternate-reverse;
}

.style-glass__blob--3 {
  width: 35%;
  height: 35%;
  top: 35%;
  right: 20%;
  background: #2563eb;
  animation: glassBlob3 calc(7s * var(--anim-speed)) ease-in-out infinite alternate;
}

.style-glass__panel {
  position: absolute;
  inset: 22% 16%;
  z-index: 2;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  justify-content: center;
}

.style-glass__panel span {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
}

.style-glass__panel span:nth-child(1) { width: 72%; }
.style-glass__panel span:nth-child(2) { width: 48%; opacity: 0.65; }
.style-glass__panel span:nth-child(3) { width: 58%; opacity: 0.45; }

@keyframes glassBlob1 {
  from { transform: translate(0, 0); }
  to { transform: translate(12%, 8%); }
}

@keyframes glassBlob2 {
  from { transform: translate(0, 0); }
  to { transform: translate(-10%, -6%); }
}

@keyframes glassBlob3 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6%, -8%) scale(1.12); }
}

@media (max-width: 768px) {
  .styles-showcase__grid {
    gap: 12px;
  }

  .style-card {
    min-height: 240px;
  }

  .style-card__info h3 {
    font-size: 1rem;
    overflow-wrap: break-word;
  }
}

@media (max-width: 1200px) {
  .styles-showcase__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .styles-showcase__grid { grid-template-columns: 1fr; }
  .style-card { min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  .style-cinematic__layer--sky,
  .style-cinematic__layer--city,
  .style-cinematic__light,
  .style-minimal__text span,
  .style-minimal__line,
  .style-3d__cube,
  .style-scroll__progress span,
  .style-scroll__block,
  .style-neu__card,
  .style-neu__btn,
  .style-glitch__text,
  .style-glitch__text::before,
  .style-glitch__text::after,
  .style-glass__blob {
    animation: none !important;
  }

  .style-minimal__text span { opacity: 1; transform: none; }
  .style-minimal__line { width: 56px; opacity: 1; }
  .style-scroll__progress span { height: 60%; }
  .style-scroll__block { opacity: 0.6; transform: none; }
}
