/**
 * utahcreates.com — the machine shop.
 *
 * The ground is steel paper and cards are white plates that sit ON it, so
 * every project reads as an object you could pick up. Monospace is the
 * signature face: stats, part codes and prices are stamped, never set.
 */

:root {
	--ground: #edeff2;
	--surface: #ffffff;
	--recess: #e3e7ee;
	--ink: #141a22;
	--ink-soft: #55606f;
	--accent: #2545d3;
	--accent-ink: #ffffff;
	--proof: #1f8a4c;
	--hairline: #d5dbe4;
	--shadow: rgba(20, 26, 34, 0.10);

	/* Machine families */
	--pine: #0b5f57;
	--teal: #10808c;
	--crimson: #a63434;
	--amber: #b06a12;
	--violet: #5b41a8;

	/* Machine drawing */
	--m-steel: #ccd3de;
	--m-steel-deep: #9aa6b8;
	--m-ink: #141a22;
	--m-plate: #ffffff;

	--mono: "Cascadia Code", ui-monospace, Consolas, "SF Mono", monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ground: #0d1117;
		--surface: #161d26;
		--recess: #10161e;
		--ink: #e6eaf0;
		--ink-soft: #9aa5b4;
		--accent: #7d93f2;
		--accent-ink: #0d1117;
		--proof: #4fbe7f;
		--hairline: #263140;
		--shadow: rgba(0, 0, 0, 0.5);

		--pine: #35a396;
		--teal: #3fb2bc;
		--crimson: #e07a7a;
		--amber: #d99433;
		--violet: #9c85e6;

		--m-steel: #3a4350;
		--m-steel-deep: #2a323d;
		--m-ink: #0a0e14;
		--m-plate: #1f2833;
	}
}

* { box-sizing: border-box; }

body {
	background: var(--ground);
	color: var(--ink);
	font-family: system-ui, "Segoe UI", sans-serif;
	line-height: 1.6;
	margin: 0;
}

.shell { max-width: 70rem; margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3, .brand { letter-spacing: -0.025em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

header.site {
	display: flex; align-items: center; justify-content: space-between;
	padding: 1.1rem 0; border-bottom: 1px solid var(--hairline);
	flex-wrap: wrap; gap: 0.6rem;
}
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand b { color: var(--accent); }
nav a.navlink {
	color: var(--ink-soft); text-decoration: none; margin-left: 1.3rem;
	font-size: 0.95rem; font-weight: 600;
}
nav a.navlink:hover, nav a.navlink:focus-visible, nav a.navlink[aria-current="page"] { color: var(--accent); }

footer.site {
	margin-top: 3.5rem; border-top: 1px solid var(--hairline);
	padding: 1.6rem 0 2.2rem; color: var(--ink-soft); font-size: 0.85rem;
	display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
}
footer.site a { color: var(--ink-soft); }

/* ---- Hero + page heads ---- */

.hero { padding: 3.2rem 0 2.4rem; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.06; margin: 0 0 1rem; text-wrap: balance; font-weight: 800; }
.hero h1 .u { color: var(--accent); }
.hero p.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.5rem; max-width: 34rem; }

.page-hero { padding: 2.8rem 0 0.5rem; max-width: 48rem; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 0 0 0.6rem; font-weight: 800; text-wrap: balance; }
.page-hero .lede { font-size: 1.1rem; color: var(--ink-soft); }

.cta {
	display: inline-block; background: var(--accent); color: var(--accent-ink);
	font-weight: 700; text-decoration: none; padding: 0.75rem 1.4rem; border-radius: 8px;
}
.cta.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); margin-left: 0.6rem; }
.cta.is-disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- The hero toy ---- */

