:root {
    --ink: #24180f;
    --muted: #6b5848;
    --burgundy: #7b2d26;
    --burgundy-deep: #3d1f18;
    --gold: #e0b429;
    --gold-deep: #b88914;
    --cream: #f3e7d4;
    --paper: #fffaf3;
    --linen: #f7f0e4;
    --teal: #1f6f68;
    --oak: #c0783a;
    --stone: #8c7b6b;
    --hairline: rgba(125, 45, 38, 0.14);
    --shadow: 0 18px 40px rgba(36, 24, 15, 0.12);
    --radius: 1.15rem;
}

html, body {
    margin: 0;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(224, 180, 41, 0.12), transparent 50%),
        radial-gradient(900px 400px at 100% 0%, rgba(31, 111, 104, 0.08), transparent 45%),
        var(--cream);
    color: var(--ink);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    line-height: 1.55;
}

h1, h2, h3, h4, .brand-word {
    font-family: "Cormorant Garamond", Georgia, serif;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

a { color: var(--burgundy); }
a:hover { color: var(--burgundy-deep); }

img { max-width: 100%; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    background: var(--gold);
    color: var(--burgundy-deep);
    padding: .5rem .9rem;
    border-radius: 999px;
    z-index: 50;
    font-weight: 800;
}
.skip-link:focus { top: 1rem; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.beta-bar {
    background: #2a1712;
    color: #f6ead6;
    font-size: .86rem;
    letter-spacing: .04em;
    padding: .45rem 1.4rem;
    display: flex;
    justify-content: center;
    gap: .7rem;
    flex-wrap: wrap;
    text-align: center;
}
.beta-bar strong { color: var(--gold); }
.beta-bar a { color: #fff4d8; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.4rem;
    background:
        linear-gradient(90deg, #2a1510 0%, #7b2d26 46%, #b88914 100%);
    color: #fff8e8;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 10px 28px rgba(36, 24, 15, .28);
    border-bottom: 3px solid var(--gold);
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff8e8;
    text-decoration: none;
    line-height: 1.05;
}
.brand img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(224, 180, 41, .7);
    background: #1b100c;
}
.brand small {
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
    font-size: .64rem;
    font-weight: 800;
    display: block;
}
.brand .brand-word { font-size: 1.55rem; font-weight: 700; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger {
    display: none;
    background: rgba(255, 248, 232, .12);
    color: #fff8e8;
    border: 1px solid rgba(255, 248, 232, .28);
    border-radius: 999px;
    padding: .45rem .9rem;
    font-weight: 800;
    cursor: pointer;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .55rem;
    align-items: center;
}
.nav a, .nav button {
    color: #fff8e8;
    text-decoration: none;
    background: none;
    border: 0;
    font-weight: 700;
    padding: .38rem .7rem;
    border-radius: 999px;
    font-size: .95rem;
}
.nav a.active, .nav a:hover, .nav button:hover {
    background: rgba(255, 248, 232, .16);
}
.nav .cta {
    background: var(--gold) !important;
    color: #3d1f18 !important;
}
.nav-cart { position: relative; }
.nav-cart .count {
    display: inline-flex;
    min-width: 1.2rem;
    height: 1.2rem;
    align-items: center;
    justify-content: center;
    margin-left: .25rem;
    border-radius: 999px;
    background: var(--gold);
    color: #3d1f18;
    font-size: .72rem;
    font-weight: 800;
    padding: 0 .28rem;
}

.hero {
    position: relative;
    min-height: min(86vh, 760px);
    display: grid;
    place-items: end start;
    color: #fff8e8;
    overflow: hidden;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(24, 14, 10, .62) 0%, rgba(24, 14, 10, .18) 46%, transparent 70%),
        linear-gradient(180deg, transparent 20%, rgba(24, 14, 10, .78) 100%);
}
.hero-copy { position: relative; z-index: 1; padding: 3.4rem 1.6rem 3.2rem; max-width: 42rem; }
.kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: rgba(224, 180, 41, .16);
    border: 1px solid rgba(224, 180, 41, .45);
    color: var(--gold);
    border-radius: 999px;
    padding: .22rem .7rem;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hero-copy h1 {
    font-size: clamp(2.8rem, 7vw, 5.1rem);
    margin: .45rem 0 .55rem;
    text-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.hero-copy p { font-size: 1.12rem; max-width: 34rem; color: #f6ead6; }
.btn-row { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.15rem; }

.band { padding: 3.6rem 1.5rem; }
.inner { max-width: 1180px; margin: 0 auto; }
.band.paper { background: var(--paper); }
.band.ink {
    background: linear-gradient(160deg, #2a1510, #7b2d26 70%);
    color: #fff6e8;
}
.band.teal { background: #1b4f4b; color: #f4efe4; }
.band.linen {
    background:
        linear-gradient(180deg, rgba(255, 250, 243, .4), rgba(243, 231, 212, .9)),
        var(--linen);
}

.lede { color: var(--muted); font-size: 1.08rem; max-width: 42rem; }
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); }
.section-head a { font-weight: 800; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.mosaic { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; margin-top: 1.6rem; }

.listing-card, .card, .tile, .panel, .stat {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--hairline);
}
.listing-card, .tile { text-decoration: none; color: inherit; display: block; transition: transform .2s ease, box-shadow .2s ease; }
.listing-card:hover, .tile:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(36, 24, 15, .16); color: inherit; }

.listing-photo, .tile-photo { position: relative; overflow: hidden; }
.listing-photo img, .card img, .tile-photo img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
    transition: transform .45s ease;
}
.listing-card:hover img, .tile:hover img { transform: scale(1.05); }
.listing-body, .card .body, .panel, .stat { padding: 1.05rem 1.15rem 1.25rem; }
.listing-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .35rem; }
.listing-card h3, .card h3 { margin: .15rem 0 .35rem; font-size: 1.45rem; }
.listing-blurb {
    color: var(--muted);
    font-size: .94rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.listing-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: .7rem;
    gap: .5rem;
}
.listing-cta { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--burgundy); }

