:root {
    --bg: #0e0c0a;
    --ink: #f7f1e8;
    --muted: #c4bbb0;
    --cream: #e8dcc8;
    --line: rgba(247, 241, 232, 0.12);
    --panel: #1a1714;
    --field: #141210;
    --bad: #e8b4b4;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; overflow-x: clip; }
body {
    min-height: 100dvh;
    background-color: var(--bg);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.94  0 0 0 0 0.86  0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.045'/></svg>");
    background-size: 220px 220px;
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
}
button, input, textarea { font-family: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.btn-cream:focus-visible,
.bar .in:focus-visible {
    outline-offset: 3px;
}
.text-link:focus-visible {
    outline-offset: 3px;
    border-radius: 2px;
}
.serif { font-family: Fraunces, Georgia, serif; font-weight: 500; letter-spacing: -0.03em; }

.skip {
    position: absolute;
    left: 12px;
    top: 8px;
    z-index: 80;
    padding: 8px 14px;
    background: var(--cream);
    color: var(--bg);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border-radius: 8px;
    transform: translateY(-160%);
}
.skip:focus, .skip:focus-visible {
    transform: none;
    outline: 2px solid var(--cream);
    outline-offset: 3px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bar {
    position: sticky;
    top: 16px;
    z-index: 30;
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 48px;
    padding: 4px 4px 4px 16px;
    background: rgba(26, 23, 20, 0.94);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.bar.fixed {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: 18px;
    margin: 0;
}
.bar .brand {
    font-size: 17px;
    padding: 0 12px 0 2px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.bar-links {
    display: flex;
    align-items: center;
    gap: 2px;
}
.bar-links a,
.bar > a:not(.brand):not(.in) {
    height: 40px;
    padding: 0 14px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    flex-shrink: 0;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.bar-links a:hover,
.bar > a:not(.brand):not(.in):hover { color: var(--ink); }
.bar .in {
    height: 40px;
    padding: 0 16px;
    margin-left: 6px;
    border: 0;
    border-radius: 999px;
    background: var(--cream);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.bar .in:hover { background: #f4eee6; color: var(--bg); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:active { transform: scale(0.99); }
.btn-cream { background: var(--cream); color: var(--bg); }
.btn-cream:hover { background: #f4eee6; }
.btn-ghost {
    color: var(--ink);
    border: 1px solid var(--line);
    background: transparent;
}
.btn-ghost:hover { border-color: rgba(232, 220, 200, 0.35); }

.text-link {
    color: var(--cream);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(232, 220, 200, 0.35);
}
.text-link:hover { border-bottom-color: var(--cream); }

footer.site {
    width: min(880px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0 calc(40px + env(safe-area-inset-bottom));
    color: var(--muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
}
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); }

.field { margin: 0 0 4px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin: 14px 0 7px;
}
.field .hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.field input::placeholder { color: #9a9186; }
.field input:focus {
    border-color: rgba(232, 220, 200, 0.45);
    background: #161310;
}
.field input:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 2px;
    border-color: var(--cream);
}

@media (max-width: 820px) {
    .bar,
    .bar.fixed {
        top: max(8px, env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        height: 44px;
        min-height: 44px;
        padding: 3px 3px 3px 10px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 2px;
        border-radius: 999px;
        overflow-x: clip;
        transform: none;
    }
    .bar.fixed {
        left: 12px;
        right: 12px;
        transform: none;
        width: auto;
    }
    .bar .brand {
        font-size: 14px;
        padding: 0 8px 0 2px;
        line-height: 32px;
    }
    .bar .in {
        margin-left: 4px;
        height: 38px;
        padding: 0 11px;
        font-size: 12px;
    }
    .bar-links {
        order: 0;
        flex: 1 1 auto;
        display: flex;
        justify-content: flex-end;
        gap: 0;
        padding: 0;
        border: 0;
        margin: 0;
        min-width: 0;
    }
    .bar-links a {
        height: 38px;
        padding: 0 9px;
        font-size: 12px;
        color: var(--muted);
        background: none;
        border: 0;
        border-radius: 999px;
        flex-shrink: 1;
        min-width: 0;
    }
    .bar-links a:hover { color: var(--ink); }
    footer.site {
        width: calc(100% - 28px);
        flex-direction: column;
        gap: 8px;
        padding-top: 28px;
    }
    .btn {
        min-height: 44px;
        padding: 0 13px;
        font-size: 13px;
        border-radius: 9px;
    }
}
@media (max-width: 360px) {
    .bar-links a { padding: 0 6px; }
    .bar .in { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}
