:root {
    --primary-color: #913E20;
    /* Reddish terracotta */
    --secondary-color: #7395AE;
    /* Blueish */
    --dark-brown: #2C1810;
    /* Deep dark brown background */
    --text-color: #edeff2;
    /* Slightly off-white for warmth */
    --text-muted: rgba(237, 239, 242, 0.7);
    --card-bg: rgba(255, 255, 255, 0.03);
    --spacing-unit: 20px;
    --header-height: 130px;
    /* Logo 96px + 32px padding + border */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--dark-brown);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1000px;
    /* Slightly tighter measure for readability */
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(44, 24, 16, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 0;
    /* Height is controlled by content + padding */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* height: 48px; Removed fixed height */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
}

.logo-icon {
    height: 96px;
    /* Desktop size */
    width: auto;
    transition: height 0.3s ease;
}

.logo-text {
    font-size: 1.5rem;
    /* Slightly larger text to match */
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 16px;
    /* Reduced from 24px */
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.btn-header {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-color);
}

.btn-header:hover {
    background-color: var(--primary-color);
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

/* Mobile Nav */
@media (max-width: 768px) {
    :root {
        --header-height: 82px;
        /* Mobile: 48px logo + 32px padding + border */
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        /* Position exactly below the header */
        left: 0;
        width: 100%;
        height: 100vh;
        /* Ensure it covers the screen */
        background-color: var(--dark-brown);
        flex-direction: column;
        padding: 24px;
        gap: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .logo-icon {
        height: 48px;
        /* Smaller mobile logo */
    }

    /* Ensure header takes up space even with absolute logo */
    .site-header {
        padding: 16px 0;
        /* Re-add padding for mobile header height */
    }
}

/* Scroll Offset for Sticky Header */
section[id],
div[id],
h2[id],
h3[id] {
    scroll-margin-top: calc(var(--header-height) + 40px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0 60px;
    background: radial-gradient(circle at top, #2c1810 0%, #1a0f0a 100%);
}

.app-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-color);
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0 0 24px;
    line-height: 1.4;
    color: var(--text-muted);
    /* Dimmed contrast */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Remove old hero h1 style if necessary or just override items */
.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-image-container {
    margin: 40px auto;
    max-width: 800px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hero-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* Vertical Center for the row */
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
}

.hero-cta>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    /* Fixed height for all items */
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 0 32px;
    /* Horizontal padding, height handled by parent/self */
    border-radius: 8px;
    /* Matching rounded look of badges */
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 48px;
    /* Explicit match */
    box-sizing: border-box;
}

.btn-primary:hover {
    background-color: #bd512a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(208, 114, 0, 0.4);
}

/* Specific styling for the badges to fit the height */
.store-badge img {
    height: 100%;
    width: auto;
    display: block;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    color: var(--text-color);
    text-decoration: underline;
}

/* Content Grid (Rise Style) */
.content-section {
    padding: 80px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.grid-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 40px;
    text-align: center;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    align-items: start;
}

.grid-col h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.grid-col ul {
    list-style: none;
}

.grid-col li {
    margin-bottom: 12px;
    color: var(--text-muted);
}

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

.store-badge {
    opacity: 0.8;
    transition: opacity 0.2s;
    display: inline-block;
}

.store-badge:hover {
    opacity: 1;
}

.store-badge img {
    height: 48px;
}

/* Footer */
footer {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }

    .download-links {
        align-items: center;
    }
}

/* Expandable Feature Items */
.feature-item {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    transition: opacity 0.2s;
}

.feature-summary:hover {
    opacity: 0.8;
}

.feature-summary h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--text-color);
}

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

.feature-chevron {
    font-size: 0.8rem;
    color: var(--secondary-color);
    transition: transform 0.3s ease;
}

.feature-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.feature-item.active .feature-details {
    max-height: 500px;
    /* Arbitrary large height */
    opacity: 1;
    margin-top: 12px;
}

.feature-item.active .feature-chevron {
    transform: rotate(180deg);
}

.detail-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding-left: 0px;
    border-left: 2px solid var(--secondary-color);
    padding-left: 12px;
}

/* Long-form Content */
.content-section.alt-bg {
    background-color: rgba(255, 255, 255, 0.02);
}

.text-content {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 80px;
    margin-bottom: 32px;
    padding-top: 40px;
    position: relative;
}

.section-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
}

.section-header:first-child {
    margin-top: 0;
    padding-top: 0;
}

.section-header:first-child::before {
    display: none;
}

.text-content h2 {
    font-size: 2.22rem;
    color: var(--primary-color);
    margin: 0;
    /* Removed margins/padding as they are handled by section-header now */
}

/* Retain original pseudo-element for h2 if not using section-header, 
   but since we are replacing the h2 styling strategy for this section, 
   we can adapt. 
   Wait, the original CSS applied to ALL h2 in text-content. 
   I should be careful not to break other h2s.
   
   Original:
   .text-content h2 { ... margin-top: 80px ... padding-top: 40px ... }
   .text-content h2::before { ... }
   
   I will OVERRIDE this specific h2 behavior with a utility class or specific selection mechanism 
   HTML side, or just modify the generic rule if I use flex wrapper everywhere.
   
   Let's use a specific modification.
*/

.author-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.author-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.author-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
}

.text-content h2:first-child::before {
    display: none;
}

.text-content h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: 48px;
    margin-bottom: 20px;
}

.text-content p {
    margin-bottom: 28px;
}

.text-content ul {
    margin-bottom: 32px;
    padding-left: 24px;
}

.text-content li {
    margin-bottom: 12px;
    padding-left: 8px;
}

.text-content a {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--secondary-color);
}

.text-content a:hover {
    text-decoration: none;
    border-bottom: 1px solid var(--secondary-color);
}

/* Image Styling */
.image-container {
    margin: 40px 0;
    text-align: center;
}

.content-image {
    max-width: 280px;
    /* Default for phone screenshots */
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.content-image.wide {
    max-width: 100%;
    /* For landscape photos like SFBI task list */
}

.content-image:hover {
    transform: scale(1.02);
}

.image-caption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#lightbox.active img {
    transform: scale(1);
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#lightbox-close:hover {
    opacity: 1;
}

.mr-3 {
    margin-right: 12px;
}