/* ============================================================
   REFERENCE ARCHITECTURES — Cinematic Showcase Gallery
   Built by Cerebro for King Kyle
   
   NOT a template grid. This is a visual imagination trigger.
   Large cinematic cards. Horizontal gallery. Subtle motion.
   ============================================================ */

/* ── Section Container ── */
.refarch-section {
  position: relative;
  padding: clamp(5rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 6rem);
  overflow: hidden;
  background: var(--bg);
}

/* Ambient background glow */
.refarch-section::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1200px;
  height: 700px;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--purple-rgb), 0.04) 0%,
    rgba(var(--pink-rgb), 0.02) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.refarch-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width-lg);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ── Section Header ── */
.refarch-header {
  text-align: center;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.refarch-header.refarch-visible {
  opacity: 1;
  transform: translateY(0);
}

.refarch-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--purple-light);
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.refarch-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--purple-light);
  opacity: 0.5;
}

.refarch-label::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--purple-light);
  opacity: 0.5;
}

.refarch-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

.refarch-title-accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.refarch-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}


/* ══════════════════════════════════════════════════
   GALLERY — Horizontal Scroll Showcase
   ══════════════════════════════════════════════════ */
.refarch-gallery {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 clamp(1rem, 4vw, 2rem) 2rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
}

.refarch-gallery:active {
  cursor: grabbing;
}

.refarch-gallery::-webkit-scrollbar {
  display: none;
}

/* ── Scroll Indicator ── */
.refarch-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  opacity: 0;
  transition: opacity 0.6s ease 0.8s;
}

.refarch-scroll-hint.refarch-visible {
  opacity: 1;
}

.refarch-scroll-dots {
  display: flex;
  gap: 8px;
}

.refarch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-ghost);
  transition: all 0.4s ease;
}

.refarch-dot.active {
  width: 24px;
  border-radius: 3px;
  background: var(--purple-mid);
}

.refarch-scroll-arrows {
  display: flex;
  gap: 6px;
  margin-left: 16px;
}

.refarch-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.refarch-arrow:hover {
  border-color: var(--purple-mid);
  color: var(--text);
  background: rgba(var(--purple-rgb), 0.1);
}


/* ══════════════════════════════════════════════════
   CINEMATIC CARD
   ══════════════════════════════════════════════════ */
.refarch-card {
  flex: 0 0 clamp(340px, 42vw, 580px);
  scroll-snap-align: center;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.5s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.5s ease;
  opacity: 0;
  transform: translateY(40px) scale(0.97);
}

.refarch-card.refarch-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.refarch-card:nth-child(2) { transition-delay: 0.1s; }
.refarch-card:nth-child(3) { transition-delay: 0.2s; }
.refarch-card:nth-child(4) { transition-delay: 0.3s; }
.refarch-card:nth-child(5) { transition-delay: 0.4s; }

.refarch-card:hover {
  border-color: rgba(var(--purple-rgb), 0.3);
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(var(--purple-rgb), 0.06);
}


/* ── Visual Preview Frame ── */
.refarch-preview {
  position: relative;
  width: 100%;
  height: clamp(320px, 45vw, 480px);
  overflow: hidden;
}

/* Simulated homepage preview — CSS-generated aesthetic */
.refarch-preview-inner {
  position: absolute;
  inset: 16px;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.refarch-card:hover .refarch-preview-inner {
  transform: scale(1.03);
}

/* Browser chrome mock (subtle) */
.refarch-browser-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 5px;
  z-index: 2;
}

.refarch-browser-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.refarch-browser-url {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.03em;
}

/* Individual architecture visual themes */

/* ── Obsidian: dark editorial luxury ── */
.refarch-preview--obsidian {
  background: linear-gradient(170deg, #0a0a0a 0%, #1a1a2e 100%);
}

.refarch-preview--obsidian .refarch-scene {
  position: absolute;
  inset: 0;
  top: 28px;
}

.refarch-preview--obsidian .refarch-scene::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 8%;
  width: 45%;
  height: 2px;
  background: linear-gradient(90deg, #d4af37, transparent);
  opacity: 0.6;
}

.refarch-preview--obsidian .refarch-scene::after {
  content: '';
  position: absolute;
  top: 14%;
  left: 8%;
  right: 20%;
  height: 38px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  background: linear-gradient(180deg, transparent 0%, rgba(212, 175, 55, 0.02) 100%);
}

.refarch-scene-blocks {
  position: absolute;
}

/* Obsidian blocks */
.refarch-preview--obsidian .refarch-block-hero {
  position: absolute;
  top: 35%;
  left: 8%;
  width: 50%;
  height: 25%;
}

.refarch-preview--obsidian .refarch-block-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.refarch-preview--obsidian .refarch-block-hero::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 0;
  width: 55%;
  height: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
}

