:root {
    --bg-color: #ffffff; 
    --text-main: #2b2b2b; /* Soft black/dark charcoal */
    --text-muted: #5e5c58;
    --accent-color: #8c3f3f; /* Deep, muted brick red for elegance */
    --border-color: #e2dfd5;
    --blue-accent-color: #0072FF;
    
    --font-heading: ui-serif, 'Crimson Pro', serif;
    --font-body: 'Lora', serif;
    --font-secondary: 'Inter', sans-serif;
}

@supports (font: -apple-system-body) {
    html {
        font: -apple-system-body;
    }
}

.dark-section {
    --bg-color: #1a1a1a;
    --text-main: #f7f6f2;
    --text-muted: #a3a19b;
    --border-color: #333333;
    background-color: var(--bg-color);
    color: var(--text-main);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 1.125rem; /* 18px equivalent */
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

main {
    flex-grow: 1;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
}

.font-secondary {
    font-family: var(--font-secondary);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding-left: calc(32px + env(safe-area-inset-left));
    padding-right: calc(32px + env(safe-area-inset-right));
}

/* HERO SECTION */
.hero {
    /* No padding/border to allow hero-bottom to span full width */
}

.hero-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #ffffff;
}

.hero-bottom {
    padding: 3rem 0 6rem;
    border-bottom: 1px solid var(--border-color);
}

.hero-logo {
    width: 100%;
    max-width: 960px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.hero-content-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.hero-text {
    text-align: center;
}

.tagline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.app-store-btn {
    display: inline-block;
    background-color: var(--text-main);
    color: var(--bg-color);
    text-decoration: none;
    padding: 1.2rem 2.5rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.2rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.app-store-btn:hover {
    background-color: var(--blue-accent-color);
    transform: translateY(-2px);
}

.hero-media {
    display: flex;
    justify-content: center;
}

.hero-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 496 / 1080;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-bezel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% * 554 / 496); /* Scales the 1108px bezel to 50% relative to the 496px video */
    height: auto;
    z-index: 10;
    pointer-events: none;
}

.preview-video {
    width: 100%;
    display: block;
    border-radius: 34px;
}

/* EDITORIAL / CREATOR MESSAGE */
.editorial {
    padding: 6rem 0;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

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

.message-text h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.message-text h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin-top: 1rem;
}

.message-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.message-text .signature {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-main);
    margin-top: 3rem;
}

.message-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.message-media figure {
    width: 100%;
    margin: 0;
}

.timelapse-video {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.message-media figcaption {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

.app-icon-img {
    width: 96px;
    height: 96px;
    border-radius: 22%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* HOW TO PLAY */
.how-to-play {
    padding: 6rem 0;
}

.section-header.center {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
}

.rule-explanation {
    max-width: 600px;
    margin: 0 auto 5rem;
}

.hand-drawn-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.placeholder-content p {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.placeholder-content span {
    font-style: italic;
    color: var(--text-muted);
}

.screenshots-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.screenshot {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.screenshot:hover {
    transform: translateY(-5px);
}

/* FEATURES */
.features {
    padding: 6rem 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

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

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.feature-item p {
    color: var(--text-muted);
    font-size: 1em; /* 16px equivalent */
}

.secondary-screenshots {
    margin-top: 4rem;
}

/* FOOTER */
footer {
    text-align: center;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0 1.5rem;
}

.footer-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    filter: grayscale(100%);
    opacity: 0.6;
}

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero-media,
    .message-media {
        padding: 0 64px;
    }

    .hero-video-wrapper {
        border-radius: 24px;
        border-width: 6px;
    }

    .preview-video {
        border-radius: 18px;
    }

    .hero-logo {
        min-height: 300px;
        object-fit: cover;
    }

    .editorial-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .screenshots-row {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1.5rem;
        max-width: 100%;
        margin: 0;
        padding: 0 64px 1rem 64px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .screenshots-row::-webkit-scrollbar {
        display: none;
    }

    .screenshot {
        flex: 0 0 85%;
        scroll-snap-align: center;
    }
}
