/**
 * Markdown Lens Website Styles
 * Version: 1.0
 */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
    /* Colors */
    --color-primary: #3d7a9e;
    --color-primary-dark: #2d5a7e;
    --color-primary-light: #4a9bc4;

    --color-bg: #fafafa;
    --color-bg-alt: #f5f5f5;
    --color-card: #ffffff;
    --color-card-header: #f9fafb;

    --color-text: #333333;
    --color-text-dark: #1a1a1a;
    --color-text-light: #666666;
    --color-text-muted: #888888;

    --color-border: #e0e0e0;
    --color-border-light: #eeeeee;

    /* Gradients for card icons */
    --gradient-blue: linear-gradient(135deg, #3b82f6, #1d4ed8);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #6d28d9);
    --gradient-teal: linear-gradient(135deg, #14b8a6, #0d9488);
    --gradient-orange: linear-gradient(135deg, #f97316, #c2410c);
    --gradient-green: linear-gradient(135deg, #22c55e, #16a34a);
    --gradient-coral: linear-gradient(135deg, #f43f5e, #e11d48);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 16px;
    --line-height: 1.6;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-icon: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

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

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

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-dark);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: 600;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.container--narrow {
    max-width: 800px;
}

section {
    padding: var(--spacing-xl) 0;
}

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

.nav {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.nav__list {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.nav__link {
    font-weight: 500;
    color: var(--color-primary);
}

.nav__link:hover {
    text-decoration: underline;
}

.nav__link--active {
    color: var(--color-text);
}

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

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
}

.hero__icon-wrapper {
    flex-shrink: 0;
    padding-top: 14px;
}

.hero__icon {
    width: 150px;
    height: 150px;
}

.hero__content {
    flex-shrink: 0;
}

.hero__title {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.hero__tagline {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.hero__badge {
    display: inline-block;
    background: linear-gradient(135deg, #1e3a5f, #3d7a9e);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
}

/* App Store Badge */
.app-store-badge {
    display: inline-block;
}

.app-store-badge a {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.app-store-badge a:hover {
    text-decoration: none;
    opacity: 0.85;
}

.app-store-badge img {
    height: 40px;
    width: auto;
    display: block;
}

/* Hero responsive - stack on mobile */
@media (max-width: 640px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero__icon {
        width: 120px;
        height: 120px;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__tagline {
        font-size: 1.1rem;
    }

    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   Why Section
   ========================================================================== */

.why {
    background-color: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.why__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
}

.why__intro {
    font-size: 1.15rem;
    color: var(--color-text-light);
}

.why__grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--spacing-md);
}

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

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

.why__point {
    padding: var(--spacing-sm);
}

.why__point h3 {
    color: var(--color-primary-dark);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.why__point p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* ==========================================================================
   Feature Cards with Offset Icons
   ========================================================================== */

.features {
    padding: var(--spacing-xl) 0;
}

.features__header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
}

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

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

.card {
    position: relative;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: visible;
    transition: box-shadow var(--transition-normal);
    margin-bottom: var(--spacing-sm);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card__icon {
    position: absolute;
    top: 0;
    left: var(--spacing-sm);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 4px solid white;
    box-shadow: var(--shadow-icon);
    transform: translateY(-50%);
    z-index: 10;
    color: white;
}

.card__icon svg {
    width: 24px;
    height: 24px;
}

/* Icon color variants */
.card__icon--blue { background: var(--gradient-blue); }
.card__icon--purple { background: var(--gradient-purple); }
.card__icon--teal { background: var(--gradient-teal); }
.card__icon--orange { background: var(--gradient-orange); }
.card__icon--green { background: var(--gradient-green); }
.card__icon--coral { background: var(--gradient-coral); }

.card__header {
    background: var(--color-card-header);
    padding: var(--spacing-sm) var(--spacing-md);
    padding-top: calc(var(--spacing-sm) + 12px); /* Extra space for icon */
    border-bottom: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card__header h3 {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.card__body {
    padding: var(--spacing-md);
    color: var(--color-text-light);
}

.card__body p {
    font-size: 0.95rem;
    margin-bottom: var(--spacing-sm);
}

.card__list {
    padding-left: var(--spacing-md);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.card__list li {
    margin-bottom: 4px;
}

.card__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
}

.card__link:hover {
    text-decoration: none;
    color: var(--color-primary-dark);
}

/* ==========================================================================
   Screenshots Gallery
   ========================================================================== */

.screenshots {
    padding: var(--spacing-xl) 0;
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.screenshots__header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.screenshot-item {
    margin-bottom: var(--spacing-lg);
    scroll-margin-top: var(--spacing-lg);
}

.screenshot-item:last-child {
    margin-bottom: 0;
}

.screenshot-item__label {
    text-align: center;
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.screenshot-item__image {
    max-width: 900px;
    margin: 0 auto;
}


/* ==========================================================================
   FAQ / Support
   ========================================================================== */

.support {
    padding: var(--spacing-xl) 0;
}

.support__header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.faq {
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
}

.faq details {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
}

.faq summary {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--color-text-dark);
    background-color: var(--color-bg-alt);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    font-size: 1.25rem;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details[open] summary {
    border-bottom: 1px solid var(--color-border-light);
}

.faq__answer {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.faq__answer p:last-child {
    margin-bottom: 0;
}

/* Contact */
.contact {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.contact h3 {
    margin-bottom: var(--spacing-sm);
}

.contact p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

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

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

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

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

/* CTA Button Group */
.cta-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
}

.cta-buttons .app-store-badge img {
    height: 48px;
    width: auto;
}

.cta-buttons__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 187px;
    height: 48px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: background var(--transition-fast);
}

.cta-buttons__btn:hover {
    text-decoration: none;
}

.cta-buttons__btn--primary {
    background: var(--color-primary);
    color: white;
}

.cta-buttons__btn--primary:hover {
    background: var(--color-primary-dark);
}

.cta-buttons__btn--secondary {
    background: var(--color-primary);
    color: white;
}

.cta-buttons__btn--secondary:hover {
    background: var(--color-primary-dark);
}

@media (max-width: 640px) {
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   Content (Privacy, Getting Started)
   ========================================================================== */

.content {
    background: var(--color-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.content h2 {
    font-size: 1.3rem;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.content ul, .content ol {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md);
}

.content li {
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
}

.content .last-updated {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

/* Sample Files Download */
.sample-files {
    text-align: center;
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
}

/* Keyboard shortcuts table */
.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
}

.shortcuts-table th,
.shortcuts-table td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.shortcuts-table th {
    font-weight: 600;
    color: var(--color-text-dark);
    background: var(--color-card-header);
}

.shortcuts-table kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

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

.footer {
    text-align: center;
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-lg);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer p:last-child {
    margin-bottom: 0;
}

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

.footer__links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.footer__links a {
    color: var(--color-primary);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

@media (max-width: 640px) {
    h1, .hero__title {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero__tagline {
        font-size: 1.1rem;
    }

    .nav__list {
        justify-content: center;
    }

    .content {
        padding: var(--spacing-md);
    }

    section {
        padding: var(--spacing-lg) 0;
    }
}

/* ==========================================================================
   Version 2.0 Elements
   ========================================================================== */

/* Nav: Right-justified bold green "New in Version 2.0!" link */
.nav__list {
    position: relative;
}

.nav__link--v2 {
    color: #16a34a;
    font-weight: 700;
    margin-left: auto;
}

.nav__link--v2:hover {
    color: #15803d;
}

/* Hero: Button row (App Store badge + v2 announcement side-by-side) */
.hero__buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.hero__buttons .app-store-badge img {
    height: 48px;
    width: auto;
}

/* Hero: v2 announcement button with tooltip */
.coming-soon-wrapper {
    position: relative;
    display: inline-block;
}

.coming-soon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 48px;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-sizing: border-box;
    background: #15803d;
    color: white;
    transition: background var(--transition-fast);
}

.coming-soon-btn:hover {
    background: #16a34a;
    text-decoration: none;
    color: white;
}

.coming-soon-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: linear-gradient(135deg, #64748b, #7d8da1);
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    width: 340px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 100;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Tooltip arrow */
.coming-soon-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #7d8da1;
}

.coming-soon-wrapper:hover .coming-soon-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.coming-soon-tooltip strong {
    color: #4ade80;
    font-weight: 600;
}

.coming-soon-tooltip p {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
}

.coming-soon-tooltip p:last-child {
    margin-bottom: 0;
}

/* V2 Page Styles */
.v2-page section {
    padding: 30px 0;
}

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

.v2-hero__badge {
    display: inline-block;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.v2-hero__title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.v2-hero__subtitle {
    font-size: 1.15rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* V2 Features Image */
.v2-features-image {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.v2-features-image img {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* V2 Video Section */
.v2-videos {
    margin-bottom: var(--spacing-xl);
}

.v2-videos__header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.v2-videos__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    max-width: 800px;
    margin: 0 auto;
}

.v2-video-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: box-shadow var(--transition-normal);
}

.v2-video-card:hover {
    box-shadow: var(--shadow-lg);
}

.v2-video-card video {
    width: 100%;
    display: block;
}

.v2-video-card__info {
    padding: var(--spacing-sm) var(--spacing-md);
}

.v2-video-card__title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.v2-video-card__desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* V2 Feature Highlights */
.v2-highlights {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

@media (min-width: 640px) {
    .v2-highlights {
        grid-template-columns: 1fr 1fr;
    }
}

.v2-highlight {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md);
}

.v2-highlight__icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.v2-highlight h3 {
    color: var(--color-primary-dark);
    margin-bottom: var(--spacing-xs);
}

.v2-highlight p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.v2-highlight ul {
    color: var(--color-text-light);
    font-size: 0.95rem;
    padding-left: var(--spacing-md);
    margin-bottom: 0;
}

.v2-highlight li {
    margin-bottom: 4px;
}

/* V2 CTA */
.v2-cta {
    text-align: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.v2-cta p {
    color: var(--color-text-light);
    max-width: 500px;
    margin: 0 auto var(--spacing-md);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .nav,
    .hero__badge,
    .app-store-badge,
    .card__link,
    .btn {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
