/* sidelight.pro, "The Posted Record". Tokens and rules come from DESIGN.md in
   sidelight-pro/design (mirrored in this repository). Logos and fonts in
   assets/ are byte-for-byte copies from that repository's brand/ folder. */

@font-face {
	font-family: 'Archivo';
	src: url('assets/fonts/Archivo-Variable.woff2') format('woff2');
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
}

@font-face {
	font-family: 'Public Sans';
	src: url('assets/fonts/PublicSans-Variable.woff2') format('woff2');
	font-weight: 100 900;
	font-display: swap;
}

:root {
	--yellow: #f2c230;
	--ink: #16181a;
	--stamp: #1d4e9e;
	--night: #1e2326;
	--night-deep: #101416;
	--paper: #f3f3f0;
	--manila: #e8dec3;
	--mist: #9fb5ae;
	--pencil: #4a4f52;
	--red: #b3261e;
	--red-wash: #f7e4e2;
	--hairline: #d9d2c0;
	--display: 'Archivo', 'Arial Narrow', sans-serif;
	--body: 'Public Sans', Arial, sans-serif;
	--gutter: clamp(16px, 4vw, 64px);
	--section: clamp(64px, 9vw, 128px);
	--card-pad: clamp(24px, 3vw, 44px);
	color-scheme: light;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 17px/1.55 var(--body);
	font-variant-numeric: tabular-nums;
}

::selection {
	background: var(--yellow);
	color: var(--ink);
}

a {
	color: inherit;
	text-underline-offset: 3px;
}

:focus-visible {
	outline: 3px solid var(--stamp);
	outline-offset: 3px;
}

.night :focus-visible,
.join-band :focus-visible,
.foot :focus-visible {
	outline-color: var(--yellow);
}

h1,
h2,
h3 {
	font-family: var(--display);
	font-weight: 800;
	font-stretch: 72%;
	letter-spacing: -0.01em;
	line-height: 0.95;
	margin: 0;
	text-wrap: balance;
}

p {
	margin: 0 0 1em;
	max-width: 62ch;
}

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

.defs {
	position: absolute;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

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

.lede {
	font-size: clamp(19px, 1.6vw, 22px);
	max-width: 56ch;
}

.skip {
	position: absolute;
	left: -999px;
	top: 8px;
	z-index: 10;
	background: var(--yellow);
	color: var(--ink);
	padding: 10px 16px;
	font-weight: 700;
}

.skip:focus {
	left: 8px;
}

/* ---------- Buttons ---------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 11px 16px;
	border: 0;
	border-radius: 0;
	font: 700 17px/1.3 var(--body);
	text-decoration: none;
	cursor: pointer;
}

.button.primary {
	background: var(--yellow);
	color: var(--ink);
}

.button.primary:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.button[disabled] {
	cursor: progress;
	opacity: 0.7;
}

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

.top-row {
	display: flex;
	align-items: center;
	gap: 16px 32px;
	padding-top: 20px;
	padding-bottom: 20px;
}

.lockup img {
	height: 34px;
	width: auto;
}

.top nav {
	margin-left: auto;
}

.top nav ul {
	list-style: none;
	display: flex;
	gap: 6px 28px;
	margin: 0;
	padding: 0;
	font: 600 15px/1.3 var(--body);
}

.top nav a {
	display: inline-block;
	padding: 12px 0;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.top nav a:hover {
	border-bottom-color: var(--ink);
}

/* ---------- First viewport: two doors ---------- */

.entry {
	padding-top: clamp(16px, 3vw, 40px);
}

.entry-head {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(24px, 4vw, 64px);
	align-items: end;
	margin-bottom: clamp(32px, 4vw, 56px);
}

.entry h1 {
	font-size: clamp(44px, 6.4vw, 92px);
	max-width: 15ch;
}

.entry-lede .lede {
	margin-bottom: 14px;
}

.legend {
	list-style: none;
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	font: 600 14px/1.4 var(--body);
	color: var(--pencil);
}

.legend li {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.legend .box.mini {
	margin-top: 1px;
	color: var(--stamp);
}

.doors {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(20px, 3vw, 48px);
	align-items: start;
	margin-bottom: clamp(48px, 6vw, 80px);
}

.record {
	background: var(--yellow);
	color: var(--ink);
	padding: var(--card-pad);
	box-shadow: 0 18px 40px rgba(22, 24, 26, 0.28);
}

.record-head h2 {
	font-size: clamp(30px, 3vw, 42px);
	font-stretch: 80%;
}

.record-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	max-width: none;
	margin: 12px 0 0;
	font: 700 15px/1.35 var(--body);
	letter-spacing: 0.02em;
}

.record-note {
	margin: 18px 0 0;
	font: 600 16px/1.45 var(--body);
}

/* Sign-off rows: label, date, box. Closed by 3px rules, divided by hairlines. */
.rows {
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
	border-top: 3px solid currentColor;
	border-bottom: 3px solid currentColor;
}

.rows li {
	border-bottom: 1px solid currentColor;
}

.rows li:last-child {
	border-bottom: 0;
}

.rows a,
.rows .row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto 34px;
	gap: 16px;
	align-items: center;
	min-height: 48px;
	padding: 7px 0;
	text-decoration: none;
	font: 600 18px/1.3 var(--body);
}

