/* AI Prompt Book Web Portal - Core Stylesheet */

/* --- 1. Custom Properties (Design System Tokens) --- */
:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #12161f;
    --bg-tertiary: #1b212f;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #d2bbff;
    --primary-container: #7c3aed;
    --secondary: #adc6ff;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --accent-glow: rgba(124, 58, 237, 0.4);
    
    /* Layout & Spacing */
    --unit: 8px;
    --container-margin: 24px;
    --gutter: 16px;
    --stack-sm: 8px;
    --stack-md: 16px;
    --stack-lg: 32px;
}

/* --- 2. Base & Resets --- */
html {
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary-container);
    color: #ffffff;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease-out;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* --- 3. Typography Utility --- */
.font-display {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.title-large {
    font-size: 2.5rem; /* 40px */
    line-height: 1.15;
    font-weight: 700;
    margin-bottom: var(--stack-md);
}

.title-section {
    font-size: 2rem; /* 32px */
    line-height: 1.25;
    font-weight: 700;
}

.title-card {
    font-size: 1.5rem; /* 24px */
    line-height: 1.35;
    font-weight: 500;
}

.text-muted-styled {
    color: var(--text-muted);
}

/* --- 4. Navigation & Layout Container --- */
.max-width-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-margin);
    width: 100%;
}

.glass {
    background: rgba(18, 22, 31, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

/* Header & Nav */
header.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--stack-md);
    padding-bottom: var(--stack-md);
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: var(--stack-lg);
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link.active, .nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--stack-md);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 24px;
}

/* --- 5. Interactive Components --- */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease, box-shadow 0.2s ease;
    border: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.03);
}

/* Feature Cards Grid */
.features-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(18, 22, 31, 0.5) 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 8px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card-feature {
    border-radius: 24px;
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-feature:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.icon-purple {
    background: rgba(210, 187, 255, 0.1);
    color: var(--primary);
}

.icon-blue {
    background: rgba(173, 198, 255, 0.1);
    color: var(--secondary);
}

.icon-orange {
    background: rgba(255, 183, 132, 0.1);
    color: #ffb784;
}

/* --- 6. Live Prompts Showcase --- */
.showcase-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 24px;
}

.tabs-container {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: 4px;
    border-radius: 9999px;
    gap: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--primary-container);
    color: #ffffff;
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Prompt Card styling */
.prompt-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 4/5;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.prompt-card:hover {
    transform: scale(1.02);
    border-color: rgba(124, 58, 237, 0.5);
}

.prompt-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.prompt-card:hover img {
    transform: scale(1.08);
}

.prompt-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary);
    text-transform: uppercase;
    z-index: 5;
}

.prompt-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    gap: 16px;
    z-index: 10;
}

.prompt-card:hover .prompt-overlay {
    opacity: 1;
}

.prompt-overlay p {
    text-align: center;
    color: #ffffff;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.4;
}

