/* ==========================================================================
   The Goldsmitty — public site
   ========================================================================== */

:root {
    --bg: #0b0a08;
    --surface: #14120f;
    --surface-raised: #1b1814;
    --line: rgba(227, 194, 122, 0.14);
    --line-strong: rgba(227, 194, 122, 0.35);
    --text: #ebe5d8;
    --text-muted: #a39b8b;
    --text-faint: #6f6859;
    --gold: #e3c27a;
    --gold-bright: #fedb85;
    --gold-deep: #b48a3c;

    --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
    --font-body: "Cormorant Garamond", "Garamond", Georgia, serif;

    --radius: 4px;
    --gutter: clamp(16px, 4vw, 40px);
    --content-width: 1180px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.5);

    color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-color: #3a342a var(--bg);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 400 1.1875rem/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Damask texture with a warm glow, fixed behind the page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(227, 194, 122, 0.08), transparent 70%),
        linear-gradient(to bottom, rgba(11, 10, 8, 0.35), rgba(11, 10, 8, 0.9)),
        url("../../images/bg.jpg") center / cover no-repeat var(--bg);
}

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

img {
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 200ms var(--ease);
}

a:hover {
    color: var(--gold-bright);
}

:focus-visible {
    outline: 1px solid var(--gold-bright);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

::selection {
    background: rgba(227, 194, 122, 0.3);
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--gold);
    color: var(--bg);
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 16px;
    color: var(--bg);
}

/* --- Header -------------------------------------------------------------- */

.site-header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(to bottom, rgba(11, 10, 8, 0.85), rgba(11, 10, 8, 0.4));
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: var(--content-width);
    min-height: 72px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* The logo's long "TT" deliberately hangs below the header rule */
.brand {
    position: absolute;
    left: var(--gutter);
    top: 16px;
    width: 250px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
    transition: filter 300ms var(--ease);
}

.brand:hover {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7)) brightness(1.12);
}

.main-nav ul {
    display: flex;
    gap: clamp(18px, 3vw, 40px);
    padding: 0;
    list-style: none;
}

.main-nav a {
    position: relative;
    display: block;
    padding: 24px 0;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 300ms var(--ease);
}

.main-nav a:hover,
.main-nav a.is-current {
    color: var(--gold-bright);
}

.main-nav a:hover::after,
.main-nav a.is-current::after {
    transform: scaleX(1);
}

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

.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 88px var(--gutter) 64px;
    animation: page-in 600ms var(--ease) backwards; /* not "both": a lingering transform would trap position:fixed children (filter sheet) */
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 24px;
    max-width: var(--content-width);
    width: 100%;
    margin: 0 auto;
    padding: 24px var(--gutter) 32px;
    border-top: 1px solid var(--line);
    color: var(--text-faint);
    font-size: 0.95rem;
}

/* --- Home hero ----------------------------------------------------------- */

.hero {
    max-width: 960px;
    margin: 0 auto;
}

.hero__stage {
    position: relative;
    aspect-ratio: 8 / 5;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #000;
    box-shadow: var(--shadow-lg);
}

/* Soft vignette over the slides */
.hero__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    box-shadow: inset 0 0 60px 20px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.hero__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1600ms ease-in-out, transform 7000ms linear;
}

.hero__slide.is-active {
    z-index: 1;
    opacity: 1;
    transform: scale(1);
}

/* --- Collection layout (also used by About) ------------------------------ */

.collection {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.filters {
    position: sticky;
    top: 24px;
}

.filter-group + .filter-group {
    margin-top: 22px;
}

.filter-heading {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-align: left;
    text-transform: uppercase;
    transition: color 200ms var(--ease);
}

button.filter-heading:hover,
.filter-heading[aria-pressed="true"],
.filter-heading[aria-selected="true"] {
    color: var(--gold-bright);
}

.filter-heading--label {
    color: var(--text-faint);
    cursor: default;
}

.filter-list {
    padding: 0;
    list-style: none;
}

.filter-option {
    position: relative;
    display: block;
    padding: 3px 0 3px 18px;
    color: var(--text-muted);
    font-size: 1.0625rem;
    text-align: left;
    transition: color 200ms var(--ease);
}

/* Diamond marker for the selected state */
.filter-option::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    width: 6px;
    height: 6px;
    border: 1px solid var(--text-faint);
    transform: translateY(-50%) rotate(45deg);
    transition: background 200ms var(--ease), border-color 200ms var(--ease);
}

