:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
}

html {
    scroll-padding-top: 80px;
}

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

/* Header & Navigation */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* space-between alone lets the wrapped nav links touch the wordmark
       on narrow screens; guarantee a minimum gutter */
    gap: 1.25rem;
}

.nav-brand h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* the whole logo (icon + wordmark) is the way back home */
.nav-brand h1 a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: inherit;
    text-decoration: none;
}

.nav-brand h1 a::before {
    content: "";
    display: inline-block;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    background: url("mergeraw-icon.png") center / contain no-repeat;
}

.brand-wordmark {
    display: block;
    height: 2rem;
    width: auto;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Nav dropdown (Bonuses) */
.nav-dropdown {
    position: relative;
    /* bridge the gap under the trigger so the pointer can travel into the
       menu without the hover state dropping out */
    padding-bottom: 0.75rem;
    margin-bottom: -0.75rem;
}

.nav-dropdown > a::after {
    content: "";
    display: inline-block;
    margin-left: 0.35rem;
    vertical-align: 0.15em;
    border: 0.3em solid transparent;
    border-bottom: 0;
    border-top-color: currentColor;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 14rem;
    list-style: none;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    padding: 0.4rem 0;
    z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    font-weight: 400;
}

.nav-dropdown-menu a:hover {
    background: var(--bg-light);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Subpages end the hero at the lead -- no trailing gap above the band's edge */
.hero .lead:last-child {
    margin-bottom: 0;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--bg-light);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
    text-align: center;
}

.section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Intro Text */
.intro-with-screenshot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.intro-text p {
    margin-bottom: 1.5rem;
}

.intro-screenshot {
    position: sticky;
    top: 100px;
    text-align: center;
}

.intro-screenshot .screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
    display: inline-block;
}

.intro-screenshot .caption {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    font-size: 0.9rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Screenshot Showcase */
.screenshot-showcase {
    margin: 3rem 0;
    text-align: center;
}

.screenshot-showcase h3 {
    margin-bottom: 1.5rem;
}

.screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
}

.caption {
    color: var(--text-light);
    font-style: italic;
}

/* Customer Quotes */
.section-quotes {
    background: #eff6ff;
}

.quotes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1050px;
    margin: 0 auto;
}

/* An odd number of quotes leaves the last one alone on its row; center it
   at the same width as the others instead of hugging the left column. */
.quote-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 1rem);
    margin-inline: auto;
}

.quote-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    line-height: 1.7;
}

.quote-card p {
    margin-bottom: 1rem;
}

/* Credit links stay as quiet as the attribution they sit in -- underlined
   so they read as links, but not competing with the quote itself. */
.quote-attribution a {
    color: inherit;
    text-decoration: underline;
}

.quote-attribution a:hover {
    color: var(--primary-color);
}

