:root {
    --bg-color: #000000;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #32CD32;
    /* Lime Green */
    --spacing: 12px;
    --radius: 16px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-color: #ffffff;
        --card-bg: #f8f8f8;
        --text-primary: #111111;
        --text-secondary: #555555;
    }
}

@media (min-width: 768px) {
    :root {
        --spacing: 14px;
    }
}

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

body {
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing);
    background: rgba(0, 0, 0, 0.9);
    /* backdrop-filter: blur(12px); Removed for Tesla performance */
    border-bottom: 1px solid #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.version-pill {
    display: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid #333;
    border-radius: 999px;
    padding: 4px 8px;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.version-pill.visible {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.version-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Feed Grid */
#feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-width: 1800px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    #feed {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 0;
        /* No gaps */
        justify-content: center;
        padding: 0;
        /* Edge to edge */
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    /* Flex layout for Image + Footer stack */
    display: flex;
    flex-direction: column;
    isolation: isolate;
    border-radius: 0;
    /* Seamless */
    border: none;
    box-shadow: none;
}

.card.optimistic {
    border-color: #4c4c4c;
    box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.optimistic-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(204, 255, 0, 0.5);
    border-radius: 12px;
    padding: 6px 10px;
    z-index: 4;
    backdrop-filter: blur(6px);
}

.optimistic-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e3e3e3;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 999px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card.optimistic-retrying .optimistic-pill {
    color: #ffd166;
    border-color: rgba(255, 209, 102, 0.8);
    background: rgba(255, 209, 102, 0.08);
}

.card.optimistic-expired {
    opacity: 0.7;
}

@media (min-width: 768px) {
    .card {
        aspect-ratio: 1 / 1;
    }

    .card img {
        aspect-ratio: unset;
        flex: 1;
        /* Fill remaining card space */
        height: 100%;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }
}

.card img {
    width: 100%;
    /* Mobile: Wide Banner */
    aspect-ratio: 2.4 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.feed-video {
    width: 100%;
    /* Mobile: Horizontal Banner feel */
    aspect-ratio: 2.4 / 1;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .feed-video {
        aspect-ratio: unset;
        flex: 1;
        height: 0;
        min-height: 0;
    }
}

.card:hover img {
    transform: scale(1.02);
}

.card .card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 3;
}

.card:hover .card-actions {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 767px) {
    .card .card-actions {
        opacity: 0.9;
        pointer-events: auto;
    }
}

