/* DyslexiaAway Website Styles - Cleaned & Optimized */
:root {
    /* Light theme (default) */
    --primary-color: #0d8fd8;
    /* Slightly stronger, more saturated blue */
    --primary-hover: #0278b3;
    /* Adjusted hover */
    --primary-active: #025d8f;
    /* Adjusted active */
    --primary-color-subtle: rgb(93, 123, 154);
    /* Subtle link color - between text and primary */
    --text-color: #1f2937;
    --text-light: #4b5563;
    --bg-color: #fefcf5;
    --container-width: 1000px;
    --transition: all 0.2s ease-out;

    /* Firefox button color */
    --firefox-color: #FF7139;

    /* Shadow colors */
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --shadow-subtle: rgba(0, 0, 0, 0.1);

    /* Particle colors - using darker blue for light theme */
    --particle-color: rgba(4, 56, 104, 0.3);
    /* Darker blue (#0d64b4) with good opacity for light theme */
    --particle-connection-color: rgba(4, 56, 104, 0.2);
    /* Darker blue connections for light theme */
    /* UI colors */
    --border-color: #d1d5db;
    --card-bg: rgba(248, 248, 248, 0.7);
    /* Slightly darker white */
    --card-border: #e5e7eb;

    /* Component backgrounds - light theme */
    --nav-initial: rgba(242, 242, 242, 0.2);
    /* Slightly darker with blur effect */
}

/* Dark theme */
[data-theme="dark"] {
    --text-color: #b1b1b1;
    --text-light: #ccc;
    --bg-color: #181818;
    --border-color: #404040;
    --card-bg: rgba(42, 42, 42, 0.7);
    --card-border: #3a3a3a;
    --particle-color: rgba(150, 200, 230, 0.3);
    /* Subtle light blue (#96c8e6) with lower opacity for dark theme */
    --particle-connection-color: rgba(150, 200, 230, 0.2);
    /* Subtle light blue connections for dark theme */
    --primary-color-subtle: #8fa9c7;
    /* Subtle link color for dark theme */

    /* Component backgrounds - dark theme */
    --nav-initial: rgba(42, 42, 42, 0.4);
}

/* System preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --text-color: #b1b1b1;
        --text-light: #ccc;
        --bg-color: #181818;
        --border-color: #404040;
        --card-bg: rgba(42, 42, 42, 0.7);
        --card-border: #3a3a3a;
        --particle-color: rgba(150, 200, 230, 0.3);
        --particle-connection-color: rgba(150, 200, 230, 0.2);
        --nav-initial: rgba(42, 42, 42, 0.4);
    }
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    line-height: 1.5;
}


body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    padding-top: 4rem;
    max-width: var(--container-width);
    margin: 0 auto !important;
}

/* Background layers */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: var(--bg-color);
    z-index: -2;
    transition: background-color 0.5s ease;
}

#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: var(--container-width);
    margin: 0 auto;
}

main {
    padding-inline: 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
    padding-inline: 2rem;
    background: var(--nav-initial);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    min-width: fit-content;
}

nav.scrolled {
    background: var(--bg-color);
    box-shadow: 0 10px 10px var(--shadow-light),
        0 0 10px rgba(13, 143, 216, 0.2);
    /* Slight glow */
    border-bottom: 2px solid rgba(13, 143, 216, 0.6);
    /* Slightly bigger and more visible */
}

[data-theme="dark"] nav.scrolled {
    box-shadow: 0 2px 10px var(--shadow-dark),
        0 0 10px rgba(13, 143, 216, 0.25);
    border-bottom: 2px solid rgba(13, 143, 216, 0.7);
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

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

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

/* Theme toggle */
.theme-toggle-button {
    cursor: pointer;
    border-radius: 50%;
    padding: 0.5rem;
    transition: var(--transition);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    width: 2rem;
    height: 2rem;
    margin-left: 1rem;
    color: var(--text-color);
    position: relative;
}

.theme-icon {
    display: none;
    color: currentColor;
    transition: color 0.5s ease, transform 0.5s ease;
    width: 2rem;
    height: 2rem;
}

[data-theme="light"] .theme-icon.light,
[data-theme="dark"] .theme-icon.dark {
    display: block;
}

:root:not([data-theme]) .theme-icon.light {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-icon.light {
        display: none;
    }

    :root:not([data-theme]) .theme-icon.dark {
        display: block;
    }
}

/* Mobile navigation */
.burger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    z-index: 1001;
    padding: 0.5rem;
    color: var(--text-color);
    user-select: none;
}

.nav-svg {
    width: 2rem;
    height: 2rem;
    stroke: currentColor;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform var(--transition);
}

