@font-face {
    font-family: Shonen;
    src: url("../fonts/shonen.otf") format("opentype");
}

:root {
    --ink: #111;
    --muted: #656565;
    --line: #d8d8d8;
    --paper: #fbfbfa;
    --card: #fff;
    --shadow: 0 10px 28px rgba(0, 0, 0, .07);
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: Shonen, Arial, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header,
main,
footer {
    width: min(100% - 32px, 1120px);
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 0 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.brand img {
    width: 132px;
    height: 132px;
    object-fit: contain;
}

nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    font-size: 18px;
}

nav a:not(.button) {
    padding: 8px 2px 5px;
    border-bottom: 1px solid var(--ink);
}

.hero {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 18px 0 42px;
    text-align: center;
}

h1 {
    max-width: 980px;
    margin: 0;
    font-size: clamp(30px, 4.6vw, 58px);
    font-weight: 400;
    line-height: 1.05;
    text-align: center;
}

h1 span {
    display: block;
}

.nowrap {
    white-space: nowrap;
}

h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 3.4vw, 38px);
    font-weight: 400;
}

p {
    line-height: 1.45;
}

.hero p {
    max-width: 760px;
    margin: 0;
    font-size: clamp(17px, 2vw, 24px);
    white-space: nowrap;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    padding: 9px 18px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .16);
}

.button.big {
    min-height: 52px;
    font-size: 22px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.card > a:first-child {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.card img {
    display: block;
    width: 82px;
    height: 82px;
    object-fit: contain;
    margin: 0;
}

.card strong {
    display: block;
    font-size: clamp(20px, 1.8vw, 24px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.card p {
    color: var(--muted);
}

.card-description {
    margin: 14px 0 16px;
    font-size: 17px;
    line-height: 1.36;
    overflow-wrap: anywhere;
}

.meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    min-width: 0;
    font-size: 16px;
}

.meta span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta span:last-child {
    flex: 0 0 auto;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--ink);
    border-radius: 6px;
    padding: 4px 10px;
    background: #fff;
}

.add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border-style: dashed;
    text-align: center;
    box-shadow: none;
}

.add-card.card {
    gap: 8px;
}

.icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
    background: currentColor;
    mask: var(--icon-url) center / contain no-repeat;
    -webkit-mask: var(--icon-url) center / contain no-repeat;
}

.add-card .add-circle {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    margin-bottom: 12px;
    font-size: 34px;
}

.add-card .add-circle .icon {
    width: 1em;
    height: 1em;
}

.info,
.narrow {
    max-width: 720px;
    margin: 48px auto;
}

.narrow h1 {
    margin-bottom: 28px;
}

.info {
    text-align: center;
}

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

.form-hint {
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.char-counter {
    justify-self: end;
    margin-top: -6px;
    padding-right: 2px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;
}

.char-counter.is-low {
    color: #9b1c1c;
}

.image-field {
    display: grid;
    gap: 10px;
}

.image-field > span {
    display: block;
}

.image-field img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

label {
    display: grid;
    gap: 6px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    color: var(--ink);
    font: 18px Arial, sans-serif;
}

.hidden {
    position: absolute;
    left: -9999px;
}

.notice,
.error {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
    background: #fff;
}

.error {
    border-color: #9b1c1c;
}

footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 36px 0 24px;
}

.admin-list {
    display: grid;
    gap: 14px;
}

.admin-row {
    display: grid;
    grid-template-columns: 86px 1fr auto;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.admin-row img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions form {
    margin: 0;
}

@media (max-width: 820px) {
    .site-header {
        align-items: flex-start;
    }

    nav {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 16px;
    }

    .brand img {
        width: 104px;
        height: 104px;
    }

    .hero {
        padding-top: 8px;
    }

    .nowrap,
    .hero p {
        white-space: normal;
    }

    .admin-row {
        grid-template-columns: 64px 1fr;
    }

    .actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .site-header {
        display: grid;
        justify-items: center;
    }

    nav {
        justify-content: center;
    }

    h1 {
        font-size: clamp(28px, 10vw, 42px);
    }

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

    .card {
        min-height: 0;
        padding: 16px;
    }

    .card > a:first-child {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 14px;
    }

    .card img {
        width: 72px;
        height: 72px;
    }

    .card-description {
        font-size: 16px;
    }

    .meta {
        font-size: 16px;
    }
}