.card .delete-btn {
    background: rgba(0, 0, 0, 0.75);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card .delete-btn.hidden {
    display: none;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    padding: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    /* Allow clicks to pass through to image (lightbox) */
}

.card-overlay>* {
    pointer-events: auto;
    /* Re-enable for buttons */
}

.overlay-row-1 {
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.overlay-row-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ddd;
    font-size: 0.8rem;
    height: 24px;
}

.overlay-row-2 .stats-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.text-bundle {
    position: relative;
    background: #111;
    color: #eee;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* List View: Bundles just stack vertically */
.text-bundle-item {
    padding: 16px;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (min-width: 768px) {
    .text-bundle {
        display: grid;
        grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
        /* Auto divide space for items */
    }

    .text-bundle-item {
        border-bottom: 1px solid #222;
        justify-content: center;
        text-align: center;
        align-items: center;
    }
}

.card-content-legacy {
    position: relative;

    padding: 8px 10px;
    background: #111;
    /* Firm dark background */
    border-top: 1px solid #333;
    /* Line separator */
    z-index: 2;
}

.card.text-only {
    aspect-ratio: unset;
    /* Allow auto height on mobile */
    min-height: 0;
}

@media (min-width: 768px) {
    .card.text-only {
        aspect-ratio: 1 / 1 !important;
    }
}

.card.text-only .card-content {
    background: #111;
    border-top: 1px solid #333;
    height: auto;
    flex: unset;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding: var(--spacing);
    gap: 8px;
}

@media (min-width: 768px) {
    .card.text-only .card-content {
        flex: 1;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .card.text-only .card-content p {
        flex: 1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        word-break: break-word;
    }

    .card.text-only .card-meta {
        margin-top: auto;
    }
}

.card-meta {
    /* Deprecated in new logic? */
    display: none;
}

.text-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
    border-top: 1px solid #333;
    padding-top: 8px;
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #888;
}

.vote-btn-merged {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.vote-btn-merged:active {
    transform: scale(0.95);
}

.vote-btn-merged.active {
    color: var(--accent);
    background: rgba(50, 205, 50, 0.2);
}

.vote-btn-merged .icon {
    font-size: 0.8rem;
}

.vote-btn-merged .count {
    font-weight: 600;
}

.text-bundle.split-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* Ensure items share height equally in grid */
.text-bundle.split-view .text-bundle-item {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-bottom: 1px solid #333;
}

.text-bundle.split-view .text-bundle-item:last-child {
    border-bottom: none;
}

.text-post-excerpt {
    font-size: 0.95rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 2 lines max per requirement */
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

/* Placeholder View */
.bundle-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    cursor: pointer;
}

.bundle-placeholder:active {
    background: #222;
}

.bundle-count {
    font-size: 1.2rem;
    /* Smaller font as requested */
    font-weight: 800;
    color: white;
}

.bundle-hint {
    color: #666;
    font-size: 0.85rem;
    margin-top: 4px;
    text-transform: uppercase;
}

.bundle-icon {
    font-size: 1.8rem;
    color: #666;
    margin-bottom: 6px;
}

/* Detail Overlay */
.bundle-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.bundle-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.bundle-detail-header h2 {
    font-size: 1.5rem;
    color: white;
}

.btn-close-detail {
    /* DEPRECATED in favor of btn-circle-back */
    display: none;
}

.btn-circle-back {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn-circle-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bundle-detail-header {
    /* Now just a spacer or container if needed, but button is absolute */
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 20px;
    /* border-bottom: 1px solid #333; */
    /* Cleaner without? */
    margin-bottom: 20px;
    padding-top: 10px;
}

.bundle-detail-header h2 {
    font-size: 1.2rem;
    color: #ccc;
    font-weight: 600;
}

.bundle-detail-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Vertical gap between posts */
    padding-bottom: 40px;
    max-width: 480px;
    /* Sensible width like portrait phone */
    width: 100%;
    margin: 0 auto;
    /* Center list */
}

.bundle-detail-item {
    background: transparent;
    /* No box */
    border: none;
    border-radius: 0;
    padding: 0;
    border-bottom: 1px solid #333;
    /* Optional separator? Or pure gap? Keeping separate */
    padding-bottom: 24px;
}

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

.bundle-detail-item p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 12px;
}


.location-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
    /* Responsive truncation */
    display: inline-block;
}

/* Menu Dropdown */
.menu-dropdown {
    position: absolute;
    bottom: 30px;
    left: 0;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 4px 0;
    display: none;
    flex-direction: column;
    min-width: 120px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.menu-dropdown.visible {
    display: flex;
}

.menu-item {
    padding: 8px 12px;
    color: #ccc;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

.menu-item:hover {
    background: #333;
    color: white;
}

/* FAB */
#post-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: black;
    border: none;
    font-size: 2rem;
    box-shadow: 0 10px 20px rgba(204, 255, 0, 0.3);
    cursor: pointer;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

#post-btn:active {
    transform: scale(0.9);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 70px 12px 20px;
}

.hidden {
    display: none !important;
}

/* Own Post Highlight */
.card.own-post .overlay-row-1,
.text-bundle-item.own-post .text-post-excerpt {
    color: #007AFF;
    /* Blue highlight */
    font-weight: 500;
}

/* Explicitly ensuring lightbox does NOT get this highlight if it reuses .card components (it likely doesn't directly, but just in case) */
.lightbox-view .card.own-post .overlay-row-1 {
    color: white;
}

/* Disabled Vote Buttons for Own Posts */
.vote-btn-merged.disabled {
    opacity: 0.7;
    cursor: default;
    pointer-events: none;
    /* Prevent clicks */
}

.vote-btn-merged.disabled:active {
    transform: none;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: #111;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 22px;
    position: relative;
    /* Ensure space for top-right close btn */
    padding-top: 50px;
}

.btn-close-absolute {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-close-absolute:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.image-picker {
    width: 100%;
    background: #222;
    border: 2px dashed #444;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
    padding: 8px;
}

.image-picker.has-image {
    border: none;
}

.picker-controls {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    gap: 12px;
    padding: 10px 6px;
    box-sizing: border-box;
}

.picker-btn-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #333;
    width: 48%;
    min-width: 140px;
    height: 110px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    border: 1px solid #444;
}

.picker-btn-primary:active {
    transform: scale(0.96);
    background: #444;
}

.picker-btn-primary .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.picker-btn-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #333;
    width: 48%;
    min-width: 140px;
    height: 110px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    border: 1px solid #444;
    color: #ccc;
    font-weight: 600;
}

.picker-btn-secondary .icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.picker-btn-secondary:active {
    transform: scale(0.96);
    background: #444;
}

.image-picker img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    display: block;
}

.placeholder-icon {
    font-size: 3rem;
    color: #555;
}

.placeholder-text {
    margin-top: 10px;
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.minimal-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: white;
    font-size: 1.05rem;
    padding: 10px 0;
    resize: none;
    height: 70px;
    margin-bottom: 0;
}

.minimal-input:focus {
    outline: none;
    border-color: var(--accent);
}

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

.message-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-row .minimal-input {
    flex: 1;
}

.message-row .btn-circle {
    margin-top: 6px;
}

.btn-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cancel {
    background: #333;
    color: white;
}

.btn-post {
    background: var(--accent);
    color: black;
    font-weight: bold;
}

.profile-btn {
    background: #222;
    color: #888;
    border: 1px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
}

.btn-primary {
    background: white;
    color: black;
    padding: 14px 24px;
    border-radius: 30px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-text {
    background: transparent;
    color: #888;
    border: none;
    margin-top: 15px;
    cursor: pointer;
    text-decoration: underline;
}

.modal-link {
    display: inline-block;
    padding: 8px 0;
    color: var(--accent);
    text-decoration: underline;
    font-weight: 700;
    text-align: center;
}

strong#user-tier-display {
    color: var(--accent);
}

/* Lightbox - Restored */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    /* Solid black for premium feel */
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    will-change: transform;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #888;
    font-size: 3rem;
    line-height: 0.8;
    cursor: pointer;
    z-index: 5001;
}

