/* =========================================
   PORNGEN GLOBAL STYLES (FINAL FIX - CHAT & GRIDS RESTORED)
   ========================================= */

:root {
  /* Brand Colors */
  --bg-main: #050505;
  --bg-dark: #0a0a0c;
  --bg-card: #121214;
  --text-main: #fff;
  --text-muted: #b0b0b0;
  --accent: #e6007a;
  --accent-rgb: 230, 0, 122;
  --accent-hover: #ff1a8c;
  
  /* Layout */
  --container: 1240px;
  --radius: 12px;
  --border: rgba(255, 255, 255, 0.08);
  --header-height: 70px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  display: flex; flex-direction: column; min-height: 100vh;
}
img, video { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul, ol { list-style: none; padding: 0; margin: 0; }

/* UTILS */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.bg-dark { background: var(--bg-dark); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-white { color: #fff; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mb-50 { margin-bottom: 50px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }

/* UTILITY GRIDS (ADDED MISSING CLASSES) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.gap-40 { gap: 40px; }

/* BUTTONS */
.btn {
  display: inline-flex; justify-content: center; align-items: center;
  background: var(--accent); color: #fff; font-weight: 700;
  border-radius: 99px; text-transform: uppercase; cursor: pointer; white-space: nowrap;
  border: none; transition: all 0.3s ease;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(230,0,122,0.4); }
.btn-primary { padding: 14px 28px; }
.btn-lg { padding: 18px 40px; font-size: 1.2rem; }
.btn-sm { padding: 10px 20px; font-size: 0.9rem; }
.cta-wrapper { margin-top: 30px; }

/* HEADER */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(5, 5, 5, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  backdrop-filter: blur(10px);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; flex-wrap: wrap; }
.logo { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.main-nav { display: flex; align-items: center; }
.main-nav a { margin: 0 15px; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover, .main-nav a.active { color: #fff; }
.main-nav a.active { border-bottom: 2px solid var(--accent); }

/* HERO */
.hero, .hero-video, .hero-chat { padding: 80px 0; min-height: 600px; display: flex; align-items: center; }
.hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-copy h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 20px; letter-spacing: -0.02em; }
.hero-sub { font-size: 1.25rem; color: #ddd; margin-bottom: 30px; max-width: 550px; }

/* Hero Chips */
.hero-chips { display: flex; gap: 12px; margin-top: 25px; flex-wrap: wrap; align-items: center; }
.chip-link, .chip-link-static {
  font-size: 0.85rem; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.1); padding: 8px 16px;
  border-radius: 99px; border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 0.05em;
}
.chip-link:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* HERO MEDIA */
.hero-media, .chat-hero-container, .video-container { 
    position: relative; height: 550px; width: 100%; display: flex; justify-content: center; 
}
.hero-img-card, .hero-video-card, .chat-hero-card {
  position: relative; width: 100%; height: 100%;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5); border: 1px solid var(--border);
}
.hero-img-card.no-border, .hero-video-card.no-border, .chat-hero-card.no-border { 
    border: none; box-shadow: none; background: transparent; 
}

/* Hero Images */
.hero-img, .hero-video-element, .hero-img-element {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center bottom;
  opacity: 0; transition: opacity 1s;
}
.hero-img.is-active, .hero-video-element, .hero-img-element { opacity: 1; }

/* CHAT HERO BUBBLE */
.chat-overlay-message { 
    position: absolute; bottom: 30px; left: 20px; right: 20px; 
    background: rgba(20, 20, 20, 0.95); border: 1px solid var(--accent); 
    padding: 15px; border-radius: 12px; display: flex; align-items: center; gap: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: floatUp 1s ease-out; z-index: 10; 
}
.avatar-circle { width: 40px; height: 40px; background-color: var(--accent); border-radius: 50%; flex-shrink: 0; }
.message-bubble { color: #fff; font-size: 0.95rem; line-height: 1.4; }
@keyframes floatUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* TOC */
.toc-section { background: var(--bg-card); padding: 15px 0; border-bottom: 1px solid var(--border); }
.toc-nav { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; align-items: center; }
.toc-label { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; margin-right: 5px; }
.toc-nav a { color: var(--text-main); font-size: 0.9rem; font-weight: 500; padding: 5px 12px; background: rgba(255,255,255,0.05); border-radius: 99px; border: 1px solid transparent; transition: 0.2s; }
.toc-nav a:hover { border-color: var(--accent); background: rgba(230,0,122,0.1); }

/* TEXT BLOCKS */
.text-block { max-width: 800px; margin: 0 auto; }
.text-block p { margin-bottom: 1.5rem; color: var(--text-muted); font-size: 1.1rem; line-height: 1.7; text-align: left; }
.text-block h2, .text-block h3 { color: #fff; margin-bottom: 20px; margin-top: 40px; }

/* ============================
   GALLERIES
   ============================ */

/* Main Gallery */
.fantasy-gallery { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    margin-top: 40px; 
}

/* Gallery Item */
.gallery-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Images (Face Fix) */
.gallery-item img, .fantasy-gallery > img { 
    width: 100%; 
    height: 320px; 
    object-fit: cover; 
    object-position: top center; 
    border-radius: 8px; 
    border: 1px solid var(--border);
    cursor: pointer; 
    transition: transform 0.3s; 
    background: #111;
}
.gallery-item img:hover, .fantasy-gallery > img:hover { 
    transform: scale(1.02); 
    z-index: 2; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); 
}

.gallery-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CHAT PAGE GRIDS */
.chat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.chat-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2 / 3; background: #000; border: 1px solid var(--border); transition: transform 0.3s ease; }
.chat-item:hover { transform: translateY(-5px); border-color: var(--accent); }
.chat-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-label { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; font-size: 0.9rem; font-weight: 600; text-align: center; }

/* MINI GALLERY (FOR CHAT PAGE BOTTOM) */
.mini-gallery { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-top: 20px;
}
.mini-gallery img { 
    width: 100%; 
    height: auto; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
}

/* PERSONA GRID */
.persona-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.persona-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding-bottom: 20px; text-align: center; transition: 0.3s; }
.persona-card:hover { border-color: var(--accent); }
.persona-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; margin-bottom: 15px; border-bottom: 1px solid var(--border); }
.persona-card h3 { margin: 10px 0 5px; color: var(--accent); font-size: 1.2rem; }
.persona-card p { font-size: 0.9rem; padding: 0 15px; opacity: 0.8; }

/* VIDEO PAGE GRID */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.video-item { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--border); aspect-ratio: 9/16; }
.video-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-label { position: absolute; bottom: 0; width: 100%; padding: 10px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; font-size: 0.9rem; font-weight: 600; text-align: center; }

/* HOME VIDEO PREVIEW */
.video-preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-top: 40px; }
.video-wrapper { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--border); aspect-ratio: 9/16; max-width: 350px; margin: 0 auto; width: 100%; transition: transform 0.3s ease; }
.video-wrapper:hover { transform: scale(1.02); border-color: var(--accent); }
.video-wrapper video { width: 100%; height: 100%; object-fit: cover; }

