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

html, body {
    height: 100%;
}

/* Only lock horizontal scroll on hero page */
body:has(.hero) {
    overflow-x: hidden;
    overflow-y: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    background-color: #7BA7BC;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hero Section - Full Viewport */
.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: visible;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem 4rem;
    overflow: visible;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo {
    flex-shrink: 0;
}

.logo-img {
    height: clamp(50px, 8vw, 80px);
    width: auto;
}

.nav {
    display: flex;
    gap: 2.5rem;
    padding-top: 0.5rem;
}

.nav a {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.2s ease;
}

.nav a:hover {
    opacity: 0.7;
}

/* Hamburger Menu - Hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 100;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #1a1a1a;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation - Full viewport overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 249, 247, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    z-index: 99;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 2.5rem;
    color: #1a1a1a;
    text-decoration: none;
    transition: opacity 0.2s ease;
    letter-spacing: -0.02em;
}

.mobile-nav a:hover {
    opacity: 0.7;
}

/* Main Content - Two Column Layout */
.main {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 2rem;
    overflow: visible;
}

/* Left Content - positioned at top */
.left-content {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: -1rem;
}

/* Tagline - right below logo */
.tagline {
    margin-top: 0.25rem;
}

.tagline p {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    color: #1a1a1a;
}

.rotating-word {
    display: inline-block;
    min-width: 200px;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.rotating-word.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.rotating-word.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Phones Row - App Store + Phones */
.phones-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex: 0 0 auto;
    padding-right: 2rem;
    gap: 2rem;
    overflow: visible;
}

.phone {
    position: relative;
    overflow: visible;
}

.phone-frame {
    position: relative;
    height: auto;
    overflow: visible;
}

.phone-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2rem;
}

/* Animated phone - SMALLER, in front */
.phone-animated {
    z-index: 2;
}

.phone-animated .phone-frame {
    position: relative;
    height: clamp(500px, 65vh, 720px);
    width: auto;
}

