/* ============================================================
   Mariner Studio Design System
   ============================================================ */

/* ---------- CSS Custom Properties (Light Theme) ---------- */
:root {
    --ms-purple: #8B5CF6;
    --ms-navy: #1e3c72;
    --ms-navy-light: #2a5298;
    --ms-charcoal: #1a1a2e;

    --background: #f5f5f5;
    --foreground: #1a1a2e;
    --card: #ffffff;
    --card-foreground: #1a1a2e;
    --primary: #6d28d9;
    --primary-foreground: #fafafa;
    --secondary: #f0ecf9;
    --secondary-foreground: #3b1f7a;
    --muted: #f0ecf9;
    --muted-foreground: #6b7280;
    --accent: #ede9fe;
    --accent-foreground: #3b1f7a;
    --destructive: #ef4444;
    --border: #e5e5e5;
    --input: #e5e5e5;
    --ring: #7c3aed;

    --radius: 0.625rem;
    --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Dark Theme ---------- */
.dark {
    --ms-purple: #a78bfa;
    --ms-navy: #3b82f6;
    --ms-navy-light: #60a5fa;
    --ms-charcoal: #1a1a2e;

    --background: #0f0f1a;
    --foreground: #f0f0f5;
    --card: #1a1a2e;
    --card-foreground: #f0f0f5;
    --primary: #a78bfa;
    --primary-foreground: #0f0f1a;
    --secondary: #2a2a3e;
    --secondary-foreground: #f0f0f5;
    --muted: #2a2a3e;
    --muted-foreground: #9ca3af;
    --accent: #2a2a3e;
    --accent-foreground: #f0f0f5;
    --destructive: #f87171;
    --border: rgba(255,255,255,0.1);
    --input: rgba(255,255,255,0.15);
    --ring: #7c3aed;
}

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

html {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s, color 0.2s;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ---------- Container ---------- */
.container-ms {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-ms { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .container-ms { padding-left: 2rem; padding-right: 2rem; }
}

.container-narrow {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-narrow { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .container-narrow { padding-left: 2rem; padding-right: 2rem; }
}

.container-md {
    max-width: 64rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-md { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .container-md { padding-left: 2rem; padding-right: 2rem; }
}

/* ---------- Navbar ---------- */
.navbar-ms {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid var(--border);
    background-color: var(--background);
    backdrop-filter: blur(8px);
}

.navbar-ms-inner {
    display: flex;
    align-items: center;
    height: 3.5rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .navbar-ms-inner { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
    .navbar-ms-inner { padding: 0 2rem; }
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1.5rem;
    color: var(--ms-navy);
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.dark .navbar-brand {
    color: var(--primary);
}

.navbar-brand svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--ms-navy);
}

.dark .navbar-brand svg {
    color: var(--primary);
}

.navbar-links {
    display: none;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

@media (min-width: 1024px) {
    .navbar-links { display: flex; }
}

.navbar-links a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.15s;
}

.navbar-links a:hover {
    color: var(--foreground);
}

.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Icon Button ---------- */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.15s;
    position: relative;
}

.btn-icon:hover {
    background-color: var(--accent);
}

.btn-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Theme toggle icon states */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
.dark .theme-toggle .icon-sun { display: none; }
.dark .theme-toggle .icon-moon { display: block; }

/* ---------- Mobile Menu ---------- */
.mobile-menu-btn {
    display: inline-flex;
}

@media (min-width: 1024px) {
    .mobile-menu-btn { display: none; }
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 51;
    width: 18rem;
    background-color: var(--card);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-sheet.active {
    transform: translateX(0);
}

.mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-sheet-header .navbar-brand {
    margin-right: 0;
}

.mobile-sheet-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    list-style: none;
}

.mobile-sheet-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.15s;
}

.mobile-sheet-nav a:hover {
    color: var(--foreground);
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: linear-gradient(135deg, var(--ms-navy), var(--ms-purple));
    padding: 5rem 1rem;
    text-align: center;
    color: #fff;
}

.dark .hero-section {
    background: var(--card);
    color: var(--foreground);
}

.hero-section h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .hero-section h1 { font-size: 3rem; }
}

.hero-section .hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* ---------- Buttons ---------- */
.btn-pill {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.15s;
    cursor: pointer;
    border: none;
}

.btn-pill:hover {
    opacity: 0.9;
}

.btn-pill-white {
    background: #fff;
    color: var(--ms-navy);
}

.dark .btn-pill-white {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-pill-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.dark .btn-pill-outline {
    border-color: var(--border);
    color: var(--foreground);
}

.btn-pill-navy {
    background: var(--ms-navy);
    color: #fff;
}

.dark .btn-pill-navy {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-pill-green {
    background: #34a853;
    color: #fff;
}

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

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    color: var(--foreground);
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-ghost:hover {
    background-color: var(--accent);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-outline:hover {
    background-color: var(--accent);
}

/* ---------- Cards ---------- */
.card-ms {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--card-foreground);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.card-ms-hover:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dark .card-ms-hover:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---------- Feature Card ---------- */
.feature-icon-wrap {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(139, 92, 246, 0.1);
    margin-bottom: 0.75rem;
}

.dark .feature-icon-wrap {
    background: rgba(167, 139, 250, 0.1);
}

.feature-icon-wrap svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--ms-purple);
}

.dark .feature-icon-wrap svg {
    color: var(--primary);
}

.feature-icon-wrap-sm {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
}

.feature-icon-wrap-sm svg {
    width: 1.25rem;
    height: 1.25rem;
}

.feature-icon-wrap-lg {
    width: 8rem;
    height: 8rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--card);
}

.feature-icon-wrap-lg svg {
    width: 3rem;
    height: 3rem;
    opacity: 0.3;
}

/* ---------- Section Heading ---------- */
.section-heading {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--ms-navy);
    text-align: center;
    margin-bottom: 2.5rem;
}

.dark .section-heading {
    color: var(--primary);
}

.section-heading-left {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--ms-navy);
    font-weight: 700;
}

