/* ============================================
   Text Animations Page — Specific Styles
   ============================================ */

/* --- Hero --- */
.ta-hero {
  background: var(--gs-darker);
  padding: 10rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.ta-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 150%;
  background: radial-gradient(ellipse at 30% 20%, rgba(0, 255, 102, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(0, 204, 136, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* --- Effect Indicator Bar --- */
.ta-effect-indicator {
  position: sticky;
  top: var(--nav-height, 60px);
  z-index: 40;
  background: rgba(15, 15, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 0;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
}
.ta-effect-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Demo Section --- */
.ta-demos {
  background: var(--gs-dark);
}

.demo-section {
  scroll-margin-top: 120px;
}

.demo-preview {
  background: var(--gs-darker);
  min-height: 350px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.demo-content {
  text-align: center;
  padding: 2rem;
}

/* Replay button */
.replay-btn {
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}
.replay-btn:hover {
  opacity: 1;
}

/* Source code blocks */
.demo-section pre {
  background: transparent;
  margin: 0;
}
.demo-section pre code {
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.8;
}

/* --- Glitch Effect --- */
.glitch-text {
  position: relative;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.glitch-text::before {
  color: var(--gs-primary);
  z-index: -1;
}
.glitch-text::after {
  color: var(--gs-secondary);
  z-index: -2;
}
.glitch-text.glitching::before {
  opacity: 0.8;
  animation: glitch-before 0.3s linear 3;
}
.glitch-text.glitching::after {
  opacity: 0.8;
  animation: glitch-after 0.3s linear 3;
}
@keyframes glitch-before {
  0%   { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 2px); }
  25%  { clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px); }
  50%  { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 1px); }
  75%  { clip-path: inset(70% 0 5% 0);  transform: translate(2px, -2px); }
  100% { clip-path: inset(10% 0 70% 0); transform: translate(0, 0); }
}
@keyframes glitch-after {
  0%   { clip-path: inset(50% 0 20% 0); transform: translate(3px, -2px); }
  25%  { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 1px); }
  50%  { clip-path: inset(40% 0 30% 0); transform: translate(2px, -1px); }
  75%  { clip-path: inset(5% 0 70% 0);  transform: translate(-2px, 2px); }
  100% { clip-path: inset(70% 0 10% 0); transform: translate(0, 0); }
}

/* --- Typewriter cursor --- */
.typewriter-cursor {
  display: inline-block;
  animation: cursor-blink 0.6s step-end infinite;
  margin-left: -4px;
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* --- Parallax layers --- */
.parallax-layers {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

/* --- TOC --- */
.ta-toc {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ta-toc-list {
  padding-left: 1.2rem;
}
.ta-toc-list li {
  margin-bottom: 0.5rem;
}
.ta-toc-list a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.ta-toc-list a:hover {
  color: var(--gs-primary);
}
.ta-toc-list ul {
  padding-left: 1.2rem;
  margin-top: 0.5rem;
}

/* --- Content section headings --- */
.ta-section-heading {
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.ta-section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gs-primary);
  border-radius: 2px;
}

/* --- Content lists --- */
.ta-content-list {
  padding-left: 1.2rem;
}
.ta-content-list li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

/* --- FAQ Accordion --- */
.ta-accordion .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ta-accordion .accordion-button {
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 1.25rem 0;
  box-shadow: none;
}
.ta-accordion .accordion-button::after {
  filter: brightness(0) invert(1);
}
.ta-accordion .accordion-button:not(.collapsed) {
  color: var(--gs-primary);
  background: transparent;
  box-shadow: none;
}
.ta-accordion .accordion-body {
  color: rgba(255, 255, 255, 0.6);
  padding: 0 0 1.25rem;
  line-height: 1.7;
}

/* --- Guide Cards --- */
.ta-guide-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color var(--transition-base), transform var(--transition-base);
}
.ta-guide-card:hover {
  border-color: var(--gs-primary);
  transform: translateY(-4px);
}

/* --- Reason Cards (Why It Matters) --- */
.ta-reason-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}
.ta-reason-card:hover {
  border-color: rgba(0, 255, 102, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 255, 102, 0.06);
}
.ta-reason-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 255, 102, 0.08);
  color: var(--gs-primary);
  font-size: 1.25rem;
}

/* --- Technique Cards --- */
.ta-technique-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color var(--transition-base), transform var(--transition-base);
}
.ta-technique-card:hover {
  border-color: rgba(0, 255, 102, 0.25);
  transform: translateY(-3px);
}
.ta-technique-num {
  font-size: 2rem;
  line-height: 1;
  color: var(--gs-primary);
  opacity: 0.4;
}
.ta-technique-tags .badge {
  background: rgba(0, 255, 102, 0.1) !important;
  color: var(--gs-primary) !important;
  font-weight: 500;
  font-size: 0.75rem;
  border: 1px solid rgba(0, 255, 102, 0.15);
}

