:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #687386;
    --line: #dbe1ea;
    --primary: #1263d8;
    --primary-dark: #0e4fac;
    --ok: #16784f;
    --err: #b3261e;
    --nsfw: #8b2f4d;
    --sfw: #12615a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 198px;
    height: 44px;
}

nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
}

button {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

button.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

button.primary:hover {
    background: var(--primary-dark);
}

.inline { display: inline; }

.shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 28px auto;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

.public-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 20px;
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.narrow {
    max-width: 460px;
    margin: 0 auto;
}

.public-grid .narrow {
    max-width: none;
    margin: 0;
}

h1, h2 {
    margin: 0 0 18px;
    letter-spacing: 0;
}

h1 { font-size: 28px; }
h2 { font-size: 18px; }

.stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
}

.check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.notice {
    margin-bottom: 18px;
    border-radius: 6px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.notice.success {
    border-color: #a8dbc4;
    color: var(--ok);
}

.notice.error {
    border-color: #f0b4af;
    color: var(--err);
}

.warning {
    border: 1px solid #ead6a4;
    border-radius: 6px;
    background: #fff9ea;
    color: #6f540f;
    line-height: 1.45;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.promo p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
    margin: 0 0 18px;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.feature-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: #f8fafc;
    color: var(--text);
    cursor: help;
    outline: none;
}

.feature-chip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: min(280px, calc(100vw - 44px));
    padding: 10px 12px;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.feature-chip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    z-index: 21;
    border: 6px solid transparent;
    border-top-color: #111827;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.feature-chip:hover,
.feature-chip:focus-visible {
    border-color: rgba(18, 99, 216, 0.42);
    background: #ffffff;
}

.feature-chip:hover::after,
.feature-chip:hover::before,
.feature-chip:focus-visible::after,
.feature-chip:focus-visible::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

.promo-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 6px 0 18px;
}

.promo-card {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 172px;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 16px;
    background-position: center;
    background-size: cover;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
    color: #ffffff;
}

.promo-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: inherit;
    transform: scale(1.02);
    transition: transform 180ms ease;
}

.promo-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.78) 100%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.58) 0%, rgba(15, 23, 42, 0.1) 72%);
}

.promo-card:hover::before {
    transform: scale(1.07);
}

.promo-card--social {
    background-image: url("/assets/promo/promo-social.jpg");
}

.promo-card--video {
    background-image: url("/assets/promo/promo-video.jpg");
}

.promo-card--references {
    background-image: url("/assets/promo/promo-references.jpg");
}

.promo-card--concepts {
    background-image: url("/assets/promo/promo-concepts.jpg");
}

.promo-card--business {
    grid-column: 1 / -1;
    min-height: 150px;
    background-image: url("/assets/promo/promo-business.jpg");
}

.promo-cards strong {
    display: block;
    max-width: 360px;
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.2;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.46);
}

.promo-cards span {
    display: block;
    max-width: 430px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.42;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.54);
}

.stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.mode {
    border-radius: 6px;
    padding: 12px;
    color: #ffffff;
    background: var(--sfw);
}

.mode.nsfw { background: var(--nsfw); }
.mode.sfw { background: var(--sfw); }

.balance {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
}

.side p, .side li, .muted {
    color: var(--muted);
}

.hint {
    color: var(--muted);
    line-height: 1.4;
}

.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.estimate {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    padding: 12px 14px;
}

.doc-page h1 {
    margin-bottom: 18px;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.doc-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
    padding: 16px;
}

.doc-grid h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.doc-grid p,
.doc-grid li {
    color: var(--muted);
    line-height: 1.55;
}

.doc-grid p {
    margin: 0 0 10px;
}

.doc-grid p:last-child {
    margin-bottom: 0;
}

.doc-grid ol,
.doc-grid ul {
    margin: 0;
    padding-left: 20px;
}

.example {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

.footer {
    width: min(1120px, calc(100vw - 32px));
    margin: 22px auto 36px;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.jobs {
    display: grid;
    gap: 12px;
}

.job {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.job div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.job span, .job small {
    color: var(--muted);
}

@media (max-width: 760px) {
    .topbar {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    nav {
        flex-wrap: wrap;
    }

    .topbar {
        height: auto;
        min-height: 60px;
        align-items: flex-start;
        padding: 10px 18px;
    }

    .brand-logo {
        width: 168px;
        height: auto;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .public-grid {
        grid-template-columns: 1fr;
    }

    .promo-cards {
        grid-template-columns: 1fr;
    }

    .promo-card--business {
        grid-column: auto;
    }

    .doc-grid {
        grid-template-columns: 1fr;
    }

    .shell {
        width: min(100vw - 20px, 1120px);
        margin: 16px auto;
    }

    .panel {
        padding: 18px;
    }
}