.rows a:hover .label {
	text-decoration: underline;
}

.date {
	color: var(--stamp);
	font: 800 16px/1 var(--display);
	font-stretch: 80%;
	letter-spacing: 0.04em;
}

.box {
	width: 28px;
	height: 28px;
	border: 3px solid currentColor;
	display: grid;
	place-items: center;
	color: var(--stamp);
}

.rows .box {
	border-color: var(--ink);
}

.box.mini {
	width: 18px;
	height: 18px;
	border-width: 2px;
	border-color: var(--ink);
	display: inline-grid;
	vertical-align: -3px;
}

/* ---------- Early access form on the night band ---------- */

.join-band {
	position: relative;
	background: var(--night);
	color: var(--manila);
	padding: clamp(32px, 4vw, 48px) 0 calc(clamp(32px, 4vw, 48px) + 10px);
}

.join-band .sill {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 10px;
	background: var(--night-deep);
}

.interest {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
	gap: 16px clamp(24px, 4vw, 64px);
	align-items: start;
}

.interest-head h2 {
	font-size: clamp(30px, 3vw, 42px);
	font-stretch: 80%;
	color: var(--manila);
}

.interest-head p {
	margin: 10px 0 0;
	color: var(--mist);
	font-size: 15px;
}

.interest-fields {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
	gap: 14px 16px;
	align-items: start;
}

.field label {
	display: block;
	margin-bottom: 6px;
	font: 700 14px/1.3 var(--body);
}

.field input,
.field select,
.field textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 11px 12px;
	border: 2px solid var(--manila);
	border-radius: 0;
	background: #fff;
	color: var(--ink);
	font: 400 17px/1.4 var(--body);
}

.field textarea {
	resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
	outline: 3px solid var(--yellow);
	outline-offset: 2px;
}

.field [aria-invalid='true'] {
	border-color: var(--red);
}

/* On night, an error is a correction-red block with paper text (The Correction Rule). */
.field-error {
	margin: 6px 0 0;
	padding: 6px 10px;
	background: var(--red);
	color: var(--paper);
	font: 600 14px/1.35 var(--body);
}

.interest .send {
	margin-top: 26px;
	white-space: nowrap;
}

.more {
	grid-column: 1 / -1;
}

.more summary {
	display: inline-block;
	padding: 10px 0;
	cursor: pointer;
	font: 600 15px/1.3 var(--body);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.more-fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px 16px;
	padding-top: 8px;
}

.more-fields .wide {
	grid-column: 1 / -1;
}

.trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.interest-status {
	grid-column: 2;
}

.interest-status:empty {
	margin-top: -16px;
}

.interest-status .received {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
}

.interest-status .received p {
	margin: 0;
	color: var(--manila);
}

.interest-status .problem {
	margin: 0;
	padding: 12px 14px;
	background: var(--red);
	color: var(--paper);
	font-weight: 600;
}

.interest-status .sending {
	margin: 0;
	color: var(--mist);
	font-weight: 600;
}