.refarch-preview--obsidian .refarch-block-img {
  position: absolute;
  top: 12%;
  right: 6%;
  width: 35%;
  height: 55%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.02) 100%);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 4px;
}

.refarch-preview--obsidian .refarch-block-nav {
  position: absolute;
  bottom: 8%;
  left: 8%;
  right: 8%;
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
}

.refarch-preview--obsidian .refarch-block-cta {
  position: absolute;
  top: 42%;
  left: 8%;
  width: 22%;
  height: 26px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 2px;
}


/* ── Aurora: gradient SaaS tech-forward ── */
.refarch-preview--aurora {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.refarch-preview--aurora .refarch-scene::before {
  content: '';
  position: absolute;
  top: 8%;
  left: 20%;
  width: 60%;
  height: 50%;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.08), transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
}

.refarch-preview--aurora .refarch-block-hero {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  text-align: center;
}

.refarch-preview--aurora .refarch-block-hero::before {
  content: '';
  display: block;
  width: 80%;
  margin: 0 auto;
  height: 8px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  border-radius: 4px;
}

.refarch-preview--aurora .refarch-block-hero::after {
  content: '';
  display: block;
  width: 50%;
  margin: 10px auto 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.refarch-preview--aurora .refarch-block-cta {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translateX(-50%);
  width: 18%;
  height: 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(236, 72, 153, 0.4));
  border-radius: 20px;
}

.refarch-preview--aurora .refarch-block-cards {
  position: absolute;
  bottom: 12%;
  left: 10%;
  right: 10%;
  display: flex;
  gap: 6%;
}

.refarch-preview--aurora .refarch-block-card {
  flex: 1;
  height: 60px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}


/* ── Meridian: clean minimal Scandinavian ── */
.refarch-preview--meridian {
  background: #f5f5f0;
}

.refarch-preview--meridian .refarch-scene {
  top: 28px;
}

.refarch-preview--meridian .refarch-block-nav {
  position: absolute;
  top: 3%;
  left: 6%;
  right: 6%;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.refarch-preview--meridian .refarch-block-nav::before {
  content: '';
  width: 15%;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
}

.refarch-preview--meridian .refarch-block-nav::after {
  content: '';
  width: 25%;
  height: 3px;
  background: #ddd;
  border-radius: 2px;
}

.refarch-preview--meridian .refarch-block-hero {
  position: absolute;
  top: 18%;
  left: 6%;
  width: 45%;
}

.refarch-preview--meridian .refarch-block-hero::before {
  content: '';
  display: block;
  width: 85%;
  height: 7px;
  background: #1a1a1a;
  border-radius: 2px;
  margin-bottom: 8px;
}

.refarch-preview--meridian .refarch-block-hero::after {
  content: '';
  display: block;
  width: 60%;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
}

.refarch-preview--meridian .refarch-block-img {
  position: absolute;
  top: 14%;
  right: 4%;
  width: 38%;
  height: 50%;
  background: linear-gradient(180deg, #e8e4df, #d4cfc8);
  border-radius: 3px;
}

.refarch-preview--meridian .refarch-block-cta {
  position: absolute;
  top: 42%;
  left: 6%;
  width: 16%;
  height: 22px;
  background: #1a1a1a;
  border-radius: 2px;
}

.refarch-preview--meridian .refarch-block-grid {
  position: absolute;
  bottom: 8%;
  left: 6%;
  right: 6%;
  display: flex;
  gap: 4%;
}

.refarch-preview--meridian .refarch-block-grid-item {
  flex: 1;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 3px;
}


/* ── Forge: bold industrial conversion ── */
.refarch-preview--forge {
  background: linear-gradient(180deg, #111 0%, #1a1a1a 100%);
}

.refarch-preview--forge .refarch-scene::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06), transparent);
}

.refarch-preview--forge .refarch-block-hero {
  position: absolute;
  top: 12%;
  left: 5%;
  right: 5%;
  text-align: center;
}

