/* CSS Variables */
:root {
    --purple: #8b6a9e;
    --gold: #c9a06b;
    --teal: #5a9e91;
    --slate: #4a5568;

    --bg: #faf9f7;
    --bg-card: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e8e6e3;

    color-scheme: light dark;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1a1a2e;
        --bg-card: #252540;
        --text: #e2e2e2;
        --text-light: #a0a0a0;
        --border: #3a3a50;
        --slate: #2d2d44;
    }
}

[data-theme="dark"] {
    --bg: #1a1a2e;
    --bg-card: #252540;
    --text: #e2e2e2;
    --text-light: #a0a0a0;
    --border: #3a3a50;
    --slate: #2d2d44;
}

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Source Sans 3",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--slate);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
}

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

/* Header */
header {
    background: var(--slate);
    color: white;
    padding: 4rem 1.5rem 5rem;
    text-align: center;
}

header img {
    width: 140px;
    height: 140px;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Main content */
main {
    max-width: 640px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

/* About section */
.about {
    margin-bottom: 3rem;
}

.about p {
    font-size: 1.125rem;
    color: var(--text-light);
    text-align: center;
}

/* Tech tags */
.technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.tech-tag {
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.tech-tag.purple {
    background: var(--purple);
    color: white;
}

.tech-tag.teal {
    background: var(--teal);
    color: white;
}

.tech-tag.gold {
    background: var(--gold);
    color: white;
}

/* Apps section */
.apps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apps h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-card img {
    width: auto;
    height: 72px;
    max-width: 72px;
    border-radius: 16px;
    flex-shrink: 0;
    object-fit: contain;
}

.app-card-link {
    text-decoration: none;
    color: inherit;
}

.app-icon-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.app-icon-box {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-icon-box img {
    max-width: 72px;
    max-height: 72px;
    width: auto;
    height: 72px;
    border-radius: 0;
}

.app-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.app-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.app-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.app-tag {
    background: var(--bg);
    color: var(--text-light);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Contact section */
.contact {
    margin-top: 3rem;
}

.contact h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.contact-links a {
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.contact-links a:hover {
    text-decoration: underline;
    transform: translateY(-1px);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer a {
    color: var(--purple);
    text-decoration: none;
}

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

/* Privacy page specific styles */
.privacy-header {
    padding: 3rem 1.5rem;
}

.privacy-header h1 {
    margin-bottom: 0.5rem;
}

.back-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    color: white;
    text-decoration: underline;
}

.privacy-main {
    max-width: 680px;
    padding: 2.5rem 1.5rem 4rem;
}

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

.intro {
    margin-bottom: 2.5rem;
}

.intro p {
    color: var(--text-light);
}

.privacy-main section {
    margin-bottom: 2.5rem;
}

.privacy-main section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.privacy-main section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--text);
}

.privacy-main section p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.privacy-main section ul {
    color: var(--text-light);
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.privacy-main section li {
    margin-bottom: 0.35rem;
}

.privacy-main section a {
    color: var(--purple);
    text-decoration: none;
}

.privacy-main section a:hover {
    text-decoration: underline;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.2s ease;
}

/* Light mode: show moon icon */
.theme-toggle .icon-moon { opacity: 1; color: #1a1a2e; }
.theme-toggle .icon-sun { opacity: 0; color: #c9a06b; }

/* Dark mode (explicit): show sun icon */
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; }

/* Dark mode (system preference, no override): show sun icon */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 0; }
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { opacity: 1; }
}

/* Mobile */
@media (max-width: 500px) {
    header {
        padding: 3rem 1.5rem 4rem;
    }

    header img {
        width: 110px;
        height: 110px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .app-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .app-tags {
        justify-content: center;
    }

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

    .privacy-header {
        padding: 2rem 1.5rem;
    }

    .privacy-header h1 {
        font-size: 1.5rem;
    }

    .privacy-main {
        padding: 2rem 1rem 3rem;
    }
}
