:root {
    --background: #f7f6f2;
    --surface: #ffffff;
    --surface-muted: #efeee9;
    --surface-soft: #f1eee6;
    --text-primary: #171717;
    --text-secondary: #5f5f5a;
    --text-tertiary: #8f8c82;
    --border: #ded9cf;
    --border-strong: #cbc4b7;
    --accent: #171717;
    --accent-soft: #e8e1d4;
    --success: #4f5b46;
    --shadow-soft: 0 18px 40px rgba(23, 23, 23, 0.04);
    --radius-card: 0;
    --container: 1440px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #fbfaf7 0%, var(--background) 38%, #f2efe8 100%);
    color: var(--text-primary);
    font-family: "Instrument Sans", "Aptos", "Segoe UI", sans-serif;
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
    padding-bottom: 48px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.brand-lockup {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.wordmark {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2rem;
    letter-spacing: 0.02em;
}

.brand-note,
.muted-copy,
.site-footer,
.product-meta,
.collection-count,
.detail-list dt {
    color: var(--text-tertiary);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link,
.text-action,
.button-secondary,
.button-primary,
.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid transparent;
    font-size: 0.81rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link:hover,
.text-action:hover {
    color: var(--text-primary);
}

.nav-link.is-active,
.filter-chip.is-active {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.62);
}

.button-primary {
    background: var(--text-primary);
    color: var(--background);
    border-color: var(--text-primary);
}

.button-secondary {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.6);
}

.text-action {
    padding-inline: 0;
    min-height: auto;
    border: 0;
}

.text-action.muted {
    color: var(--text-tertiary);
}

.page-stack {
    display: grid;
    gap: 28px;
}

.home-grid,
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 32px 24px;
}

.signed-in-home-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    align-items: start;
}

.hero-card {
    grid-column: span 2;
    min-height: 320px;
}

.signed-in-hero-card {
    display: grid;
    gap: 26px;
    min-height: auto;
}

.editorial-card,
.collection-card,
.auth-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.editorial-card,
.collection-card {
    padding: 24px;
}

.hero-title,
.section-title,
.item-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.hero-title {
    max-width: 12ch;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 0.95;
}

.section-title {
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1;
}

.section-subtitle {
    margin: 0;
    font-size: 1.35rem;
}

.item-title {
    font-size: clamp(2.3rem, 4vw, 4rem);
    line-height: 0.96;
}

.hero-copy,
.section-copy {
    max-width: 54ch;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.hero-actions,
.form-actions,
.filter-cluster,
.product-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.align-end {
    justify-content: flex-end;
}

.hero-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: auto;
    padding-top: 32px;
}

.home-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-metric-card,
.home-side-card {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.48);
}

.home-metric-card {
    padding: 18px;
    display: grid;
    gap: 8px;
}

.home-metric-card h2 {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 0.95;
}

.home-metric-card p,
.home-side-card p {
    margin: 0;
    color: var(--text-secondary);
}

.home-side-card {
    padding: 24px;
    display: grid;
    gap: 18px;
    min-height: 100%;
}

.home-summary-list {
    gap: 12px;
}

.home-summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.home-summary-list li strong {
    font-weight: 500;
    color: var(--text-primary);
}

.home-section-stack {
    gap: 18px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.plain-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.editorial-list {
    display: grid;
    gap: 7px;
    color: var(--text-secondary);
}

.flash-banner,
.form-errors {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    padding: 14px 16px;
    color: var(--text-secondary);
}

.split-hero,
.item-detail-grid,
.wishlist-layout,
.auth-layout {
    display: grid;
    gap: 24px;
}

.split-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.toolbar {
    display: grid;
    gap: 16px;
}

.filter-chip {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.48);
}

.wishlist-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
}

.side-panel {
    position: sticky;
    top: 20px;
}

.side-list {
    display: grid;
    gap: 12px;
}

.side-list a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}

.product-card {
    position: relative;
}

.product-image-wrap {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-wrap img,
.collection-preview-tile img,
.item-visual-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-meta-row,
.collection-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.product-meta {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-name {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.3;
}

.product-name a:hover {
    color: var(--text-secondary);
}

.product-price,
.item-price {
    margin: 0;
    color: var(--text-primary);
}

.item-price {
    font-size: 1.05rem;
}

.badge {
    font-size: 0.68rem;
    line-height: 1;
    padding: 6px 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.form-card,
.form-grid {
    display: grid;
    gap: 18px;
}

.clean-form-card {
    max-width: 980px;
}

.clean-add-form {
    gap: 24px;
}

.form-section {
    display: grid;
    gap: 18px;
    padding-top: 4px;
}

.form-section + .form-section {
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.section-note {
    max-width: 34ch;
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.84rem;
}

.compact-form-grid {
    gap: 16px;
}

.autofill-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.autofill-button {
    min-width: 126px;
}

.two-column-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
    grid-column: 1 / -1;
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
}

.input-hint {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 10px 12px;
    font-size: 0.94rem;
    color: var(--text-primary);
}

.textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtle-toggle {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.56);
}

.checkbox-row input {
    width: 16px;
    height: 16px;
}

.item-detail-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.item-visual-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.item-meta-card {
    display: grid;
    align-content: start;
    gap: 16px;
}

.detail-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.detail-list dt,
.detail-list dd,
.collection-description,
.site-footer p {
    margin: 0;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.collection-card {
    display: grid;
    gap: 16px;
}

.collection-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.collection-description {
    color: var(--text-secondary);
}

.collection-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.collection-preview-tile {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    overflow: hidden;
}

.public-hero,
.narrow-card {
    max-width: 720px;
}

.empty-state-card {
    display: grid;
    gap: 12px;
    align-content: start;
    min-height: 220px;
}

.compact-copy {
    font-size: 0.9rem;
}

.auth-layout {
    justify-content: center;
}

.site-footer {
    padding-top: 28px;
    font-size: 0.85rem;
}

@media (max-width: 1100px) {
    .hero-card {
        grid-column: span 1;
    }

    .signed-in-home-grid,
    .wishlist-layout,
    .item-detail-grid,
    .split-hero {
        grid-template-columns: 1fr;
    }

    .home-metric-grid {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(calc(100% - 24px), var(--container));
    }

    .site-header,
    .brand-lockup,
    .section-heading-row,
    .form-section-header {
        flex-direction: column;
        align-items: start;
    }

    .home-grid,
    .product-grid,
    .collection-grid,
    .two-column-form,
    .hero-columns {
        grid-template-columns: 1fr;
    }

    .autofill-row {
        grid-template-columns: 1fr;
    }

    .align-end {
        justify-content: start;
    }
}