.filter-option:hover {
    color: var(--text);
}

.filter-option[aria-pressed="true"],
.filter-option[aria-selected="true"] {
    color: var(--gold-bright);
}

.filter-option[aria-pressed="true"]::before,
.filter-option[aria-selected="true"]::before {
    background: var(--gold);
    border-color: var(--gold);
}

.collection__body {
    min-width: 0;
}

/* Phone-only filter chrome (bar, chips, sheet header/footer) */
.filter-bar,
.active-filters,
.filters-backdrop,
.filters__head,
.filters__foot {
    display: none;
}

.collection__empty {
    padding: 64px 0;
    color: var(--text-faint);
    font-style: italic;
    text-align: center;
}

/* Antiguanite: the introduction replaces the grid until a filter is chosen */
.collection.is-showing-intro [data-grid],
.collection.is-showing-intro [data-empty],
.collection:not(.is-showing-intro) [data-intro] {
    display: none !important;
}

/* --- Piece grid ---------------------------------------------------------- */

.piece-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: 22px;
}

.piece__open {
    display: block;
    width: 100%;
    padding: 8px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 300ms var(--ease), transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

.piece__media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 2px;
    background: #000;
}

.piece__media::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
}

.piece__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease);
}

.piece__name {
    display: block;
    padding: 12px 6px 6px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    line-height: 1.4;
    transition: color 300ms var(--ease);
}

