/* ===== Reset e Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #FFFAF0;
    color: #1F1F1F;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    overflow-x: hidden;
}

/* ===== Tipografia ===== */
.title-manuscript {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 4rem;
    letter-spacing: 0.05em;
    color: #1F1F1F;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.title-manuscript.orange {
    color: #E8844B;
    font-size: 4.5rem;
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: 'Caveat', cursive;
    font-size: 3.5rem;
    font-weight: 700;
    color: #1F1F1F;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.125rem;
    color: #4A4A4A;
    line-height: 1.8;
    max-width: 500px;
}

.tagline-highlight {
    color: #E8844B;
    font-style: italic;
    font-weight: 600;
}

/* ===== Dedicatória ===== */
.dedication {
    margin-top: 1rem;
    padding: 0;
    background: transparent;
    border: none;
}

.dedication-text {
    font-family: 'Caveat', cursive;
    font-size: 1.75rem;
    line-height: 1.3;
    color: #4A4A4A;
    margin: 0;
    font-weight: 500;
    text-align: left;
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* ===== Mobile Sticky Header ===== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 250, 240, 0.95) 0%, rgba(255, 250, 240, 0.9) 100%);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.3s ease;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    transition: all 0.3s ease;
    flex: 1;
}

.mobile-countdown {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mobile-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    padding: 0.4rem;
    background: linear-gradient(135deg, rgba(232, 132, 75, 0.1) 0%, rgba(232, 132, 75, 0.05) 100%);
    border: 1px solid rgba(232, 132, 75, 0.2);
    border-radius: 0.3rem;
}

.mobile-countdown-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    color: #E8844B;
    line-height: 1;
}

.mobile-countdown-text {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B6B6B;
    margin-top: 0.2rem;
}

.mobile-header-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover;
    transition: all 0.3s ease;
}

.mobile-header-text {
    flex: 1;
    min-width: 0;
    transition: all 0.3s ease;
}

.mobile-header-title {
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
    transition: all 0.3s ease;
}

.mobile-header-title-first {
    color: #1F1F1F;
    font-size: 1rem;
}

.mobile-header-title-second {
    color: #E8844B;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex !important;
    }
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background-image: url('images/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
    margin-left: calc(-50vw + 50%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 250, 240, 0.4) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
    width: 100%;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    width: 100%;
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.hero-image {
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
    transform-origin: center;
}

.writer-image {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.title-section {
    transition: all 0.3s ease;
    transform-origin: center;
}

/* ===== Animações de Entrada ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pageFlipDown {
    0% {
        opacity: 0;
        transform: perspective(1000px) rotateX(90deg) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateX(0deg) translateY(0);
    }
}

@keyframes flipCard {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.page-flip-down {
    animation: pageFlipDown 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ===== Countdown com Flip Animation ===== */
.countdown-section {
    padding-top: 2rem;
    border-top: 1px solid rgba(232, 132, 75, 0.3);
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6B6B6B;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.countdown-box {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    justify-content: center;
}

@media (max-width: 768px) {
    .countdown-box {
        justify-content: center;
        gap: 0.5rem;
    }
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
}

.countdown-flip {
    perspective: 1000px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card-inner.flip {
    transform: rotateX(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    border-radius: 0.5rem;
    border: 1px solid rgba(232, 132, 75, 0.2);
    background: linear-gradient(135deg, rgba(232, 132, 75, 0.1) 0%, rgba(232, 132, 75, 0.05) 100%);
}

.flip-card-front {
    color: #E8844B;
}

.flip-card-back {
    color: #E8844B;
    transform: rotateX(180deg);
}

.countdown-text {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6B6B6B;
}

@media (max-width: 480px) {
    .countdown-item {
        min-width: 55px;
    }
    
    .countdown-flip {
        height: 50px;
    }
    
    .flip-card-front,
    .flip-card-back {
        font-size: 1.25rem;
    }
}

/* ===== Seções Genéricas ===== */
.section {
    position: relative;
    padding: 5rem 2rem;
    overflow: hidden;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

@media (max-width: 768px) {
    .section {
        padding: 3rem 1.5rem;
    }
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background-image: url('images/section-bg.webp');
    background-size: cover;
    background-position: center;
    z-index: 1;
    margin-left: calc(-50vw + 50%);
}

.section-bg-alt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background-image: url('images/accent-bg.webp');
    background-size: cover;
    background-position: center;
    z-index: 1;
    margin-left: calc(-50vw + 50%);
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 2;
}

.section-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    margin: 0 auto;
}

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

.title-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #E8844B, #D97A3A);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.section-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4A4A4A;
}

.section-text p {
    margin-bottom: 1.5rem;
}

.section-text .highlight {
    color: #E8844B;
    font-weight: 600;
}

.section-text .quote {
    font-style: italic;
    color: #E8844B;
    font-weight: 500;
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 4px solid #E8844B;
    background-color: rgba(232, 132, 75, 0.05);
}

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

/* ===== Author Section ===== */
.author-card {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 3rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .author-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }
}

.author-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .author-image {
        max-width: 250px;
        margin: 0 auto;
    }
}

.author-photo {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(232, 132, 75, 0.15);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

.author-text {
    flex: 1;
}

.author-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4A4A4A;
    margin-bottom: 1.5rem;
}

.author-text p:last-child {
    margin-bottom: 0;
}

/* ===== CTA Section ===== */
.cta-section {
    text-align: center;
}

.section-description {
    font-size: 1.1rem;
    color: #4A4A4A;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #E8844B 0%, #D97A3A 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(232, 132, 75, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(232, 132, 75, 0.3);
}

.cta-button svg {
    width: 24px;
    height: 24px;
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, #8B5A2B 0%, #6B4423 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-highlight {
    color: white;
    font-weight: 600;
}

/* ===== Page Section Animation ===== */
.page-section {
    opacity: 0;
}

.page-section.visible {
    animation: pageFlipDown 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ===== Responsividade ===== */
@media (max-width: 768px) {
    .title-manuscript {
        font-size: 2.5rem;
    }
    
    .title-manuscript.orange {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .dedication-text {
        line-height: 1.1;
    }
}

@media (max-width: 480px) {
    .title-manuscript {
        font-size: 2rem;
    }
    
    .title-manuscript.orange {
        font-size: 2.25rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-grid {
        gap: 1rem;
    }
}

/* ===== Fade nas Bordas ===== */
.hero-bg::before,
.section-bg::before,
.section-bg-alt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 100% 50% at 50% 0%, transparent 0%, rgba(255, 250, 240, 0.6) 100%),
        radial-gradient(ellipse 100% 50% at 50% 100%, transparent 0%, rgba(255, 250, 240, 0.6) 100%),
        linear-gradient(90deg, rgba(255, 250, 240, 0.5) 0%, transparent 15%, transparent 85%, rgba(255, 250, 240, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
}