.interest-noscript {
	grid-column: 2;
	color: var(--mist);
}

/* Stamp: always dated, marks a fact. On night it sits in manila. */
.stamp {
	display: inline-grid;
	gap: 2px;
	justify-items: center;
	padding: 8px 14px 7px;
	border: 3px solid var(--stamp);
	border-radius: 3px;
	color: var(--stamp);
	transform: rotate(-4deg);
	font: 800 15px/1 var(--display);
	font-stretch: 85%;
	letter-spacing: 0.08em;
}

.stamp small {
	font-size: 11px;
	letter-spacing: 0.12em;
}

.join-band .stamp {
	border-color: var(--manila);
	color: var(--manila);
}

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

section.how,
section.office,
section.field-sec,
section.built,
section.doors-sec {
	padding: var(--section) 0;
	border-top: 2px solid var(--ink);
}

.night {
	background: var(--night);
	color: var(--manila);
}

section.night {
	border-top-color: var(--night-deep);
}

.join-band + section,
.entry + section {
	border-top: 0;
}

.sec-head {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(24px, 4vw, 64px);
	align-items: end;
	margin-bottom: clamp(40px, 5vw, 72px);
}

.sec-head h2 {
	font-size: clamp(44px, 6vw, 84px);
}

.sec-head p {
	margin: 0;
}

.night .sec-head p {
	color: var(--manila);
}

.how-grid {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(32px, 5vw, 80px);
	align-items: start;
}

.sample {
	position: relative;
	background: var(--yellow);
	color: var(--ink);
	padding: var(--card-pad);
	transform: rotate(1deg);
	box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
	max-width: 760px;
}

/* The tape may reach past a narrow viewport; never scroll sideways for it. */
main {
	overflow-x: clip;
}

.sample::before,
.sample::after {
	content: '';
	position: absolute;
	top: -10px;
	width: 72px;
	height: 22px;
	background: rgba(255, 255, 255, 0.55);
}

.sample::before {
	left: -14px;
	transform: rotate(-7deg);
}

.sample::after {
	right: -14px;
	transform: rotate(8deg);
}

.sample-cap {
	margin: 18px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--ink);
	font: 700 15px/1.35 var(--body);
}

.sample h3 {
	font-size: clamp(26px, 2.4vw, 32px);
	font-stretch: 80%;
}

.stamp-line {
	margin: 24px 0 0;
}

.facts dt {
	font: 800 22px/1.1 var(--display);
	font-stretch: 80%;
	margin-top: 30px;
}

.facts dt:first-child {
	margin-top: 0;
}

.facts dd {
	margin: 8px 0 0;
	max-width: 46ch;
	color: var(--manila);
}

/* Office: the Pro app in a use frame. */
.use-frame {
	margin: 0;
	max-width: 980px;
	border: 2px solid var(--ink);
	background: #fff;
}

.app-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: var(--night);
	color: var(--manila);
	padding: 14px 20px;
	font: 600 14px/1.3 var(--body);
}

.app-bar img {
	height: 28px;
	width: auto;
}

.app-bar span {
	border-bottom: 2px solid var(--yellow);
	padding-bottom: 2px;
}

.app-body {
	padding: 10px 20px 14px;
}

.app-row {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--hairline);
	font-size: 16px;
}

.app-row:last-child {
	border-bottom: 0;
}

.use-frame figcaption {
	border-top: 2px solid var(--ink);
	padding: 10px 14px;
	background: var(--paper);
	font: 600 14px/1.3 var(--body);
}

.tag {
	display: inline-block;
	font: 800 12px/1 var(--display);
	letter-spacing: 0.06em;
	padding: 5px 8px;
	border: 2px solid var(--stamp);
	color: var(--stamp);
	white-space: nowrap;
}

.tag.wait {
	border-color: var(--pencil);
	color: var(--pencil);
}

.tag.failed {
	border-color: var(--red);
	color: var(--red);
}

/* Field: the four sync states as one ruled set. */
.sync {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin: 0;
	border-top: 3px solid var(--ink);
	border-bottom: 3px solid var(--ink);
}

.sync > div {
	padding: 24px 24px 28px 0;
	border-right: 1px solid var(--ink);
}

