/* Calm, trust-first palette: one blue accent on cool slate neutrals, green only for
   "verified", red only for danger. Every text pair clears WCAG AA (4.5:1) in both themes. */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #475569;
    --accent: #1d4ed8;
    --accent-2: #0284c7;
    --accent-text: #ffffff;
    --ok: #15803d;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #b91c1c;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
}

/* theme.js sets data-theme from the visitor's choice, else their system setting. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #111a2e;
    --border: #1f2a40;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --accent-2: #38bdf8;
    --accent-text: #0b1220;
    --ok: #4ade80;
    --danger-bg: #2a1215;
    --danger-border: #5f1d22;
    --danger-text: #fca5a5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(60rem 26rem at 50% -8rem, color-mix(in srgb, var(--accent) 13%, transparent), transparent)
        no-repeat,
        var(--bg);
    color: var(--text);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
/* Pushed right, beside whatever else the header holds. */
.theme-toggle { margin-left: auto; padding: .55rem; }

.wordmark {
    font-weight: 650;
    letter-spacing: -.02em;
    text-decoration: none;
    color: var(--text);
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
}
.wordmark span { color: var(--accent); }
/* Shield logo (a phylax is a guard), drawn here so every page's header gets it without template edits. */
.wordmark::before {
    content: "";
    width: 1.4rem;
    height: 1.4rem;
    margin-right: .5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-mask: var(--shield) center / contain no-repeat;
    mask: var(--shield) center / contain no-repeat;
    --shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/%3E%3C/svg%3E");
}

.wrap { width: 100%; max-width: 56rem; margin: 0 auto; padding: 3.5rem 1.5rem; flex: 1; }
.narrow { max-width: 24rem; }

h1 {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -.03em;
    margin: 0 0 1rem;
}

.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 2rem; max-width: 40rem; }

h2 { font-size: 1.4rem; letter-spacing: -.02em; margin: 0 0 1.25rem; }

/* --- landing --- */
.hero { padding: 1rem 0 4.5rem; text-align: center; }
.hero h1, .hero .lede { margin-left: auto; margin-right: auto; }
.hero h1 { max-width: 44rem; }
.hero .row { justify-content: center; }
.accent {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.eyebrow {
    display: inline-block;
    margin: 0 0 1rem;
    padding: .25rem .7rem;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 600;
}


#how { scroll-margin-top: 5rem; }
.steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}
.steps p { margin: .4rem 0 0; }
.step-num {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: .8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-text);
    font-weight: 700;
    font-size: .9rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-center { text-align: center; padding: 2.25rem 1.75rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .7rem 1.15rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:hover { border-color: var(--accent); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-primary:hover { filter: brightness(1.07); }

.btn-google { width: 100%; }
.btn-danger { color: var(--danger-text); border-color: var(--danger-border); }
.btn-danger:hover { border-color: var(--danger-text); }

.identity { display: flex; align-items: center; gap: .85rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); }
.identity-name { font-weight: 600; }
.identity-email { color: var(--muted); font-size: .9rem; word-break: break-all; }

.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }

.alert {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    border-radius: 9px;
    padding: .7rem .9rem;
    font-size: .9rem;
    margin-bottom: 1.1rem;
    text-align: left;
}

.divider { height: 1px; background: var(--border); margin: 1.4rem 0; border: 0; }

/* --- header account button --- */
.account-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .8rem .3rem .3rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-weight: 550;
    text-decoration: none;
    transition: border-color .15s;
}
.account-chip:hover { border-color: var(--accent); }
.account-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-chip .avatar { width: 32px; height: 32px; }
.account-chip-name { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 30rem) { .account-chip-name { max-width: 6rem; } }

/* Stands in for a picture: the name's first letter on the accent gradient. */
.avatar-initial {
    display: inline-grid;
    place-items: center;
    flex: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-text);
    font-weight: 700;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }

/* --- profile --- */
.profile { max-width: 40rem; }
.profile > .card + .card { margin-top: 1.25rem; }
.profile .card h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.profile-name { font-size: 1.4rem; margin: 0; word-break: break-word; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
.tabs a {
    padding: .4rem .85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: .875rem;
    font-weight: 550;
    text-decoration: none;
}
.tabs a:hover { border-color: var(--accent); color: var(--text); }
.profile section { scroll-margin-top: 5rem; }

/* --- forms --- */
.field { text-align: left; margin-bottom: .9rem; }
.field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .3rem;
}
.field input {
    width: 100%;
    padding: .62rem .75rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field .error { color: var(--danger-text); font-size: .8rem; margin-top: .28rem; }
.field input.invalid { border-color: var(--danger-border); }

.btn-block { width: 100%; }

.or {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.3rem 0;
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.or::before, .or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.notice {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--text);
    border-radius: 9px;
    padding: .7rem .9rem;
    font-size: .9rem;
    margin-bottom: 1.1rem;
    text-align: left;
}

/* --- wallet --- */
.addr {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82em;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .1rem .35rem;
    word-break: break-all;
}
.error-text { color: var(--danger-text); }

/* --- social linking --- */
.social-card .row { gap: 1rem; }
.social-card .small { max-width: 34rem; margin-top: .2rem; }

.prose { max-width: 42rem; }
.prose h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.prose li { margin-bottom: .4rem; }

.site-footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: .875rem;
}
.site-footer a { color: var(--muted); }
