/* ==========================================================================
   Personit Newsletter Landing Page - Styles
   ========================================================================== */

/* CSS Variables - Personit Design System */
:root {
    --brand-green: #0cffa7;
    --brand-green-dark: #00cc88;
    --dark-bg: #0f1214;
    --dark-bg-alt: #121416;
    --border-gray: rgba(255, 255, 255, 0.1);
    --text-white: #ffffff;
    --text-gray: rgba(255, 255, 255, 0.6);

    /* Personit design tokens */
    --radius: 12;
    --border-size: 1;
    --hue: 160;
    --saturation: 100;
    --lightness: 53;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Urbanist', sans-serif;
    background: var(--dark-bg);
    color: var(--text-white);
    line-height: 1.3;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   Animations & Microinteractions
   ========================================================================== */

/* Page load animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-up.delay-1 {
    animation-delay: 0.15s;
}

.fade-in-up.delay-2 {
    animation-delay: 0.3s;
}

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

/* Scroll-triggered animations */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Topic cards scroll animation */
.topic-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.topic-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.topic-card.locked.visible {
    opacity: 0.6;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: min(1800px, 94vw);
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    padding: 24px 0;
    background: var(--dark-bg);
}

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

.header-left,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.logo {
    height: 52px;
    width: auto;
}

.logo img {
    height: 100%;
    width: auto;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
}

.lang-option {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-family: 'Urbanist', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    color: var(--text-white);
}

.lang-option.active {
    background: var(--brand-green);
    color: var(--dark-bg);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-cta {
    padding: 120px 0 80px;
    background: var(--dark-bg);
    position: relative;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(61.22% 81.57% at 50% -3.83%,
            rgba(12, 255, 167, 0.2) 0%,
            rgba(15, 18, 20, 0.2) 100%);
    z-index: 0;
}

/* Hero Canvas Animation */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* CSS Fallback Animation */
.hero-animation-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    width: var(--size, 300px);
    height: var(--size, 300px);
    background: radial-gradient(circle, rgba(12, 255, 167, 0.25) 0%, transparent 70%);
    filter: blur(60px);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbit var(--duration, 20s) linear infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes orbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(calc(150px + var(--offset-x, 0px))) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(calc(150px + var(--offset-x, 0px))) rotate(-360deg);
    }
}