.phone-animated .phone-screen {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: auto;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.phone-animated .phone-screen:first-child {
    position: relative;
}

.phone-animated .phone-screen.active {
    opacity: 1;
}

/* Static phone - BIGGER, behind */
.phone-static {
    z-index: 1;
}

.phone-static .phone-frame {
    height: clamp(600px, 80vh, 900px);
    width: auto;
}

.phone-static .phone-frame img {
    height: 100%;
    width: auto;
}

/* Download Badge - In row with phones */
.download {
    display: flex;
    align-items: flex-end;
}

.app-store-badge {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-store-badge img {
    width: clamp(235px, 23vw, 340px);
    height: auto;
    display: block;
}

.app-store-badge:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ===================
   Content Pages (About, Privacy, Manifesto)
   =================== */

.page {
    min-height: 100vh;
    background: #faf9f7;
    overflow-y: auto;
}

.page-header {
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.page-header .logo-img {
    height: 40px;
}

.page-header .logo a {
    text-decoration: none;
    color: inherit;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.page-content h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: #1a1a1a;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.page-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.page-content p {
    font-size: 1.125rem;
    color: #333;
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.page-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.page-content li {
    font-size: 1.125rem;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.page-content .lead {
    font-size: 1.375rem;
    color: #1a1a1a;
    font-style: italic;
    margin-bottom: 2.5rem;
}

.page-content a {
    color: #8B4513;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-content a:hover {
    opacity: 0.7;
}

.page-content .signature {
    margin-top: 3rem;
    font-style: italic;
    color: #666;
}

/* Privacy Policy specific styles */
.page-content .last-updated {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 2rem;
}

.page-content h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    color: #1a1a1a;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* Manifesto specific */
.page-content blockquote {
    border-left: 3px solid #8B4513;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #555;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-bottom: 2rem;
}

.back-link:hover {
    color: #1a1a1a;
}

.back-link::before {
    content: '←';
}

/* ===================
   Responsive
   =================== */

@media (max-width: 1200px) {
    .phones-row {
        padding-right: 0;
        gap: 1.5rem;
    }

    .phone-animated .phone-frame {
        width: clamp(120px, 14vw, 190px);
    }

    .phone-static .phone-frame {
        width: clamp(150px, 18vw, 250px);
    }
}

@media (max-width: 1024px) {
    /* Tablet - use vertical layout like mobile */
    body:has(.hero) {
        overflow: auto;
    }

    .hero {
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        padding: 1.5rem 2rem;
        min-height: 100vh;
    }

    .nav {
        gap: 1.5rem;
    }

    /* Stack vertically on tablet */
    .main {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 1.5rem;
        padding-top: 1rem;
    }

    .left-content {
        align-self: flex-start;
    }

    .phones-row {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-end;
        padding-right: 0;
        gap: 1rem;
    }

    /* App Store button above phones */
    .download {
        order: -1;
        flex-basis: 100%;
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }

    /* Phones side by side - use flex-shrink to fit */
    .phone {
        flex-shrink: 1;
    }

    .phone-animated .phone-frame {
        height: clamp(320px, 42vh, 420px);
        width: auto;
    }

    .phone-static .phone-frame {
        height: clamp(380px, 50vh, 500px);
        width: auto;
    }

    .phone-static {
        margin-left: -2rem;
    }
}

@media (max-width: 768px) {
    /* Allow scroll on mobile */
    body:has(.hero) {
        overflow: auto;
    }

    .hero {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .hero-content {
        padding: 2rem 1.5rem 1.5rem;
        min-height: 100vh;
    }

    /* Header with hamburger */
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    /* Smaller logo on mobile */
    .logo-img {
        height: clamp(40px, 10vw, 55px);
    }

    .nav {
        display: none;
    }

    .hamburger {
        display: flex;
        z-index: 100;
    }

    /* Main mobile layout - vertical stack */
    .main {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 1.5rem;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    /* 1. Logo already at top in header */

    /* 2. Tagline/Subtitle */
    .left-content {
        order: 1;
        align-self: center;
        text-align: center;
        margin-top: 0;
    }

    .tagline p {
        font-size: 1.85rem;
    }

    .rotating-word {
        display: inline-block;
        min-width: 140px;
        text-align: left;
    }

    /* 3. Phones - centered, side by side */
    .phones-row {
        order: 2;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-end;
        padding-right: 0;
        gap: 0.5rem;
    }

    .phone {
        flex-shrink: 1;
    }

    .phone-animated .phone-frame {
        height: clamp(280px, 40vh, 380px);
        width: auto;
    }

    .phone-static .phone-frame {
        height: clamp(340px, 48vh, 460px);
        width: auto;
    }

    /* 4. App Store button - above phones */
    .download {
        order: -1;
        flex-basis: 100%;
        width: 100%;
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .app-store-badge img {
        width: clamp(280px, 75vw, 340px);
    }

    /* Page styles */
    .page-header {
        padding: 1.25rem 1.5rem;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .page-header .nav {
        display: none;
    }

    .page-header .hamburger {
        display: flex;
        z-index: 100;
    }

    .page-header .logo-img {
        height: 32px;
    }

    .page-content {
        padding: 2rem 1.5rem 4rem;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 1.5rem 1rem 1rem;
    }

    .logo-img {
        height: clamp(35px, 9vw, 45px);
    }

    .tagline p {
        font-size: 1.5rem;
    }

    .rotating-word {
        min-width: 115px;
    }

    .phones-row {
        gap: 0.25rem;
    }

    .phone-animated .phone-frame {
        height: clamp(240px, 38vh, 320px);
        width: auto;
    }

    .phone-static .phone-frame {
        height: clamp(290px, 45vh, 380px);
        width: auto;
    }

    .phone-frame img {
        border-radius: 1.25rem;
    }

    .app-store-badge img {
        width: clamp(260px, 70vw, 320px);
    }

    .mobile-nav a {
        font-size: 2rem;
    }
}