.toy {
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
	padding: 1.1rem 1.2rem; box-shadow: 0 10px 30px var(--shadow);
}
.toy .toy-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; gap: 0.5rem; }
.toy .toy-title strong { font-size: 0.95rem; }
.chip {
	font-family: var(--mono); font-size: 0.7rem; padding: 0.15rem 0.5rem;
	border-radius: 999px; border: 1px solid var(--proof); color: var(--proof); white-space: nowrap;
}
.toy .apibar {
	display: flex; gap: 0.4rem; font-family: var(--mono); font-size: 0.78rem;
	background: var(--recess); border: 1px solid var(--hairline); border-radius: 8px;
	padding: 0.5rem 0.7rem; margin-bottom: 0.7rem; overflow: hidden; white-space: nowrap;
}
.toy .evidence { list-style: none; margin: 0 0 0.7rem; padding: 0; font-size: 0.85rem; }
.toy .evidence li { margin: 0.25rem 0; opacity: 0; animation: rise 0.4s ease forwards; }
.toy .evidence li::before { content: "✓ "; color: var(--proof); font-weight: 700; }
.toy .evidence li:nth-child(1) { animation-delay: 0.3s; }
.toy .evidence li:nth-child(2) { animation-delay: 0.75s; }
.toy .evidence li:nth-child(3) { animation-delay: 1.2s; }
.toy table { width: 100%; border-collapse: collapse; font-size: 0.83rem; opacity: 0; animation: rise 0.4s ease 1.7s forwards; }
.toy th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 0.25rem 0.4rem; border-bottom: 2px solid var(--hairline); }
.toy td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--hairline); }
.toy .replay { font-size: 0.78rem; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; font-weight: 700; font-family: inherit; }

@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---- Sections ---- */

section { padding: 2.6rem 0 0.6rem; }
.kicker {
	font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
	font-size: 0.72rem; color: var(--accent); margin: 0 0 0.4rem; font-weight: 600;
}
h2 { font-size: 1.75rem; margin: 0 0 0.4rem; font-weight: 800; }
.section-lede { color: var(--ink-soft); margin: 0 0 1.4rem; max-width: 46rem; }

/* ---- Tiles (arcade / generic) ---- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tile {
	border: 1px solid var(--hairline); border-radius: 12px; padding: 1rem 1.1rem;
	text-decoration: none; color: var(--ink); background: var(--surface);
	border-top: 4px solid var(--tile-hue, var(--accent));
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: block;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 26px var(--shadow); }
.tile h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.tile p { margin: 0 0 0.6rem; font-size: 0.88rem; color: var(--ink-soft); }
.tile .go { font-size: 0.82rem; font-weight: 700; color: var(--accent); }

.proofchips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.55rem 0 0; }
.proofchip {
	font-family: var(--mono); font-size: 0.68rem; color: var(--proof);
	border: 1px solid var(--proof); border-radius: 999px; padding: 0.1rem 0.5rem;
}

/* ---- Machine cards ---- */

.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.4rem; margin-top: 1.6rem; }

.mcard {
	background: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 3px 10px var(--shadow);
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.mcard:hover { transform: translateY(-3px); box-shadow: 0 16px 34px var(--shadow); }

.mcard-art {
	background: var(--recess);
	border-bottom: 1px solid var(--hairline);
	padding: 0.4rem 0.5rem 0;
	position: relative;
}
.mcard-art .machine { width: 100%; height: auto; display: block; }

.mcard-status {
	position: absolute; top: 0.7rem; right: 0.8rem;
	font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em;
	text-transform: uppercase; padding: 0.16rem 0.5rem; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--hairline); color: var(--ink-soft);
}
.mcard-status[data-status="shipping"] { color: var(--proof); border-color: var(--proof); }

