/* Ant's View - design system
   Editorial, photo-first, warm neutrals with a burnt-orange accent. Light and dark. */

:root {
    --bg: #fbfaf7;
    --bg-2: #f2efe9;
    --card: #ffffff;
    --ink: #17140f;
    --ink-2: #4a443c;
    --muted: #686158;
    --line: #e5e0d8;
    --accent: #b9471d;
    --accent-hover: #9e3a15;
    --accent-ink: #ffffff;
    --accent-soft: #f6e3da;
    --green: #2e6b4f;
    --green-soft: #dcefe4;
    --danger: #b3261e;
    --danger-soft: #f9dedc;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(23, 20, 15, .06), 0 2px 8px rgba(23, 20, 15, .06);
    --shadow: 0 2px 6px rgba(23, 20, 15, .08), 0 14px 34px rgba(23, 20, 15, .12);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: "Fraunces", Georgia, "Times New Roman", serif;
    --header-h: 68px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0e0c;
        --bg-2: #181613;
        --card: #1d1a17;
        --ink: #f3efe8;
        --ink-2: #cfc8bd;
        --muted: #a69d91;
        --line: #2a2622;
        --accent: #e0693a;
        --accent-hover: #f07b4b;
        --accent-ink: #14100d;
        --accent-soft: #3a251c;
        --green-soft: #1e3328;
        --danger-soft: #3d1f1d;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 14px 34px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .35em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
h3 { font-size: 1.15rem; }
h4, .site-footer__heading { margin: 0 0 .6rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.skip-link { position: absolute; left: .75rem; top: -3rem; z-index: 1000; padding: .6rem 1rem; border-radius: .5rem; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip-link:focus { top: .75rem; }
.site-main:focus { outline: none; }
p { margin: 0 0 .9em; }

code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; background: var(--bg-2); padding: .1em .4em; border-radius: 4px; }

.container { width: min(1400px, 100% - 40px); margin-inline: auto; }
@media (max-width: 640px) { .container { width: calc(100% - 32px); } }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.prose { max-width: 760px; }
.prose .lead { font-size: 1.2rem; color: var(--ink-2); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: .1rem 0; }

/* ---------------------------------------------------------------- buttons, chips, badges */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .62rem 1.1rem; border-radius: var(--radius-pill);
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
    color: var(--ink); background: var(--card); text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-sm { padding: .42rem .85rem; font-size: .84rem; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linklike:hover { text-decoration: underline; }

.chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .38rem .8rem; border-radius: var(--radius-pill);
    border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
    font: inherit; font-size: .84rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--bg-2); text-decoration: none; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip--glass { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(6px); }
.chip--glass:hover { background: rgba(255, 255, 255, .28); }

.badge { display: inline-block; padding: .2rem .55rem; border-radius: var(--radius-pill); font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
.badge--free { background: var(--green); color: #fff; }
.badge--price { background: rgba(255, 255, 255, .92); color: var(--ink); }
.badge--soft { background: var(--accent-soft); color: var(--accent); }

.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); margin: 0 0 1rem; }
.notice--success { background: var(--green-soft); }
.notice--error { background: var(--danger-soft); color: var(--danger); }
.notice__text { margin: 0; }
.notice__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.form-error { padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); margin: .6rem 0; font-size: .9rem; }
.form-success { padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); margin: .6rem 0; font-size: .9rem; }
.validation-message { color: var(--danger); font-size: .82rem; margin-top: .25rem; display: block; }

/* ---------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label, .field__label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="search"],
.field textarea, .field select, .select__control {
    width: 100%; padding: .65rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--card); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 2.5rem; }
.field input:focus, .field textarea:focus, .field select:focus, .select__control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field--details summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.checkbox { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; margin: .4rem 0 1rem; cursor: pointer; }
.checkbox input { margin-top: .25rem; accent-color: var(--accent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-bottom: 1.2rem; }
.panel h2 { font-size: 1.2rem; }

/* ---------------------------------------------------------------- header */

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

