:root {
    font-family: "Avenir Next", Avenir, system-ui, sans-serif;
    color: #222a23;
    background: #f7f6f1;
    --paper: #fffefa;
    --muted: #515c52;
    --border: #dcded3;
    --ink: #222a23;
    --action: #2b4535;
    --accent: #e5f1d9;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--action); text-underline-offset: .2em; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #658855; outline-offset: 3px; }
[hidden] { display: none !important; }

.topbar {
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px clamp(20px, 6vw, 88px);
    border-bottom: 1px solid var(--border);
    background: var(--paper);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.055em;
}

.brand-mark {
    display: grid;
    grid-template-columns: repeat(2, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 2px;
    transform: rotate(-10deg);
}

.brand-mark i { border-radius: 2px; background: #405a43; }
.brand-mark i:nth-child(2) { background: #9bb78e; }
.brand-mark i:nth-child(3) { background: #d4ac77; }
.brand-mark i:nth-child(4) { background: #778e70; }

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(calc(100% - 48px), 936px);
    margin: clamp(38px, 9vh, 106px) auto;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    background: var(--paper);
    min-height: 490px;
}

.swatch-art {
    position: relative;
    isolation: isolate;
    background: #e4eadb;
    min-height: 100%;
    overflow: hidden;
}

.swatch-art i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(51%, 238px);
    aspect-ratio: .75;
    border: 1px solid #25352942;
    border-radius: 7px 7px 26px 7px;
    transform-origin: 25% 82%;
    box-shadow: 0 13px 22px #32473424;
    background: #718d75;
    transform: translate(-50%, -49%) rotate(-29deg);
}

.swatch-art i:nth-child(2) { background: #e7b77d; transform: translate(-50%, -49%) rotate(-10deg); }
.swatch-art i:nth-child(3) { background: #c9d7a3; transform: translate(-50%, -49%) rotate(12deg); }
.swatch-art i:nth-child(4) { background: #3c5948; transform: translate(-50%, -49%) rotate(33deg); }
.swatch-art i::after {
    content: "";
    position: absolute;
    inset: auto 10% 9%;
    height: 10%;
    background: #ffffff4a;
    border-radius: 3px;
}

.auth-card { align-self: center; min-width: 0; padding: clamp(24px, 5vw, 62px); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 4vw, 49px); line-height: 1.06; letter-spacing: -.066em; font-weight: 670; overflow-wrap: anywhere; }
h2 { font-size: 21px; letter-spacing: -.037em; line-height: 1.2; }
.subtle { margin-top: 12px; color: var(--muted); line-height: 1.5; }
.account-email { overflow-wrap: anywhere; }
.stack { display: grid; gap: 15px; margin-top: 28px; }
label { display: block; font-size: 14px; font-weight: 650; }
input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #a8b2a5;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
}

button {
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--action);
    color: #fff;
    font-weight: 650;
    cursor: pointer;
}

button:hover { background: #1d3326; }
button:disabled { opacity: .66; cursor: wait; }
.hint, .account-switch, .notice { font-size: 14px; line-height: 1.5; }
.hint { margin-top: -8px; color: var(--muted); }
.account-switch { margin-top: 24px; color: var(--muted); }
.account-switch a { font-weight: 680; }
.notice { margin-top: 10px; padding: 9px 12px; border-radius: 7px; }
.stack .notice { margin-top: 0; }
.error { color: #7e3025; background: #faece5; }
.success { color: #28432d; background: #eaf3e0; }
.quiet-button { min-height: 38px; background: transparent; color: var(--action); border-color: #a8b2a5; }
.quiet-button:hover { background: var(--accent); }
.nav-feedback { position: absolute; right: 20px; z-index: 1; max-width: 320px; }

.dashboard { width: min(calc(100% - 48px), 940px); margin: clamp(34px, 7vw, 76px) auto; }
.dashboard-heading { margin-bottom: 32px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; align-items: stretch; }
.panel, .balance-card { padding: clamp(20px, 4vw, 33px); border: 1px solid var(--border); border-radius: 16px; }
.panel { background: var(--paper); }
.balance-card { background: var(--accent); border-color: #c4d5b8; }
.balance-card h2 { color: #344a38; }
.balance { display: flex; gap: 13px; align-items: baseline; margin-top: 11px; }
.balance strong { line-height: 1; font-size: 67px; letter-spacing: -.075em; font-weight: 660; font-variant-numeric: tabular-nums; }
.balance span { font-size: 17px; color: #344a38; }
.redeem-card form { margin-top: 18px; }
.redeem-input { display: flex; gap: 8px; margin-top: 6px; }
.redeem-input input { margin: 0; }
.code-input { text-transform: uppercase; }
.code-input::placeholder { text-transform: none; }
.activity-card { margin-top: 18px; }
.activity-list { padding: 0; margin: 17px 0 0; list-style: none; }
.activity-list li { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--border); padding: 14px 0; }
.activity-list li:last-child { padding-bottom: 0; }
.activity-list time, .activity-list span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.grant-amount { text-align: right; }
.grant-amount strong { color: #365540; }

@media (max-width: 680px) {
    .auth-shell, .dashboard-grid { grid-template-columns: 1fr; }
    .auth-shell, .dashboard { width: calc(100% - 32px); }
    .auth-shell { margin-top: 24px; }
    .swatch-art { height: 142px; }
    .swatch-art i { width: 88px; }
    .auth-card { padding: 27px 22px; }
}