/* PIPELINE (5 COLS FIXED) */
.steps-grid { display: grid; gap: 20px; margin: 40px 0; grid-template-columns: repeat(5, 1fr); }
.steps-grid.four-cols { grid-template-columns: repeat(4, 1fr); }
.step-card { background: var(--bg-card); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); text-align: left; display: flex; flex-direction: column; }
.step-card h3 { font-size: 1.1rem; margin-bottom: 8px; margin-top: 15px; }
.step-card p { font-size: 0.9rem; margin: 0; color: var(--text-muted); }
.step-media { width: 100%; height: auto; object-fit: contain; border-radius: 6px; background: #000; }
.step-number { font-size: 3rem; font-weight: 900; color: rgba(255, 255, 255, 0.05); line-height: 1; margin-bottom: -10px; }

/* FEATURES & SILO */
.features-box { max-width: 900px; margin: 0 auto; background: var(--bg-card); padding: 40px; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.features-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; margin-top: 20px; }
.features-list li { color: var(--text-muted); font-size: 1rem; padding-left: 20px; position: relative; }
.features-list li::before { content: "•"; color: var(--accent); position: absolute; left: 0; font-weight: bold; }
.features-list strong { color: #fff; }

.features-box-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 40px; }
.feature-card-large { background: rgba(255,255,255,0.03); padding: 35px; border-radius: var(--radius); border: 1px solid var(--border); text-align: left; }
.feature-card-large code { background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); padding: 3px 8px; border-radius: 6px; color: #ff2a6d; font-family: 'Courier New', monospace; font-size: 0.9em; font-weight: 600; display: block; margin-top: 10px; word-break: break-all; }

/* SILO GRID */
.silo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: left; margin: 30px auto 0; max-width: 960px; }
.silo-col h3 { color: var(--accent); font-size: 1.2rem; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.silo-col ul li { margin-bottom: 10px; }
.silo-col ul li a { color: var(--text-muted); font-size: 1rem; transition: 0.2s; }
.silo-col ul li a:hover { color: #fff; padding-left: 5px; }

/* STYLES GRID */
.styles-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; margin-top: 40px; }
.style-card { text-align: center; cursor: pointer; }
.style-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 50%; border: 2px solid transparent; transition: 0.2s; margin-bottom: 10px; }
.style-card:hover img { border-color: var(--accent); transform: scale(1.05); }
.style-label { font-size: 0.9rem; font-weight: 600; color: #fff; }
.style-labels-row { display: flex; justify-content: center; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.chip { background: #222; padding: 8px 16px; border-radius: 99px; font-size: 0.85rem; color: #ccc; border: 1px solid var(--border); }

/* AUDIENCE */
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.audience-card { background: var(--bg-card); padding: 30px; border-radius: var(--radius); border: 1px solid var(--border); text-align: left; }
.audience-card h3 { font-size: 1.25rem; margin-bottom: 10px; color: #fff; }
.audience-card p { font-size: 0.95rem; color: var(--text-muted); margin: 0; }

/* COMPARISON TABLES */
.comparison-table-wrapper { overflow-x: auto; margin: 40px 0; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.4); }
.comparison-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.comparison-table th, .comparison-table td { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.comparison-table th { background: rgba(255, 255, 255, 0.02); font-weight: 700; color: #aaa; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }
.comparison-table .highlight { background: rgba(230, 0, 122, 0.1); color: #fff; font-weight: 700; border-left: 1px solid rgba(230, 0, 122, 0.3); border-right: 1px solid rgba(230, 0, 122, 0.3); }
.check { color: #4ade80; }
.cross { color: #f87171; }

/* COMPARISON CARDS */
.comparison-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 30px; align-items: center; max-width: 1000px; margin: 0 auto; }
.comparison-card { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid var(--border); aspect-ratio: 3/4; }
.comparison-card img, .comparison-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.comparison-arrow { font-size: 3rem; color: var(--accent); font-weight: 900; }
.badge { position: absolute; top: 15px; left: 15px; background: rgba(0,0,0,0.7); color: #fff; padding: 5px 12px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; z-index: 2; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.1); }
.badge-accent { background: var(--accent); border-color: var(--accent); }

/* FAQ */
.faq-list { max-width: 900px; margin: 40px auto; text-align: left; }
.faq-item { border-bottom: 1px solid var(--border); padding: 25px 0; }
.faq-q { font-weight: 600; cursor: pointer; font-size: 1.1rem; transition: color 0.2s; }
.faq-q:hover { color: var(--accent); }
.faq-a { display: none; padding-top: 15px; color: var(--text-muted); line-height: 1.6; }
.faq-item.is-open .faq-a { display: block; animation: fadeIn 0.3s; }

/* FOOTER */
.site-footer { margin-top: auto; padding: 40px 0; border-top: 1px solid var(--border); background: #000; font-size: 0.9rem; color: #666; }

/* LIGHTBOX */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); display: none; justify-content: center; align-items: center; z-index: 2000; }
.lightbox.is-visible { display: flex; animation: fadeIn 0.2s; }
.lightbox-content { position: relative; max-width: 90vw; max-height: 90vh; display: flex; align-items: center; justify-content: center; }
.lightbox-content img { max-width: 100%; max-height: 90vh; border-radius: 4px; box-shadow: 0 0 50px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: -40px; right: 0; color: #fff; font-size: 30px; cursor: pointer; z-index: 2001; }
.lightbox-nav { background: rgba(0,0,0,0.5); border: none; color: white; font-size: 40px; cursor: pointer; padding: 0 20px; user-select: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2001; border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }
.lightbox-nav:hover { color: var(--accent); background: rgba(0,0,0,0.8); }
.lightbox-prev { left: -80px; }
.lightbox-next { right: -80px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* BREADCRUMB */
.breadcrumb { padding: 12px 0; background: var(--bg-dark); border-bottom: 1px solid var(--border); }
.breadcrumb-list { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.breadcrumb-item a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb-item a:hover { color: #fff; }
.breadcrumb-item.active { color: var(--accent); }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--text-muted); margin-right: 0; padding-right: 0; }

/* GENERATOR NAV CARDS */
.generator-nav-section { padding: 60px 0; background: var(--bg-dark); }
.generator-nav-section h2 { margin-bottom: 40px; }
.generator-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; align-items: start; }
.generator-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: all 0.3s ease; display: flex; flex-direction: column; text-decoration: none;
}
.generator-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 10px 30px rgba(230, 0, 122, 0.15); }
.generator-card.is-active { border-color: var(--accent); box-shadow: 0 0 20px rgba(230, 0, 122, 0.25); cursor: default; }
.generator-card-media {
    width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: #111; display: flex; align-items: center; justify-content: center;
}
.generator-card-media img, .generator-card-media video {
    width: 100%; height: 100%; object-fit: cover; object-position: top center;
}
.generator-card-video { position: relative; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: #111; display: flex; align-items: center; justify-content: center; }
.generator-card-video video { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.generator-card-body { padding: 16px; flex: 1; }
.generator-card-body h3 { font-size: 1rem; margin-bottom: 6px; color: #fff; }
.generator-card-body p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* UNIVERSE DESC */
.universe-desc { color: var(--text-muted); font-size: 1.1rem; line-height: 1.7; margin-bottom: 40px; text-align: center; }

/* TEXT LINKS */
.text-link { color: var(--accent); font-weight: 600; border-bottom: 1px solid transparent; transition: all 0.2s; }
.text-link:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }

/* MOBILE STICKY CTA */
.mobile-sticky-cta {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
    padding: 12px 16px; background: rgba(5, 5, 5, 0.95); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); text-align: center;
    transition: transform 0.3s ease;
}
.mobile-sticky-cta.is-hidden { transform: translateY(100%); }
.btn-mobile-cta { width: 100%; padding: 14px 24px; font-size: 1rem; }

@media (max-width: 767px) {
    .mobile-sticky-cta { display: block; }
    body { padding-bottom: 70px; }
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .fantasy-gallery, .chat-grid, .persona-grid, .steps-grid, .silo-grid, .video-grid { grid-template-columns: repeat(3, 1fr); }
  .generator-cards { grid-template-columns: repeat(3, 1fr); }
  .styles-grid { grid-template-columns: repeat(4, 1fr); }
  .lightbox-prev { left: 10px; } .lightbox-next { right: 10px; }
}
@media (max-width: 992px) {
  .hero-layout { grid-template-columns: 1fr; text-align: center; }
  .hero-media, .chat-hero-container { height: 400px; margin-top: 40px; }
  .hero-copy p { text-align: center; margin-left: auto; margin-right: auto; }
  .hero-chips { justify-content: center; }
  .audience-grid, .features-list, .features-box-grid, .silo-grid, .video-grid, .grid-2 { grid-template-columns: 1fr 1fr; }
  .chat-grid, .persona-grid { grid-template-columns: repeat(2, 1fr); }
  .generator-cards { grid-template-columns: repeat(2, 1fr); }
  .video-preview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .site-header { height: auto; padding: 15px 0; }
  .header-inner { flex-direction: column; gap: 15px; }
  .main-nav { flex-wrap: wrap; justify-content: center; width: 100%; margin-top: 5px; }
  .main-nav a { margin: 5px; font-size: 0.9rem; }
  
  .hero-copy h1 { font-size: 2.5rem; }
  .fantasy-gallery, .chat-grid, .persona-grid, .steps-grid, .audience-grid, .features-list, .features-box-grid, .silo-grid, .video-grid, .grid-2, .mini-gallery { grid-template-columns: 1fr; }
  .generator-cards { grid-template-columns: 1fr; }
  .styles-grid { grid-template-columns: repeat(3, 1fr); }
  .comparison-grid { flex-direction: column; grid-template-columns: 1fr; }
  .comparison-arrow { transform: rotate(90deg); margin: 10px auto; }
  .toc-nav { display: none; }
}