.site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 1.1rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand__mark { flex: 0 0 auto; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand__name { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }

.search { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill); padding: .3rem .4rem .3rem .9rem; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; padding: .4rem 0; }
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__icon { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search__go { border: 0; background: var(--ink); color: var(--bg); border-radius: var(--radius-pill); padding: .45rem .9rem; font: inherit; font-weight: 600; font-size: .84rem; cursor: pointer; }
.search--header { flex: 1; min-width: 0; max-width: 560px; }
.search--hero { width: min(720px, 100%); padding: .45rem .5rem .45rem 1.1rem; box-shadow: var(--shadow); border: 0; }
.search--hero input { font-size: 1.05rem; padding: .55rem 0; }
.search--inline { width: min(420px, 100%); }

.site-nav { display: flex; gap: 1.2rem; margin-left: auto; font-weight: 500; font-size: .93rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav__create { color: var(--accent); font-weight: 600; }
.site-header__actions { display: flex; align-items: center; gap: .55rem; position: relative; }

.cart-badge { position: relative; display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; }
.cart-badge:hover { background: var(--bg-2); }
.cart-badge svg { width: 22px; height: 22px; fill: var(--ink); }
.cart-badge__count { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; display: grid; place-items: center; }

.avatar { border-radius: 50%; width: 48px; height: 48px; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--lg { width: 96px; height: 96px; }

.user-menu { position: relative; }
.user-menu__summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .2rem .5rem .2rem .2rem; border-radius: var(--radius-pill); }
.user-menu__summary::-webkit-details-marker { display: none; }
.user-menu__summary:hover { background: var(--bg-2); }
.user-menu__name { font-size: .9rem; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .4rem; display: flex; flex-direction: column; z-index: 50; }
.user-menu__panel a, .user-menu__panel button { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 6px; font-size: .9rem; color: var(--ink); }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: var(--bg-2); text-decoration: none; }
.user-menu__logout { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }

/* The panel anchors to the actions row's right edge, not the button's: the button sits mid-header on a phone. */
.site-menu { display: none; position: static; }
.site-menu__summary { list-style: none; display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; }
.site-menu__summary::-webkit-details-marker { display: none; }
.site-menu__summary:hover, .site-menu[open] .site-menu__summary { background: var(--bg-2); }
.site-menu__summary svg { width: 22px; height: 22px; fill: var(--ink); }

@media (max-width: 1080px) {
    .site-nav { display: none; }
    .site-menu { display: block; }
    .site-header__upload, .user-menu__name { display: none; }
}
@media (max-width: 720px) {
    .site-header__inner { gap: .6rem; }
    .brand__name { display: none; }
    .search--header { padding-left: .6rem; }
    .search__go { display: none; }
}
@media (max-width: 480px) {
    .site-header__inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "brand actions"
            "search search";
        gap: .5rem .6rem;
        height: auto;
        min-height: var(--header-h);
        padding-block: .5rem;
    }
    .site-header__inner > .brand { grid-area: brand; }
    .search--header { grid-area: search; width: 100%; max-width: none; }
    .site-header__actions { grid-area: actions; justify-self: end; }
}

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

.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--bg-2); }
.site-footer__inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 2rem; padding: 2.5rem 0 1.5rem; }
.site-footer__brand p { margin: .4rem 0 0; }
.site-footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
/* Three link columns need about 330px; below that the page scrolled sideways. */
@media (max-width: 480px) { .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.site-footer__cols a { display: block; padding: .2rem 0; font-size: .92rem; color: var(--ink-2); }
.site-footer__legal { padding: 1rem 0 2rem; border-top: 1px solid var(--line); }
@media (max-width: 800px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- hero + home */

.hero {
    position: relative; min-height: 560px; display: flex; align-items: center; color: #fff;
    background: var(--ink) var(--hero) center / cover no-repeat;
}
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 6, .35) 0%, rgba(10, 8, 6, .25) 45%, rgba(10, 8, 6, .72) 100%); }
.hero__inner { position: relative; padding: 4.5rem 0 3.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
.hero__logo { border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.hero__title { font-size: clamp(2.2rem, 5vw, 3.8rem); margin: 0; text-shadow: 0 2px 20px rgba(0, 0, 0, .35); max-width: 14ch; }
.hero__lead { max-width: 620px; font-size: 1.08rem; color: rgba(255, 255, 255, .9); margin: 0 0 .6rem; }
.hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; align-items: center; }
.hero__chips-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; opacity: .8; margin-right: .2rem; }
.hero__credit { margin: 1.4rem 0 0; font-size: .82rem; opacity: .85; }
.hero__credit a { text-decoration: underline; text-underline-offset: 3px; }

