/* bko.li — shared stylesheet */

:root {
    --sky: #1f6fd6;
    --sky-deep: #0f4fa8;
    --flame: #f59a12;
    --ink: #10253f;
    --muted: #4c6582;
    --paper: #f2f7fd;
    --surface: #ffffff;
    --line: #d4e3f3;
    --app: var(--sky);

    --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
    --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

    --measure: 66ch;
    --wide: 1120px;
    --gutter: clamp(16px, 4vw, 40px);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --sky: #5ea4f7;
        --sky-deep: #8fc0fb;
        --ink: #e6eef9;
        --muted: #9bb0ca;
        --paper: #0b1828;
        --surface: #12233a;
        --line: #213a58;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sky); text-underline-offset: 0.18em; }
a:hover { color: var(--sky-deep); }

:focus-visible {
    outline: 3px solid var(--flame);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0;
}

.dot { color: var(--flame); }

/* ---------- top bar ---------- */

.topbar {
    max-width: var(--wide);
    width: 100%;
    margin: 0 auto;
    padding: 18px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--sky);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.brand img { width: 40px; height: 34px; object-fit: cover; object-position: 50% 8%; }

.back {
    font-size: 0.95rem;
    color: var(--muted);
}

/* ---------- home: hero ---------- */

.hero {
    max-width: var(--wide);
    margin: 0 auto;
    padding: clamp(32px, 8vw, 96px) var(--gutter) clamp(40px, 7vw, 80px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: clamp(24px, 5vw, 64px);
}

.hero h1 {
    font-size: clamp(2.6rem, 8.2vw, 6.25rem);
    font-weight: 800;
    font-variation-settings: "opsz" 96;
    line-height: 0.95;
    letter-spacing: -0.035em;
    max-width: 12ch;
    text-wrap: balance;
}
.hero h1 .later {
    display: block;
    font-weight: 400;
    color: var(--muted);
    margin-top: 0.12em;
}

.hero .lead {
    margin: 28px 0 0;
    max-width: 40ch;
    font-size: 1.2rem;
    color: var(--muted);
}

.hero .mark {
    width: clamp(120px, 22vw, 260px);
    animation: liftoff 1.4s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes liftoff {
    from { transform: translate(-18px, 28px) rotate(-4deg); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* ---------- home: app list ---------- */

.apps {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 var(--gutter) clamp(48px, 8vw, 96px);
}

.apps h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0;
    margin-bottom: 16px;
}

.app-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 2px solid var(--ink);
}

.app-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 24px;
    padding: 24px 4px;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}
.app-row:hover { color: inherit; background: var(--surface); }
.app-row:hover .app-name { color: var(--app); }

.app-tile {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--app);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.9rem;
    overflow: hidden;
}
.app-tile img { width: 100%; height: 100%; object-fit: cover; }

.app-name {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 600;
    transition: color .15s;
}

.app-desc {
    margin: 4px 0 0;
    color: var(--muted);
    max-width: 60ch;
}

.app-meta {
    text-align: right;
    font-size: 0.95rem;
    color: var(--muted);
    white-space: nowrap;
}
.app-meta strong { display: block; color: var(--ink); font-weight: 700; }

/* ---------- app pages ---------- */

.app-hero {
    background: var(--app);
    color: #fff;
}
.app-hero-inner {
    max-width: var(--wide);
    margin: 0 auto;
    padding: clamp(40px, 8vw, 88px) var(--gutter);
}
.app-hero h1 {
    font-size: clamp(2.4rem, 7vw, 4.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    max-width: 16ch;
}
.app-hero .lead {
    margin: 20px 0 0;
    font-size: 1.25rem;
    max-width: 44ch;
    opacity: 0.92;
}
.app-hero .status {
    display: inline-block;
    margin-top: 28px;
    padding: 6px 14px;
    border: 1.5px solid rgba(255,255,255,.7);
    border-radius: 999px;
    font-size: 0.95rem;
}

.app-body {
    max-width: var(--wide);
    margin: 0 auto;
    padding: clamp(40px, 6vw, 72px) var(--gutter);
}
.app-body .prose { max-width: var(--measure); }
.app-body .prose p { margin: 0 0 1.1em; }

.app-shot {
    margin: 40px 0 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.app-links {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

/* ---------- policy pages ---------- */

.policy-head {
    max-width: var(--measure);
    margin: 0 auto;
    padding: clamp(32px, 6vw, 64px) var(--gutter) 0;
    box-sizing: content-box;
}
.policy-head h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
}
.policy-head p { color: var(--muted); margin: 14px 0 0; }
.policy-head .app-chip {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 4px;
    background: var(--app);
    margin-right: 8px;
    vertical-align: -1px;
}

.policy {
    max-width: var(--measure);
    margin: 32px auto clamp(48px, 8vw, 96px);
    padding: clamp(24px, 5vw, 48px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow-wrap: anywhere;
}
/* The policy markup is generated with heavy inline styles; normalise it. */
.policy [data-custom-class="body"],
.policy [data-custom-class="body"] * {
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    background: transparent !important;
    max-width: 100% !important;
}
.policy [data-custom-class="body"] {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}
.policy [data-custom-class="title"] {
    display: block;
    font-family: var(--font-display) !important;
    font-size: 1.6rem !important;
}
.policy [data-custom-class="subtitle"] { color: var(--muted) !important; }
.policy [data-custom-class="heading_1"] {
    display: block;
    margin-top: 0.6em;
    font-family: var(--font-display) !important;
    font-size: 1.2rem !important;
    letter-spacing: -0.01em;
}
.policy [data-custom-class="heading_2"] {
    display: block;
    font-family: var(--font-display) !important;
    font-size: 1.05rem !important;
}
.policy a { color: var(--sky) !important; }

/* ---------- footer ---------- */

.footer {
    max-width: var(--wide);
    width: 100%;
    margin: 0 auto;
    padding: 28px var(--gutter) 36px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    font-size: 0.95rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}
.footer p { margin: 0; }
.footer a { color: inherit; }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
    .hero { grid-template-columns: 1fr; }
    .hero .mark { grid-row: 1; width: 112px; }

    .app-row { grid-template-columns: 56px minmax(0, 1fr); }
    .app-tile { width: 56px; height: 56px; font-size: 1.6rem; }
    .app-meta { grid-column: 2; text-align: left; white-space: normal; }
    .app-meta strong { display: inline; margin-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
