/* Mobile-First CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Site Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 20px 0;
}

.nav-bar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(28, 28, 30, 0.7);
    border: none;
    border-radius: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.brand-text {
    font-weight: 600;
    color: #ffffff;
}

.primary-nav {
    display: none;
    gap: 32px;
}

.primary-nav a {
    color: #9CA3AF;
    text-decoration: none;
    font-weight: 500;
}

.primary-nav .nav-cta {
    padding: 8px 12px;
    background: #ffffff;
    color: #000000;
    border-radius: 8px;
}

.nav-toggle {
    width: 28px;
    height: 24px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.nav-toggle .bar {
    height: 2px;
    width: 100%;
    background: #fff;
}

/* Header scroll states */
.site-header.is-scrolled .nav-bar {
    background: rgba(28, 28, 30, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Mobile header animations - Apple-inspired motion design */
@media (max-width: 767px) {
    .site-header {
        background: transparent;
        backdrop-filter: none;
    }
    
    .nav-bar {
        background: transparent !important;
        border: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        justify-content: center;
    }
    
    /* Animate brand text hide/show on scroll */
.brand-text {
        transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1), opacity 400ms cubic-bezier(0.23, 1, 0.32, 1); 
        will-change: transform, opacity; 
    }
    
    /* Smooth transitions for brand container and logo movement */
    .brand { 
        transition: width 400ms cubic-bezier(0.23, 1, 0.32, 1), gap 400ms cubic-bezier(0.23, 1, 0.32, 1), justify-content 400ms cubic-bezier(0.23, 1, 0.32, 1);
        will-change: width, gap, justify-content;
    }
    
    .brand-logo { 
        transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
        will-change: transform;
    }
    
    /* When collapsed, keep logo centered and take text out of layout so width equals logo */
    .site-header.is-collapsed .brand { 
        position: relative; 
        gap: 0; 
        width: 40px; 
        overflow: hidden; 
        justify-content: center; 
    }
    .site-header.is-collapsed .brand-logo { 
        position: relative; 
        z-index: 2; 
    }
    .site-header.is-collapsed .brand-text { 
        position: absolute; 
        left: 0; 
        z-index: 1; 
    opacity: 0;
        transform: translateX(-8px); 
        pointer-events: none; 
    }
}

@media (min-width: 768px) {
    .primary-nav { display: inline-flex; }
    .nav-toggle { display: none; }
}

/* Section Layout */
main { margin-top: 48px; }
.section { padding: 60px 20px; }
.section--dark { background: #000000; }
.section--darker { background: #1C1C1E; }
.container { max-width: 1200px; margin: 0 auto; color: #ffffff; }

/* Mobile adjustments */
@media (max-width: 767px) {
    main { margin-top: 80px; }
    .section { padding: 40px 20px; }
}

/* Hero section specific padding */
#hero.section { 
    padding-top: 56px; 
}

@media (max-width: 767px) {
    #hero.section { 
        padding-top: 36px; 
    }
}

/* Buttons */
.btn { 
    display: inline-flex; 
    align-items: center;
    gap: 8px; 
    padding: 12px 20px; 
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none; 
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: all 0.3s ease;
}
.btn-primary { 
    background: #ffffff; 
    color: #000000; 
}
.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}
.btn-primary .icon { 
    width: 16px; 
    height: 16px; 
    display: inline-block; 
}

/* Actions container */
.actions {
    margin-top: 24px;
}

/* Text utilities */
.text-primary { color: #ffa500; }
.text-small { font-size: 13px; line-height: 1.5; color: #8d8d93; }

/* Layout utilities */
.stack-3 > * + * { margin-top: 12px; }

/* Hero specific classes */
.hero-first-two { display: inline; }

/* Global word wrapping - prevent hyphenation, allow natural word breaks */
* {
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

.highlight {
    color: #ffa500;
    position: relative;
    display: inline-block;
    white-space: nowrap;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffa500, #ff8c00);
    border-radius: 2px;
    opacity: 0.3;
    z-index: -1;
}

/* Mobile Sticky CTA */
.mobile-sticky-cta { display: none; }

@media (max-width: 767px) {
    .mobile-sticky-cta {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0; /* stick to the bottom edge */
        background: rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding-top: 32px;
        padding-bottom: calc(32px + var(--safe-bottom, env(safe-area-inset-bottom, 0)));
        z-index: 100000;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transition: transform 180ms ease;
        will-change: transform;
    }
    .mobile-sticky-cta .container { display: flex; justify-content: center; }
}

/* Prevent horizontal scroll */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Prevent text overflow - gentle approach */
p, h1, h2, h3, h4, h5, h6, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: none;
}

/* Ensure all containers don't exceed viewport */
.container, .wrapper, .content, .main, .section {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Features Section */
#features.section {
    position: relative;
    overflow: hidden;
}

#features.section::before {
    content: '';
    position: absolute;
    inset: -20%;
    background: 
        linear-gradient(to right, #1C1C1E 1px, transparent 1px),
        linear-gradient(to bottom, #1C1C1E 1px, transparent 1px);
    background-size: 40px 40px;
    transform: rotate(-4deg);
    z-index: 0;
}

#features .container {
    position: relative;
    z-index: 1;
    max-width: 1200px; /* Use standard container width */
    margin: 0 auto;
    padding: 0 20px; /* Add padding for smaller screens */
    overflow: hidden; /* Prevent stickers from creating scroll areas */
}

/* Offset the features title to start one column later */
#features .container > div:first-child {
    margin-left: 8.33%; /* Offset by one column (1/12 of container) */
}

.features-rows {
    display: grid;
    gap: 40px;
    margin-top: 48px;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
}

.feature-row--reverse {
    direction: rtl;
}

.feature-row--reverse > * {
    direction: ltr;
}

.feature-media {
    background-color: #2c2c2c50;
    border-radius: 12px;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.feature-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

/* Specific sizing for unlocks and streaks images */
.feature-image[src*="Limited-unlocks.png"],
.feature-image[src*="Streaks.png"] {
    max-width: 90%;
    max-height: 70%;
}

.feature-text-block {
    max-width: 280px;
    padding: 20px;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.feature-text-block h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.feature-text-block p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .feature-row {
        grid-template-columns: 1fr;
        gap: 16px;
    text-align: center;
    }
    
    .feature-row--reverse {
        direction: ltr;
    }
    
    .feature-media {
        order: 1;
        background-color: #2c2c2c95;

    }
    
    .feature-text-block {
        order: 2;
        margin: 10px auto;
    }
}

/* App Blocker Component */
.app-blocker {
    position: relative;
    width: fit-content;
    margin: 0 auto;
    /* Removed transform: translateY(-52px) to fix centering */
}

.folder-bg {
    position: relative;
    width: auto;
    height: auto;
    max-width: 320px;
    border-radius: 24px;
    display: block;
}

.app-icons {
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 2;
}

.app-icon {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.app-icon:hover,
.app-icon:active {
    transform: translateY(-16px);
    z-index: 10;
}

.app-icon img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    transition: opacity 0.2s ease 0.15s;
}

.app-icon .blocked {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.app-icon:hover img:first-child,
.app-icon:active img:first-child {
    opacity: 0;
}

.app-icon:hover .blocked,
.app-icon:active .blocked {
    opacity: 1;
}

.folder-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, #303030 0%, #2b2b2b 91%, #303030 100%);
    border-radius: 0 0 24px 24px;
    filter: drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.25));
    z-index: 3;
}

.folder-text {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--color-text-secondary);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: nowrap;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .folder-bg {
        max-width: 280px;
    }
    
    .app-icons {
        gap: 10px;
    }
    
    .app-icon {
        width: 40px;
        height: 40px;
    }
    
    .app-icon:hover,
    .app-icon:active {
        transform: translateY(-12px);
    }
    
    .folder-text {
        font-size: 15px;
        left: 12px;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .folder-bg {
        max-width: 280px;
    }
    
    .app-icons {
        gap: 8px;
    }
    
    .app-icon {
        width: 36px;
        height: 36px;
    }
    
    .app-icon:hover,
    .app-icon:active {
        transform: translateY(-12px);
    }
    
    .folder-text {
        font-size: 16px;
        left: 14px;
    }
}

/* Draggable Stickers */
.draggable-stickers {
    position: absolute;
    top: 0;
    left: 0;
    right: -100px; /* Extend 100px beyond section right edge */
    bottom: -80px; /* Extend 80px beyond section bottom */
    pointer-events: none; /* Allow clicks to pass through container */
    z-index: 100; /* High z-index to appear above other content */
    overflow: hidden; /* Prevent stickers from going outside bounds */
}

.sticker {
    position: absolute;
    width: auto; /* Let image determine width */
    height: auto; /* Let image determine height */
    cursor: grab;
    pointer-events: auto; /* Enable interactions on stickers */
    z-index: 500; /* High z-index to appear above section content */
    transition: filter 0.2s ease, left 0.3s ease, top 0.3s ease; /* Smooth transitions for position and filter */
    user-select: none;
    transform: scale(0.5) rotate(var(--initial-rotation, 0deg)); /* 50% scale for 2x images */
    transform-origin: center center; /* Ensure consistent transform origin */
    direction: ltr; /* Override any inherited RTL direction */
}

.sticker:hover {
    transform: scale(0.55) rotate(var(--initial-rotation, 0deg)); /* Subtle hover increase from 50% base */
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.sticker:active,
.sticker.dragging {
    transform: scale(0.5) rotate(var(--initial-rotation, 0deg)) !important; /* Force exact same transform as base state */
    cursor: grabbing !important;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4)) !important;
    z-index: 501 !important; /* Higher when dragging */
    transition: filter 0.2s ease !important; /* Disable position transitions during drag */
}

