:root {
    color-scheme: light;
    --ink: #242124;
    --muted: #62595c;
    --line: #e6dedb;
    --accent: #983b25;
    --surface: #fffdfc;
    font-family: Inter, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    background: var(--surface);
    color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
p, h1, h2, h3 { word-break: keep-all; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.gallery-shell { width: min(100% - 48px, 1120px); margin-inline: auto; }
.gallery-header { border-bottom: 1px solid var(--line); }
.gallery-nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gallery-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; }
.gallery-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 20px;
    border-radius: 5px;
    background: var(--ink);
    color: white;
    font: 700 13px/1 ui-monospace, monospace;
    padding-top: 3px;
}
.gallery-create, .gallery-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    font-size: 14px;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
}

.gallery-intro {
    margin: 34px 0 36px;
    padding: clamp(28px, 5vw, 48px) clamp(22px, 6vw, 68px);
    border-radius: 24px;
    background: #f9ebe3;
}
.gallery-intro h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.1; letter-spacing: -.065em; }
.gallery-intro p { margin-top: 16px; color: #66483d; font-size: clamp(15px, 2vw, 18px); line-height: 1.65; }

.gallery-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.gallery-toolbar h2 { font-size: 25px; letter-spacing: -.045em; }
.gallery-order { margin-top: 6px; color: var(--muted); font-size: 13px; }
.gallery-search { flex: 0 1 320px; }
.gallery-search input {
    min-height: 44px;
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #877979;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
}
.gallery-search input::placeholder { color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.gallery-card { min-width: 0; }
.gallery-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    text-decoration: none;
    transition: border-color 150ms, background-color 150ms;
}
.gallery-media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: #f5e7df; }
.gallery-card:nth-child(3n+2) .gallery-media { background: #e9ece5; }
.gallery-card:nth-child(3n) .gallery-media { background: #eae8f3; }
.gallery-initial { font-size: clamp(46px, 10vw, 88px); line-height: 1; color: #69534b; font-weight: 750; }
.gallery-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: inherit; outline: 1px solid rgb(0 0 0 / 10%); outline-offset: -1px; }
.gallery-card-info { display: flex; flex: 1; flex-direction: column; padding: 16px 17px 18px; }
.gallery-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.gallery-stock { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.gallery-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gallery-stock.has-codes { color: #24623c; }
.gallery-platforms { color: var(--muted); font-size: 12px; }
.gallery-card h3 { font-size: 22px; letter-spacing: -.035em; line-height: 1.3; }
.gallery-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.gallery-card-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 19px; color: var(--accent); font-size: 14px; font-weight: 700; }
.gallery-card-action > span + span { font-size: 19px; line-height: 1; }

.gallery-status { padding: 34px 16px; border: 1px dashed #b7a7a3; border-radius: 14px; color: var(--muted); text-align: center; }
.gallery-controls { display: flex; justify-content: center; margin-top: 20px; }
.gallery-footer { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 50px; border-top: 1px solid var(--line); padding-block: 20px 30px; color: var(--muted); font-size: 12px; }
.gallery-footer a { text-underline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { display: inline-block; position: absolute; top: 8px; left: 8px; z-index: 1; padding: 10px; background: white; }

@media (hover: hover) {
    .gallery-card-link:hover { border-color: #b46e58; background: #fff9f5; }
    .gallery-create:hover, .gallery-controls button:hover { background: #4a3531; }
}
@media (prefers-reduced-motion: no-preference) {
    .gallery-create, .gallery-controls button { transition: scale 150ms ease-out, background-color 150ms ease-out; }
    .gallery-create:active, .gallery-controls button:enabled:active { scale: .96; }
}
@media (max-width: 850px) {
    .gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
    .gallery-shell { width: calc(100% - 32px); }
    .gallery-nav { min-height: 62px; }
    .gallery-create { padding-inline: 10px; font-size: 13px; }
    .gallery-intro { margin: 22px 0 26px; border-radius: 16px; }
    .gallery-search { flex-basis: 100%; }
    .gallery-grid { grid-template-columns: 1fr; gap: 14px; }
}