.sync > div + div {
	padding-left: 24px;
}

.sync > div:last-child {
	border-right: 0;
}

.sync dt {
	display: grid;
	justify-items: start;
	gap: 14px;
	font: 800 22px/1.1 var(--display);
	font-stretch: 80%;
}

.sync dd {
	margin: 10px 0 0;
}

/* Built: the plain-state ledger. */
.ledger-wrap {
	overflow-x: auto;
}

.ledger {
	width: 100%;
	border-collapse: collapse;
	border-top: 3px solid var(--ink);
	border-bottom: 3px solid var(--ink);
}

.ledger th,
.ledger td {
	text-align: left;
	padding: 14px 16px 14px 0;
	border-bottom: 1px solid var(--ink);
	vertical-align: middle;
}

.ledger thead th {
	font: 800 15px/1.35 var(--display);
	font-stretch: 85%;
	letter-spacing: 0.03em;
}

.ledger tbody tr:last-child td {
	border-bottom: 0;
}

.ledger td:first-child {
	font-weight: 600;
}

/* Three doors. */
.three {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(16px, 2vw, 28px);
}

.door-card {
	display: grid;
	gap: 18px;
	align-content: start;
	padding: 0 26px 30px;
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.door-card::before {
	content: '';
	display: block;
	height: 18px;
	margin: 0 -26px 6px;
	background: var(--stock);
}

.door-card.pro {
	--stock: var(--yellow);
}

.door-card.work {
	--stock: #e8732c;
}

.door-card.house {
	--stock: #6db37a;
}

.door-card p {
	margin: 0;
}

.door-card .domain {
	font: 800 26px/1 var(--display);
	font-stretch: 80%;
	border-top: 2px solid var(--ink);
	padding-top: 12px;
}

.close {
	margin: clamp(40px, 5vw, 64px) 0 0;
}

/* Footer. */
.foot {
	background: var(--night);
	color: var(--mist);
	border-top: 2px solid var(--night-deep);
	padding: 28px 0 40px;
	font-size: 14px;
}

.foot-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
}

.foot img {
	height: 26px;
	width: auto;
}

.foot p {
	margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.interest {
		grid-template-columns: 1fr;
	}

	.interest-status,
	.interest-noscript {
		grid-column: 1;
	}
}

@media (max-width: 900px) {
	.top nav {
		display: none;
	}

	.top-cta {
		margin-left: auto;
	}

	.entry-head,
	.doors,
	.sec-head,
	.how-grid,
	.three {
		grid-template-columns: 1fr;
	}

	.sample {
		transform: rotate(0.6deg);
	}

	.sync {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sync > div:nth-child(2) {
		border-right: 0;
	}

	.sync > div:nth-child(n + 3) {
		border-top: 1px solid var(--ink);
	}

	.sync > div:nth-child(3) {
		padding-left: 0;
	}

	.more-fields {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 620px) {
	body {
		font-size: 16px;
	}

	.lockup img {
		height: 28px;
	}

	.top-cta {
		padding: 10px 12px;
		font-size: 15px;
	}

	.rows a,
	.rows .row {
		font-size: 16px;
		gap: 10px;
	}

	.interest-fields,
	.more-fields {
		grid-template-columns: 1fr;
	}

	.interest .send {
		margin-top: 4px;
		width: 100%;
	}

	.sync {
		grid-template-columns: 1fr;
	}

	.sync > div,
	.sync > div + div {
		padding: 20px 0;
		border-right: 0;
	}

	.sync > div + div {
		border-top: 1px solid var(--ink);
	}

	.app-row {
		grid-template-columns: 52px minmax(0, 1fr);
		row-gap: 6px;
	}

	.app-row .tag {
		grid-column: 2;
		justify-self: start;
	}

	.ledger thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.ledger tr {
		display: grid;
		gap: 6px;
		padding: 14px 0;
		border-bottom: 1px solid var(--ink);
	}

	.ledger tbody tr:last-child {
		border-bottom: 0;
	}

	.ledger td {
		padding: 0;
		border: 0;
	}

	.ledger td:last-child {
		color: var(--pencil);
		font-size: 15px;
	}
}
