:root {
	color-scheme: light;
	--bg: #ffffff;
	--surface: #eceee8;
	--field: #dde4d6;
	--fg: #15181a;
	--muted: #5b635d;
	--accent: #1e3fae;
	--accent-ink: #ffffff;
	--border: #d9ddd5;
	--danger: #b42318;
	--ok: #2d6a3e;
	--radius: 4px;
	--radius-lg: 10px;
	--shadow: 0 18px 48px rgba(21, 24, 26, 0.18);
	--space: 1rem;
	--font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display: "Bricolage Grotesque", "Figtree", ui-sans-serif, system-ui, sans-serif;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

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

body.no-scroll {
	overflow: hidden;
}

a {
	color: var(--accent);
}

h1,
h2,
h3 {
	font-family: var(--display);
	letter-spacing: -0.02em;
	line-height: 1.1;
}

h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.9rem, 5vw, 2.75rem);
}

h2 {
	margin: 0 0 0.75rem;
	font-size: 1.4rem;
}

p {
	margin: 0 0 0.75rem;
}

.muted {
	color: var(--muted);
}

.small {
	font-size: 0.875rem;
}

.center {
	text-align: center;
}

.price {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.shell {
	max-width: 42rem;
	margin: 0 auto;
	padding: 0 var(--space);
}

.narrow {
	max-width: 36rem;
}

.lede {
	margin: 0 0 1rem;
	font-size: 1.1rem;
}

.hint {
	margin: 0;
	color: var(--muted);
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.6rem 1.1rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--fg);
	color: var(--bg);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:hover {
	opacity: 0.9;
}

.btn:active {
	transform: scale(0.98);
}

.btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}

.btn-lg {
	min-height: 52px;
	padding: 0.8rem 1.5rem;
	font-size: 1.05rem;
}

.btn-block {
	width: 100%;
}

.btn-secondary {
	background: transparent;
	color: var(--fg);
	border-color: var(--fg);
}

.link-btn {
	padding: 0.35rem 0;
	border: 0;
	background: none;
	color: var(--muted);
	font: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.link-btn:hover {
	color: var(--fg);
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	color: var(--fg);
	cursor: pointer;
}

.icon-btn:hover {
	background: var(--surface);
}

/* Forms */
.card,
.panel {
	padding: calc(var(--space) * 1.25);
	border-radius: var(--radius-lg);
	background: var(--surface);
}

.input,
.select,
.textarea {
	width: 100%;
	min-height: 46px;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
}

.textarea {
	resize: vertical;
}

.input:focus,
.textarea:focus {
	border-color: var(--fg);
}

.field {
	display: grid;
	gap: 0.35rem;
	margin-bottom: var(--space);
}

.field > label {
	font-size: 0.875rem;
	font-weight: 600;
}

.field-pair {
	display: grid;
	gap: 0 var(--space);
	grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
}

.stack {
	display: grid;
	gap: var(--space);
}

.row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.grid {
	display: grid;
	gap: var(--space);
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.list {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.table {
	width: 100%;
	border-collapse: collapse;
}

.table th,
.table td {
	padding: 0.6rem 0.5rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

.table th {
	font-size: 0.8125rem;
	color: var(--muted);
	font-weight: 600;
}

.empty {
	padding: calc(var(--space) * 2);
	text-align: center;
	color: var(--muted);
}

.empty-title {
	margin: 0 0 0.25rem;
	color: var(--fg);
	font-weight: 600;
}

.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: calc(var(--space) * 1.5);
	color: var(--muted);
}

.spinner {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: fab-spin 0.7s linear infinite;
}

@keyframes fab-spin {
	to {
		transform: rotate(360deg);
	}
}

.skeleton {
	display: block;
	height: 1rem;
	border-radius: calc(var(--radius) / 2);
	background: linear-gradient(90deg, var(--border), transparent, var(--border));
	background-size: 200% 100%;
	animation: fab-shimmer 1.2s linear infinite;
}

@keyframes fab-shimmer {
	to {
		background-position: -200% 0;
	}
}

.alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: var(--space);
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-left: 3px solid var(--muted);
	border-radius: var(--radius);
	background: var(--bg);
}

.alert-error {
	border-left-color: var(--danger);
	color: var(--danger);
}

.badge {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 0.8125rem;
	color: var(--muted);
}

/* Header */
.announce {
	margin: 0;
	padding: 0.5rem var(--space);
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 0.85rem;
	font-weight: 500;
	text-align: center;
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}

.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
}

.wordmark {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--fg);
	font-family: var(--display);
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	cursor: pointer;
}

.wordmark-sm {
	font-size: 1.2rem;
	margin-bottom: 0.25rem;
}

.amp {
	color: var(--accent);
}

.bag-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	padding: 0.4rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.bag-btn:hover {
	border-color: var(--fg);
}

