/* =====================================================================
   PieceCraft — design tokens, reset, typography, layout primitives
   Spacing: strict 8px scale. Type: modular scale with fluid clamp().
   ===================================================================== */

:root {
	/* Colour */
	--bg: #FAF8F3;
	--bg-2: #F3EFE6;
	--bg-3: #ECE6D8;
	--surface: #FFFFFF;
	--ink: #0E1330;
	--ink-2: #3B4262;
	--muted: #6A7088;
	--line: #E8E2D4;
	--line-2: #D9D1BE;
	--accent: #B13F00;
	--accent-2: #F26A1B;
	--accent-ink: #8A2F00;
	--accent-soft: #FFEBDD;
	--accent-grad: linear-gradient(135deg, #C24400 0%, #F26A1B 100%);
	--navy: #0B1026;
	--navy-2: #151C3D;
	--gold: #F5B544;
	--green: #1F8A5B;
	--green-soft: #DDF3E8;
	--blue-soft: #E4EAFF;
	--rose-soft: #FFE3E8;
	--violet-soft: #ECE4FF;

	/* Space (8px scale) */
	--s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 24px;
	--s-6: 32px; --s-7: 40px;  --s-8: 48px;  --s-9: 64px;  --s-10: 80px;
	--s-11: 96px; --s-12: 128px;

	/* Radius */
	--r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px; --r-pill: 999px;

	/* Shadow */
	--sh-xs: 0 1px 2px rgba(14, 19, 48, .06);
	--sh-sm: 0 2px 8px rgba(14, 19, 48, .06), 0 1px 2px rgba(14, 19, 48, .04);
	--sh-md: 0 12px 32px -8px rgba(14, 19, 48, .14), 0 2px 6px rgba(14, 19, 48, .05);
	--sh-lg: 0 32px 64px -16px rgba(14, 19, 48, .22), 0 4px 12px rgba(14, 19, 48, .06);
	--sh-accent: 0 12px 28px -8px rgba(177, 63, 0, .5);

	/* Type */
	--font-head: "Outfit", "Segoe UI", system-ui, sans-serif;
	--font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

	/* Layout */
	--container: 1240px;
	--gutter: 32px;
	--header-h: 80px;

	/* Motion */
	--ease: cubic-bezier(.22, 1, .36, 1);
	--ease-spring: cubic-bezier(.34, 1.56, .64, 1);

	color-scheme: light;
}

@media (max-width: 820px) { :root { --gutter: 24px; --header-h: 72px; } }
@media (max-width: 480px) { :root { --gutter: 20px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink-2);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 var(--s-4); }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-head); color: var(--ink); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-2); color: #fff; }

/* Type scale */
h1, .h1 { font-size: clamp(2.5rem, 1.5rem + 4.2vw, 4.5rem); line-height: 1.02; letter-spacing: -.035em; }
h2, .h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -.03em; line-height: 1.08; }
h3, .h3 { font-size: clamp(1.375rem, 1.2rem + .6vw, 1.75rem); line-height: 1.2; }
h4, .h4 { font-size: 1.125rem; line-height: 1.3; }
.lede { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 62ch; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.accent-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.eyebrow {
	display: inline-block;
	font-family: var(--font-head);
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: var(--s-4);
}

/* Layout primitives */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: calc(820px + var(--gutter) * 2); }
.section { padding-block: clamp(64px, 8vw, 112px); position: relative; }
.section-sm { padding-block: clamp(40px, 5vw, 72px); }
.section-tint { background: var(--bg-2); }
.section-dark { background: var(--navy); color: #C5CAE6; }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: var(--s-8); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lede { margin-inline: auto; }
.section-head.split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-6); flex-wrap: wrap; }
.section-head h2 + p, .section-head h2 + .lede { margin-top: var(--s-4); }
.stack > * + * { margin-top: var(--s-4); }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -64px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-sm); z-index: 999; transition: top .2s; }
.skip-link:focus { top: 16px; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .section-head { margin-bottom: var(--s-6); } }

/* ---------- Buttons ---------- */
.btn {
	--btn-bg: var(--ink);
	--btn-fg: #fff;
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
	height: 52px; padding: 0 var(--s-6);
	border-radius: var(--r-pill);
	background: var(--btn-bg); color: var(--btn-fg);
	font-family: var(--font-body); font-weight: 700; font-size: .9375rem; letter-spacing: -.005em; line-height: 1;
	white-space: nowrap;
	border: 1.5px solid transparent;
	transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, color .25s, border-color .25s;
	position: relative; isolation: isolate;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--accent-grad); box-shadow: var(--sh-accent); }
