/* ========================================
   ERICK Website - Stylesheet
   Soft pastel palette with light/dark themes
   ======================================== */

/* ---- Light theme (default) ---- */
:root,
[data-theme="light"] {
    --purple-primary: #9b8ec4;
    --purple-deep: #6650a4;
    --purple-dark: #381e72;
    --lavender: #c8bfe7;
    --lavender-light: #ece8f6;
    --peach: #f5c6aa;
    --peach-light: #fde8d8;
    --mint: #a8d8c8;
    --mint-light: #d4f0e7;
    --sky: #a3c4f3;
    --sky-light: #d4e4fb;
    --rose: #e8b4b8;
    --rose-light: #f5dfe1;
    --cream: #fdf6ee;
    --white: #ffffff;
    --text-primary: #2d2346;
    --text-secondary: #5a5072;
    --text-muted: #8a82a0;
    --border: #e0dce8;
    --card-bg: #ffffff;
    --nav-bg: rgba(253, 246, 238, 0.92);
    --section-alt-bg: #ffffff;
    --footer-bg: #381e72;
    --footer-text: rgba(255, 255, 255, 0.8);
}

/* ---- Dark theme (soft pastel) ---- */
[data-theme="dark"] {
    --purple-primary: #c4b5e3;
    --purple-deep: #bfa8e0;
    --purple-dark: #ddd0f2;
    --lavender: #6b5f8a;
    --lavender-light: #3e3658;
    --peach: #c09882;
    --peach-light: #4a3d34;
    --mint: #7aad98;
    --mint-light: #344a40;
    --sky: #7a9ac0;
    --sky-light: #354558;
    --rose: #b08388;
    --rose-light: #4a3a3c;
    --cream: #2a2438;
    --white: #322c44;
    --text-primary: #ede6f4;
    --text-secondary: #c8c0d6;
    --text-muted: #9a92b0;
    --border: #4a4462;
    --card-bg: #322c44;
    --nav-bg: rgba(42, 36, 56, 0.94);
    --section-alt-bg: #362f4a;
    --footer-bg: #241e34;
    --footer-text: rgba(255, 255, 255, 0.8);
}

:root {
    /* Layout */
    --max-width: 1100px;
    --nav-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    /* Base font size - adjustable by JS */
    --base-font-size: 16px;
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

/* Dyslexia font override */
body.dyslexia-font,
body.dyslexia-font * {
    font-family: "OpenDyslexic", "Comic Sans MS", cursive, sans-serif !important;
}

a {
    color: var(--purple-deep);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--purple-dark);
}

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

/* ---- Navigation ---- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: var(--nav-height);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--purple-dark);
}

.nav-logo img {
    height: 36px;
    width: auto;
}

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

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 2px;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--purple-deep);
    border-radius: 1px;
    transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--purple-deep);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ---- A11y Controls (nav bar) ---- */
.a11y-controls {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.a11y-btn {
    background: var(--lavender-light);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    line-height: 1;
}

.a11y-btn:hover {
    background: var(--lavender);
    transform: translateY(-1px);
}

.a11y-btn.active {
    background: var(--purple-deep);
    color: #fff;
    border-color: var(--purple-deep);
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* ---- Hero Section ---- */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 4rem;
    background: linear-gradient(170deg,
            var(--lavender-light) 0%,
            var(--cream) 50%,
            var(--peach-light) 100%);
    transition: background 0.3s;
}

.hero-logo {
    width: 140px;
    margin: 0 auto 1.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 80, 164, 0.18);
}

.btn-primary {
    background: var(--purple-deep);
    color: #fff;
}

.btn-primary:hover {
    color: #fff;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--purple-deep);
    border: 2px solid var(--purple-deep);
}

.btn-secondary:hover {
    color: var(--purple-dark);
    border-color: var(--purple-dark);
}

/* ---- Sections ---- */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section-alt {
    background: var(--section-alt-bg);
    transition: background 0.3s;
}

.section h2 {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--purple-dark);
    margin-bottom: 0.5rem;
}

.section .section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 640px;
}

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

