/* ========================================
   NEST Brand Colors & Typography
   ======================================== */

:root {
    --nest-deep-navy: #0E2841;
    --nest-black: #0A0A0A;
    --nest-teal: #207888;
    --nest-teal-dark: #1a5f6f;
    --ice-white: #F5F5F5;
    --text-secondary: #555555;
    --border-light: #e8e8e8;

    --font-family: 'Montserrat', sans-serif;
    --font-bold: 700;
    --font-semi-bold: 600;
    --font-medium: 500;
    --font-regular: 400;
    --font-light: 300;
}

/* ========================================
   Reset & Base Styles
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--nest-black);
    background-color: #ffffff;
    font-weight: var(--font-regular);
    line-height: 1.6;
    overflow-x: hidden;
}

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

a {
    color: inherit;
}

/* Accessibility: focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--nest-teal);
    outline-offset: 2px;
}

/* ========================================
   Container & Layout
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ========================================
   Navigation Bar
   ======================================== */

.navbar {
    background-color: var(--ice-white);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(14, 40, 65, 0.08);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-image {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--nest-deep-navy);
    text-decoration: none;
    font-weight: var(--font-medium);
    font-size: 14px;
    transition: color 0.3s ease;
    padding: 8px 4px;
}

.nav-link:hover {
    color: var(--nest-teal);
}

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

.hero {
    background: linear-gradient(135deg, var(--nest-deep-navy) 0%, #1a3d52 100%);
    color: var(--ice-white);
    padding: 20px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    font-weight: var(--font-bold);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 14px;
    font-weight: var(--font-light);
    max-width: 100%;
    margin: 0 auto;
    opacity: 0.9;
}

/* ========================================
   Marketplace Section
   ======================================== */

.marketplace {
    padding: 60px 20px 40px 20px;
    background-color: var(--ice-white);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* ========================================
   App Card
   ======================================== */

.app-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(14, 40, 65, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(14, 40, 65, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--nest-deep-navy) 0%, var(--nest-teal) 100%);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.app-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: brightness(1.2);
}

.app-icon-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Gradient variations (moved from inline styles for CSP compliance) */
.gradient-teal-navy {
    background: linear-gradient(135deg, var(--nest-teal) 0%, var(--nest-deep-navy) 100%);
}

.gradient-navy-teal {
    background: linear-gradient(135deg, var(--nest-deep-navy) 0%, var(--nest-teal) 100%);
}

.card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.app-name {
    font-size: 17px;
    font-weight: var(--font-semi-bold);
    color: var(--nest-deep-navy);
    margin-bottom: 8px;
}

.app-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: var(--font-regular);
}

.card-footer {
    padding: 0 18px 18px 18px;
    border-top: 1px solid var(--border-light);
    padding-top: 15px;
}

/* ========================================
   About Section
   ======================================== */

.about-section {
    background-color: var(--nest-deep-navy);
    color: var(--ice-white);
    padding: 25px 20px;
    text-align: center;
    margin: 0;
}

.about-section p {
    font-size: 14px;
    font-weight: var(--font-regular);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.95;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: var(--font-semi-bold);
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--nest-teal);
    color: var(--ice-white);
}

.btn-primary:hover {
    background-color: var(--nest-teal-dark);
}

.btn-disabled {
    background-color: #b0b0b0;
    color: var(--ice-white);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-disabled:hover {
    background-color: #b0b0b0;
    transform: none;
}

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

.footer {
    background-color: var(--ice-white);
    color: var(--nest-deep-navy);
    padding: 20px;
    margin-top: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

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

.footer-section:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.footer-section h4 {
    font-size: 14px;
    font-weight: var(--font-semi-bold);
    margin-bottom: 10px;
    color: var(--nest-teal);
}

.footer-section p {
    font-size: 13px;
    color: var(--nest-deep-navy);
    margin-bottom: 8px;
    line-height: 1.5;
    word-break: break-word;
}

.footer-section p a {
    color: var(--nest-deep-navy);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section p a:hover {
    color: var(--nest-teal);
}

.footer-logo-link {
    display: inline-block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.footer-logo-link:hover {
    transform: scale(1.05);
}

.footer-logo {
    height: 70px;
    width: auto;
    margin-bottom: 12px;
    object-fit: contain;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 5px;
}

.footer-section ul li a {
    color: var(--nest-deep-navy);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--nest-teal);
}

.footer-bottom {
    border-top: 1px solid rgba(14, 40, 65, 0.1);
    padding-top: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--nest-deep-navy);
}

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

/* Tablet (landscape) */
@media (max-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* Tablet (portrait) */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 18px 16px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 13px;
    }

    .marketplace {
        padding: 40px 16px 30px 16px;
    }

    .apps-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }

    .about-section {
        padding: 20px 16px;
    }

    .about-section p {
        font-size: 13px;
    }

    .logo-image {
        height: 42px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .navbar {
        padding: 8px 0;
    }

    .navbar-content {
        gap: 8px;
    }

    .logo-image {
        height: 36px;
    }

    .nav-link {
        font-size: 13px;
    }

    .hero {
        padding: 16px 12px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero p {
        font-size: 12px;
    }

    .marketplace {
        padding: 30px 12px 20px 12px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card-header {
        height: 100px;
    }

    .app-icon,
    .app-icon-placeholder {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }

    .app-name {
        font-size: 16px;
    }

    .about-section p {
        font-size: 12px;
        line-height: 1.5;
    }

    .footer {
        padding: 16px 12px;
    }

    .footer-logo {
        height: 60px;
    }
}

/* Reduce motion accessibility preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-card {
    animation: fadeIn 0.6s ease forwards;
}

.app-card:nth-child(1) { animation-delay: 0s; }
.app-card:nth-child(2) { animation-delay: 0.1s; }
.app-card:nth-child(3) { animation-delay: 0.2s; }
.app-card:nth-child(4) { animation-delay: 0.3s; }
.app-card:nth-child(5) { animation-delay: 0.4s; }
.app-card:nth-child(6) { animation-delay: 0.5s; }
.app-card:nth-child(7) { animation-delay: 0.6s; }