.section { padding: 3rem 0 0; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section__head h2, .section__head h1 { margin-bottom: .2rem; }
.section__head p { margin: 0; }

.studio-teaser { margin-top: 4rem; background: var(--ink); color: var(--bg); }
@media (prefers-color-scheme: dark) { .studio-teaser { background: #1a1512; color: var(--ink); } }
.studio-teaser__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; padding: 3.5rem 0; }
.studio-teaser__copy h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.studio-teaser__copy p { color: rgba(255, 255, 255, .8); max-width: 520px; }
.prompt-form { display: flex; gap: .5rem; margin: 1.2rem 0 .8rem; }
.prompt-form input { flex: 1; min-width: 0; padding: .8rem 1rem; border-radius: var(--radius-pill); border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; }
.prompt-form input::placeholder { color: rgba(255, 255, 255, .55); }
.prompt-form input:focus { outline: none; border-color: var(--accent); }
.studio-teaser .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .9); }
.studio-teaser__art { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.studio-teaser__tile { display: block; border-radius: var(--radius); overflow: hidden; background: var(--tone); aspect-ratio: 4 / 3; box-shadow: var(--shadow); transform: rotate(0); transition: transform .2s; }
.studio-teaser__tile:hover { transform: scale(1.02); }
.studio-teaser__tile img { width: 100%; height: 100%; object-fit: cover; }
.studio-teaser__tile:nth-child(2) { margin-top: 1.5rem; }
.studio-teaser__tile:nth-child(3) { margin-top: -1.5rem; }
@media (max-width: 900px) { .studio-teaser__inner { grid-template-columns: minmax(0, 1fr); } .studio-teaser__tile:nth-child(n) { margin-top: 0; } }

.prompt-ideas { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.prompt-ideas--wrap { justify-content: center; max-width: 720px; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.category-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 5 / 4; border-radius: var(--radius); overflow: hidden; background: var(--tone); color: #fff; padding: 1rem; isolation: isolate; }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .3s; }
.category-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .7)); }
.category-card:hover img { transform: scale(1.04); }
.category-card:hover { text-decoration: none; }
.category-card__name { position: relative; font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.category-card__count { position: relative; font-size: .8rem; opacity: .85; }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.collection-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.collection-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.collection-card__cover { aspect-ratio: 3 / 2; background: var(--tone); overflow: hidden; }
.collection-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.collection-card__cover--multi { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.collection-card__cover--multi img:first-child { grid-row: span 2; }
.collection-card__body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; }

.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cta-card { background: var(--accent-soft); border-radius: var(--radius); padding: 2rem; }
.cta-card--alt { background: var(--bg-2); }
.cta-card p { color: var(--ink-2); max-width: 46ch; }
@media (max-width: 760px) { .cta-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- masonry grid + cards */

.masonry { columns: 4 260px; column-gap: 14px; }
.masonry > * { break-inside: avoid; margin-bottom: 14px; }

.img-card { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--tone, var(--bg-2)); box-shadow: var(--shadow-sm); isolation: isolate; }
.img-card:hover { text-decoration: none; }
.img-card__media { position: relative; width: 100%; background: var(--tone, var(--bg-2)); }
.img-card__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.img-card:hover .img-card__media > img { transform: scale(1.03); }
.img-card__overlay { position: absolute; inset: auto 0 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; padding: 2.2rem .8rem .8rem; color: #fff; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .68)); opacity: 0; transition: opacity .2s; }
.img-card:hover .img-card__overlay, .img-card:focus-visible .img-card__overlay { opacity: 1; }
@media (hover: none) { .img-card__overlay { opacity: 1; padding-top: 1.4rem; } }
.img-card__meta { display: flex; flex-direction: column; min-width: 0; }
.img-card__title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-card__creator { font-size: .78rem; opacity: .85; }
.img-card__ai { position: absolute; top: .55rem; left: .55rem; padding: .15rem .45rem; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .06em; backdrop-filter: blur(4px); }

.watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: var(--wm-opacity, .6); mix-blend-mode: multiply; }
.watermark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9)); }
.watermark--grid img { transform: scale(.92); }
@media (prefers-color-scheme: dark) { .watermark { mix-blend-mode: normal; } }

