:root {
    color-scheme: light;
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-strong: #047857;
    --accent-soft: #d1fae5;
    --accent-ink: #064e3b;
    --background: #f8faf9;
    --glow: rgba(16, 185, 129, 0.14);
    --surface: rgba(255, 255, 255, 0.94);
    --surface-muted: #f1f5f3;
    --border: #d9e3df;
    --text: #17211e;
    --muted: #5d6b66;
    --danger-background: #fef2f2;
    --danger-text: #991b1b;
    --button-text: #fff;
    --shadow: 0 1.5rem 4rem rgba(6, 78, 59, 0.1);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --accent-hover: #10b981;
    --accent-strong: #34d399;
    --accent-soft: #063f32;
    --accent-ink: #a7f3d0;
    --background: #09110f;
    --glow: rgba(16, 185, 129, 0.12);
    --surface: rgba(17, 29, 25, 0.96);
    --surface-muted: #16241f;
    --border: #2b3d37;
    --text: #edf6f2;
    --muted: #aab9b3;
    --danger-background: #3b171a;
    --danger-text: #fecaca;
    --button-text: #022c22;
    --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.34);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --accent-hover: #10b981;
        --accent-strong: #34d399;
        --accent-soft: #063f32;
        --accent-ink: #a7f3d0;
        --background: #09110f;
        --glow: rgba(16, 185, 129, 0.12);
        --surface: rgba(17, 29, 25, 0.96);
        --surface-muted: #16241f;
        --border: #2b3d37;
        --text: #edf6f2;
        --muted: #aab9b3;
        --danger-background: #3b171a;
        --danger-text: #fecaca;
        --button-text: #022c22;
        --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.34);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient(circle at 50% -10%, var(--glow), transparent 38rem), var(--background);
}

h1, h2, h3 { font-family: Merriweather, Georgia, serif; }
button, input { font: inherit; }

.theme-toggle {
    position: fixed;
    z-index: 10;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    box-shadow: 0 0.35rem 1.25rem rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--text); background: var(--surface); }
.theme-icon { width: 1rem; font-size: 1rem; line-height: 1; text-align: center; }
.theme-label { font-size: 0.82rem; font-weight: 700; }

.theme-toggle:focus-visible, button:focus-visible, .button:focus-visible,
.quiet:focus-visible, input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent);
    outline-offset: 2px;
}

.landing-page, .account-page {
    display: grid;
    place-items: center;
    padding: 4.5rem 1.25rem 2rem;
}

.landing-card, .account-card {
    width: min(100%, 34rem);
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(1rem);
}

.landing-card {
    max-width: 30rem;
    padding: clamp(2rem, 8vw, 3.5rem);
    text-align: center;
}

.landing-logo { width: 5.5rem; height: auto; margin-bottom: 1rem; }
.landing-card h1 { margin: 0; font-size: clamp(2.6rem, 12vw, 4rem); letter-spacing: -0.045em; }
.tagline, .error-message { margin: 0.55rem 0 1.75rem; color: var(--muted); font-size: 1.15rem; line-height: 1.6; }
.footer { margin-top: 1.75rem; color: var(--muted); font-size: 0.8rem; }

.account-card { padding: clamp(1.5rem, 5vw, 2.5rem); }
.account-card header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 2rem; }
.account-card header img { width: 2.5rem; height: 3.125rem; }
.account-card h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.4rem); letter-spacing: -0.035em; }
.account-card p { color: var(--muted); line-height: 1.55; }

.avatar-section {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 0.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.avatar {
    display: grid;
    width: 5rem;
    height: 5rem;
    place-items: center;
    border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    border-radius: 50%;
    color: var(--accent-ink);
    background: var(--accent-soft);
    object-fit: cover;
    font-family: Merriweather, Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
}

.field { display: grid; gap: 0.45rem; margin-top: 1.25rem; }
.avatar-field { margin-top: 0; }
label { font-weight: 700; }

input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    color: var(--text);
    background: var(--surface);
}

input:focus { border-color: var(--accent); }
input[readonly] { color: var(--muted); background: var(--surface-muted); }
input[type="file"]::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: 0.45rem;
    color: var(--accent-ink);
    background: var(--accent-soft);
    font-weight: 700;
    cursor: pointer;
}

small { color: var(--muted); line-height: 1.45; }
.notice, .error { padding: 0.75rem 0.9rem; border-radius: 0.65rem; }
.notice { color: var(--accent-ink) !important; background: var(--accent-soft); }
.error { color: var(--danger-text) !important; background: var(--danger-background); }
.actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.avatar-actions { margin-top: 0.85rem; }

button, .button {
    padding: 0.8rem 1.05rem;
    border: 0;
    border-radius: 0.65rem;
    color: var(--button-text);
    background: var(--accent-hover);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover, .button:hover { background: var(--accent-strong); }
button.secondary { margin-top: 0.6rem; padding: 0.35rem 0; color: var(--accent-strong); background: transparent; font-size: 0.9rem; }
button.secondary:hover, .quiet:hover { color: var(--accent-hover); background: transparent; text-decoration: underline; }
.quiet { color: var(--muted); text-decoration: none; }

@media (max-width: 30rem) {
    .avatar-section { grid-template-columns: 1fr; }
    .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .theme-toggle { padding-inline: 0.75rem; }
}

@media (prefers-reduced-motion: no-preference) {
    .theme-toggle, button, .button, .quiet, input {
        transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
    }
}