.quote-attribution {
    background: var(--bg-light);
    color: var(--text-light);
    font-style: italic;
    line-height: 1.4;
    padding: 0.4rem 0.75rem;
    border-radius: 0.25rem;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.tool-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Under the Hood (boxes, same style as the FAQ) */
.hood-grid {
    max-width: 900px;
    margin: 0 auto;
}

.hood-item {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.hood-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hood-screenshot {
    text-align: center;
    margin-top: 1.5rem;
}

.hood-screenshot .screenshot {
    margin-bottom: 0;
}

/* Download Box */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

/* Inside the grid, the gap provides the spacing and the boxes stretch to
   equal height; center the shorter download box's content vertically. */
.download-grid .download-box {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.download-box {
    background: white;
    padding: 3rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.download-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.release-date {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-note {
    margin-top: 1rem;
    color: var(--text-light);
}

.download-links {
    margin-top: 1.5rem;
}

.download-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 0.5rem;
}

.download-links a:hover {
    text-decoration: underline;
}

.recent-changes {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.recent-changes h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.recent-changes ul {
    list-style-position: inside;
}

.recent-changes li {
    margin-bottom: 0.5rem;
}

.recent-changes ul ul {
    margin-top: 0.5rem;
    margin-left: 1.25rem;
}

.recent-changes ul ul li {
    margin-bottom: 0.25rem;
}

/* Install Steps */
.install-steps {
    max-width: 800px;
    margin: 0 auto;
}

.install-step {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    margin-bottom: 0.5rem;
}

.install-link {
    text-align: center;
    margin-top: 2rem;
}

.install-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.install-link a:hover {
    text-decoration: underline;
}

/* FAQ */
.faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Contact */
#contact {
    text-align: center;
}

#contact p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-info {
    font-weight: 600;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Footer */
body > footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

body > footer a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
}

body > footer a:hover {
    text-decoration: underline;
}

body > footer .attribution {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

body > footer .attribution a {
    margin: 0;
    text-decoration: underline;
}

/* Installation Page Specific */
.install-methods {
    max-width: 900px;
    margin: 0 auto;
}

.install-method {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.install-method h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.install-method h4 {
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

.install-method ol, .install-method ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.install-method li {
    margin-bottom: 0.75rem;
}

.install-method code, .install-method strong {
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

.path-box {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.path-box h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 1rem;
}

.path-box .path {
    display: block;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    border: 1px solid var(--border-color);
    color: var(--primary-dark);
}

.path-note {
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.install-tip {
    background: #fffbeb;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0.25rem;
    font-size: 0.95rem;
}

.install-screenshot {
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.install-screenshot .screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Changelog Specific */
.changelog-entry {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.changelog-entry h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.changelog-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.changelog-entry ul {
    list-style-position: inside;
}

.changelog-entry li {
    margin-bottom: 0.5rem;
}

/* Remove Profile Page Specific */
.content-box {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.content-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.content-box h3:first-child {
    margin-top: 0;
}

.content-box h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.content-box p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-box .screenshot-showcase {
    margin: 2rem 0;
}

.content-box .screenshot-showcase .screenshot {
    max-width: 50%;
}

.content-box .screenshot-showcase .screenshot-large {
    max-width: 65%;
}

.feature-list {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.feature-list li {
    margin-bottom: 0.5rem;
}

.how-to-list {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.how-to-list li {
    margin-bottom: 0.75rem;
}

.note {
    background: #fffbeb;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 0.25rem;
}

/* Before/After Comparison Animation */
.comparison-container {
    margin: 2rem 0;
    text-align: center;
}

.comparison-wrapper {
    position: relative;
    display: inline-block;
    max-width: 50%;
}

.comparison-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Shadow lives on the base (in-flow) image only. The overlay images are
   positioned directly on top, so giving them their own shadow would stack a
   second shadow layer on top of the base's whenever they fade in, doubling
   the density at the edges. */
.comparison-before,
.comparison-a {
    display: block;
    box-shadow: var(--shadow-lg);
}

.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeToggle 2s infinite;
}

@keyframes fadeToggle {
    0%, 45% {
        opacity: 0;
    }
    50%, 95% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.comparison-label {
    margin-top: 1rem;
    color: var(--text-light);
    font-style: italic;
}

.label-before {
    color: var(--accent-color);
    font-weight: 600;
}

.label-after {
    color: var(--primary-color);
    font-weight: 600;
}

/* Three-image comparison loop */
.comparison-b {
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeToggleB 6s infinite;
}

.comparison-c {
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeToggleC 6s infinite;
}

@keyframes fadeToggleB {
    0%, 30% {
        opacity: 0;
    }
    33%, 63% {
        opacity: 1;
    }
    66%, 100% {
        opacity: 0;
    }
}

@keyframes fadeToggleC {
    0%, 63% {
        opacity: 0;
    }
    66%, 96% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.label-a, .label-b, .label-c {
    font-weight: 600;
}

.label-a {
    color: var(--accent-color);
}

.label-b {
    color: var(--primary-color);
}

.label-c {
    color: var(--accent-color);
}

/* CTA Box */
.cta-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-box p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.cta-box .install-link {
    margin-top: 1rem;
}

/* Tool Card Button */
.tool-card .btn {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

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

    .hero .lead {
        font-size: 1rem;
    }

    .intro-with-screenshot {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .intro-screenshot {
        position: static;
    }

    .features-grid,
    .tools-grid,
    .quotes-grid,
    .download-grid {
        grid-template-columns: 1fr;
    }

    /* Single column here, so the lone-last-quote centering above would
       squeeze that card to half the screen width. */
    .quote-card:last-child:nth-child(odd) {
        max-width: none;
    }

    .install-step {
        flex-direction: column;
        gap: 1rem;
    }

    .step-number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }

    .comparison-wrapper {
        max-width: 100%;
    }

    .content-box .screenshot-showcase .screenshot {
        max-width: 100%;
    }

    .content-box .screenshot-showcase .screenshot-large {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* a centered menu overflows the viewport at this width */
    .nav-dropdown-menu {
        left: auto;
        right: 0;
        transform: none;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Keep the star-trail workflow comparison readable on narrow screens. */
.table-responsive {
    overflow-x: auto;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    text-align: left;
}
.comparison-table th,
.comparison-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.comparison-table th {
    background: var(--bg-light);
}
