/* ==========================================
   ¡APRENDE! HOME PAGE
   Forma Pura - Bold & Minimal
   ========================================== */

/* ==========================================
   BASE
   ========================================== */

.home-page {
    overflow: hidden;
    height: 100vh;
    background: var(--bg-primary);
}

.home-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px);
    max-width: 1600px;
    margin: 70px auto 0;
    padding: 0 5vw;
    display: flex;
    align-items: center;
}

/* ==========================================
   GRAIN TEXTURE
   ========================================== */

.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================
   TYPING ANIMATION TEXT (Positioned independently)
   ========================================== */

.typing-container {
    position: absolute;
    top: 15.5%;
    left: 5vw;
    z-index: 10;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.typing-text {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 500;
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    text-transform: lowercase;
}

.typing-text strong {
    font-weight: 700;
}

.typing-cursor {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
    animation: cursorBlink 0.6s ease-in-out infinite;
    display: inline;
}

@keyframes cursorBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* ==========================================
   LEFT SIDE - BOLD TYPOGRAPHY
   ========================================== */

.home-left {
    position: absolute;
    left: 5vw;
    top: 50%;
    transform: translateY(-55%);
    z-index: 10;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ==========================================
   STACKED TEXT
   ========================================== */

.text-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stack-line {
    font-family: 'Syne', var(--font-sans);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    display: block;
    overflow: hidden;
}

.stack-line span {
    display: inline-block;
}

/* Staggered animation */
.line-1 {
    opacity: 0;
    transform: translateX(-30px);
    animation: lineSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.line-2 {
    opacity: 0;
    transform: translateX(-30px);
    animation: lineSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--text-primary);
}

.line-3 {
    opacity: 0;
    transform: translateX(-30px);
    animation: lineSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes lineSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hover effect on lines */
.stack-line {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                letter-spacing 0.4s ease;
    cursor: default;
}

.stack-line:hover {
    transform: translateX(8px);
    letter-spacing: 0.01em;
}

.line-2:hover {
    -webkit-text-stroke-color: #6B7A6E;
}

/* ==========================================
   HERO BUTTONS
   ========================================== */

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Create Button - Black Background (matches .auth-btn) */
.btn-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.5rem 1.25rem;
    background: #222221;
    color: #FFF9F7;
    border: 1px solid #222221;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: lowercase;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-create svg {
    width: 14px;
    height: 14px;
    stroke: #FFF9F7;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-create:hover {
    background: #333333;
    border-color: #333333;
    color: #FFF9F7;
}

.btn-create:hover svg {
    transform: translateX(3px);
}

/* About Button - Transparent with Outline (matches .nav-btn) */
.btn-about {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.5rem 1.25rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid #888888;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: lowercase;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-about:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
    border-color: #666666;
}

/* ==========================================
   RIGHT SIDE - BLOB COMPOSITION (CENTERED)
   ========================================== */

.home-right {
    position: absolute;
    right: 0;
    top: 0;
    width: 65%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   MAIN BLOB
   ========================================== */

.blob-main {
    position: relative;
    width: clamp(320px, 45vw, 500px);
    height: clamp(320px, 45vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    overflow: visible;
    animation: blobReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes blobReveal {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.blob-main .blob-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        145deg,
        rgba(107, 122, 110, 0.12) 0%,
        rgba(122, 154, 168, 0.1) 40%,
        rgba(180, 144, 128, 0.08) 100%
    );
    border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%;
    animation: blobMorphMain 18s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.blob-main:hover .blob-shape {
    transform: scale(1.05);
}

@keyframes blobMorphMain {
    0%, 100% {
        border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%;
    }
    20% {
        border-radius: 50% 60% 45% 55% / 45% 50% 60% 50%;
    }
    40% {
        border-radius: 45% 55% 60% 40% / 60% 45% 55% 45%;
    }
    60% {
        border-radius: 55% 45% 50% 50% / 50% 55% 45% 55%;
    }
    80% {
        border-radius: 40% 60% 55% 45% / 55% 40% 60% 40%;
    }
}

/* Blob Content */
.blob-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    overflow: visible;
}

.blob-type {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 100px;
    backdrop-filter: blur(10px);
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.blob-type.transitioning {
    transform: translateY(-10px);
    opacity: 0;
}

/* Spanish Word - Updated to match page fonts */
.blob-spanish {
    font-family: 'Syne', var(--font-sans);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    overflow: visible;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease;
}

.blob-spanish.transitioning {
    transform: scale(0.96);
    opacity: 0;
}

.blob-english {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 400;
    color: var(--text-secondary);
    overflow: visible;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease;
}

.blob-english.transitioning {
    transform: translateY(10px);
    opacity: 0;
}

/* ==========================================
   ACCENT BLOBS
   ========================================== */

.blob-accent {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    animation: accentReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes accentReveal {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.blob-accent .blob-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s ease;
}

.blob-accent:hover .blob-shape {
    transform: scale(1.15);
}

/* Blob 1 - Top right */
.blob-1 {
    width: 140px;
    height: 140px;
    top: 12%;
    right: 15%;
    animation-delay: 0.6s;
}

.blob-1 .blob-shape {
    background: rgba(122, 154, 168, 0.12);
    border-radius: 55% 45% 50% 50% / 50% 55% 45% 50%;
    animation: blobMorph1 14s ease-in-out infinite;
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 55% 45% 50% 50% / 50% 55% 45% 50%; }
    50% { border-radius: 45% 55% 45% 55% / 55% 45% 55% 45%; }
}

/* Blob 2 - Bottom left of blob area */
.blob-2 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    left: 10%;
    animation-delay: 0.75s;
}

.blob-2 .blob-shape {
    background: rgba(180, 144, 128, 0.1);
    border-radius: 50% 50% 45% 55% / 55% 50% 50% 45%;
    animation: blobMorph2 16s ease-in-out infinite;
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 50% 50% 45% 55% / 55% 50% 50% 45%; }
    50% { border-radius: 45% 55% 55% 45% / 45% 55% 45% 55%; }
}

/* Blob 3 - Right edge */
.blob-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    right: 5%;
    animation-delay: 0.9s;
}

.blob-3 .blob-shape {
    background: rgba(107, 122, 110, 0.1);
    animation: blobMorph3 12s ease-in-out infinite;
}

@keyframes blobMorph3 {
    0%, 100% { border-radius: 50%; }
    50% { border-radius: 40% 60% 55% 45% / 55% 45% 55% 45%; }
}

/* Blob 4 - Top center-left */
.blob-4 {
    width: 60px;
    height: 60px;
    top: 25%;
    left: 25%;
    animation-delay: 1s;
}

.blob-4 .blob-shape {
    background: rgba(138, 122, 130, 0.08);
    animation: blobMorph4 10s ease-in-out infinite;
}

@keyframes blobMorph4 {
    0%, 100% { border-radius: 50%; }
    50% { border-radius: 45% 55% 50% 50%; }
}

/* Blob 5 - Bottom right */
.blob-5 {
    width: 90px;
    height: 90px;
    bottom: 25%;
    right: 20%;
    animation-delay: 1.1s;
}

.blob-5 .blob-shape {
    background: rgba(106, 138, 135, 0.08);
    animation: blobMorph5 15s ease-in-out infinite;
}

@keyframes blobMorph5 {
    0%, 100% { border-radius: 50%; }
    50% { border-radius: 55% 45% 45% 55%; }
}

/* ==========================================
   FLOATING ANIMATION FOR ACCENT BLOBS
   ========================================== */

.blob-1 {
    animation: accentReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards,
               float1 8s ease-in-out infinite 1.4s;
}

.blob-2 {
    animation: accentReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.75s forwards,
               float2 10s ease-in-out infinite 1.55s;
}

.blob-3 {
    animation: accentReveal3 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards,
               float3 7s ease-in-out infinite 1.7s;
}

.blob-4 {
    animation: accentReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1s forwards,
               float4 9s ease-in-out infinite 1.8s;
}

.blob-5 {
    animation: accentReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.1s forwards,
               float5 11s ease-in-out infinite 1.9s;
}

/* Special reveal animation for blob-3 (maintains vertical centering) */
@keyframes accentReveal3 {
    from {
        opacity: 0;
        transform: translateY(calc(-50% + 20px)) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10px, 15px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15px, -10px); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(calc(-50% - 12px)); }
}

@keyframes float4 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(8px, 10px); }
}

