/* LUCA Free License Website Styles */

/* ── Design tokens ── */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --background-color: #ecf0f1;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --code-background: #f8f9fa;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --nav-height: 64px;
    --radius: 10px;
    --transition: 0.3s ease;
    /* Hamburger: height(20px) / 2 - bar-height(3px) / 2 = 8.5px */
    --hamburger-offset: 8.5px;
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1e27;
        --card-background: #242836;
        --text-color: #e0e6f0;
        --text-light: #9aa5b4;
        --border-color: #3a4256;
        --code-background: #1e2330;
        --shadow: 0 2px 10px rgba(0,0,0,0.4);
        --shadow-hover: 0 4px 20px rgba(0,0,0,0.5);
    }
}

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

/* ── Base ── */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* ── Skip-to-content ── */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: bold;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ── Focus styles ── */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* ── Header / Nav ── */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

nav {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition);
}

nav a:hover,
nav a[aria-current="page"] {
    opacity: 0.8;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ── Hamburger button ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: transform var(--transition), opacity var(--transition);
    transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(var(--hamburger-offset)) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(calc(-1 * var(--hamburger-offset))) rotate(-45deg);
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero .subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero .tagline {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: bold;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}

.hero-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 2px solid transparent;
}

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

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

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

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

/* ── Main content wrapper ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .section-title {
        color: var(--text-color);
    }
}

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

/* ── Cards ── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

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

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

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

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ── Features ── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1.5rem;
}

.feature {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    border-inline-start: 4px solid var(--primary-color);
}

.feature h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature.success {
    border-inline-start-color: var(--success-color);
}

.feature.success h4 {
    color: var(--success-color);
}

/* ── Two-column responsive grid ── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* ── Comparison Table ── */
.table-container {
    overflow-x: auto;
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

tr:hover {
    background: var(--code-background);
}

/* ── Code blocks ── */
pre {
    background: var(--code-background);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    border-inline-start: 4px solid var(--primary-color);
    margin: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

code {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    background: var(--code-background);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

pre code {
    background: none;
    padding: 0;
}

/* ── License text ── */
.license-text {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.8;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Badges ── */
.badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    justify-content: center;
    align-items: center;
}

.badge {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* ── FAQ ── */
.faq-item {
    background: var(--card-background);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

.faq-item strong {
    color: var(--accent-color);
}

/* ── Footer ── */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 2rem;
}

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

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

.footer-section li + li {
    margin-top: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ── Utility classes ── */
.text-center { text-align: center; }
.mt-2        { margin-top: 2rem; }
.mb-2        { margin-bottom: 2rem; }

.highlight {
    color: var(--accent-color);
    font-weight: bold;
}

.success-text {
    color: var(--success-color);
}

/* ── Scroll-triggered animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out both;
}

.fade-in-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: none;
}

/* ── Check / Cross icons ── */
.icon-check::before { content: "✅ "; }
.icon-cross::before { content: "❌ "; }
.icon-info::before  { content: "ℹ️ "; }

/* ── Reduced motion ── */
@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;
    }

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

/* ── Tablet breakpoint ── */
@media (max-width: 1024px) {
    .cards {
        grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    }
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {
    /* Hamburger visible, nav hidden behind overlay */
    .hamburger {
        display: flex;
    }

    #nav-menu {
        position: fixed;
        inset-block-start: var(--nav-height);
        inset-inline-end: 0;
        width: min(280px, 90vw);
        height: calc(100dvh - var(--nav-height));
        background: var(--secondary-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 0.25rem;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--transition);
        box-shadow: -4px 0 20px rgba(0,0,0,0.25);
    }

    #nav-menu.open {
        transform: translateX(0);
    }

    #nav-menu li {
        width: 100%;
    }

    #nav-menu a {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 6px;
        font-size: 1.1rem;
    }

    #nav-menu a:hover {
        background: rgba(255,255,255,0.1);
        opacity: 1;
    }

    /* Layout */
    .two-col-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 2.5rem 1.25rem;
    }

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

    .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .container {
        padding: 2rem 1.25rem;
    }

    .table-container {
        padding: 1rem;
    }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
    nav {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .hero .tagline {
        padding: 0.75rem 1rem;
    }

    .cards {
        gap: 1rem;
    }

    .features {
        gap: 1rem;
    }
}
