@font-face {
    font-family: "Bricolage Grotesque";
    src: url("fonts/bricolage-grotesque.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

:root {
    --royal: #1739B8;
    --royal-deep: #0F2A8F;
    --royal-soft: #EEF2FF;
    --ink: #0D1B4F;
    --muted: #55628F;
    --line: #D9E0F5;
    --page: #FFFFFF;
    --panel: #FFFFFF;
    --link: #1739B8;
    --danger: #B42318;
    --ok: #0E7C5A;
    --radius-tile: 22px;
    --radius-ui: 10px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --royal-soft: #16225A;
        --ink: #EEF2FF;
        --muted: #A8B4E0;
        --line: #26357A;
        --page: #0A1338;
        --panel: #101C4A;
        --link: #9DB2FF;
        --danger: #FF8A80;
        --ok: #5FD3A8;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; background: var(--page); color: var(--ink);
    font: 16px/1.55 "Bricolage Grotesque", system-ui, sans-serif;
    font-optical-sizing: auto;
}
a { color: var(--link); }
:focus-visible { outline: 3px solid #FFD84D; outline-offset: 3px; border-radius: 4px; }

/* Royal blue band: navigation, and on the start page the big wordmark */
.band { background: var(--royal); color: #fff; }
.band-inner { max-width: 1040px; margin: 0 auto; padding: 18px 16px; }
.band nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.band nav a { color: #fff; text-decoration: none; opacity: .85; }
.band nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.band .brand { margin-right: auto; font-weight: 750; font-size: 20px; letter-spacing: -.02em; opacity: 1; }
.band .who { opacity: .65; }
.hero { padding: 48px 0 104px; }
.hero h1 {
    margin: 0; font-size: clamp(56px, 13vw, 148px); line-height: .86; font-weight: 800;
    letter-spacing: -.055em;
}
.hero p { margin: 18px 0 0; max-width: 34ch; font-size: clamp(17px, 2.2vw, 21px); opacity: .85; }

main { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
.home main { margin-top: -72px; padding-top: 0; }
h1.page-title { margin: 0 0 20px; font-size: 32px; letter-spacing: -.03em; font-weight: 750; }

/* Project tiles */
.group + .group { margin-top: 44px; }
.group h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.home .group:first-of-type h2 { color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.tile {
    --c: var(--royal);
    position: relative; display: flex; flex-direction: column; min-height: 230px; padding: 22px 22px 20px;
    border-radius: var(--radius-tile); overflow: hidden; isolation: isolate;
    background: var(--c); color: #fff; text-decoration: none;
    box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 14px 32px -18px var(--c);
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.tile::before { /* light from the top left, so flat colours get some depth */
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.22), transparent 60%);
}
.tile .mono {
    position: absolute; right: -.06em; bottom: -.24em; z-index: -1;
    font-size: 190px; line-height: 1; font-weight: 800; letter-spacing: -.07em;
    color: rgba(255,255,255,.16); pointer-events: none; user-select: none;
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.tile strong { font-size: 24px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; max-width: 14ch; }
.tile p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; max-width: 30ch; opacity: .88; }
.tile .state {
    margin-top: auto; padding-top: 0; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 650;
    background: #fff; color: var(--c);
}
.tile p + .state, .tile strong + .state { margin-top: auto; }
a.tile:hover, a.tile:focus-visible { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 22px 40px -16px var(--c); }
a.tile:hover .mono, a.tile:focus-visible .mono { transform: translate(-10px, -8px) rotate(-4deg); }
.tile.locked { filter: saturate(.25); }
.tile.locked .state { background: rgba(255,255,255,.2); color: #fff; }
a.tile.locked:hover { filter: saturate(.6); }
.lock { width: 14px; height: 14px; flex: none; }
@media (prefers-reduced-motion: reduce) {
    .tile, .tile .mono { transition: none; }
    a.tile:hover, a.tile:focus-visible, a.tile:hover .mono, a.tile:focus-visible .mono { transform: none; }
}
.empty { color: var(--muted); }
.home .empty { color: #fff; }

/* Forms, admin */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.narrow { max-width: 400px; margin: 8px auto 0; }
label { display: block; font-size: 14px; font-weight: 650; margin: 16px 0 6px; }
input[type=text], input[type=password], input[type=url], input[type=number] {
    width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--page);
    border: 1px solid var(--line); border-radius: var(--radius-ui);
}
input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-ui); background: var(--page); }
input:focus { outline: 2px solid var(--royal); outline-offset: -1px; }
.choices label, label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; }
.help, .form-help { font-size: 13px; color: var(--muted); margin-top: 4px; }
ul.errors, .form-error { color: var(--danger); font-size: 14px; margin: 6px 0 0; padding: 0; list-style: none; }
button, .button {
    display: inline-block; margin-top: 22px; padding: 11px 20px; font: inherit; font-weight: 650; cursor: pointer;
    background: var(--royal); color: #fff; border: 0; border-radius: var(--radius-ui); text-decoration: none;
}
button:hover, .button:hover { background: var(--royal-deep); }
button.link { background: none; color: var(--danger); padding: 0; margin: 0; font-weight: 400; }
.flash { padding: 11px 14px; border-radius: var(--radius-ui); margin-bottom: 18px; background: var(--royal-soft); }
.flash.error { color: var(--danger); }
.flash.success { color: var(--ok); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 650; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--royal-soft); color: var(--ink); margin: 0 4px 4px 0; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions .page-title { margin: 0 auto 0 0; }
.back { display: inline-block; margin-bottom: 14px; }
/* The start page carries the big wordmark, so the small one in the navigation would repeat it */
.home .band .brand { visibility: hidden; }