.btn-primary:hover { box-shadow: 0 16px 32px -8px rgba(177, 63, 0, .6); }
.btn-dark { --btn-bg: var(--ink); }
.btn-dark:hover { --btn-bg: var(--navy-2); }
.btn-light { --btn-bg: #fff; --btn-fg: var(--ink); border-color: var(--line); box-shadow: var(--sh-xs); }
.btn-light:hover { border-color: var(--ink); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); background: #fff; }
.btn-soft { --btn-bg: var(--bg-3); --btn-fg: var(--ink); }
.btn-soft:hover { --btn-bg: var(--line-2); }
.btn-on-dark { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: #fff; border-color: rgba(255, 255, 255, .18); }
.btn-on-dark:hover { background: rgba(255, 255, 255, .18); }
.btn-sm { height: 44px; padding: 0 var(--s-5); font-size: .875rem; }
.btn-xs { height: 36px; padding: 0 var(--s-4); font-size: .8125rem; }
.btn-lg { height: 60px; padding: 0 var(--s-7); font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); font-size: .9375rem; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }
.icon-btn {
	width: 44px; height: 44px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #fff; border: 1.5px solid var(--line); color: var(--ink);
	position: relative;
	transition: border-color .2s, transform .25s var(--ease), background-color .2s;
}
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .count {
	position: absolute; top: -4px; right: -4px;
	min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: var(--r-pill);
	background: var(--accent); color: #fff;
	font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
	box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- Pills & badges ---------- */
.pill {
	display: inline-flex; align-items: center; gap: var(--s-2);
	height: 32px; padding: 0 var(--s-4);
	border-radius: var(--r-pill);
	background: #fff; border: 1px solid var(--line);
	font-size: .8125rem; font-weight: 600; color: var(--ink-2); line-height: 1;
	white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; }
.pill.is-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.pill.is-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.is-green { background: var(--green-soft); border-color: transparent; color: #11623F; }
.badge {
	display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s-3);
	border-radius: var(--r-pill); font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1;
	background: var(--bg-3); color: var(--ink-2);
}
.badge-easy { background: var(--green-soft); color: #11623F; }
.badge-medium { background: var(--blue-soft); color: #2A3FB0; }
.badge-hard { background: var(--accent-soft); color: var(--accent-ink); }
.badge-expert { background: var(--ink); color: #fff; }
.badge-sale { background: var(--accent); color: #fff; }
.badge-new { background: var(--gold); color: var(--ink); }

/* The trust pill — a single, deliberately-sized component */
.trust-pill {
	display: inline-flex; align-items: center; gap: var(--s-3);
	height: 40px; padding: 0 var(--s-5) 0 var(--s-2);
	border-radius: var(--r-pill);
	background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-sm);
	font-size: .875rem; font-weight: 500; color: var(--ink-2); line-height: 1;
}
.trust-pill b { color: var(--ink); font-weight: 800; }
.trust-pill .tp-badge {
	display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--s-3);
	border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: .8125rem;
}
.trust-pill .tp-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(242, 106, 27, .6); animation: pulse 2s infinite; }
.trust-pill .tp-sep { width: 1px; height: 16px; background: var(--line-2); }
@media (max-width: 640px) {
	.trust-pill { height: auto; min-height: 40px; padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2); flex-wrap: wrap; justify-content: center; row-gap: 4px; font-size: .8125rem; }
	.trust-pill .tp-sep { display: none; }
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242, 106, 27, .55); } 70% { box-shadow: 0 0 0 10px rgba(242, 106, 27, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 106, 27, 0); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field > label, .label { font-size: .875rem; font-weight: 700; color: var(--ink); }
.input, .select, .textarea {
	width: 100%; height: 52px; padding: 0 var(--s-4);
	border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: #fff;
	font-size: .9375rem; color: var(--ink);
	transition: border-color .2s, box-shadow .2s;
}
.textarea { height: auto; min-height: 140px; padding: var(--s-4); resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236A7088' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
.input::placeholder, .textarea::placeholder { color: #98A0B8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(242, 106, 27, .15); }
.hint { font-size: .8125rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: var(--s-3); align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; border: 1.5px solid var(--line-2); background: #fff; margin: 1px 0 0; display: grid; place-items: center; transition: .2s; cursor: pointer; }
.check input:checked { background: var(--accent-grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.radio-card { position: relative; display: flex; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-5); border: 1.5px solid var(--line-2); border-radius: var(--r-md); background: #fff; cursor: pointer; transition: .2s; }
.radio-card:hover { border-color: var(--ink-2); }
.radio-card:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); box-shadow: 0 0 0 4px rgba(242, 106, 27, .12); }
.radio-card input { accent-color: var(--accent); width: 18px; height: 18px; }

/* Chips / segmented */
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chip {
	height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill);
	background: #fff; border: 1.5px solid var(--line); color: var(--ink-2);
	font-size: .875rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
	transition: .2s var(--ease); white-space: nowrap;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.segmented { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--bg-3); gap: 2px; }
.segmented button { height: 36px; padding: 0 var(--s-4); border-radius: var(--r-pill); font-size: .8125rem; font-weight: 700; color: var(--ink-2); transition: .2s var(--ease); }
.segmented button.is-active { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }

/* Grid children may shrink below their content so wide tables/scrollers never blow the layout out */
.acct > *, .cart-layout > *, .shop-layout > *, .tool > *, .contact > *, .legal > *, .pdp > *, .daily-layout > *, .split > *, .flow > *, .studio > *, .band > *, .acct-grid > *, .grid > * { min-width: 0; }
@media (max-width: 560px) {
	.btn-lg { height: auto; min-height: 56px; padding: 12px var(--s-5); white-space: normal; text-align: center; max-width: 100%; }
}