.section-centered .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ---- Feature Cards ---- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.75rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(102, 80, 164, 0.1);
}

.feature-card .icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.section-alt .feature-card {
    background: var(--lavender-light);
    border-color: var(--lavender);
}

/* ---- How It Works ---- */
.steps {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    text-align: center;
    position: relative;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--lavender);
    color: var(--purple-dark);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 0.35rem;
}

.step p {
    font-size: 0.93rem;
    color: var(--text-secondary);
}

.step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -1.25rem;
    top: 1rem;
    font-size: 1.5rem;
    color: var(--lavender);
    font-weight: 700;
}

/* ---- Demo GIFs ---- */
.demo-section {
    text-align: center;
}

.demo-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.demo-item {
    max-width: 280px;
}

.demo-item img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.demo-item p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---- Open Source Banner ---- */
.oss-banner {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg,
            var(--lavender-light) 0%,
            var(--mint-light) 100%);
    border-radius: var(--radius);
    margin: 0 auto;
    max-width: var(--max-width);
    transition: background 0.3s;
}

.oss-banner h2 {
    color: var(--purple-dark);
    margin-bottom: 0.5rem;
}

.oss-banner p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

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

/* ---- Footer ---- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 2.5rem 1.5rem 1.5rem;
    font-size: 0.9rem;
    transition: background 0.3s;
}

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

.site-footer a:hover {
    color: #fff;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    list-style: none;
}

.footer-dev {
    margin-bottom: 1rem;
}

.footer-dev p {
    margin-bottom: 0.35rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.footer-copy {
    font-size: 0.82rem;
    opacity: 0.7;
}

/* ---- Privacy Policy & Legal Pages ---- */
.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.legal-page h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple-dark);
    margin-bottom: 0.25rem;
}

.legal-page .effective-date {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.legal-page h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.legal-page p,
.legal-page ul {
    font-size: 0.97rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.legal-page ul {
    padding-left: 1.5rem;
}

.legal-page ul li {
    margin-bottom: 0.4rem;
}

/* ---- Accessibility Page ---- */
.a11y-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.a11y-hero {
    text-align: center;
    padding: 4rem 1.5rem 3rem;
    background: linear-gradient(170deg,
            var(--mint-light) 0%,
            var(--cream) 50%,
            var(--sky-light) 100%);
    transition: background 0.3s;
}

.a11y-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin-bottom: 0.5rem;
}

.a11y-hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

.a11y-feature {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}

.a11y-feature:last-child {
    border-bottom: none;
}

.a11y-feature-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.75rem;
}

.a11y-feature-icon.colorblind {
    background: var(--peach-light);
}

.a11y-feature-icon.lefty {
    background: var(--sky-light);
}

.a11y-feature-icon.dyslexia {
    background: var(--mint-light);
}

.a11y-feature-icon.motor {
    background: var(--rose-light);
}

.a11y-feature-icon.custom {
    background: var(--lavender-light);
}

.a11y-feature-icon.chord {
    background: var(--peach-light);
}

.a11y-feature-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 0.4rem;
}

.a11y-feature-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Color palette swatches */
.palette-swatches {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.swatch-group {
    text-align: center;
}

.swatch-group span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.swatch-colors {
    display: flex;
    gap: 4px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.swatch {
    width: 28px;
    height: 28px;
}

/* Hypothetical note */
.hypothetical-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* Persona cards */
.personas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.persona-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: background 0.3s;
}

.persona-card .persona-name {
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 0.25rem;
}

.persona-card .persona-role {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.persona-card blockquote {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.93rem;
    border-left: 3px solid var(--lavender);
    padding-left: 0.75rem;
}



/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.85rem;
    }

    .hero .tagline {
        font-size: 1.05rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .step:not(:last-child)::after {
        content: "↓";
        position: static;
        display: block;
        margin: 0.5rem 0;
    }

    .a11y-feature {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--cream);
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 0.75rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .a11y-controls {
        order: -1;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .demo-item {
        max-width: 240px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 1rem 2.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero-logo {
        width: 100px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

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

    .a11y-controls {
        gap: 0.2rem;
    }

    .a11y-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }
}