.wm-frame { position: relative; width: 100%; background: var(--tone, var(--bg-2)); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.wm-frame > img { width: 100%; height: 100%; object-fit: contain; }

.empty-state { padding: 2rem 1rem; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.empty-state--tall { padding: 5rem 1rem; }
/* Links in running text are underlined: colour alone is 1.15:1 against --muted (#3168). */
.empty-state a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.load-more { display: flex; justify-content: center; padding: 1.5rem 0; }

.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--card), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
.skeleton--block { height: 260px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- explore */

.explore { padding-top: 1.8rem; }
.explore__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.explore__title { margin-bottom: .1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; padding: .9rem 0 1.3rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.filter-group { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.filter-group__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: .2rem; }
.filter-group--selects { margin-left: auto; gap: .8rem; }
.select { display: flex; align-items: center; gap: .4rem; }
.select select { padding: .4rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .88rem; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); background: var(--swatch); cursor: pointer; padding: 0; transition: transform .12s; }
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--ink); }
.swatch--any { background: conic-gradient(#f2632f, #e9c25a, #3f8f4a, #2f6fd6, #7a4fc9, #e86aa0, #f2632f); }

/* ---------------------------------------------------------------- image detail */

.detail { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); gap: 2rem; padding-top: 1.6rem; align-items: start; }
.detail__media { position: relative; }
.detail__side { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: calc(var(--header-h) + 16px); }
.detail__title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 0; }
.detail__description { color: var(--ink-2); margin: 0; }
.detail__link { display: inline-block; margin-top: .5rem; font-size: .88rem; color: var(--accent); }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } .detail__side { position: static; } }

