:root {
    --max-width: 900px;
}

/* Manual dark/light override */
html.light-mode {
    --primary: #515b92;
    --on-primary: #ffffff;
    --primary-container: #dee0ff;
    --on-primary-container: #0b154b;
    --secondary: #5b5d72;
    --on-secondary: #ffffff;
    --secondary-container: #e0e1f9;
    --on-secondary-container: #181a2c;
    --tertiary: #77536d;
    --on-tertiary: #ffffff;
    --tertiary-container: #ffd7f1;
    --on-tertiary-container: #2d1228;
    --surface: #fbf8ff;
    --on-surface: #1b1b21;
    --surface-container: #efedf4;
    --surface-container-highest: #e4e1e9;
    --on-surface-variant: #46464f;
    --outline: #767680;
    --outline-variant: #c7c5d0;
    --shadow: #000000;
}

html.dark-mode {
    --primary: #bac3ff;
    --on-primary: #222c61;
    --primary-container: #394379;
    --on-primary-container: #dee0ff;
    --secondary: #c3c5dd;
    --on-secondary: #2d2f42;
    --secondary-container: #434659;
    --on-secondary-container: #e0e1f9;
    --tertiary: #e6bad7;
    --on-tertiary: #44263d;
    --tertiary-container: #5d3c55;
    --on-tertiary-container: #ffd7f1;
    --surface: #121318;
    --on-surface: #e4e1e9;
    --surface-container: #1f1f25;
    --surface-container-highest: #34343a;
    --on-surface-variant: #c7c5d0;
    --outline: #90909a;
    --outline-variant: #46464f;
    --shadow: #000000;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--surface);
    color: var(--on-surface);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    scroll-behavior: smooth;
}

header {
    /* translucent for light mode */
    background: color-mix(in srgb, var(--surface-container) 75%, transparent);
    backdrop-filter: blur(12px);
    /* Safari support */
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
    /* subtle separator */
    border-bottom: 1px solid color-mix(in srgb, var(--outline) 50%, transparent);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, border-bottom 0.3s ease;
}

header nav a {
    margin-right: 1rem;
    text-decoration: none;
    color: var(--on-surface-variant);
    font-weight: 500;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: var(--primary);
    transition: color 0.3s ease;
}

.theme-toggle {
    background: var(--surface-container);
    border: 1px solid var(--outline);
    color: var(--on-surface-variant);
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease, background-color 0.3s ease, color 0.3s ease, border 0.3s ease, border-color 0.3s ease;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
    transition: backbround 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

section {
    background-color: var(--surface-container);
    border-radius: 1rem;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--shadow) 10%, transparent);
    padding: 2rem;
    margin-bottom: 3rem;
    max-width: var(--max-width);
    width: 100%;
    transition: background-color 0.3s ease, border 0.3s ease, color 0.3s ease;
    scroll-margin-top: 80px;
}

h1,
h2 {
    color: var(--on-surface);
    line-height: 1.3;
    transition: color 0.3s ease;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

p {
    margin: 0.75rem 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--shadow) 25%, transparent);
    transition: box-shadow 0.3s ease;
}

.center {
    text-align: center;
}

.store-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.store-link {
    text-decoration: none !important;
    font-size: 0px;
}

.store-link-left {
    text-align: right !important;
    justify-self: end;
    margin-right: 1rem;
}

.store-link-right {
    text-align: left !important;
    justify-self: start;
    margin-left: 1rem;
}

.store-badge {
    height: min(10vw, 60px);
    width: auto;
}

.main-button {
    display: inline-block;
    background: var(--primary);
    color: var(--on-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    min-width: 240px;
    margin-top: 1rem;
    text-decoration: none;
    transition: background 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.main-button:hover {
    background: color-mix(in srgb, var(--primary) 85%, var(--surface) 15%);
}

hr {
    border: 0;
    border-top: 1px solid var(--outline);
    margin: 2rem 0;
    transition: border-top 0.3s ease, border-color 0.3s ease;
}

footer {
    text-align: center;
    color: var(--on-surface-variant);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}