.burger-menu[aria-expanded="true"] .nav-svg {
    transform: rotate(45deg);
}

.nav-svg-line {
    stroke: var(--text-color);
    stroke-width: 12;
    stroke-dasharray: 60 31 60 300;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger-menu[aria-expanded="true"] .nav-svg-line {
    stroke-dasharray: 60 105 60 300;
    stroke-dashoffset: -90;
}

/* Sections */
section {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
    scroll-margin-top: 4rem;
}

#hero {
    min-height: calc(100dvh - 4rem);
    display: flex;
    align-items: center;
}

.hero-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
    justify-content: space-around;
}

.hero-content {
    flex: 2;
    text-align: center;
}

.hero-visual {
    flex: 1;
    text-align: center;
}

.hero-visual img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 5px 10px var(--shadow-subtle);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0.8;
}

.scroll-chevron {
    width: 3rem;
    height: 3rem;
    color: var(--text-color);
    animation: float 2s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(0.5rem);
    }
}


/* Typography */
h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

/* Buttons & CTA */
.cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.btn-store {
    align-items: center;
    padding: 0.9rem 1.6rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.btn-store.firefox {
    background-color: var(--firefox-color);
}

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

.feature-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--card-border);
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.feature-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.feature-card .github-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.feature-card .github-link svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* Content boxes */
.content-box {
    max-width: 750px;
    margin: 0 auto;
}

.content-box h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-content {
    max-width: var(--container-width);
    margin: 0 auto;
}

.sample-image {
    margin-top: 4rem;
    text-align: center;
}

.sample-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 5px 10px var(--shadow-subtle);
}

/* Image fade-in animation */
.fade-img {
    opacity: 0;
    transition: var(--transition);
}

.fade-img.loaded {
    opacity: 1;
}

/* Footer */
footer {
    padding: 2rem;
    color: var(--text-light);
    font-size: 1rem;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    text-align: center;
}

.footer-links a {
    color: var(--primary-color-subtle);
    text-decoration: none;
    margin-left: 1rem;
    transition: var(--transition);
}

.author-link {
    color: var(--primary-color-subtle);
    text-decoration: none;
    transition: var(--transition);
    font-style: italic;
}

/* Interactive states */
@media (hover: hover) {
    .nav-links a:hover {
        color: var(--primary-color);
    }

    .theme-toggle-button:hover {
        transform: scale(1.1);
        color: var(--primary-color);
    }

    .btn-store:hover {
        transform: translateY(-1px);
        filter: brightness(1.1);
    }

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

    .feature-card .github-link:hover {
        color: var(--primary-hover);
    }

    .footer-links a:hover,
    .author-link:hover {
        color: var(--primary-color);
    }
}

.nav-links a:active,
.feature-card .github-link:active,
.footer-links a:active,
.author-link:active {
    color: var(--primary-active);
}

.theme-toggle-button:active {
    transform: scale(0.95);
    color: var(--primary-active);
}

.btn-store:active {
    transform: translateY(0);
    filter: brightness(0.9);
}

.btn-store.chrome:active {
    background-color: var(--primary-active);
}

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

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-container {
        flex-direction: column;
        gap: 2rem;
    }

    main {
        padding-inline: 1rem;
    }

    nav {
        padding-inline: 1rem;
        padding-right: 0.5rem;
        width: calc(100% - 12px);
    }


    .logo {
        font-size: 1.1rem;
    }

    .burger-menu {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -6px;
        width: 100%;
        max-width: 250px;
        height: 100dvh;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 4rem;
        padding-left: 1rem;
        gap: 1rem;
        transform: translateX(100%);
        transition: transform 0.3s ease, visibility 0.3s ease;
        z-index: 100;
        box-shadow: 0 0 8px var(--shadow-subtle);
        border-top-left-radius: 1.25rem;
        border-bottom-left-radius: 1.25rem;
        border-left: 2px solid rgba(255, 255, 255, 0.1);
        /* Delimiter line */
        overflow: hidden;
        background: var(--bg-color);
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible !important;
    }

    .nav-links a {
        margin: 0;
        font-size: 1.2rem;
        padding: 0.5rem 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links .theme-toggle-button {
        margin-left: auto;
        margin-top: auto;
        margin-bottom: 1.5rem;
        margin-right: 1.5rem;
    }

    section {
        padding: 3rem 0;
    }

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

    .feature-card {
        padding: 1.25rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links a {
        margin: 0 0.75rem;
    }

    .btn-store {
        padding: 0.5rem 1rem;
    }

    .scroll-indicator {
        display: none;
    }
}