.dark .section-heading-left {
    color: var(--primary);
}

/* ---------- Grid Layouts ---------- */
.grid-features {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-features { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-features-4 { grid-template-columns: repeat(4, 1fr); }
    .grid-features-3 { grid-template-columns: repeat(3, 1fr); }
}

.grid-conditions {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-conditions { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-conditions { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Alternating Feature Layout ---------- */
.feature-alt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .feature-alt {
        flex-direction: row;
    }
    .feature-alt.reversed {
        flex-direction: row-reverse;
    }
}

.feature-alt > div {
    flex: 1;
}

.feature-alt .feature-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Condition Item ---------- */
.condition-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    padding: 1rem;
}

/* ---------- Stacked Cards ---------- */
.stack-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---------- Section Backgrounds ---------- */
.section-py {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.section-muted {
    background: rgba(139, 92, 246, 0.03);
}

.dark .section-muted {
    background: rgba(167, 139, 250, 0.03);
}

/* ---------- Download CTA ---------- */
.download-cta {
    border-top: 1px solid var(--border);
    background: linear-gradient(90deg, var(--ms-navy), var(--ms-purple));
    padding: 3rem 1rem;
    text-align: center;
    color: #fff;
}

.dark .download-cta {
    background: var(--card);
    color: var(--foreground);
}

.download-cta h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.download-cta .cta-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.download-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 24rem;
    margin: 0 auto;
}

.download-cta-buttons .btn-pill {
    width: 100%;
}

/* ---------- Footer ---------- */
.footer-ms {
    border-top: 1px solid var(--border);
    background: rgba(139, 92, 246, 0.03);
}

.dark .footer-ms {
    background: rgba(167, 139, 250, 0.03);
}

.footer-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

@media (min-width: 640px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .footer-inner { padding: 1.5rem 2rem; }
}

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

.footer-links a {
    color: var(--muted-foreground);
    transition: color 0.15s;
}

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

/* ---------- Badge ---------- */
.badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--secondary);
    color: var(--secondary-foreground);
}

/* ---------- Prose (for blog/privacy content) ---------- */
.prose-ms h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--foreground);
}

.prose-ms p {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--foreground);
}

.prose-ms ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    list-style: disc;
}

.prose-ms li {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.7;
}

.prose-ms a {
    color: var(--ms-navy);
    text-decoration: underline;
}

.dark .prose-ms a {
    color: var(--primary);
}

.prose-ms strong {
    font-weight: 600;
}

/* ---------- Accordion ---------- */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--card);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s;
}

.accordion-trigger:hover {
    background-color: var(--accent);
}

.accordion-trigger svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s;
    color: var(--muted-foreground);
}

.accordion-item.open .accordion-trigger svg {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.open .accordion-content {
    max-height: 20rem;
}

.accordion-content-inner {
    padding: 0 1.25rem 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.7;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 28rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--card);
    color: var(--card-foreground);
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    text-align: center;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--foreground);
}

.modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-icon-wrap {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(30, 60, 114, 0.1);
    margin: 0 auto 1rem;
}

.dark .modal-icon-wrap {
    background: rgba(167, 139, 250, 0.1);
}

.modal-icon-wrap svg {
    width: 2rem;
    height: 2rem;
    color: var(--ms-navy);
}

.dark .modal-icon-wrap svg {
    color: var(--primary);
}

/* ---------- 404 Page ---------- */
.not-found-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 1rem;
    text-align: center;
}

.not-found-page h1 {
    font-size: 3.75rem;
    font-weight: 700;
    color: var(--ms-navy);
    margin-bottom: 0.5rem;
}

.dark .not-found-page h1 {
    color: var(--primary);
}

/* ---------- Blog Card ---------- */
.blog-card {
    display: block;
    transition: box-shadow 0.2s;
}

.blog-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dark .blog-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.blog-card:hover .blog-card-title {
    color: var(--ms-purple);
}

.dark .blog-card:hover .blog-card-title {
    color: var(--primary);
}

.blog-read-more {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ms-purple);
    margin-top: 0.75rem;
}

.dark .blog-read-more {
    color: var(--primary);
}

/* ---------- Screenshot Carousel ---------- */
.screenshot-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: var(--muted);
    aspect-ratio: 9 / 16;
    max-height: 20rem;
}

.screenshot-carousel .carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.screenshot-carousel .carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-carousel .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Carousel dot indicators */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0 0;
}

.carousel-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s, transform 0.2s;
}

.carousel-dot.active {
    background: var(--ms-purple);
    transform: scale(1.3);
}

.dark .carousel-dot.active {
    background: var(--primary);
}

/* ---------- Utility Classes ---------- */
.text-muted { color: var(--muted-foreground); }
.text-navy { color: var(--ms-navy); }
.dark .text-navy { color: var(--primary); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.main-content {
    flex: 1;
}