.place-hub-art {
    height: 230px;
    background: linear-gradient(135deg, #0B3D5C 0%, #0E7490 55%, #0F766E 100%);
}
.listing-card.place-card { cursor: default; }

.price { color: var(--burgundy); font-weight: 800; font-size: 1.18rem; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tag {
    display: inline-block;
    background: #f3e0c2;
    color: #7b2d26;
    border-radius: 999px;
    padding: .12rem .55rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tag-quiet { background: #efe7da; color: #5c4638; }
.tag-gold { background: var(--gold); color: #3d1f18; }
.photo-chip {
    position: absolute;
    left: .7rem;
    bottom: .7rem;
    background: rgba(36, 24, 15, .78);
    color: #fff6e8;
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .72rem;
    font-weight: 800;
}
.photo-chip.sample {
    top: .7rem;
    bottom: auto;
    background: #d4a017;
    color: #2a1712;
}

.tile { position: relative; min-height: 180px; }
.tile.wide { grid-column: span 7; }
.tile.narrow { grid-column: span 5; }
.tile.third { grid-column: span 4; }
.tile-photo img { height: 220px; }
.tile .caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.1rem 1.15rem;
    background: linear-gradient(transparent, rgba(24, 14, 10, .82));
    color: #fff8e8;
}
.tile .caption h3 { margin: 0; font-size: 1.7rem; }
.tile .caption p { margin: .2rem 0 0; color: #f0e2cc; font-size: .92rem; }

.btn, .btn-pop, .btn-gold, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 0;
    border-radius: 999px;
    padding: .78rem 1.25rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.1;
}
.btn-pop { background: var(--burgundy); color: white; }
.btn-pop:hover { background: #641f1a; color: white; }
.btn-gold { background: var(--gold); color: #3d1f18; }
.btn-gold:hover { background: #f0c64a; color: #3d1f18; }
.btn-ghost {
    background: transparent;
    color: inherit;
    box-shadow: inset 0 0 0 2px currentColor;
}
.btn-sm { padding: .45rem .85rem; font-size: .86rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-row .btn { padding: .5rem .95rem; }

.page-hero {
    padding: 2.4rem 1.5rem 1.4rem;
    background:
        linear-gradient(120deg, #2a1510, #7b2d26 50%, #1f6f68);
    color: #fff8e8;
    border-bottom: 3px solid var(--gold);
}
.page-hero h1 { margin: .2rem 0; font-size: clamp(2.1rem, 4vw, 3.4rem); }
.page-hero p { margin: .3rem 0 0; color: #f4e6d0; max-width: 40rem; }

.flash {
    background: #fff1c2;
    border-left: 6px solid var(--gold);
    padding: .85rem 1rem;
    border-radius: .55rem;
    margin: 1rem 0;
}
.flash.ok { background: #e7f5ef; border-left-color: var(--teal); }
.flash.warn { background: #fde8d8; border-left-color: var(--oak); }

.panel { padding: 1.15rem 1.2rem 1.3rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1.2rem 0 1.8rem; }
.stat h3 { margin: 0; font-size: 2rem; }
.stat p { margin: .2rem 0 0; color: var(--muted); }

.piece-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 1.7rem;
    align-items: start;
}
.piece-photo {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--hairline);
    background: #1b100c;
}
.piece-photo img { width: 100%; max-height: 640px; object-fit: cover; display: block; }
.buy-card { position: sticky; top: 5.5rem; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0 1.2rem; }
.spec { background: var(--linen); border-radius: .8rem; padding: .7rem .8rem; }
.spec span { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.spec strong { font-size: .98rem; }

.line-row {
    display: grid;
    grid-template-columns: 96px 1fr auto auto;
    gap: 1rem;
    align-items: center;
}
.thumb {
    width: 96px;
    height: 76px;
    object-fit: cover;
    border-radius: .7rem;
    background: #efe7da;
}
.search {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 0 0 1.1rem;
}
.search input {
    flex: 1;
    min-width: 220px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 1.2rem;
}
.form-control, .form-select, textarea.form-control, select.form-control {
    border-radius: .75rem;
    border: 1px solid #e4d3bc;
    padding: .75rem .9rem;
    background: #fffdf8;
    color: var(--ink);
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 3px rgba(224, 180, 41, .25);
    outline: none;
}
label.field { display: block; font-weight: 800; font-size: .82rem; margin: 0 0 .35rem; }
.preview-frame {
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 220px;
    background:
        repeating-conic-gradient(#efe7da 0% 25%, #fffaf3 0% 50%) 50% / 22px 22px;
    display: grid;
    place-items: center;
    border: 1px dashed #d8c4a8;
}
.preview-frame img { width: 100%; height: 280px; object-fit: cover; display: block; }
.drop-note { padding: 1.2rem; color: var(--muted); text-align: center; }

.admin-list { display: grid; gap: .8rem; }
.admin-row {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 1rem;
    align-items: center;
}
.tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    min-height: calc(100vh - 210px);
}
.auth-art { position: relative; overflow: hidden; min-height: 320px; }
.auth-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(24,14,10,.55)); }
.auth-copy { position: relative; z-index: 1; color: #fff8e8; padding: 2rem; display: flex; flex-direction: column; justify-content: end; height: 100%; }
.auth-form { padding: 2.4rem 1.6rem; }
.auth-form h1 { font-size: 2.6rem; margin-bottom: .3rem; }
.auth-card { max-width: 440px; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; }
.how article { padding: 1.2rem 1.2rem 1.3rem; }
.how h3 { margin: .2rem 0 .4rem; font-size: 1.5rem; }

.footer {
    background: #1b100c;
    color: #efe3d2;
    padding: 2.4rem 1.5rem 1.6rem;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1.5rem;
}
.footer a { color: var(--gold); }
.footer .tiny { color: #cbb8a2; font-size: .88rem; }
.mark-mini { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }

.empty {
    text-align: center;
    padding: 2.4rem 1rem;
    color: var(--muted);
}

@media (max-width: 980px) {
    .tile.wide, .tile.narrow, .tile.third { grid-column: span 12; }
    .form-grid, .auth-shell, .piece-layout, .footer-grid, .how { grid-template-columns: 1fr; }
    .buy-card { position: static; }
    .line-row { grid-template-columns: 72px 1fr; }
    .line-row .price, .line-row .btn { grid-column: 2; }
    .admin-row { grid-template-columns: 72px 1fr; }
}

@media (max-width: 860px) {
    .nav-burger { display: inline-flex; margin-left: auto; }
    .topbar { flex-wrap: wrap; }
    .nav { display: none; width: 100%; }
    .nav-toggle:checked ~ .nav { display: flex; }
    .hero { min-height: 62vh; }
    .brand img { width: 38px; height: 38px; }
}

#blazor-error-ui {
    background: #fff1c2;
    bottom: 0;
    display: none;
    left: 0;
    padding: .6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

@media (prefers-reduced-motion: reduce) {
    .listing-card, .tile, .listing-photo img, .tile-photo img { transition: none; }
}
