/* Cartwright: site styles. One family (Archivo), drafting-paper palette from the plugin icon. */

@font-face {
	font-family: "Archivo";
	src: url("fonts/archivo.woff") format("woff");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
}

:root {
	--ink: #1f2a44;        /* navy from the icon: text, header, buttons */
	--ink-soft: #4b5670;   /* secondary text */
	--oak: #d9a35b;        /* box fills, dimension lines */
	--oak-deep: #9a6424;   /* oak dark enough for text on light backgrounds */
	--paper: #eef1f5;      /* cool drafting-paper page background */
	--sheet: #ffffff;      /* panels */
	--rule: rgba(31, 42, 68, 0.14);
	--grid: rgba(31, 42, 68, 0.055);

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.3rem;
	--step-2: 1.75rem;
	--step-3: clamp(2.1rem, 4.2vw, 3.1rem);

	--measure: 64ch;
	--wrap: 1120px;
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: "Archivo", system-ui, sans-serif;
	font-size: var(--step-0);
	line-height: 1.55;
	color: var(--ink);
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 24px 24px;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--ink);
	text-decoration-color: var(--oak);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

a:hover {
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 3px solid var(--oak);
	outline-offset: 2px;
	border-radius: 2px;
}

.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 20px;
}

/* Header */
.site-header {
	background: var(--ink);
	color: #fff;
}

.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 64px;
	flex-wrap: wrap;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-stretch: 112%;
	font-size: 1.15rem;
	letter-spacing: 0.01em;
}

.brand img {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.site-nav {
	display: flex;
	gap: 22px;
	flex-wrap: wrap;
}

.site-nav a {
	color: #fff;
	text-decoration: none;
	font-size: var(--step--1);
	font-weight: 500;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
	border-bottom-color: var(--oak);
}

/* Type */
h1,
h2,
h3 {
	line-height: 1.12;
	margin: 0 0 0.5em;
	font-stretch: 108%;
}

h1 {
	font-size: var(--step-3);
	font-weight: 800;
	letter-spacing: -0.015em;
}

h2 {
	font-size: var(--step-2);
	font-weight: 750;
	letter-spacing: -0.01em;
}

h3 {
	font-size: var(--step-1);
	font-weight: 700;
}

p {
	margin: 0 0 1em;
	max-width: var(--measure);
}

.lead {
	font-size: var(--step-1);
	line-height: 1.45;
	color: var(--ink-soft);
}

/* Buttons */
.btn {
	display: inline-block;
	font: inherit;
	font-weight: 650;
	padding: 0.7em 1.15em;
	border-radius: 6px;
	text-decoration: none;
	border: 2px solid var(--ink);
	background: var(--ink);
	color: #fff;
	line-height: 1.2;
}

.btn:hover {
	background: #2b3a5e;
	border-color: #2b3a5e;
}

.btn-quiet {
	background: transparent;
	color: var(--ink);
}

.btn-quiet:hover {
	background: var(--sheet);
	border-color: var(--ink);
}

.btn[aria-disabled="true"] {
	background: transparent;
	color: var(--ink-soft);
	border-color: var(--rule);
	cursor: default;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-top: 1.5em;
}

.note {
	font-size: var(--step--1);
	color: var(--ink-soft);
}

/* Sections */
.section {
	padding: 72px 0;
}

.section + .section {
	border-top: 1px solid var(--rule);
}

.section-intro {
	margin-bottom: 32px;
}

/* Hero */
.hero {
	padding: 64px 0 72px;
}

.hero .wrap {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: start;
}

@media (min-width: 900px) {
	.hero .wrap {
		grid-template-columns: 1.05fr 1fr;
		gap: 56px;
	}
}

/* Demo: the calculator, drawn like a plan sheet */
.demo {
	background: var(--sheet);
	border: 1px solid var(--rule);
	border-radius: 10px;
	padding: 24px;
	box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(31, 42, 68, 0.45);
}

.demo-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	font-size: var(--step--1);
	color: var(--ink-soft);
	border-bottom: 1px dashed var(--rule);
	padding-bottom: 12px;
	margin-bottom: 18px;
}

.demo-head strong {
	color: var(--ink);
	font-weight: 650;
}

.demo label {
	display: block;
	font-weight: 650;
	margin-bottom: 8px;
}

.demo-input {
	display: flex;
	align-items: center;
	gap: 10px;
}

