/* ==========================================================================
   components.css — CTA, FAQ, portfolio, features, footnote, star interactions
   Mobile-first. Base = 320px.
   ========================================================================== */

/* ---------- CTA Button ---------- */

.cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  margin-top: 2rem;
  opacity: 0;
  background: transparent;
  color: #ffffff;
  font-family: 'Press Start 2P', 'VT323', monospace;
  font-weight: 400;
  font-size: 0.6rem;
  text-decoration: none;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  border: 2px solid #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: transform 0.2s ease, border-color 0.3s ease, color 0.3s ease;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-secondary, var(--accent)) 0%, var(--accent) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: -1;
}

.cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cta:hover .cta-glow {
  animation-play-state: paused;
}

.cta:active::before,
.cta.filling::before {
  transform: scaleX(1);
  transition: transform 1.2s ease-out;
}

.cta:active,
.cta.filling {
  color: var(--bg, #0a0a0f);
  border-color: var(--accent);
}

.cta-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent-secondary, var(--accent)), var(--accent));
  border-radius: 6px;
  opacity: 0;
  filter: blur(15px);
  z-index: -2;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

.cta-meteor {
  position: absolute;
  top: 50%;
  left: -100px;
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  transform: translateY(-50%) rotate(-15deg);
  opacity: 0;
  pointer-events: none;
}

@media (pointer: coarse) {
  .cta:active::before,
  .cta.filling::before {
    transition: transform 0.2s ease-out;
  }
}

@media (min-width: 768px) {
  .cta {
    padding: 1rem 2rem;
    margin-top: 4rem;
    font-size: 0.8rem;
  }
}

/* ---------- FAQ Accordion ---------- */

.faq-list {
  --indent: 1.5rem;
  max-width: 600px;
  margin: 1.5rem auto;
  text-align: left;
}

.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateX(-20px);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  text-align: left;
  padding: 1rem 0;
  padding-left: var(--indent);
  position: relative;
  cursor: none;
  transition: color 0.2s ease;
}

.faq-question::before {
  content: '>';
  color: #ef4444;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5em;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question::before {
  transform: translateY(-50%) rotate(90deg);
}

.faq-question:hover {
  color: #ef4444;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 200px;
  padding-bottom: 1rem;
}

.faq-answer p {
  font-family: 'VT323', monospace;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: var(--indent);
}

@media (min-width: 768px) {
  .faq-list {
    --indent: 2.5rem;
    margin: 2rem auto;
  }

  .faq-question {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    padding: 1.25rem 0;
    padding-left: var(--indent);
  }

  .faq-question::before {
    font-size: 0.6em;
  }

  .faq-item.open .faq-answer {
    padding-bottom: 1.25rem;
  }

  .faq-answer p {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  }
}

/* ---------- Portfolio Grid ---------- */

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 90vw;
  max-width: 900px;
  margin: 1.5rem auto;
  padding: 0 0.5rem;
}

.portfolio-item {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95);
  transition: border-color 0.2s ease;
  cursor: none;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.portfolio-item:hover {
  border-color: #ffffff;
}

.portfolio-item:hover .portfolio-label {
  color: #ffffff;
}

.portfolio-item:hover .portfolio-thumb::after {
  border-color: rgba(255, 255, 255, 0.4);
  width: 1.9rem;
  height: 1.9rem;
  animation: diamond-spin 0.75s linear infinite;
}

@keyframes diamond-spin {
  from { transform: translate(-50%, -50%) rotate(45deg); }
  to { transform: translate(-50%, -50%) rotate(405deg); }
}

.portfolio-item.placeholder {
  cursor: none;
}

.portfolio-thumb {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: linear-gradient(
    135deg,
    rgba(20, 184, 166, 0.1) 0%,
    rgba(168, 85, 247, 0.1) 50%,
    rgba(251, 191, 36, 0.1) 100%
  );
  position: relative;
}

.portfolio-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 4px
  );
}

.portfolio-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.4rem;
  height: 1.4rem;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  transition: border-color 0.2s ease, width 0.3s ease, height 0.3s ease;
}

.portfolio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--text-muted);
  text-align: center;
  padding: 0.3rem 0.5rem;
  height: 2rem;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

@media (pointer: coarse) {
  .portfolio-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 0 7.5vw;
    scrollbar-width: none; /* Firefox */
  }

  .portfolio-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .portfolio-item {
    flex: 0 0 75vw;
    scroll-snap-align: center;
    aspect-ratio: 1 / 1;
    min-height: auto;
  }
}

/* ---------- Carousel (mobile only) ---------- */

.carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text, #f8fafc);
  font-size: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.carousel-arrow:active {
  background: rgba(255, 255, 255, 0.15);
}

.carousel-arrow--prev { left: 0; }
.carousel-arrow--next { right: 0; }

.carousel-dots {
  display: inline-flex; /* Shrink to hug dots */
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  background: rgba(30, 30, 40, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.4rem 0.75rem;
  border-radius: 999px; /* Pill shape */
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  padding: 0;
  cursor: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.carousel-dot.active {
  background: var(--accent, #fbbf24);
  border-color: var(--accent, #fbbf24);
}

@media (min-width: 640px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    width: 85vw;
    height: 60vh;
    margin: 2rem auto;
    padding: 0 1rem;
  }

  .portfolio-item {
    min-height: auto;
  }

  .portfolio-label {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    padding: 0.4rem 0.5rem;
    height: 2.5rem;
  }
}

/* ---------- Feature list ---------- */

.feature-item {
  font-family: 'VT323', monospace;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  line-height: 1.8;
}

@media (min-width: 768px) {
  .feature-item {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  }
}

/* ---------- Footnote ---------- */

.footnote {
  font-family: 'VT323', monospace;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  opacity: 0;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .footnote {
    font-size: clamp(1rem, 2vw, 1.3rem);
  }
}

/* ---------- Logo ---------- */

.logo-img {
  width: clamp(72px, 16vw, 160px);
  height: auto;
  opacity: 0;
  filter: blur(0.4px) drop-shadow(0 0 4px rgba(248, 250, 252, 0.2))
          drop-shadow(0 0 12px rgba(248, 250, 252, 0.08));
  /* Prevent iOS image preview on tap-hold */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.logo-container {
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .logo-container {
    margin-top: 6rem;
  }
}

/* Star proximity glow — see background.css */

.star-killed {
  pointer-events: none;
}

/* ---------- Meteor lines ---------- */

.meteor {
  opacity: 0;
  will-change: stroke-dashoffset, opacity;
}
