/* ============================================================
   OGApe Manifesto — ogape.ai
   Dark cinematic design, gold accents, split-panel principles
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-deep: #06060a;
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: rgba(18, 18, 28, 0.7);
    --gold: #c9a84c;
    --gold-bright: #e3c66d;
    --gold-dim: #8a7535;
    --text-primary: #e8e0d0;
    --text-secondary: #9a9488;
    --text-muted: #5a5650;
    --border-subtle: rgba(201, 168, 76, 0.12);
    --border-gold: rgba(201, 168, 76, 0.3);

    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --section-padding: clamp(80px, 12vw, 160px);
    --container-max: 1100px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

.nav.scrolled {
    background: rgba(6, 6, 10, 0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 1px 0 var(--border-subtle);
}

.nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gold);
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.nav-logo img {
    border-radius: 50%;
    border: 1.5px solid var(--border-gold);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 32px);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-cta {
    background: transparent;
    border: 1px solid var(--border-gold);
    padding: 6px 16px;
    border-radius: 6px;
    color: var(--gold) !important;
    font-weight: 500 !important;
    transition: background 0.3s ease, border-color 0.3s ease !important;
}

.nav-cta:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: brightness(0.35) contrast(1.1) saturate(0.8);
    transform: scale(1.05);
    opacity: 0;
    transition: transform 8s ease-out, opacity 0.35s ease;
}

.hero-bg-img.is-loaded {
    opacity: 1;
}

.hero:hover .hero-bg-img {
    transform: scale(1.0);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(6, 6, 10, 0.3) 0%,
        rgba(6, 6, 10, 0.1) 40%,
        rgba(6, 6, 10, 0.6) 70%,
        rgba(6, 6, 10, 1) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 24px;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: var(--gold-dim);
    border: 1px solid var(--border-gold);
    padding: 4px 16px;
    border-radius: 2px;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 1s 0.3s ease forwards;
}

.hero-title {
    font-family: var(--font-serif);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-title-line {
    display: block;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    color: var(--text-primary);
    opacity: 0;
    animation: fadeUp 1s 0.5s ease forwards;
}

.hero-title-accent {
    color: var(--gold);
    opacity: 0;
    animation: fadeUp 1s 0.7s ease forwards;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeUp 1s 0.9s ease forwards;
}

.hero-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fadeUp 1s 1.1s ease forwards;
}

.hero-scroll-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    color: var(--gold-dim);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    opacity: 0;
    animation: fadeUp 1s 1.4s ease forwards;
}

.hero-scroll-cta:hover {
    color: var(--gold);
}

.hero-scroll-cta svg {
    animation: bob 2s ease-in-out infinite;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 1;
    padding: var(--section-padding) 0;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold-dim);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.principles-section.section {
    padding-top: clamp(40px, 6vw, 72px);
}

/* --- Manifesto Intro --- */
.manifesto-intro {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    padding: clamp(40px, 6vw, 64px) 0;
}

.manifesto-opening {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2.2vw, 1.45rem);
    font-weight: 700;
    color: var(--gold);
    line-height: 1.45;
    margin-bottom: 20px;
    padding-left: 18px;
    border-left: 3px solid var(--gold-dim);
    max-width: 720px;
}

.manifesto-body {
    font-size: clamp(0.92rem, 1.5vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 680px;
    margin-bottom: 14px;
    line-height: 1.65;
}

.manifesto-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.manifesto-body em {
    color: var(--gold);
    font-style: normal;
    font-weight: 500;
}

/* --- Principles — Split Panel Layout --- */
.principles-section {
    background: var(--bg-deep);
    padding-bottom: 0;
}

.principle {
    display: grid;
    /* minmax(0,…) forces equal columns — stops text from blowing past the image */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
    width: min(100%, var(--container-max));
    margin-inline: auto;
    padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 40px);
    border-top: 1px solid var(--border-subtle);
    box-sizing: border-box;
}

/* Reversed layout: image right, text left */
.principle.layout-right .principle-image {
    order: 2;
}

.principle.layout-right .principle-content {
    order: 1;
}

/* Image — same column width as text, full image visible, rounded */
.principle-image {
    min-width: 0;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

.principle-image img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 10px;
    filter: brightness(0.75) contrast(1.05) saturate(0.9);
    opacity: 0;
    transition: filter 0.6s ease, opacity 0.3s ease;
}

.principle-image img.is-loaded {
    opacity: 1;
}

.principle:hover .principle-image img {
    filter: brightness(0.85) contrast(1.05) saturate(1);
}

/* Text — locked to its column (no horizontal overrun) */
.principle-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    background: transparent;
}

.principle-number {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--gold);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: -8px;
}

.principle-title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.principle-quote {
    font-family: var(--font-sans);
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    font-weight: 400;
    color: var(--gold);
    padding: 14px 0 14px 20px;
    border-left: 2px solid var(--gold-dim);
    margin-bottom: 24px;
    line-height: 1.6;
}

.principle-text {
    font-size: clamp(0.88rem, 1.4vw, 1rem);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 14px;
}

.principle-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.principle-emphasis {
    color: var(--gold) !important;
    font-weight: 500;
}

/* --- Closing --- */
.closing-section {
    background: var(--bg-deep);
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    padding: clamp(36px, 5vw, 56px) 0;
}

.closing-content {
    max-width: none;
    width: 100%;
    margin: 0;
}

.closing-text {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.closing-text strong {
    color: var(--gold);
}

.closing-highlight {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-primary) !important;
}

.closing-highlight em {
    color: var(--gold);
    font-style: normal;
    font-weight: 600;
}

.closing-emoji {
    font-size: 2rem;
    margin: 20px 0 16px;
    opacity: 0.7;
}

.closing-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.closing-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.3s ease;
}

.closing-link:hover {
    background: rgba(201, 168, 76, 0.1);
    transform: translateY(-2px);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    padding: 24px 0 28px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-deep);
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    max-width: none;
    width: 100%;
    margin: 0 0 8px;
    line-height: 1.6;
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.6;
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links a:not(.nav-cta) {
        display: none;
    }

    .principle {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 28px 20px;
    }

    .principle-image,
    .principle.layout-right .principle-image {
        width: min(100%, 360px);
        margin-inline: auto;
        order: -1; /* image always on top on mobile */
    }

    .principle.layout-right .principle-content {
        order: 0;
    }

    .principle-content {
        padding: 0;
    }

    .closing-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero-badge {
        font-size: 0.6rem;
    }
}