.demo input {
	font: inherit;
	font-size: 1.35rem;
	font-weight: 650;
	width: 6.5em;
	padding: 0.35em 0.6em;
	border: 1px solid rgba(31, 42, 68, 0.35);
	border-radius: 6px;
	color: var(--ink);
	background: #fff;
}

.demo input:focus-visible {
	outline: 3px solid var(--oak);
	outline-offset: 1px;
}

.demo .unit {
	font-size: 1.15rem;
	font-weight: 600;
}

.boxes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
	gap: 5px;
	margin: 20px 0 6px;
	min-height: 26px;
}

.box {
	aspect-ratio: 1;
	border-radius: 3px;
	background: var(--oak);
	position: relative;
}

/* The unused part of the last box, shown as hatching. */
.box .spare {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	background: repeating-linear-gradient(135deg, #f3e3c8 0 3px, #fff 3px 6px);
	border-radius: 0 3px 3px 0;
}

.boxes-key {
	font-size: var(--step--1);
	color: var(--ink-soft);
	margin: 0 0 14px;
}

.result {
	font-size: var(--step-1);
	font-weight: 700;
	margin: 0;
	padding-top: 14px;
	border-top: 1px dashed var(--rule);
}

.result .price {
	color: var(--oak-deep);
}

.demo-error {
	color: #a12828;
	font-weight: 600;
	margin: 12px 0 0;
}

/* Steps: a real sequence, so numbered */
.steps {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 28px;
	counter-reset: step;
}

@media (min-width: 800px) {
	.steps {
		grid-template-columns: repeat(3, 1fr);
	}
}

.steps li {
	counter-increment: step;
	padding-top: 18px;
	border-top: 3px solid var(--ink);
}

.steps li::before {
	content: counter(step);
	display: block;
	font-weight: 800;
	font-stretch: 120%;
	font-size: 1.6rem;
	color: var(--oak-deep);
	margin-bottom: 6px;
}

.steps p {
	margin: 0;
	color: var(--ink-soft);
}

/* Two modes */
.modes {
	display: grid;
	gap: 24px;
}

@media (min-width: 800px) {
	.modes {
		grid-template-columns: 1fr 1fr;
	}
}

.mode {
	background: var(--sheet);
	border: 1px solid var(--rule);
	border-radius: 10px;
	padding: 24px;
}

.mode .example {
	font-weight: 650;
	border-left: 3px solid var(--oak);
	padding-left: 12px;
	margin: 14px 0 0;
}

.mode .for {
	color: var(--ink-soft);
	font-size: var(--step--1);
	margin-bottom: 0.75em;
}

/* Feature list */
.features {
	columns: 1;
	column-gap: 48px;
	padding-left: 1.1em;
	margin: 0;
}

@media (min-width: 800px) {
	.features {
		columns: 2;
	}
}

.features li {
	break-inside: avoid;
	margin-bottom: 10px;
}

.features li::marker {
	color: var(--oak-deep);
}

/* Screenshots */
.shots {
	display: grid;
	gap: 40px;
	max-width: 880px;
}

.shot {
	margin: 0;
}

.shot img {
	border: 1px solid var(--rule);
	border-radius: 8px;
	background: #fff;
}

.shot figcaption {
	font-size: var(--step--1);
	color: var(--ink-soft);
	margin-top: 10px;
}

/* Prose pages (docs, contact, privacy) */
.page {
	padding: 56px 0 80px;
}

.prose {
	background: var(--sheet);
	border: 1px solid var(--rule);
	border-radius: 10px;
	padding: clamp(24px, 5vw, 48px);
	max-width: 820px;
}

.prose h2 {
	margin-top: 1.6em;
}

.prose h3 {
	margin-top: 1.4em;
}

.prose ol,
.prose ul {
	max-width: var(--measure);
	padding-left: 1.3em;
}

.prose li {
	margin-bottom: 8px;
}

.prose code {
	font-family: inherit;
	font-weight: 650;
	background: var(--paper);
	padding: 1px 6px;
	border-radius: 4px;
}

.todo {
	background: #fff6e0;
	border: 1px dashed var(--oak-deep);
	padding: 2px 6px;
	border-radius: 4px;
}

/* Footer */
.site-footer {
	background: var(--ink);
	color: rgba(255, 255, 255, 0.82);
	padding: 36px 0;
	font-size: var(--step--1);
}

.site-footer .wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	justify-content: space-between;
}

.site-footer a {
	color: #fff;
}

.site-footer nav {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.site-footer p {
	margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.box {
		transition: background-color 0.15s ease;
	}
}
