:root {
    --bg: #f4f7f9;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #7a8a9a;
    --accent: #5a7d95;
    --border: #dee6ed;
    --font-main: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --theme-toggle-bg: rgba(90, 125, 149, 0.1);
}

[data-theme="dark"] {
    --bg: #0e1117;
    --surface: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #7aaccc;
    --border: #21262d;
    --theme-toggle-bg: rgba(122, 172, 204, 0.1);
}

/* Smooth global theme transition */
body,
body *,
body *::before,
body *::after {
    transition: background-color 0.5s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ── Abstract Background Branding ── */
header,
section {
    position: relative;
    overflow: hidden;
}

header::after,
section::after {
    content: '';
    position: absolute;
    width: 100vmin;
    height: 100vmin;
    background: url('../assets/logo.svg') no-repeat center / contain;
    opacity: 0.05;
    filter: grayscale(1) invert(0.2);
    z-index: -1;
    pointer-events: none;
    transition: opacity 1s ease;
}

/* Specific placements for Yaja sections */
.hero::after {
    display: none;
}

.features {
    position: relative;
    z-index: 1;
    /* Ensure section content is above bg */
}

.features::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(15deg) scale(1.5);
    opacity: 0.10;
    z-index: -1;
}

.philosophy::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg) scale(1.3);
    opacity: 0.09;
    z-index: -1;
}

/* Dark mode adjustments for background logo */
[data-theme="dark"] .features::after,
[data-theme="dark"] .philosophy::after,
[data-theme="dark"] .text-section::after {
    opacity: 0.06;
    filter: invert(1) sepia(0.05) saturate(0.3) brightness(1.2);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container.narrow {
    max-width: 800px;
}

.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ── Navbar ── */
.navbar {
    padding: 2rem 0;
}

/* ── Theme Toggle (Nav Bar) ── */
#theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    padding: 0;
    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        color 0.35s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease !important;
}

#theme-toggle:hover {
    background: var(--theme-toggle-bg);
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px var(--theme-toggle-bg);
}

#theme-toggle svg {
    width: 14px;
    height: 14px;
    position: absolute;
    transition:
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-45deg) scale(0.6);
}

[data-theme="dark"] #theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(45deg) scale(0.6);
}

[data-theme="dark"] #theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

#theme-toggle.spinning {
    animation: toggle-spin 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toggle-spin {
    from {
        transform: rotate(-30deg) scale(0.88);
    }

    to {
        transform: rotate(0deg) scale(1);
    }
}

@media (max-width: 768px) {
    #theme-toggle {
        width: 36px;
        height: 36px;
    }

    #theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

.logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

/* ── Hero ── */
.hero {
    padding: 4rem 0 8rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(122, 172, 204, 0.1);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 2rem;
}

.italic {
    font-style: italic;
    font-weight: 400;
}

.hero-tagline {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .hero-btns {
        justify-content: center;
    }
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--accent);
}

/* ── Mockup ── */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.app-mockup {
    width: 280px;
    height: 280px;
    background: transparent;
    border-radius: 64px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-icon-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Features ── */
.features {
    padding: 8rem 0;
    background: var(--surface);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}



.feature-card {
    padding: 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Philosophy ── */
.philosophy {
    padding: 10rem 0;
    text-align: center;
}

blockquote {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-style: italic;
    line-height: 1.3;
    color: var(--text);
    position: relative;
}

blockquote .emphasize {
    color: var(--accent);
    display: block;
    margin-top: 1rem;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Content Sections ── */
.text-section {
    padding: 8rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.text-section:nth-child(even)::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(10deg) scale(1.4);
    opacity: 0.09;
    z-index: -1;
}

.text-section:nth-child(odd)::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg) scale(1.3);
    opacity: 0.09;
    z-index: -1;
}

.text-section.bg-surface {
    background: var(--surface);
}

.text-section p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.text-section .section-title {
    margin-bottom: 2rem;
}

/* ── Footer ── */
.footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.rj {
    color: var(--accent);
    font-weight: 800;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ── Screenshots ── */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.screenshot-card {
    text-align: center;
}

.screenshot-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.screenshot-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.screenshot-caption {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .screenshots-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
}