/* CSS Variables & Design System */
:root {
    /* Colors */
    --color-primary-start: #E9D5FF;
    /* Soft lavender */
    --color-primary-end: #7C3AED;
    /* Deeper violet */
    --color-bg: #FFFFFF;
    --color-bg-alt: #F9FAFB;
    --color-text-main: #1F2937;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    /* 8px */
    --spacing-md: 1rem;
    /* 16px */
    --spacing-lg: 2rem;
    /* 32px */
    --spacing-xl: 4rem;
    /* 64px */

    /* Container Width */
    --container-max-width: 1200px;
    --container-padding: 1.5rem;
}

[data-theme="dark"] {
    --color-bg: #111827;
    /* Gray 900 */
    --color-bg-alt: #1F2937;
    /* Gray 800 */
    --color-text-main: #F9FAFB;
    /* Gray 50 */
    --color-text-muted: #D1D5DB;
    /* Gray 300 */
    --color-border: #374151;
    /* Gray 700 */
    --color-primary-start: #C084FC;
    /* Lighter violet for dark mode */
}

/* Nav Actions & Theme Toggle */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--color-text-main);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--color-bg-alt);
}

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

body {
    font-family: var(--font-family);
    color: var(--color-text-main);
    background-color: var(--color-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
}

p {
    color: var(--color-text-muted);
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    /* Pill shape */
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-end), #6D28D9);
    /* Slightly darker gradient for button */
    color: white;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3), 0 2px 4px -1px rgba(124, 58, 237, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-secondary {
    background: var(--color-bg-card);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-alt);
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo-link {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 24px;
    /* "Super super super small" */
    width: auto;
}

/* Hero Section */
.hero {
    padding: 2rem 0 4rem;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr;
    /* Stack columns on mobile */
    align-items: center;
    gap: 4rem;
}

@media (min-width: 768px) {
    .hero {
        min-height: 90vh;
        /* Almost full height but allows peek of next section */
        display: flex;
        align-items: center;
        padding: 0;
    }

    .hero-container {
        grid-template-columns: 1.2fr 0.8fr;
        /* Two columns only on larger screens */
    }
}

.hero-content {
    max-width: 600px;
}

.hero-logo {
    width: 300px;
    /* Reduced from 120px */
    height: auto;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
    /* Removed gradient to ensure visibility */
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Updated to 4 columns */
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
        /* Large headline */
        margin-bottom: 1.5rem;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 480px;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

/* Hero Styling - Reusable Form */
.signup-form {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .input-group {
        flex-direction: row;
        background: var(--color-bg-card);
        padding: 0.35rem;
        border-radius: 9999px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
        border: 1px solid var(--color-border);
        max-width: 480px;
    }

    .input-group input {
        flex: 1;
        border: none;
        padding: 0 1.5rem;
        font-size: 1rem;
        outline: none;
        border-radius: 9999px;
        background: transparent;
        color: var(--color-text-main);
    }

    .input-group button {
        flex-shrink: 0;
    }
}

/* Mobile specific input styling (separate from pill on desktop) */
@media (max-width: 479px) {
    .input-group input {
        width: 100%;
        padding: 1rem;
        border-radius: 12px;
        border: 1px solid var(--color-border);
        font-size: 1rem;
        background: var(--color-bg-input);
        color: var(--color-text-main);
    }

    .input-group button {
        width: 100%;
        border-radius: 12px;
    }
}

.trust-text {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.users-count {
    font-weight: 600;
    color: var(--color-primary-end);
}

/* Hero Visual - Animated */
.hero-animation-container {
    width: 100%;
    max-width: 500px;
    position: relative;
    /* Responsive sizing */
}

.sync-animation {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.1));
}

/* Notebook Handrwiting Animation - Reveal */
.reveal-rect-anim {
    animation: revealWriting 6s linear infinite;
}

/* Fade out the text itself at the end to avoid hard cut or erasing look */
.notebook-text {
    animation: fadeTextLoop 6s linear infinite;
}

/* Pen Animation */
.pen-group {
    opacity: 0;
    animation: movePenReveal 6s linear infinite;
}

/* Phone Text Animation - Appear all at once */
.phone-text {
    opacity: 0;
    animation: appearSuddenly 6s linear infinite;
    animation-delay: 0s;
}

/* Cursor Blink */
.cursor-blink {
    opacity: 0;
    animation: blinkCursor 6s linear infinite;
    animation-delay: 0s;
}

/* Keyframes */

@keyframes revealWriting {
    0% {
        width: 0;
    }

    30% {
        width: 120px;
    }

    /* Increased width to ensure 'o' is fully covered */
    90% {
        width: 120px;
    }

    /* Hold full width */
    100% {
        width: 120px;
    }

    /* Width stays full until instant reset at 0% */
}

@keyframes fadeTextLoop {

    0%,
    90% {
        opacity: 1;
    }

    95% {
        opacity: 0;
    }

    /* Quick fade out before loop restarts */
    100% {
        opacity: 0;
    }
}

/* Pen moves across and bobs, then disappears */
@keyframes movePenReveal {
    0% {
        opacity: 1;
        transform: translate(30px, 80px);
    }

    30% {
        opacity: 1;
        transform: translate(110px, 80px);
    }

    35% {
        opacity: 0;
        transform: translate(115px, 80px);
    }

    /* Hide pen */
    100% {
        opacity: 0;
        transform: translate(30px, 80px);
    }
}

/* Text appears shortly after pen finishes */
@keyframes appearSuddenly {

    0%,
    35% {
        opacity: 0;
    }

    36% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    95% {
        opacity: 0;
    }

    /* Fade out matching notebook */
    100% {
        opacity: 0;
    }
}

@keyframes blinkCursor {

    0%,
    35% {
        opacity: 1;
    }

    36% {
        opacity: 0;
    }

    /* Hide when text appears */
    100% {
        opacity: 0;
    }
}

/* Particles Flow - Trigger transition after writing */
.waiting-particles .magic-particle {
    opacity: 0;
    transform: translateX(0);
    animation: flowParticlesBatch 6s ease-in-out infinite;
}

.waiting-particles .delay-1 {
    animation-delay: 0.1s;
}

.waiting-particles .delay-2 {
    animation-delay: 0.2s;
}

.waiting-particles .delay-3 {
    animation-delay: 0.0s;
}

@keyframes flowParticlesBatch {

    0%,
    35% {
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }

    40% {
        opacity: 1;
        transform: translateX(40px) scale(1.2);
    }

    /* Burst across */
    45% {
        opacity: 1;
        transform: translateX(80px) scale(0.5);
    }

    /* Reach phone */
    50%,
    100% {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* UI Elements Fade In */
.ui-element {
    opacity: 0;
    animation: fadeInUI 6s ease-in-out infinite;
    animation-delay: 3s;
    /* After text appears */
}

/* Magic Particles Animation */
.magic-particle {
    opacity: 0;
    transform: translateX(0);
    animation: flowParticles 3s ease-in-out infinite;
}

/* Shared delays within groups */
.notebook-ink.delay-1 {
    animation-delay: 0.8s;
}

.notebook-ink.delay-2 {
    animation-delay: 1.6s;
}

.phone-ink.delay-1 {
    animation-delay: 1.3s;
}

.phone-ink.delay-2 {
    animation-delay: 2.1s;
}

.magic-particle.delay-1 {
    animation-delay: 0.8s;
}

.magic-particle.delay-2 {
    animation-delay: 1.2s;
}


@keyframes drawInk {
    0% {
        stroke-dashoffset: 100;
        opacity: 1;
    }

    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    80% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

    /* Fade out to loop cleanly */
}

@keyframes flowParticles {
    0% {
        transform: translateX(0) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    50% {
        transform: translateX(60px) scale(1.2);
        opacity: 1;
    }

    80% {
        opacity: 0;
    }

    100% {
        transform: translateX(80px) scale(0.5);
        opacity: 0;
    }
}

@keyframes fadeInUI {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }

    50% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Features Section */
.features {
    padding: 6rem 0;
    background-color: var(--color-bg-alt);
}

/* Features Split Layout */
.features-split-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

@media (min-width: 900px) {
    .features-split-container {
        grid-template-columns: 1fr 1fr;
    }
}

.features-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-card {
    background: var(--color-bg-card);
    padding: 1.25rem;
    /* Compact padding */
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    /* Vertically align icon with text */
    gap: 1.25rem;
    /* Space between icon and text */
    text-align: left;
}

.feature-card:hover {
    transform: translateX(5px);
    /* Slide right instead of up */
    border-color: var(--color-primary-end);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-end);
    flex-shrink: 0;
    /* Don't shrink icon */
    margin-bottom: 0;
    /* Reset bottom margin */
}

/* Privacy Column */
.privacy-column {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Vertically centered base */
    height: 100%;
}

.features-privacy {
    margin: 0;
    text-align: center;
    max-width: 450px;
    padding: 2rem;
    transform: translateY(-15%);
    /* Shift up ~10-15% visually */
}

.features-column-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}

/* Keepsake / Manifestation Section */
.keepsake-section {
    padding: 8rem 0;
    background-color: var(--color-bg);
    /* Alternating background */
    text-align: left;
}

.keepsake-content {
    /* Reusing editorial container width/padding */
}

.trust-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.icon-wrapper {
    width: 40px;
    /* Reduced from 48px */
    height: 40px;
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-end);
    margin-bottom: 1rem;
}

.icon-wrapper svg {
    width: 20px;
    height: 20px;
}

.feature-card h3 {
    font-size: 1.125rem;
    /* Slightly smaller title */
    margin-bottom: 0.5rem;
}

/* Editorial / Emotional Section */
.editorial-section {
    padding: 8rem 0;
    background-color: var(--color-bg-section);
    /* Warm gray/soft background */
    text-align: left;
}

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

.vertical-divider {
    display: none;
    /* Hidden on mobile */
}

@media (min-width: 900px) {
    .editorial-grid {
        grid-template-columns: 1fr auto 1fr;
        /* Left, Divider, Right */
        gap: 4rem;
        align-items: center;
        /* Center vertically */
    }

    .vertical-divider {
        display: block;
        width: 1px;
        height: 100%;
        min-height: 200px;
        /* Ensure visibility */
        background-color: var(--color-border);
        margin: 0 auto;
    }

    .editorial-section {
        padding: 6rem 0;
        /* Adjusted padding */
    }
}

.editorial-container {
    max-width: 1000px;
    /* Wider container for split view */
    margin: 0 auto;
    padding: 0 1.5rem;
}

.editorial-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    line-height: 1.2;
    color: var(--color-text-main);
    margin-bottom: 2.5rem;
    font-weight: 600;
}