.copy-card-btn {
    width: 100%;
    background: var(--primary-container);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-card-btn:hover {
    background: #6d28d9;
}

/* --- 7. Blog Preview Section --- */
.blog-preview-section {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-img-wrapper {
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.blog-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-img-wrapper img {
    transform: scale(1.05);
}

.blog-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-tag {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 500;
}

.blog-card-title:hover {
    color: var(--primary);
}

.blog-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 8. Readability Blog Detail Layout --- */
.blog-main {
    padding: 120px 0 80px 0;
}

.blog-post-article {
    max-width: 720px;
    margin: 0 auto;
}

.blog-post-header {
    margin-bottom: 32px;
}

.blog-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.blog-meta-tag {
    background: var(--bg-tertiary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.blog-title-main {
    font-size: 2.75rem; /* 44px */
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.blog-featured-image {
    aspect-ratio: 16/9;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    margin-bottom: 48px;
}

.blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-body-content {
    font-size: 1.125rem; /* 18px */
    line-height: 1.8;
    color: rgba(243, 244, 246, 0.95);
}

.blog-body-content p {
    margin-bottom: 24px;
}

.blog-body-content h2 {
    font-size: 1.75rem; /* 28px */
    color: #ffffff;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
}

.blog-body-content strong {
    color: #ffffff;
}

/* Prompt Box inside Blog */
.blog-prompt-box {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
    border: 1px solid var(--border-subtle);
    z-index: 1;
}

.blog-prompt-box::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--accent-gradient);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.25;
}

.blog-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.blog-prompt-header span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.copy-prompt-icon-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.copy-prompt-icon-btn:hover {
    background: var(--bg-tertiary);
    color: #ffffff;
}

.blog-prompt-code {
    display: block;
    color: var(--primary);
    font-family: monospace;
    font-size: 1.05rem;
    line-height: 1.5;
    word-break: break-all;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-subtle);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    overflow: hidden;
    background: var(--accent-gradient);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    color: #ffffff;
    font-weight: 500;
}

.author-title {
    color: var(--text-muted);
    font-size: 14px;
}

/* Related Posts block */
.related-section {
    max-width: 1200px;
    margin: 80px auto 0 auto;
    padding: 0 var(--container-margin);
}

.related-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.related-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.related-img-wrapper {
    aspect-ratio: 16/9;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-tertiary);
    margin-bottom: 16px;
}

.related-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-tag {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.related-heading {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #ffffff;
}

.related-card:hover .related-heading {
    color: var(--primary);
}

.related-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 9. Footer Section --- */
footer.site-footer {
    border-top: 1px solid var(--border-subtle);
    background-color: var(--bg-primary);
    padding: 64px 0 32px 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
}

.footer-brand h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 250px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-column h5 {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.footer-column a {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-column a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 12px;
}

.social-links {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
}

.social-links a:hover {
    color: var(--primary);
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* --- 10. Hero Section Visuals & Mockups --- */
.hero-section {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    z-index: 10;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--stack-lg);
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-mockup-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(124, 58, 237, 0.2);
    filter: blur(100px);
    border-radius: 9999px;
    z-index: -1;
}

.device-mockup {
    position: relative;
    width: 280px;
    height: 580px;
    background: #0c0e12;
    border: 8px solid #282a2e;
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.device-mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.device-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 12, 16, 0.8) 0%, transparent 100%);
    pointer-events: none;
}

/* Mobile Responsive Navigation overlay menu */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(10, 12, 16, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 32px var(--container-margin);
    z-index: 999;
}

.nav-mobile-overlay.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: slideDown 0.3s ease-out forwards;
}

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

.nav-mobile-overlay a {
    font-size: 1.25rem;
    font-weight: 500;
}

/* Copy Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--primary);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 2000;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- 11. Responsive Media Queries --- */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .nav-actions .btn-primary {
        display: none;
    }
    
    .title-large {
        font-size: 2.25rem;
    }
    
    .title-section {
        font-size: 1.75rem;
    }
    
    .blog-title-main {
        font-size: 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tabs-container::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        flex-shrink: 0;
    }
    
    .showcase-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .blog-meta-row {
        flex-wrap: wrap;
    }
    
    .blog-prompt-box {
        padding: 16px;
    }
    
    .blog-prompt-code {
        font-size: 0.9rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
    }
    
    .hero-actions {
        flex-direction: column;
    }
}

/* ===== Markdown content styles (Jekyll blog posts & pages) ===== */
.blog-body-content h3 {
    font-size: 1.35rem;
    color: #ffffff;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 12px;
}

.blog-body-content ul,
.blog-body-content ol {
    margin: 0 0 24px 0;
    padding-left: 28px;
}

.blog-body-content li {
    margin-bottom: 10px;
}

.blog-body-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-body-content a:hover {
    color: #ffffff;
}

.blog-body-content blockquote {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 32px 0;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--primary);
}

.blog-body-content blockquote p {
    margin-bottom: 8px;
}

.blog-body-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-body-content code {
    display: inline-block;
    color: var(--primary);
    font-family: monospace;
    font-size: 0.95em;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 8px;
    border-radius: 6px;
    word-break: break-word;
}

.blog-body-content hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 40px 0;
}

.blog-body-content img {
    max-width: 100%;
    border-radius: 16px;
}