/* --- Callout Card (Best Practices) --- */
.ta-callout {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ta-tip-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.ta-tip-item:hover {
  border-color: rgba(0, 255, 102, 0.2);
  background: rgba(0, 255, 102, 0.03);
}
.ta-tip-item i {
  font-size: 1.1rem;
}

/* --- Generator Promo --- */
.ta-generator-promo {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 102, 0.15);
}
.ta-generator-glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse at center, rgba(0, 255, 102, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.ta-generator-mockup {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ta-generator-mockup pre {
  background: transparent;
  margin: 0;
}
.ta-generator-mockup pre code {
  background: transparent;
  font-size: 0.82rem;
  line-height: 1.8;
}
.ta-mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.ta-mock-dot:nth-child(1) { background: #ff5f57; }
.ta-mock-dot:nth-child(2) { background: #febc2e; }
.ta-mock-dot:nth-child(3) { background: #28c840; }

/* --- Example Cards --- */
.ta-example-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color var(--transition-base), transform var(--transition-base);
}
.ta-example-card:hover {
  border-color: rgba(0, 255, 102, 0.25);
  transform: translateY(-3px);
}

/* --- Conclusion Callout --- */
.ta-conclusion {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Category Filter Pills --- */
.ta-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.ta-cat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.ta-cat-pill:hover {
  background: rgba(0, 255, 102, 0.08);
  border-color: rgba(0, 255, 102, 0.25);
  color: #fff;
}
.ta-cat-pill.active {
  background: var(--gs-primary);
  border-color: var(--gs-primary);
  color: #0F0F1A;
  font-weight: 600;
}

/* --- Neon effect glow --- */
.neon-target {
  text-shadow: none;
  transition: text-shadow 0.3s;
}

/* --- CRT effect scanlines --- */
.crt-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* --- RGB Split layers --- */
.rgb-layers {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rgb-layers .rgb-r,
.rgb-layers .rgb-b {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
}
.rgb-layers .rgb-g {
  position: relative;
}

/* --- Ghost Trail layers --- */
.ghost-trail-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ghost-trail-container .ghost-copy {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  pointer-events: none;
}
.ghost-trail-container .ghost-main {
  position: relative;
}

/* --- Stencil text base --- */
.stencil-target {
  color: transparent;
  -webkit-text-stroke: 2px #00FF66;
}

/* --- Font Mono utility --- */
.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
}

/* --- Paragraph Demo Styles --- */
.para-demo {
  margin: 0 auto;
}
.para-demo p {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Redacted reveal word highlights */
.redacted-target .word-span {
  display: inline-block;
  padding: 0 3px;
  border-radius: 2px;
}

/* Scroll highlight target */
.scroll-highlight-target {
  transition: none;
}
.scroll-highlight-target .word-span {
  display: inline-block;
  transition: color 0.15s ease;
}

/* Focus pull lines */
.para-focus {
  transition: none;
}

/* Gravity stack lines */
.para-stack {
  transform-origin: center bottom;
}

/* Sentence cascade */
.para-cascade {
  transform-origin: left center;
}

/* Parallax lines */
.para-parallax {
  will-change: transform;
}

/* Film credits container */
.film-credits-container {
  text-align: center;
  overflow: hidden;
  max-height: 280px;
  position: relative;
}
.film-credits-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--gs-darker));
  pointer-events: none;
}
.film-credit {
  opacity: 0;
}

/* Scramble paragraph mono text */
.scramble-para {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  letter-spacing: 0.05em;
}

/* Progress underline word spans */
.progress-underline-target .word-span {
  display: inline-block;
  background-repeat: no-repeat;
}

/* Ink drop spread */
.ink-spread-target .word-span {
  display: inline-block;
}

/* Typewriter paragraph cursor */
.typewriter-para-cursor {
  display: inline;
  animation: cursor-blink 0.6s step-end infinite;
}

/* Color wash target */
.color-wash-target .word-span {
  display: inline-block;
  transition: none;
}

/* Para unfurl */
.para-unfurl-target {
  overflow: hidden;
}

/* Paragraph demo preview height adjustment */
.demo-section[data-category="paragraph"] .demo-preview {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ta-hero { padding: 8rem 0 4rem; }
  .demo-preview { min-height: 250px; }
  .demo-preview .display-5 { font-size: 1.75rem; }
  .ta-effect-indicator { top: var(--nav-height, 56px); }
  .ta-technique-num { font-size: 1.5rem; }
  .ta-generator-glow { display: none; }
  .ta-cat-pill { font-size: 0.78rem; padding: 0.35rem 0.75rem; }
  .ta-category-filters { gap: 0.35rem; }
  .para-demo p { font-size: 0.95rem; }
  .film-credits-container { max-height: 220px; }
  .demo-section[data-category="paragraph"] .demo-preview { min-height: 260px; }
}