.sticker img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keep original proportions */
    border-radius: 0; /* Remove circular cropping */
    pointer-events: none; /* Prevent image drag */
    display: block; /* Remove any inline spacing */
}

.sticker-tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 20px; /* Set to exactly 20px */
    font-weight: 500;
    white-space: nowrap;
        opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 502;
}

.sticker:hover .sticker-tooltip {
        opacity: 1;
    visibility: visible;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sticker {
        transform: scale(0.5) rotate(var(--initial-rotation, 0deg)); /* 50% scale for 2x images on mobile */
    }
    
    .sticker:hover {
        transform: scale(0.53) rotate(var(--initial-rotation, 0deg)); /* Smaller hover increase on mobile */
    }
    
    .sticker:active,
    .sticker.dragging {
        transform: scale(0.5) rotate(var(--initial-rotation, 0deg)) !important; /* Force exact same transform as base state */
        cursor: grabbing !important;
        filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4)) !important;
        z-index: 501 !important;
        transition: filter 0.2s ease !important; /* Disable position transitions during drag */
    }
    
    .sticker-tooltip {
        font-size: 20px; /* Set to exactly 20px for mobile too */
        padding: 3px 6px;
        bottom: -35px;
    }
}
@media (max-width: 767px) {
    .draggable-stickers {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile overrides: make habits swiper edge-to-edge with no side gutters */
@media (max-width: 767px) {
    #habits.section {
        padding-left: 0;
        padding-right: 0;
    }
}