.hero-wrapper {
    display: flex;
    flex-direction: column;
    gap: calc(60px + 2rem);
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

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

.hero-title {
    font-size: clamp(2.25rem, 5vw, 5rem);
    font-weight: 500;
    line-height: 100%;
    margin-bottom: 20px;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.hero-title .accent {
    color: var(--brand-green);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-white);
    max-width: 100%;
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.cta-section {
    /* Glow effect variables */
    --base: 160;
    --spread: 20;
    --card-radius: 20;
    --border: 2;
    --backdrop: rgba(29, 34, 38, 0.4);
    --backup-border: rgba(54, 54, 54, 0.6);
    --size: 300;
    --saturation: 100;
    --lightness: 53;
    --bg-spot-opacity: 0.15;
    --border-spot-opacity: 0.7;
    --border-light-opacity: 0.5;
    --border-size: calc(var(--border) * 1px);
    --spotlight-size: calc(var(--size) * 1px);
    --hue: calc(var(--base) + (var(--xp, 0) * var(--spread)));
    --x: 0;
    --y: 0;
    --xp: 0;
    --yp: 0;

    /* Background with spotlight */
    background-image: radial-gradient(var(--spotlight-size) var(--spotlight-size) at calc(var(--x) * 1px) calc(var(--y) * 1px),
            hsl(var(--hue) calc(var(--saturation) * 1%) calc(var(--lightness) * 1%) / var(--bg-spot-opacity)),
            transparent);
    background-color: var(--backdrop);
    background-size: calc(100% + (2 * var(--border-size))) calc(100% + (2 * var(--border-size)));
    background-position: 50% 50%;

    backdrop-filter: blur(12px);
    border: var(--border-size) solid var(--backup-border);
    border-radius: calc(var(--card-radius) * 1px);
    padding: 56px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, opacity 0.6s ease, transform 0.6s ease;
}

.cta-section::before,
.cta-section::after {
    content: '';
    position: absolute;
    inset: calc(var(--border-size) * -1);
    border-radius: calc(var(--card-radius) * 1px);
    border: var(--border-size) solid transparent;
    pointer-events: none;
    z-index: 2;
}

/* Border glow effect */
.cta-section::before {
    background: radial-gradient(calc(var(--spotlight-size) * 0.75) calc(var(--spotlight-size) * 0.75) at calc(var(--x) * 1px) calc(var(--y) * 1px),
            hsl(var(--hue) calc(var(--saturation) * 1%) calc(var(--lightness) * 1%) / var(--border-spot-opacity)),
            transparent 100%);
    background-attachment: fixed;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

/* Outer glow */
.cta-section::after {
    background: radial-gradient(calc(var(--spotlight-size) * 0.5) calc(var(--spotlight-size) * 0.5) at calc(var(--x) * 1px) calc(var(--y) * 1px),
            hsl(var(--hue) calc(var(--saturation) * 1%) 70% / 0.25),
            transparent 100%);
    filter: blur(calc(var(--border-size) * 10));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cta-section:hover::after {
    opacity: 1;
}

.cta-title {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.cta-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* ==========================================================================
   Newsletter Form
   ========================================================================== */

.cta-form {
    display: flex;
    gap: 14px;
    flex-direction: column;
    justify-content: center;
}

.form-input-row {
    display: flex;
    gap: 14px;
    flex-direction: row;
    align-items: center;
}

.form-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
}

.consent-checkbox {
    margin-top: 4px;
    cursor: pointer;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.consent-label {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.5;
    cursor: pointer;
}

.cta-input {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
    flex: 1;
}

.cta-input::placeholder {
    color: var(--text-gray);
    font-weight: 500;
}

.cta-input:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 2px rgba(12, 255, 167, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.cta-button {
    padding: 16px 32px;
    background: var(--brand-green);
    color: #000;
    font-weight: 500;
    font-size: 14px;
    border: none;
    border-radius: calc(var(--radius) * 1px);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    width: auto;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12, 255, 167, 0.3);
    background: var(--brand-green-dark);
}

.cta-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Trust Badges
   ========================================================================== */

.trust-badges {
    margin-top: 32px;
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--text-gray);
    font-weight: 500;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trust-icon {
    color: var(--brand-green);
    flex-shrink: 0;
}

/* ==========================================================================
   Section Divider
   ========================================================================== */

.section-divider {
    max-width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gray), transparent);
    margin: 0 auto;
}

/* ==========================================================================
   Topics Section
   ========================================================================== */

.topics {
    padding: 4rem 4rem 140px;
    background: linear-gradient(315deg, rgba(12, 255, 167, 0.15) 3%, rgba(15, 18, 20, 1) 38%, rgba(12, 255, 167, 0.08) 68%, rgba(15, 18, 20, 1) 98%);
    animation: gradient 15s ease infinite;
    background-size: 400% 400%;
    position: relative;
    overflow: hidden;
}

.topics::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, var(--dark-bg) 0%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}

@keyframes gradient {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

.wave {
    background: rgba(12, 255, 167, 0.1);
    border-radius: 1000% 1000% 0 0;
    position: absolute;
    width: 200%;
    height: 12em;
    animation: wave 10s -3s linear infinite;
    transform: translate3d(0, 0, 0);
    opacity: 0.8;
    bottom: 0;
    left: 0;
    z-index: 0;
}

.wave:nth-of-type(2) {
    bottom: -1.25em;
    animation: wave 18s linear reverse infinite;
    opacity: 0.6;
    background: rgba(12, 255, 167, 0.08);
}

.wave:nth-of-type(3) {
    bottom: -2.5em;
    animation: wave 20s -1s reverse infinite;
    opacity: 0.4;
    background: rgba(12, 255, 167, 0.06);
}

@keyframes wave {
    2% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-25%);
    }

    50% {
        transform: translateX(-50%);
    }

    75% {
        transform: translateX(-25%);
    }

    100% {
        transform: translateX(0);
    }
}

.topics h2 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 700;
    color: var(--text-white);
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.topics .hero-subtitle {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

.topics-frequency {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.3rem;
    margin-bottom: 72px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Topic Cards
   ========================================================================== */

.topic-card {
    background: rgba(12, 255, 167, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(12, 255, 167, 0.15);
    border-radius: calc(var(--radius) * 1px);
    padding: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, var(--brand-green), transparent);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.topic-card:hover::before {
    opacity: 0.05;
}

.topic-card:hover {
    transform: translateY(-2px);
    border-color: rgba(12, 255, 167, 0.25);
    box-shadow: 0 8px 16px rgba(12, 255, 167, 0.1);
}

/* Locked cards */
.topic-card.locked {
    filter: grayscale(100%);
    opacity: 0.6;
    cursor: default;
}

.topic-card.locked:hover {
    transform: none !important;
    border-color: rgba(12, 255, 167, 0.15);
    box-shadow: none !important;
}

.topic-card.locked:hover::before {
    opacity: 0;
}

.lock-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    color: var(--text-white);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(12, 255, 167, 0.2) 0%, rgba(12, 255, 167, 0.05) 100%);
}

.topic-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-white);
    position: relative;
    z-index: 1;
    text-align: left;
    padding: 16px 16px 12px;
    min-height: 56px;
}