/* Mode Toggles */
body.landing-mode>header,
body.landing-mode>#feed,
body.landing-mode>#post-btn {
    display: none !important;
}

body.post-mode>header,
body.post-mode>#feed,
body.post-mode>#post-btn,
body.post-mode>#landing-page {
    display: none !important;
}

body.post-mode #post-view-container {
    display: flex !important;
}

body.app-mode #landing-page {
    display: none !important;
}

/* Landing Page Styling */
#landing-page {
    width: 100%;
    min-height: 100vh;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    padding-bottom: 40px;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #333;
}

.landing-nav h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.landing-nav .logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.hero-section {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px 40px;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to bottom right, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: #888;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

.btn-cta {
    background: var(--accent);
    color: #000;
    padding: 18px 36px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.2);
}

.btn-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(204, 255, 0, 0.4);
}

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

.btn-get-started-small {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: background 0.2s;
}

.btn-get-started-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

.feature-image-container {
    width: 100%;
    max-width: 800px;
    margin-top: 50px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.feature-image-container img {
    width: 100%;
    display: block;
}

.feature-section {
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-text {
    max-width: 600px;
    margin-bottom: 40px;
}

.feature-text h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.feature-text p {
    font-size: 1.1rem;
    color: #aaa;
    line-height: 1.6;
}

.landing-footer {
    padding: 60px 20px;
    border-top: 1px solid #222;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    background: #050505;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.footer-links a {
    color: #777;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

@media (min-width: 768px) {
    .hero-content h1 {
        font-size: 4.5rem;
    }

    .feature-section {
        padding: 120px 40px;
    }
}

/* 
   -----------------------------------
   New Marketing Site Styles (Update)
   -----------------------------------
*/

.sticky-download-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    transition: transform 0.2s, opacity 0.3s;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sticky-download-btn:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

.sticky-download-btn img {
    height: 44px;
    width: auto;
    display: block;
}

@media(min-width: 768px) {
    .sticky-download-btn {
        top: 20px;
        /* Align with header */
        bottom: auto;
        left: auto;
        right: 140px;
        /* Left of Get Started button if needed, or stick to bottom right? User said "always visible". Bottom left/right is safer. */
        /* Actually, header is sticky. Putting it in header area usually clashes. 
           Let's keep it fixed bottom right or left. 
           User request: "prominent and always visible".
           Bottom Right is standard for FABs.
        */
        right: 30px;
        bottom: 30px;
        top: auto;
    }
}

.new-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: 100px;
    overflow: hidden;
}

.hero-image-full {
    width: 100%;
    margin-top: 40px;
    position: relative;
    max-width: 1400px;
}

.hero-image-full img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.scroll-section {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.scroll-section:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.content-wrapper {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    text-align: center;
}

@media(min-width: 900px) {
    .content-wrapper.side-by-side {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .content-wrapper.side-by-side.reverse {
        flex-direction: row-reverse;
    }

    .text-col {
        flex: 1;
        padding: 40px;
        text-align: left;
    }

    .visual-col {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

.section-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 24px;
    /* subtle glow matching accent? */
    filter: drop-shadow(0 0 15px rgba(50, 205, 50, 0.2));
}

.text-col h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: white;
}

.text-col p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #bbb;
    margin-bottom: 16px;
    max-width: 600px;
}

.passkey-promo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(50, 205, 50, 0.1);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid rgba(50, 205, 50, 0.2);
    color: var(--accent);
    font-weight: 700;
    margin-top: 10px;
}

.big-emoji {
    font-size: 6rem;
    opacity: 0.9;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.zoom-in {
    transform: scale(0.9);
    opacity: 0;
}

.animate-on-scroll.zoom-in.visible {
    transform: scale(1);
    opacity: 1;
}

.animate-on-scroll.delay-1 {
    transition-delay: 0.1s;
}

.animate-on-scroll.delay-2 {
    transition-delay: 0.2s;
}

/* 
   -----------------------------------
   Refinement Styles
   -----------------------------------
*/

/* 1. Fix Sticky & Hero App Store Button */
.sticky-download-btn {
    bottom: 30px;
    right: 30px;
    left: auto;
    /* Ensure not left aligned */
    top: auto;

    background: rgba(255, 255, 255, 0.95);
    /* White background per plan */
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
}

.sticky-download-btn img {
    height: 48px;
    /* Slightly larger */
}

/* Ensure Hero button is visible */
.hero-content .appstore-hero-link {
    display: inline-block;
    margin-top: 24px;
    transition: transform 0.2s;
    background: rgba(255, 255, 255, 0.1);
    /* Slight container */
    padding: 10px 16px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.hero-content .appstore-hero-link:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.hero-content .appstore-hero-link img {
    height: 52px;
    width: auto;
    display: block;
}

/* 2. Smaller Icons & Layout Improvements */
.section-icon {
    width: 64px;
    /* Reduced from 80px */
    height: 64px;
    margin-bottom: 20px;
}

@media(max-width: 767px) {
    .section-icon {
        width: 48px;
        height: 48px;
    }

    .scroll-section {
        padding: 60px 20px;
    }

    .text-col {
        padding: 20px 0;
        text-align: center;
    }

    .content-wrapper {
        gap: 30px;
    }

    .text-col h2 {
        font-size: 2rem;
    }

    .sticky-download-btn {
        bottom: 20px;
        right: 20px;
        padding: 8px;
    }

    .sticky-download-btn img {
        height: 40px;
    }
}

/* 3. Typography & Spacing "Dumped text" fix */
.text-col h2 {
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.text-col p {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
    /* More spacing between paragraphs */
}

/* 4. Animation Tuning */
.animate-on-scroll {
    transition-duration: 1s;
    /* Slower, smoother */
    transform: translateY(60px);
    /* More movement */
}

/* Ensure hero image fits better */
.hero-image-full {
    margin-top: 60px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    /* Deep shadow */
    border-radius: 24px;
}

/* Feature Bullets */
.feature-bullets {
    list-style: none;
    /* Custom bullets */
    padding: 0;
    margin-top: 20px;
    text-align: left;
    /* Ensure left aligned in text column */
}

.feature-bullets li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: #ddd;
    line-height: 1.4;
}

.feature-bullets li::before {
    content: "•";
    color: var(--accent);
    /* Lime green */
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: -2px;
}

/* 
   -----------------------------------
   Hero Overlay & Content Refinements
   -----------------------------------
*/

/* Hero Overlay Redesign */
.hero-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-weight: 800;
}

.hero-content p {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Use Cases Grid */
.use-cases-section {
    padding: 80px 20px;
    background: var(--bg-color);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0;
}

.use-case-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.use-case-card:hover {
    transform: translateY(-5px);
}

.use-case-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.use-case-card ul {
    list-style: none;
    padding: 0;
}

.use-case-card li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.use-case-card li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
}

/* Hide the old full image since it is now bg */
.hero-image-full {
    display: none;
}

/* 
   -----------------------------------
   Mobile & iOS Safari Refinements
   -----------------------------------
*/

/* 1. Mobile Responsiveness (General) */
@media (max-width: 600px) {

    /* Hide 'mapfrom' logo text on small screens */
    .nav-logo-text {
        display: none !important;
    }

    /* Ensure Header links don't wrap weirdly */
    .landing-nav {
        justify-content: space-between;
    }
}

/* 2. iOS Safari Specific Overrides */
/* The detection script adds 'ios-safari' class to body */

body.ios-safari .nav-logo-text {
    display: none !important;
}

/* Hide App Store buttons/links to avoid clash with Smart App Banner */
body.ios-safari .appstore-hero-link,
body.ios-safari .header-right a[href*="apps.apple.com"],
body.ios-safari .btn-cta {
    display: none !important;
}

body.ios-safari {
    padding-top: 0;
    /* Adjust if banner pushes content */
}

/* 3. Image Sizing Consistency */
.visual-col img {
    height: 300px;
    width: 100%;
    object-fit: contain;
    /* Ensure images fit nicely */

    /* Ensure illustrations look good on dark bg */
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

@media (max-width: 768px) {
    .visual-col img {
        height: auto;
        max-height: 250px;
    }
}

/* 4. Grid Layout (Max 2 Columns) */
.use-cases-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (min-width: 1000px) {
    .use-cases-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force max 2 columns per row as requested? Or auto-fit is better? User said "3 column layout... to be 2 column" */
        /* If original was 3, maybe 2 looks better. Let's try flexible but robust sizing */
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        /* Larger min-width forces fewer columns */
    }
}

/* 5. Fix White Background on iOS Mobile */
body {
    background-color: var(--bg-color) !important;
    /* Force black */
}

.use-cases-section {
    background-color: var(--bg-color);
    /* Ensure section is black */
}

.use-case-card {
    background-color: var(--card-bg);
    /* Ensure dark card bg */
}

/* Ensure no white leak */
html,
body {
    background: #000000;
}