.bag-count {
	display: inline-grid;
	place-items: center;
	min-width: 1.4rem;
	height: 1.4rem;
	padding: 0 0.3rem;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
}

/* Hero */
.hero {
	background: var(--field);
	overflow: hidden;
}

.hero-inner {
	display: grid;
	gap: 1.5rem;
	padding-top: 2.5rem;
	padding-bottom: 2rem;
}

.hero-title {
	margin: 0 0 1rem;
	font-size: clamp(2.6rem, 11vw, 5.25rem);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.045em;
	max-width: 12ch;
}

.hero-lede {
	max-width: 36ch;
	font-size: 1.1rem;
	margin-bottom: 1.5rem;
}

.hero-art {
	position: relative;
	height: 190px;
}

.hero-piece {
	position: absolute;
	width: 46%;
	max-width: 240px;
	aspect-ratio: 1;
	border-radius: var(--radius-lg);
	background: var(--bg);
	padding: 6%;
}

.hero-piece-a {
	left: 0;
	top: 10px;
	transform: rotate(-5deg);
}

.hero-piece-b {
	left: 30%;
	top: 0;
	z-index: 1;
	transform: rotate(3deg);
}

.hero-piece-c {
	right: 0;
	top: 22px;
	transform: rotate(-2deg);
}

.garment {
	display: block;
	width: 100%;
	height: 100%;
}

/* Collection */
.collection {
	padding-top: 2.5rem;
	padding-bottom: 3.5rem;
	scroll-margin-top: 72px;
}

.collection-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.collection-head h2 {
	font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.chip {
	min-height: 40px;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
}

.chip:hover {
	border-color: var(--fg);
}

.chip-on {
	background: var(--fg);
	border-color: var(--fg);
	color: var(--bg);
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.product-card {
	display: grid;
	gap: 0.35rem;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: var(--fg);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.product-art {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	padding: 12%;
	margin-bottom: 0.35rem;
	border-radius: var(--radius-lg);
	background: var(--surface);
	transition: background 0.2s ease;
}

.product-art .garment {
	transition: transform 0.25s ease;
}

.product-card:hover .product-art .garment {
	transform: scale(1.05);
}

.tag {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	padding: 0.15rem 0.5rem;
	border-radius: var(--radius);
	background: var(--bg);
	font-size: 0.78rem;
	font-weight: 600;
}

.product-name {
	font-weight: 600;
	line-height: 1.3;
}

.product-meta {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
	font-size: 0.95rem;
}

/* Overlays */
.overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(21, 24, 26, 0.45);
	animation: fade 0.18s ease;
}

.overlay-side {
	justify-content: flex-end;
	align-items: stretch;
}

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

@keyframes rise {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
}

@keyframes slide {
	from {
		transform: translateX(24px);
		opacity: 0;
	}
}

.sheet {
	position: relative;
	width: 100%;
	max-width: 56rem;
	max-height: 92vh;
	overflow-y: auto;
	border-radius: var(--radius-lg) var(--radius-lg) 0 0;
	background: var(--bg);
	box-shadow: var(--shadow);
	animation: rise 0.22s ease;
}

.sheet-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	background: var(--bg);
}

.sheet-art {
	aspect-ratio: 4 / 3;
	padding: 8%;
	background: var(--surface);
}

.sheet-body {
	padding: 1.25rem 1.25rem 1.75rem;
}

.sheet-cat {
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
}

.sheet-body h2 {
	font-size: clamp(1.6rem, 5vw, 2.2rem);
	margin-bottom: 0.35rem;
}

.sheet-price {
	font-size: 1.25rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.swatch-line {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 500;
}

.swatch {
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.2);
}

.sizes {
	margin: 0 0 1.25rem;
	padding: 0;
	border: 0;
}

.sizes legend {
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
}

.size-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.size {
	min-width: 52px;
	min-height: 48px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.size:hover {
	border-color: var(--fg);
}

.size-on {
	background: var(--fg);
	border-color: var(--fg);
	color: var(--bg);
}

.details {
	margin: 1.25rem 0 0;
	padding: 1rem 0 0 1.1rem;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.95rem;
}

.drawer {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 26rem;
	height: 100%;
	background: var(--bg);
	box-shadow: var(--shadow);
	animation: slide 0.22s ease;
}

.drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0.75rem 0.75rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
	margin: 0;
	font-size: 1.3rem;
}

.drawer-empty {
	display: grid;
	justify-items: center;
	padding: 1rem;
}

.drawer .lines {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem 1.25rem;
}

.drawer-foot {
	padding: 1rem 1.25rem 1.25rem;
	border-top: 1px solid var(--border);
}

/* Bag lines */
.lines {
	margin: 0;
	padding: 0;
	list-style: none;
}

.line {
	display: flex;
	gap: 0.85rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--border);
}