.topic-date {
    font-size: 0.75rem;
    color: var(--text-gray);
    position: relative;
    z-index: 1;
    padding: 0 16px 16px;
    font-weight: 400;
}

/* Banner Card */
.banner-card {
    grid-column: span 2;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(12, 255, 167, 0.15);
}

.banner-card .banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--dark-bg);
    padding: 48px 0 32px;
    border-top: 1px solid var(--border-gray);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-left {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.footer-logo img {
    height: 52px;
    width: auto;
}

.footer-company-info {
    color: var(--text-gray);
    font-size: 0.85rem;
    line-height: 1.5;
}

.footer-company-info p {
    margin: 0;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.5rem;
}

.footer-links-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links-section a {
    color: var(--brand-green);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-links-section a:hover {
    color: var(--brand-green-dark);
}

.footer-divider {
    color: var(--text-gray);
}

.footer-social {
    display: flex;
    gap: 8px;
}

.footer-social a {
    color: var(--brand-green);
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: var(--brand-green-dark);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.copyright {
    color: var(--text-gray);
    font-size: 0.8rem;
    text-align: right;
    margin: 0;
}

/* ==========================================================================
   Form States
   ========================================================================== */

.form-success {
    color: var(--brand-green);
    font-weight: 600;
    margin-top: 16px;
}

.form-error {
    color: #ff6b6b;
    font-weight: 600;
    margin-top: 16px;
}

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

@media (max-width: 768px) {
    .mobile-hide {
        display: none;
    }

    .hero-cta {
        padding: 80px 0 60px;
    }

    .logo {
        height: 36px;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .cta-form {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-input {
        min-width: auto;
        font-size: 1rem;
        padding: 18px 22px;
    }

    .cta-button {
        font-size: 1rem;
        padding: 18px 28px;
    }

    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .trust-badges {
        flex-direction: column;
        gap: 14px;
        align-items: center;
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .cta-section {
        padding: 40px 28px;
    }

    .cta-input {
        padding: 14px 16px;
    }

    .cta-button {
        padding: 14px 24px;
    }

    .topics {
        padding: 0 20px 80px;
    }

    .site-footer {
        padding: 32px 0 24px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

    .footer-left {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .footer-right {
        align-items: center;
        gap: 8px;
    }

    .copyright {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-wrapper {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .cta-section {
        padding: 32px 16px;
    }

    .cta-title {
        font-size: 1.3rem;
    }

    .form-input-row {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .cta-input,
    .cta-button {
        width: 100%;
    }

    .topics h2 {
        font-size: 1.6rem;
    }

    .topics-frequency {
        font-size: 1rem;
    }

    .topics-grid {
        grid-template-columns: 1fr;
    }

    .banner-card {
        grid-column: span 1;
    }
}