.creator-card { display: flex; align-items: center; gap: .8rem; }
.creator-card__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.creator-card__name { font-weight: 600; }
.owned-pill { position: absolute; top: 1rem; left: 1rem; padding: .35rem .7rem; border-radius: var(--radius-pill); background: var(--green); color: #fff; font-size: .8rem; font-weight: 600; box-shadow: var(--shadow-sm); }

.stats { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.stat strong { color: var(--ink); }
.stat--button { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill); padding: .2rem .7rem; font: inherit; font-size: .88rem; cursor: pointer; color: var(--muted); }
.stat--button.is-active { border-color: var(--accent); color: var(--accent); }
.stat--button.is-active strong { color: var(--accent); }

.license-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .7rem; }
.license-box h3 { margin: 0; }
.license-box--free { background: var(--green-soft); border-color: transparent; }
.license-option { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio name price" "radio summary summary"; gap: .1rem .7rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.license-option:hover { background: var(--bg-2); }
.license-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.license-option input { grid-area: radio; accent-color: var(--accent); }
.license-option__name { grid-area: name; font-weight: 600; }
.license-option__price { grid-area: price; font-weight: 700; font-variant-numeric: tabular-nums; }
.license-option__summary { grid-area: summary; font-size: .8rem; color: var(--muted); }
/* --muted falls under 4.5:1 on the accent tint in both themes (#3168). */
.license-option.is-selected .license-option__summary, .model-option.is-selected .model-option__cost { color: var(--ink-2); }
.attribution { background: rgba(255, 255, 255, .55); border-radius: var(--radius-sm); padding: .8rem; display: flex; flex-direction: column; gap: .5rem; font-size: .88rem; }
@media (prefers-color-scheme: dark) { .attribution { background: rgba(0, 0, 0, .25); } }
.attribution code { display: block; white-space: normal; word-break: break-word; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .88rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.meta__prompt a { display: block; color: var(--accent); }

/* ---------------------------------------------------------------- studio */

.studio { display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.studio__panel { border-right: 1px solid var(--line); background: var(--card); padding: 1.4rem 1.3rem 2rem; overflow-y: auto; max-height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h); }
.studio__panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.studio__panel-head h1 { margin: 0; font-size: 1.6rem; }
.credits-pill { padding: .3rem .7rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; }
.studio__canvas { padding: 1.6rem 2rem 3rem; display: flex; flex-direction: column; gap: 1.4rem; }
@media (max-width: 960px) {
    .studio { grid-template-columns: 1fr; }
    .studio__panel { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .studio__canvas { padding: 1.2rem 1rem 2rem; }
}

.model-list { display: flex; flex-direction: column; gap: .4rem; }
.model-option { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.model-option:hover { background: var(--bg-2); }
.model-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.model-option input { accent-color: var(--accent); }
.model-option__text { display: flex; flex-direction: column; flex: 1; font-size: .88rem; }
.model-option__text small { font-size: .78rem; }
.model-option__cost { font-size: .8rem; font-weight: 700; color: var(--muted); }

.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.style-tile { position: relative; aspect-ratio: 5 / 3; border-radius: var(--radius-sm); border: 2px solid transparent; background: var(--swatch); cursor: pointer; padding: 0; overflow: hidden; display: flex; align-items: flex-end; }
.style-tile span { width: 100%; padding: .3rem .4rem; font-size: .72rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); text-align: left; }
.style-tile.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }

.ratio-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.ratio-btn { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink-2); font: inherit; font-size: .72rem; cursor: pointer; min-width: 52px; }
.ratio-btn i { display: block; width: 22px; border: 2px solid currentColor; border-radius: 3px; }
.ratio-btn.is-selected { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.count-row { display: flex; gap: .4rem; }
.count-btn { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.count-btn.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.studio__generate { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }

.gen-progress { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.gen-progress > div { flex: 1; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-top: .4rem; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

.gen-results { display: grid; gap: 1.2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gen-results--1 { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.gen-results--3, .gen-results--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gen-results--grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 640px) { .gen-results { grid-template-columns: 1fr; } }
.gen-card { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.gen-card__media { background: var(--tone, var(--bg-2)); }
.gen-card__media img { width: 100%; height: 100%; object-fit: contain; }
.gen-card__caption { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.gen-card__prompt { margin: 0; font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gen-card__actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem; }

.studio__empty { text-align: center; padding: 4rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.studio__empty img { border-radius: 16px; box-shadow: var(--shadow); margin-bottom: .6rem; }
.studio__empty p { max-width: 460px; }

.history { margin-top: auto; }
.history-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; }
.history-thumb { flex: none; width: 88px; height: 66px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--bg-2); padding: 0; cursor: pointer; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-thumb.is-active { border-color: var(--accent); }

.publish-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1.2fr); gap: 1.4rem; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 1.3rem; }
.publish-panel__preview { background: var(--tone, var(--bg-2)); border-radius: var(--radius-sm); overflow: hidden; }
.publish-panel__preview img { width: 100%; height: 100%; object-fit: contain; }
.publish-panel__form h2 { font-size: 1.3rem; }
@media (max-width: 760px) { .publish-panel { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- pricing */

.pricing-hero { padding: 3rem 0 1.5rem; text-align: center; max-width: 720px; }
.pricing-hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: stretch; }
.plan-grid--compact { margin-bottom: 1.2rem; }
.plan-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.5rem; display: flex; flex-direction: column; gap: .6rem; }
.plan-card--highlight { border-color: var(--accent); box-shadow: var(--shadow); }
.plan-card__flag { position: absolute; top: -12px; left: 1.4rem; padding: .2rem .7rem; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 700; }
.plan-card h2 { font-size: 1.4rem; margin: 0; }
.plan-card__price { display: flex; align-items: baseline; gap: .4rem; }
.plan-card__price strong { font-family: var(--display); font-size: 2.2rem; font-weight: 600; }
.plan-card__features { list-style: none; margin: 0 0 .6rem; padding: 0; flex: 1; display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.plan-card__features li::before { content: "\2713"; color: var(--green); font-weight: 700; margin-right: .5rem; }

.compare-table-wrap { overflow-x: auto; }
.compare-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare-table th, .compare-table td { padding: .9rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .92rem; }
.compare-table th { background: var(--bg-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: .8rem 0; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: .6rem 0 0; color: var(--ink-2); }

.license-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.license-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.license-card h2 { font-size: 1.4rem; }
.license-card h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem 0 .3rem; }
.license-card ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; }

/* ---------------------------------------------------------------- cart, checkout, orders */

.cart, .checkout, .order, .library, .upload { padding-top: 1.8rem; }
.cart__layout, .checkout__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .cart__layout, .checkout__layout { grid-template-columns: 1fr; } }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.cart-table td { padding: .8rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-table__title { font-weight: 600; }
.cart-thumb { display: block; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--tone, var(--bg-2)); flex: none; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
td.cart-thumb { display: table-cell; width: 96px; }
td.cart-thumb a { display: block; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; }

.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; display: flex; flex-direction: column; gap: .55rem; }
.summary h2 { font-size: 1.2rem; margin-bottom: .3rem; }
.summary__row { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.summary__line { font-size: .88rem; }
.summary__total { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .2rem; font-weight: 700; font-size: 1.1rem; }
.summary .btn { margin-top: .5rem; }

.pay-method { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .5rem; cursor: pointer; }
.pay-method.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.pay-method input { margin-top: .25rem; accent-color: var(--accent); }
.pay-method span { display: flex; flex-direction: column; }
.pay-method small { font-size: .8rem; }

.order__head { margin-bottom: 1.5rem; }
.order-lines { display: flex; flex-direction: column; gap: .6rem; }
.order-line { display: flex; align-items: center; gap: 1rem; padding: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.order-line__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.order__footer { display: flex; justify-content: flex-end; margin-top: 1.4rem; }
.order__footer .summary { width: min(380px, 100%); }
.order-panel .section__head { margin-bottom: .8rem; }

/* ---------------------------------------------------------------- auth */

.auth-page { display: grid; place-items: center; padding: 3rem 1rem; min-height: calc(100vh - var(--header-h) - 120px); }
.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem; }
.auth-card .brand__mark { margin-bottom: .4rem; }
.auth-card h1 { font-size: 1.8rem; margin: 0; }
.auth-card form { margin-top: .6rem; }
.auth-card .btn-block { margin-top: .4rem; }
.demo-hint { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; }

/* ---------------------------------------------------------------- profile + library */

.profile-head { display: flex; align-items: center; gap: 1.4rem; padding: 2rem 0 1.5rem; }
.profile-head__text { flex: 1; min-width: 0; }
.profile-head__text h1 { margin-bottom: .2rem; }
.profile-head__handle { font-family: var(--font); font-size: 1rem; font-weight: 400; margin-left: .3rem; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .88rem; color: var(--muted); align-items: center; }
.profile-stats strong { color: var(--ink); }

.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; }
.tab { border: 0; background: none; padding: .7rem 1rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--bg-2); }
@media (max-width: 640px) {
    .compare-table-wrap .withdrawal-notice {
        inline-size: calc(100vw - 32px - 1.8rem);
        max-inline-size: calc(100vw - 32px - 1.8rem);
        overflow-wrap: anywhere;
    }
}

/* ---------------------------------------------------------------- upload */

.upload__layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .upload__layout { grid-template-columns: 1fr; } }
.upload__tips ul { padding-left: 1.1rem; font-size: .92rem; }
.preview { background: var(--tone, var(--bg-2)); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; max-height: 420px; display: grid; place-items: center; }
.preview img { max-height: 420px; width: auto; max-width: 100%; }
input[type="file"] { font: inherit; font-size: .9rem; }

/* ---------------------------------------------------------------- about */

.about { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 3rem; padding-top: 2.5rem; align-items: start; }
.about__logo img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } .about__logo { max-width: 260px; } }

/* ---------------------------------------------------------------- blazor reconnect UI */

#components-reconnect-modal { font-family: var(--font); }

/* Installable web app (decision D5): the install button appears only once the browser offers a prompt, and the
   update notice only when a newer build has taken over while this page was open. */
.pwa-install { display: none; margin-top: .75rem; }
html.pwa-installable:not(.pwa-standalone) .pwa-install { display: inline-flex; }
.pwa-update {
    position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 60;
    display: flex; align-items: center; gap: .75rem; max-width: calc(100vw - 2rem);
    padding: .65rem .75rem .65rem 1.1rem; border-radius: 999px;
    background: var(--ink); color: var(--bg); font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.pwa-update button {
    border: 0; border-radius: 999px; padding: .45rem .9rem; font: inherit; font-weight: 600; cursor: pointer;
    background: var(--bg); color: var(--ink);
}