.piece__open:hover,
.piece__open:focus-visible {
    border-color: var(--line-strong);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.piece__open:hover img,
.piece__open:focus-visible img {
    transform: scale(1.05);
}

.piece__open:hover .piece__name,
.piece__open:focus-visible .piece__name {
    color: var(--gold-bright);
}

/* --- Piece viewer -------------------------------------------------------- */

.piece-dialog {
    width: min(760px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    color: var(--text);
    background: transparent;
    border: 0;
}

.piece-dialog::backdrop {
    background: rgba(5, 4, 3, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.piece-dialog[open] {
    animation: dialog-in 350ms var(--ease);
}

.piece-dialog[open]::backdrop {
    animation: fade-in 350ms var(--ease);
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

.piece-dialog__frame {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    background: linear-gradient(160deg, var(--surface-raised), var(--surface));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.piece-dialog__media {
    margin: 0;
    padding: 16px;
}

.piece-dialog__media img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.piece-dialog__body {
    padding: 40px 40px 24px 16px;
}

.piece-dialog__body.is-swapping {
    animation: fade-in 300ms var(--ease);
}

.piece-dialog__title {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.35;
}

.piece-specs div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
    border-bottom: 1px dotted rgba(227, 194, 122, 0.1);
}

.piece-specs dt {
    color: var(--text-muted);
}

.piece-specs dd {
    text-align: right;
}

.piece-notes {
    margin-top: 16px;
    color: var(--text-muted);
    font-style: italic;
}

.piece-dialog__nav {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    padding: 0 16px 16px;
}

.piece-dialog__step,
.piece-dialog__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    border: 1px solid var(--line);
    border-radius: 50%;
    transition: color 200ms var(--ease), border-color 200ms var(--ease), opacity 200ms var(--ease);
}

.piece-dialog__step svg,
.piece-dialog__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.piece-dialog__step:hover:not(:disabled),
.piece-dialog__close:hover {
    color: var(--gold-bright);
    border-color: var(--line-strong);
}

.piece-dialog__step:disabled {
    opacity: 0;
    pointer-events: none;
}

.piece-dialog__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    color: var(--text);
    background: rgba(11, 10, 8, 0.65);
    border-color: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* --- Prose (About, Antiguanite) ------------------------------------------ */

.prose {
    max-width: 72ch;
}

.prose h1 {
    margin-bottom: 28px;
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 400;
    letter-spacing: 0.08em;
}

.prose h2 {
    margin: 40px 0 16px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.prose p + p {
    margin-top: 1em;
}

.prose p {
    text-wrap: pretty;
}

.prose::after {
    content: "";
    display: table;
    clear: both;
}

.lede {
    font-size: 1.3rem;
    line-height: 1.55;
}

.closing {
    color: var(--gold);
    font-style: italic;
    font-size: 1.25rem;
}

.prose-figure {
    margin-bottom: 16px;
}

.prose-figure img {
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.prose-figure--plain img {
    padding: 0;
    background: none;
    border: 0;
}

.prose-figure figcaption {
    margin-top: 6px;
    color: var(--text-faint);
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
}

.prose-figure--left {
    float: left;
    margin: 6px 28px 16px 0;
}

.prose-figure--right {
    float: right;
    margin: 6px 0 16px 28px;
}

.contact-card {
    display: grid;
    gap: 2px;
    margin-bottom: 28px;
    padding: 18px 22px;
    font-style: normal;
    background: rgba(20, 18, 15, 0.7);
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold-deep);
    border-radius: var(--radius);
}

.pull-quote {
    clear: both;
    margin: 32px 0;
    padding: 4px 0 4px 24px;
    border-left: 1px solid var(--gold-deep);
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.5;
}

.pull-quote cite {
    display: block;
    margin-top: 10px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-style: normal;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.memberships {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 48px;
    padding: 0;
    list-style: none;
}

.memberships img {
    width: auto;
    max-height: 72px;
    opacity: 0.75;
    transition: opacity 300ms var(--ease);
}

.memberships img:hover {
    opacity: 1;
}

.gem-list {
    display: grid;
    gap: 28px;
}

.gem {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.gem__image {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.prose .gem__name {
    margin: 4px 0 6px;
    color: var(--gold);
    font-size: 1rem;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 860px) {
    .site-header__inner {
        flex-direction: column;
        align-items: center;
        padding-top: 18px;
    }

    .brand {
        position: static;
        width: 200px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 22px;
    }

    .main-nav a {
        padding: 14px 0;
    }

    .site-main {
        padding-top: 32px;
    }

    .collection {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    /* Filters: each group's heading on its own line, chips wrapping below */
    .filters {
        position: static;
    }

    .filter-group {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .filter-group + .filter-group {
        margin-top: 14px;
    }

    .filter-heading {
        flex: 0 0 100%;
        margin: 0;
        font-size: 0.75rem;
    }

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

    .filter-option {
        flex: none;
        padding: 3px 12px;
        font-size: 0.95rem;
        white-space: nowrap;
        border: 1px solid var(--line);
        border-radius: 999px;
    }

    .filter-option::before {
        display: none;
    }

    .filter-option[aria-pressed="true"],
    .filter-option[aria-selected="true"] {
        color: var(--bg);
        background: var(--gold);
        border-color: var(--gold);
    }

    /* --- Filters as a bottom sheet on collection pages --- */
    .collection--filterable {
        gap: 0;
    }

    .filter-bar {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 0 calc(var(--gutter) * -1);
        padding: 10px var(--gutter);
        background: rgba(11, 10, 8, 0.88);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--line);
    }

    .filter-bar__toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
        padding: 6px 16px;
        color: var(--gold-bright);
        font-family: var(--font-display);
        font-size: 0.8rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        border: 1px solid var(--line-strong);
        border-radius: 999px;
    }

    .filter-bar__toggle svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
    }

    .filter-bar__badge {
        display: grid;
        place-items: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        color: var(--bg);
        font-family: var(--font-body);
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0;
        background: var(--gold);
        border-radius: 999px;
    }

    .filter-bar__count {
        color: var(--text-muted);
        font-style: italic;
    }

    .active-filters {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding-top: 12px;
    }

    .active-filters[hidden] {
        display: none !important;
    }

    .active-filters__chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 3px 8px 3px 12px;
        color: var(--bg);
        font-size: 0.95rem;
        background: var(--gold);
        border-radius: 999px;
    }

    .active-filters__chip svg {
        width: 14px;
        height: 14px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .active-filters__clear {
        padding: 3px 6px;
        color: var(--text-muted);
        font-size: 0.95rem;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .collection--filterable .collection__body {
        padding-top: 18px;
    }

    .collection--filterable .filters {
        position: fixed;
        top: auto; /* override the desktop sidebar's sticky offset */
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        display: flex;
        flex-direction: column;
        max-height: 85dvh;
        margin: 0;
        background: var(--surface-raised);
        border-top: 1px solid var(--line-strong);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 320ms var(--ease), visibility 0s linear 320ms;
    }

    .collection--filterable.is-filtering .filters {
        transform: none;
        visibility: visible;
        transition: transform 320ms var(--ease), visibility 0s;
    }

    .filters__head {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-right: var(--gutter);
        padding-bottom: 12px;
        padding-left: var(--gutter);
        border-bottom: 1px solid var(--line);
    }

    /* The header (and its grabber) drags the sheet down to dismiss it */
    .filters__head {
        position: relative;
        padding-top: 22px;
        touch-action: none;
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }

    .filters__head:active {
        cursor: grabbing;
    }

    .filters__grabber {
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 5px;
        background: var(--line-strong);
        border-radius: 999px;
        transform: translateX(-50%);
        transition: background 150ms var(--ease), width 150ms var(--ease);
    }

    .filters.is-dragging .filters__grabber {
        width: 48px;
        background: var(--gold);
    }

    .collection--filterable .filters.is-dragging,
    .filters-backdrop.is-dragging {
        transition: none !important;
        animation: none;
    }

    .filters__title {
        flex: 1;
        color: var(--gold-bright);
        font-family: var(--font-display);
        font-size: 1rem;
        font-weight: 400;
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    .filters__clear {
        color: var(--text-muted);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .filters__close {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        color: var(--text-muted);
        border: 1px solid var(--line);
        border-radius: 50%;
    }

    .filters__close svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
    }

    .collection--filterable .filters__inner {
        flex: 1;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 16px var(--gutter);
    }

    .filters__foot {
        display: block;
        padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
    }

    .filters__apply {
        width: 100%;
        min-height: 48px;
        color: var(--bg);
        font-family: var(--font-display);
        font-size: 0.85rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        background: linear-gradient(to bottom, var(--gold-bright), var(--gold));
        border-radius: var(--radius);
    }

    .filters-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        background: rgba(5, 4, 3, 0.65);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        animation: fade-in 250ms var(--ease);
    }

    .filters-backdrop[hidden] {
        display: none !important;
    }

    html.has-sheet {
        overflow: hidden;
    }

    .filter-option {
        min-height: 36px;
    }

    .piece-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .piece-dialog__frame {
        grid-template-columns: minmax(0, 1fr);
    }

    .piece-dialog__body {
        padding: 8px 20px 16px;
    }
}

@media (max-width: 560px) {
    .main-nav ul {
        gap: 4px 16px;
    }

    .main-nav a {
        font-size: 0.75rem;
        letter-spacing: 0.12em;
    }

    .prose-figure--left,
    .prose-figure--right {
        float: none;
        margin: 24px auto;
        width: fit-content;
    }

    .gem {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 16px;
    }

    .gem__image {
        width: 64px;
        height: 64px;
    }

    .site-footer {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .main-nav ul {
        gap: 4px 11px;
    }

    .main-nav a {
        font-size: 0.68rem;
        letter-spacing: 0.07em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}