.mcard-body { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.mcard-name { margin: 0; font-size: 1.15rem; font-weight: 800; }
.mcard-name .dot { color: var(--mhue, var(--accent)); }
.mcard-job { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

.mcard-stats {
	display: flex; flex-wrap: wrap; gap: 0.3rem;
	font-family: var(--mono); font-size: 0.68rem;
	font-variant-numeric: tabular-nums;
}
.mcard-stats span {
	border: 1px solid var(--proof); color: var(--proof);
	border-radius: 4px; padding: 0.1rem 0.4rem;
}
/* Plain facts (line counts, licences) are NOT verification claims — green is
   reserved for numbers a test run or recorded check produced. */
.mcard-stats span.plain { border-color: var(--hairline); color: var(--ink-soft); }

/* Exactly two slots — Details, then the money — so every card in a row is
   the same height and the eye lands in the same place on each. */
.mcard-actions {
	margin-top: auto; padding-top: 0.75rem; display: flex; gap: 0.5rem;
	align-items: center; justify-content: space-between;
	border-top: 1px solid var(--hairline);
}

.mcard-demo {
	margin: 0; font-size: 0.85rem; font-weight: 600;
}
.mcard-demo a { color: var(--mhue, var(--accent)); text-decoration: none; }
.mcard-demo a:hover { text-decoration: underline; }
.mbtn {
	font: 600 0.85rem/1 system-ui, sans-serif; text-decoration: none;
	padding: 0.55rem 0.85rem; border-radius: 7px; border: 1px solid var(--hairline);
	color: var(--ink); background: var(--surface); cursor: pointer;
}
.mbtn:hover { border-color: var(--mhue, var(--accent)); color: var(--mhue, var(--accent)); }
.mbtn.is-buy {
	background: var(--mhue, var(--accent)); border-color: var(--mhue, var(--accent));
	color: #fff; font-family: var(--mono); font-size: 0.8rem;
}
.mbtn.is-buy:hover { filter: brightness(1.08); color: #fff; }
.mbtn.is-soon { opacity: 0.6; cursor: default; font-family: var(--mono); font-size: 0.78rem; }
.mbtn.is-soon:hover { border-color: var(--hairline); color: var(--ink); }

/* ---- Detail drawer ---- */

.mdetail {
	grid-column: 1 / -1;
	background: var(--surface);
	border: 1px solid var(--mhue, var(--accent));
	border-radius: 14px;
	padding: 1.4rem 1.5rem;
	box-shadow: 0 16px 40px var(--shadow);
}
.mdetail[hidden] { display: none; }
.mdetail h3 { margin: 0 0 0.2rem; font-size: 1.4rem; font-weight: 800; }
.mdetail .mdetail-job { color: var(--ink-soft); margin: 0 0 1rem; }
.mdetail-close {
	float: right; background: none; border: 0; font-size: 1.4rem; line-height: 1;
	color: var(--ink-soft); cursor: pointer; padding: 0 0.2rem;
}

.spec { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.78rem; margin: 1rem 0 0; font-variant-numeric: tabular-nums; }
.spec th, .spec td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--hairline); }
.spec th { color: var(--ink-soft); font-weight: 600; width: 40%; }

/* ---- Three-ways ---- */

.threeways { background: var(--recess); border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; margin: 1rem 0; }
.threeways .tw-tabs { display: flex; border-bottom: 1px solid var(--hairline); }
.threeways .tw-tab {
	flex: 1; text-align: center; padding: 0.65rem 0.5rem; font-weight: 700;
	font-size: 0.86rem; background: none; border: 0; color: var(--ink-soft); cursor: pointer;
	font-family: inherit;
}
.threeways .tw-tab[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -3px 0 var(--mhue, var(--accent)); }
.threeways .tw-panel { padding: 1.05rem 1.2rem; font-size: 0.95rem; background: var(--surface); }
.threeways .tw-panel[hidden] { display: none; }
.threeways .tw-panel p { margin: 0 0 0.6rem; }
.threeways .tw-panel p:last-child { margin-bottom: 0; }

/* ---- Store cards ---- */

.storecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.storecard {
	border: 1px solid var(--hairline); border-radius: 12px; padding: 1.1rem;
	display: flex; flex-direction: column; gap: 0.45rem; background: var(--surface);
	border-top: 4px solid var(--card-hue, var(--accent));
}
.storecard p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
.storecard .price { font-family: var(--mono); color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.storecard .buy {
	margin-top: auto; text-align: center; background: var(--accent); color: var(--accent-ink);
	text-decoration: none; font-weight: 700; border-radius: 8px; padding: 0.55rem;
}
.storecard .buy.is-disabled { opacity: 0.55; }

/* ---- Features ---- */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.feature { background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; padding: 1rem 1.1rem; }
.feature h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.feature p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

.prose { max-width: 46rem; }
.prose h2 { margin-top: 2rem; }

/* ---- Machine ambient motion ---- */

.m-drum { animation: m-spin 9s linear infinite; }
.m-blip { animation: m-pulse 2.4s ease-in-out infinite; }
.m-out { animation: m-drift 2.8s ease-in-out infinite; }
.m-out-1 { animation-delay: 0.25s; }
.m-out-2 { animation-delay: 0.5s; }
.m-fill { animation: m-breathe 5s ease-in-out infinite; transform-origin: center; }

@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes m-drift { 0%, 100% { opacity: 0.35; transform: translateX(-2px); } 50% { opacity: 1; transform: translateX(2px); } }
@keyframes m-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.82); } }