.line:last-child {
	border-bottom: 0;
}

.line-art {
	flex: none;
	width: 72px;
	height: 88px;
	padding: 8px;
	border-radius: var(--radius);
	background: var(--surface);
}

.panel .line-art {
	background: var(--bg);
}

.panel .line {
	border-bottom-color: rgba(0, 0, 0, 0.08);
}

.line-info {
	flex: 1;
	min-width: 0;
}

.line-top {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
}

.line-sub {
	margin: 0.1rem 0 0.5rem;
	font-size: 0.9rem;
}

.line-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.stepper button {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	color: var(--fg);
	cursor: pointer;
}

.stepper button:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.stepper span {
	min-width: 1.75rem;
	text-align: center;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.totals {
	margin: 0 0 1rem;
}

.totals > div {
	display: flex;
	justify-content: space-between;
	padding: 0.2rem 0;
}

.totals dt {
	color: var(--muted);
}

.totals dd {
	margin: 0;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.free-note {
	margin: 0.2rem 0;
	font-size: 0.875rem;
}

.totals .totals-grand {
	margin-top: 0.4rem;
	padding-top: 0.6rem;
	border-top: 1px solid var(--border);
	font-size: 1.15rem;
}

.totals-grand dt {
	color: var(--fg);
	font-weight: 600;
}

/* Checkout and confirmation */
.page-title {
	margin-bottom: 1.25rem;
}

.checkout,
.done,
.owner {
	padding-top: 2rem;
	padding-bottom: 3.5rem;
}

.back {
	margin-bottom: 0.75rem;
}

.checkout-grid {
	display: grid;
	gap: 2rem;
}

.checkout-form h2,
.summary h2 {
	font-size: 1.2rem;
}

.done .panel {
	margin-bottom: 1.25rem;
}

.done-total {
	display: flex;
	justify-content: space-between;
	margin: 0.75rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	font-size: 1.1rem;
}

.code {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

/* Owner */
.owner-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

.owner-head .page-title {
	margin-bottom: 0.25rem;
}

.orders {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.order-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.order-top p {
	margin: 0;
}

.status {
	padding: 0.2rem 0.6rem;
	border-radius: var(--radius);
	font-size: 0.85rem;
	font-weight: 600;
}

.status-new {
	background: var(--accent);
	color: var(--accent-ink);
}

.status-shipped {
	background: var(--bg);
	color: var(--ok);
}

.order-cols {
	display: grid;
	gap: 0.5rem 1.5rem;
	grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
	margin-bottom: 1rem;
	overflow-wrap: anywhere;
}

.order-label {
	margin: 0 0 0.15rem;
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.order-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.order-items li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.3rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.order-sum:last-child {
	border-bottom: 0;
}

/* Footer */
.footer {
	border-top: 1px solid var(--border);
	background: var(--surface);
}

.footer-inner {
	display: flex;
	justify-content: space-between;
	gap: 1rem 2rem;
	flex-wrap: wrap;
	padding-top: 2rem;
	padding-bottom: 2rem;
}

.footer-links {
	display: grid;
	gap: 0.25rem;
	align-content: start;
}

.footer-links p {
	margin: 0;
}

.footer-links a {
	color: var(--muted);
}

@media (min-width: 40rem) {
	.product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.hero-art {
		height: 260px;
	}
}

@media (min-width: 48rem) {
	.shell {
		max-width: 52rem;
		padding: 0 calc(var(--space) * 1.5);
	}

	.narrow {
		max-width: 36rem;
	}

	.overlay {
		align-items: center;
		padding: 2rem;
	}

	.overlay-side {
		align-items: stretch;
		padding: 0;
	}

	.sheet {
		display: grid;
		grid-template-columns: 1fr 1fr;
		border-radius: var(--radius-lg);
	}

	.sheet-art {
		aspect-ratio: auto;
		min-height: 100%;
		display: grid;
		place-items: center;
	}

	.sheet-body {
		padding: 2.5rem 2rem 2rem;
	}
}

@media (min-width: 64rem) {
	.shell {
		max-width: 72rem;
	}

	.narrow {
		max-width: 38rem;
	}

	.hero-inner {
		grid-template-columns: 1.1fr 1fr;
		align-items: center;
		padding-top: 4rem;
		padding-bottom: 4rem;
	}

	.hero-art {
		height: 360px;
	}

	.hero-piece {
		width: 50%;
	}

	.product-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 2rem 1.25rem;
	}

	.checkout-grid {
		grid-template-columns: 1.3fr 1fr;
		align-items: start;
	}

	.summary {
		position: sticky;
		top: 88px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spinner,
	.skeleton,
	.overlay,
	.sheet,
	.drawer {
		animation: none;
	}

	.product-art .garment,
	.btn {
		transition: none;
	}

	html {
		scroll-behavior: auto;
	}
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