@keyframes float5 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-12px, -8px); }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1200px) {
    .blob-main {
        width: clamp(280px, 40vw, 420px);
        height: clamp(280px, 40vw, 420px);
    }
    
    .stack-line {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }
    
    .blob-spanish {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .blob-1 { width: 110px; height: 110px; }
    .blob-2 { width: 150px; height: 150px; }
    .blob-3 { width: 80px; height: 80px; }
    .blob-4 { width: 50px; height: 50px; }
    .blob-5 { width: 70px; height: 70px; }
    
    .typing-text,
    .typing-cursor {
        font-size: 1rem;
    }
}

@media (max-width: 900px) {
    .home-container {
        flex-direction: column;
        justify-content: center;
        padding: 2rem 1.5rem;
    }
    
    .typing-container {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 1rem;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
    
    .home-left {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .hero-text {
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons {
        align-items: center;
    }
    
    .text-stack {
        align-items: center;
    }
    
    .stack-line {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
    
    .stack-line:hover {
        transform: none;
    }
    
    .home-right {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 350px;
    }
    
    .blob-main {
        width: clamp(220px, 50vw, 300px);
        height: clamp(220px, 50vw, 300px);
    }
    
    .blob-spanish {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .blob-1 {
        width: 80px;
        height: 80px;
        top: 0;
        right: 10%;
    }
    
    .blob-2 {
        width: 100px;
        height: 100px;
        bottom: 0;
        left: 5%;
    }
    
    .blob-3 {
        width: 60px;
        height: 60px;
        top: 40%;
        right: 0;
    }
    
    .blob-4 {
        width: 45px;
        height: 45px;
        top: 10%;
        left: 10%;
    }
    
    .blob-5 {
        width: 55px;
        height: 55px;
        bottom: 15%;
        right: 15%;
    }
    
    .typing-text,
    .typing-cursor {
        font-size: 0.875rem;
    }
}

@media (max-width: 600px) {
    .home-container {
        padding: 1.5rem 1rem;
        height: calc(100vh - 60px);
        margin-top: 60px;
    }
    
    .home-left {
        margin-bottom: 1.5rem;
    }
    
    .typing-container {
        margin-bottom: 0.75rem;
    }
    
    .typing-text,
    .typing-cursor {
        font-size: 0.75rem;
    }
    
    .stack-line {
        font-size: clamp(1.5rem, 9vw, 2rem);
    }
    
    .line-2 {
        -webkit-text-stroke-width: 1px;
    }
    
    .hero-text {
        gap: 0.875rem;
    }
    
    .btn-create,
    .btn-about {
        padding: 0.4rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .btn-create svg {
        width: 12px;
        height: 12px;
    }
    
    .blob-main {
        width: 200px;
        height: 200px;
    }
    
    .blob-spanish {
        font-size: 1.75rem;
    }
    
    .blob-english {
        font-size: 0.9375rem;
    }
    
    .blob-type {
        font-size: 0.5625rem;
        margin-bottom: 0.375rem;
    }
    
    .blob-4,
    .blob-5 {
        display: none;
    }
    
    .blob-1 {
        width: 60px;
        height: 60px;
    }
    
    .blob-2 {
        width: 75px;
        height: 75px;
    }
    
    .blob-3 {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 400px) {
    .stack-line {
        font-size: 1.375rem;
    }
    
    .typing-text,
    .typing-cursor {
        font-size: 0.6875rem;
    }
    
    .blob-main {
        width: 170px;
        height: 170px;
    }
    
    .blob-spanish {
        font-size: 1.5rem;
    }
    
    .blob-1,
    .blob-2,
    .blob-3 {
        display: none;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .stack-line,
    .hero-buttons,
    .blob-main,
    .blob-accent {
        opacity: 1;
        transform: none;
    }
    
    .blob-main .blob-shape,
    .blob-accent .blob-shape {
        animation: none;
    }
    
    .typing-cursor {
        animation: none;
        opacity: 1;
    }
}

.typing-container {
    position: absolute;
    top: 15.5%;
    left: 5vw;
    z-index: 10;
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding-left: 1rem;
    border-left: 2px solid rgba(122, 154, 168, 0.3);
}

.typing-text {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 500;
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    text-transform: lowercase;
}

.typing-text strong {
    font-weight: 700;
    color: var(--text-primary);
}

.typing-cursor {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text-tertiary);
    animation: cursorBlink 0.6s ease-in-out infinite;
    display: inline;
}