@media (prefers-reduced-motion: reduce) {
	.toy .evidence li, .toy table { animation: none; opacity: 1; }
	.m-drum, .m-blip, .m-out, .m-fill { animation: none; }
	.mcard { transition: none; }
}

@media (max-width: 760px) {
	.hero { grid-template-columns: 1fr; }
	nav a.navlink { margin-left: 0.9rem; }
}

/* ---- Project detail pages ---- */

.crumbs {
	padding: 1.4rem 0 0; font-size: 0.85rem; color: var(--ink-soft);
	font-family: var(--mono);
}
.crumbs a { color: var(--ink-soft); }
.crumbs span { margin: 0 0.35rem; }

.pdetail {
	display: grid; grid-template-columns: 1fr 1.15fr; gap: 2rem; align-items: center;
	padding: 1.2rem 0 0.5rem;
}
.pdetail-art {
	background: var(--recess); border: 1px solid var(--hairline);
	border-radius: 14px; padding: 0.5rem;
}
.pdetail-art .machine { width: 100%; height: auto; display: block; }
.pdetail-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 0.5rem; font-weight: 800; text-wrap: balance; }
.pdetail-head .lede { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 0.8rem; }
.pdetail-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 1rem 0 0; }
.pdetail-foot { margin-top: 1.6rem; }

.mbtn-lg { padding: 0.75rem 1.3rem; font-size: 0.95rem; }

/* ---- The book band: deliberately unlike a machine card ---- */

.bookband {
	display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center;
	background: var(--surface); border: 1px solid var(--hairline);
	border-left: 6px solid var(--crimson);
	border-radius: 14px; padding: 1.6rem 1.8rem; text-decoration: none; color: var(--ink);
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.bookband:hover { transform: translateY(-2px); box-shadow: 0 14px 30px var(--shadow); }
.bookband h2 { margin: 0 0 0.4rem; }
.bookband .section-lede { margin-bottom: 0.7rem; }
.bookband .go { font-weight: 700; color: var(--crimson); font-size: 0.9rem; }
.bookband code {
	font-family: var(--mono); font-size: 0.86em; background: var(--recess);
	padding: 0.1em 0.35em; border-radius: 4px;
}
.bookband-mark {
	width: 96px; height: 132px; border-radius: 5px;
	background: var(--crimson); color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--mono); font-size: 2.4rem; font-weight: 700;
	box-shadow: inset -10px 0 0 rgba(0, 0, 0, 0.18);
}

.prose code, .section-lede code {
	font-family: var(--mono); font-size: 0.88em;
	background: var(--recess); padding: 0.1em 0.35em; border-radius: 4px;
}

@media (max-width: 760px) {
	.pdetail { grid-template-columns: 1fr; }
	.bookband { grid-template-columns: 1fr; }
	.bookband-mark { width: 72px; height: 100px; font-size: 1.8rem; }
}