.editorial-title .highlight-text {
    font-style: italic;
    color: var(--color-primary-start);
}

.editorial-body {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--color-text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
}

.editorial-body p {
    margin-bottom: 1.5rem;
}

/* Privacy Subsection */
.spacer-lg {
    height: 4rem;
}

.privacy-content {
    max-width: 600px;
    margin: 4rem auto 0;
    /* Add top margin for spacing, removed border-top */
    padding-top: 0;
    /* Removed padding top */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.privacy-icon-wrapper {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--color-bg-card);
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.privacy-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.privacy-content p {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Responsive adjustments for editorial */
@media (max-width: 768px) {
    .editorial-title {
        font-size: 2.25rem;
    }

    .editorial-body {
        font-size: 1.125rem;
    }
}

/* Second CTA Section */
.cta-section {
    padding: 6rem 0;
    text-align: center;
    background: var(--gradient-cta);
}

.cta-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.center-form {
    max-width: 480px;
    margin: 0 auto;
}

.cta-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--color-border);
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-logo {
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-primary-end);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--color-text-muted);
    width: 20px;
    height: 20px;
}

.footer-social a:hover {
    color: var(--color-text-main);
}

.footer-copyright {
    color: #9CA3AF;
    font-size: 0.875rem;
}

/* Success Message Modal */
.success-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--color-bg), 0.9);
    /* Need to check how to handle rgba with hex var. Using fallback for now, or assume variable. Actually css vars in rgba is tricky unless using RGB values. */
    background: var(--color-bg-navbar);
    /* Reusing the navbar backdrop logic */
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.success-message.visible {
    opacity: 1;
    pointer-events: auto;
}

.success-content {
    background: var(--color-bg-card);
    padding: 3rem;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 90%;
    width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.success-message.visible .success-content {
    transform: scale(1);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Checkmark Animation */
.checkmark-circle {
    width: 56px;
    height: 56px;
    position: relative;
    display: inline-block;
    vertical-align: top;
    margin-bottom: 20px;
}

.checkmark-circle .background {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #10B981;
    position: absolute;
}

.checkmark-circle .checkmark {
    border-radius: 5px;
}

.checkmark-circle .checkmark.draw:after {
    animation-delay: 100ms;
    animation-duration: 1s;
    animation-timing-function: ease;
    animation-name: checkmark;
    transform: scaleX(-1) rotate(135deg);
    animation-fill-mode: forwards;
}

.checkmark-circle .checkmark:after {
    opacity: 1;
    height: 28px;
    width: 14px;
    transform-origin: left top;
    border-right: 3px solid white;
    border-top: 3px solid white;
    content: '';
    left: 14px;
    top: 28px;
    position: absolute;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1F2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
}