.refarch-preview--forge .refarch-block-hero::before {
  content: '';
  display: block;
  width: 70%;
  margin: 0 auto;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.refarch-preview--forge .refarch-block-hero::after {
  content: '';
  display: block;
  width: 40%;
  margin: 10px auto 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
}

.refarch-preview--forge .refarch-block-cta {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  width: 24%;
  height: 30px;
  background: #ef4444;
  border-radius: 3px;
}

.refarch-preview--forge .refarch-block-stats {
  position: absolute;
  top: 54%;
  left: 10%;
  right: 10%;
  display: flex;
  gap: 4%;
}

.refarch-preview--forge .refarch-block-stat {
  flex: 1;
  text-align: center;
}

.refarch-preview--forge .refarch-block-stat::before {
  content: '';
  display: block;
  width: 40%;
  margin: 0 auto;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.refarch-preview--forge .refarch-block-stat::after {
  content: '';
  display: block;
  width: 65%;
  margin: 6px auto 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
}

.refarch-preview--forge .refarch-block-bottom {
  position: absolute;
  bottom: 8%;
  left: 5%;
  right: 5%;
  height: 18%;
  border-top: 1px solid rgba(239, 68, 68, 0.15);
}


/* ── Prism: colorful creative portfolio ── */
.refarch-preview--prism {
  background: linear-gradient(160deg, #0d0d1a, #1a0d2e);
}

.refarch-preview--prism .refarch-scene::before {
  content: '';
  position: absolute;
  top: 15%;
  right: 5%;
  width: 35%;
  height: 45%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.08));
  border-radius: 8px;
  border: 1px solid rgba(6, 182, 212, 0.1);
}

.refarch-preview--prism .refarch-scene::after {
  content: '';
  position: absolute;
  top: 22%;
  right: 10%;
  width: 25%;
  height: 30%;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(245, 158, 11, 0.05));
  border-radius: 6px;
  border: 1px solid rgba(236, 72, 153, 0.08);
  transform: rotate(2deg);
}

.refarch-preview--prism .refarch-block-hero {
  position: absolute;
  top: 20%;
  left: 6%;
  width: 45%;
}

.refarch-preview--prism .refarch-block-hero::before {
  content: '';
  display: block;
  width: 70%;
  height: 6px;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6);
  border-radius: 3px;
  margin-bottom: 10px;
}

.refarch-preview--prism .refarch-block-hero::after {
  content: '';
  display: block;
  width: 85%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.refarch-preview--prism .refarch-block-text {
  position: absolute;
  top: 38%;
  left: 6%;
  width: 40%;
}

.refarch-preview--prism .refarch-block-text::before {
  content: '';
  display: block;
  width: 90%;
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
  margin-bottom: 6px;
}

.refarch-preview--prism .refarch-block-text::after {
  content: '';
  display: block;
  width: 65%;
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
}

.refarch-preview--prism .refarch-block-gallery {
  position: absolute;
  bottom: 10%;
  left: 6%;
  right: 6%;
  display: flex;
  gap: 3%;
}

.refarch-preview--prism .refarch-block-gallery-item {
  flex: 1;
  height: 50px;
  border-radius: 6px;
}

.refarch-preview--prism .refarch-block-gallery-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(6, 182, 212, 0.1);
}

.refarch-preview--prism .refarch-block-gallery-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.refarch-preview--prism .refarch-block-gallery-item:nth-child(3) {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05));
  border: 1px solid rgba(236, 72, 153, 0.1);
}

.refarch-preview--prism .refarch-block-gallery-item:nth-child(4) {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.1);
}


/* ── Card Info Strip (bottom of card, minimal) ── */
.refarch-card-info {
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

.refarch-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.refarch-card-type {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.refarch-card:hover .refarch-card-type {
  border-color: rgba(var(--purple-rgb), 0.25);
  color: var(--text-muted);
}


/* ── Hover glow line on card top ── */
.refarch-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.refarch-card:hover::after {
  opacity: 1;
}

.refarch-card:nth-child(1)::after { background: linear-gradient(90deg, transparent, #d4af37, transparent); }
.refarch-card:nth-child(2)::after { background: linear-gradient(90deg, transparent, #8b5cf6, transparent); }
.refarch-card:nth-child(3)::after { background: linear-gradient(90deg, transparent, #1a1a1a, #aaa, transparent); }
.refarch-card:nth-child(4)::after { background: linear-gradient(90deg, transparent, #ef4444, transparent); }
.refarch-card:nth-child(5)::after { background: linear-gradient(90deg, transparent, #06b6d4, transparent); }


/* ── Section Footer / Tagline ── */
.refarch-footer {
  text-align: center;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  opacity: 0;
  transition: opacity 0.6s ease 0.6s;
}

.refarch-footer.refarch-visible {
  opacity: 1;
}

.refarch-footer-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.refarch-footer-text span {
  color: var(--purple-light);
}


/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .refarch-card {
    flex: 0 0 clamp(300px, 70vw, 480px);
  }

  .refarch-preview {
    height: clamp(280px, 50vw, 380px);
  }
}

@media (max-width: 640px) {
  .refarch-card {
    flex: 0 0 85vw;
  }

  .refarch-preview {
    height: 300px;
  }

  .refarch-gallery {
    padding: 0 5vw 1.5rem;
    gap: 16px;
  }

  .refarch-scroll-arrows {
    display: none;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .refarch-header,
  .refarch-card,
  .refarch-scroll-hint,
  .refarch-footer {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .refarch-preview-inner {
    transition: none !important;
  }
}
