/* K67 website. One stylesheet, self-hosted IBM Plex, no external requests.
   Colours and type come from the app (app/src/lib/styles/tokens.css): light by default,
   dark when the phone or computer asks. */

@font-face {
	font-family: 'Plex Sans';
	src: url('/fonts/ibm-plex-sans-latin-wght-normal.woff2') format('woff2');
	font-weight: 100 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Plex Mono';
	src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

:root {
	color-scheme: light dark;
	--bg: #f5f6f8;
	--surface: #ffffff;
	--surface-2: #e9ebef;
	--ink: #121418;
	--ink-2: #454b55;
	--ink-3: #5f6672;
	--line: #d8dce2;
	--line-strong: #c3c9d1;
	--edge: #7a818d;
	--accent: #0b63ce;
	--accent-ink: #ffffff;
	--accent-wash: rgb(11 99 206 / 0.1);
	--shot-shadow: 0 18px 40px rgb(18 20 24 / 0.14), 0 2px 6px rgb(18 20 24 / 0.08);
	--w-body: 400;

	--font-sans: 'Plex Sans', 'IBM Plex Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: 'Plex Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
	--r-2: 6px;
	--r-3: 10px;
	--gutter: 16px;
	--max: 68rem;
	--measure: 42rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #08090b;
		--surface: #131519;
		--surface-2: #1c1f24;
		--ink: #e8eaed;
		--ink-2: #a9afb8;
		--ink-3: #8a919b;
		--line: #23272e;
		--line-strong: #323841;
		--edge: #737a86;
		--accent: #62b5ff;
		--accent-ink: #04121f;
		--accent-wash: rgb(98 181 255 / 0.14);
		--shot-shadow: 0 18px 40px rgb(0 0 0 / 0.5);
		--w-body: 450;
	}
}

@media (prefers-contrast: more) {
	:root {
		--ink-3: var(--ink-2);
		--line: var(--line-strong);
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	background: var(--bg);
	scroll-padding-top: 16px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 1.0625rem;
	line-height: 1.55;
	font-weight: var(--w-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: break-word;
	font-synthesis: none;
}

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

a {
	color: var(--accent);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

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

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

h1,
h2,
h3 {
	text-wrap: balance;
	color: var(--ink);
}

h1 {
	font-size: clamp(2rem, 1.35rem + 2.6vw, 3rem);
	line-height: 1.08;
	font-weight: 650;
	letter-spacing: -0.025em;
	margin: 0 0 16px;
}

h2 {
	font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
	line-height: 1.2;
	font-weight: 620;
	letter-spacing: -0.015em;
	margin: 0 0 16px;
}

h3 {
	font-size: 1.1875rem;
	line-height: 1.3;
	font-weight: 600;
	margin: 0 0 8px;
}

p,
ul,
ol,
dl {
	margin: 0 0 14px;
}

.mono {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0;
}

.lead {
	font-size: 1.1875rem;
	line-height: 1.5;
	color: var(--ink-2);
}

.meta {
	color: var(--ink-3);
	font-size: 0.9375rem;
}

/* ---- skip link ---- */
.skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 10;
	padding: 10px 14px;
	background: var(--accent);
	color: var(--accent-ink);
	border-radius: var(--r-2);
	font-weight: 600;
	text-decoration: none;
}
.skip:focus {
	top: 12px;
}

/* ---- header ---- */
header.site {
	border-bottom: 1px solid var(--line);
}

.bar {
	max-width: var(--max);
	margin: 0 auto;
	padding: 12px var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	flex-wrap: wrap;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--ink);
	text-decoration: none;
	font-weight: 650;
	font-size: 1.25rem;
	letter-spacing: -0.01em;
	min-height: 44px;
}

.brand img {
	border-radius: 7px;
}

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

header.site nav a {
	color: var(--ink-2);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	padding: 10px 10px;
	border-radius: var(--r-2);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

header.site nav a:hover {
	color: var(--ink);
	background: var(--surface-2);
}

header.site nav a[aria-current='page'] {
	color: var(--accent);
}

/* ---- main ---- */
main {
	display: block;
	max-width: var(--max);
	margin: 0 auto;
	padding: 32px var(--gutter) 56px;
}

.block {
	margin-top: 64px;
	padding-top: 40px;
	border-top: 1px solid var(--line);
}

/* ---- hero ---- */
.hero {
	display: grid;
	gap: 40px;
	align-items: center;
}

.hero-icon {
	display: block;
	border-radius: 16px;
	margin-bottom: 20px;
	box-shadow: 0 0 0 1px var(--line);
}

.hero-text .lead {
	max-width: 38rem;
}

.tags {
	color: var(--ink-3);
	font-size: 0.875rem;
	margin: 20px 0 20px;
}

.hero-shot {
	margin: 0;
	justify-self: center;
	width: min(100%, 280px);
}

.hero-shot img,
.shots img {
	display: block;
	width: 100%;
	border-radius: 28px;
	border: 1px solid var(--line);
	box-shadow: var(--shot-shadow);
	background: var(--surface);
}

@media (min-width: 820px) {
	main {
		padding-top: 56px;
	}
	.hero {
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
		gap: 56px;
	}
	.hero-shot {
		width: min(100%, 300px);
	}
}

/* ---- get block: App Store badge, Android note, trial ---- */
.get {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
}

.get .store {
	display: inline-block;
	border-radius: 8px;
	line-height: 0;
}

.get .store img {
	display: block;
}

.android-note {
	display: none;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-2);
	color: var(--ink-2);
	font-weight: 500;
}

.android .get .store {
	display: none;
}

.android .android-note {
	display: block;
}

.try,
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 18px;
	border-radius: var(--r-2);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.try {
	color: var(--accent);
	border: 1px solid var(--accent);
	background: transparent;
}

.try:hover {
	background: var(--accent-wash);
}

.btn,
.android .get .try {
	color: var(--accent-ink);
	background: var(--accent);
	border: 1px solid var(--accent);
}

.btn:hover,
.android .get .try:hover {
	filter: brightness(1.08);
}

/* ---- reasons ---- */
.reasons {
	margin: 0;
	border-top: 1px solid var(--line);
}

.reasons > div {
	padding: 20px 0;
	border-bottom: 1px solid var(--line);
}

.reasons dt {
	font-weight: 600;
	font-size: 1.1875rem;
	line-height: 1.3;
	letter-spacing: -0.005em;
	margin-bottom: 6px;
}

.reasons dd {
	margin: 0;
	color: var(--ink-2);
	max-width: var(--measure);
}

@media (min-width: 820px) {
	.reasons > div {
		display: grid;
		grid-template-columns: 19rem minmax(0, 1fr);
		gap: 32px;
		padding: 24px 0;
	}
	.reasons dt {
		margin: 0;
	}
}

/* ---- screenshots ---- */
.shots {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: min(62%, 240px);
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	padding: 4px 4px 28px;
	margin: 0 -4px;
	scrollbar-width: thin;
	scrollbar-color: var(--line-strong) transparent;
}

.shots figure {
	margin: 0;
	scroll-snap-align: start;
}

.shots figcaption {
	margin-top: 14px;
	color: var(--ink-2);
	font-size: 0.9375rem;
	line-height: 1.4;
}

@media (min-width: 820px) {
	.shots {
		grid-auto-flow: row;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-auto-columns: auto;
		gap: 40px;
		overflow: visible;
		padding: 4px 0 0;
		margin: 0;
	}
	.shots figure {
		max-width: 280px;
	}
}

/* ---- at a glance ---- */
.glance {
	margin: 0;
	display: grid;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-3);
	overflow: hidden;
}

.glance > div {
	display: grid;
	grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr);
	gap: 16px;
	padding: 12px 16px;
}

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

.glance dt {
	color: var(--ink-3);
	font-size: 0.9375rem;
}

.glance dd {
	margin: 0;
}

@media (min-width: 820px) {
	.glance {
		grid-template-columns: 1fr 1fr;
	}
	.glance > div:nth-child(2) {
		border-top: 0;
	}
	.glance > div:nth-child(even) {
		border-left: 1px solid var(--line);
	}
}

/* ---- try band ---- */
.try-band p {
	max-width: var(--measure);
	color: var(--ink-2);
}

.try-band p:last-child {
	margin: 20px 0 0;
}

/* ---- link lists ---- */
.guides {
	list-style: none;
	padding: 0;
	margin: 0;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-3);
	max-width: var(--measure);
}

.guides li + li {
	border-top: 1px solid var(--line);
}

.guides a {
	display: block;
	padding: 14px 16px;
	text-decoration: none;
}

.guides a:hover strong {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.guides strong {
	display: block;
	font-weight: 600;
}

.guides span {
	display: block;
	color: var(--ink-3);
	font-size: 0.9375rem;
}

/* ---- reading pages ---- */
.prose {
	max-width: var(--measure);
}

.prose.wide {
	max-width: 48rem;
}

.prose h2 {
	margin-top: 48px;
}

.prose h3 {
	margin-top: 28px;
}

.prose ul,
.prose ol {
	padding-left: 1.3em;
}

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

.toc {
	margin: 28px 0 8px;
	padding: 14px 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-3);
}

.prose .toc ul {
	list-style: none;
	padding: 0;
	margin: 0;
	columns: 1;
}

.toc li {
	margin: 0;
	break-inside: avoid;
}

.toc a {
	display: block;
	padding: 6px 0;
	text-decoration: none;
	font-size: 0.9375rem;
}

.toc a:hover {
	text-decoration: underline;
}

@media (min-width: 640px) {
	.prose .toc ul {
		columns: 2;
		column-gap: 32px;
	}
}

/* signs */
.family {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--line);
}

.family h2 {
	margin-top: 0;
}

.family .rule {
	font-size: 1.1875rem;
	line-height: 1.45;
	font-weight: 550;
	color: var(--ink);
}

.prose .examples {
	list-style: none;
	padding: 0;
	margin: 24px 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
	gap: 12px;
}

.examples li {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 0.875rem;
	line-height: 1.35;
	color: var(--ink-2);
}

/* Signs keep their own colours: a white tile in both themes, as in the app. */
.examples img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: contain;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-3);
}

.sources {
	font-size: 0.875rem;
	color: var(--ink-3);
	margin: 0 0 14px;
}

.sources p {
	margin: 0 0 4px;
	font-weight: 600;
	color: var(--ink-2);
}

.prose .sources ul {
	margin: 0;
	padding-left: 1.1em;
}

.sources li {
	margin-bottom: 2px;
}

.practise {
	font-size: 0.9375rem;
	color: var(--ink-2);
}

/* FAQ */
.qa {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.qa h3 {
	margin-top: 0;
}

.qa p {
	color: var(--ink-2);
}

.qa p.src {
	font-size: 0.875rem;
	color: var(--ink-3);
}

.src span {
	font-weight: 600;
	color: var(--ink-2);
}

/* closing call to action on guide pages */
.cta {
	margin-top: 56px;
	padding: 24px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-3);
}

.prose .cta h2 {
	margin-top: 0;
	font-size: 1.375rem;
}

.cta p {
	color: var(--ink-2);
}

/* ---- legal pages (from site/style.css) ---- */
.note {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px 16px;
	color: var(--ink-2);
	font-size: 0.9375rem;
}

.note p:last-child {
	margin-bottom: 0;
}

dl.ecta {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 4px 16px;
}

dl.ecta dt {
	font-weight: 600;
	padding-top: 12px;
}

dl.ecta dt span {
	color: var(--ink-3);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

dl.ecta dd {
	margin: 2px 0 0;
	padding-bottom: 12px;
	color: var(--ink-2);
}

dl.ecta dd + dt {
	border-top: 1px solid var(--line);
}

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

.foot {
	max-width: var(--max);
	margin: 0 auto;
	padding: 32px var(--gutter) 40px;
	font-size: 0.9375rem;
	color: var(--ink-3);
}

.disclaimer {
	max-width: var(--measure);
	color: var(--ink-2);
}

footer.site nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0 4px;
	margin: 12px 0 8px -8px;
}

footer.site nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 8px;
	color: var(--ink-2);
}

.copy {
	margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.try,
	.btn,
	header.site nav a {
		transition: background-color 120ms cubic-bezier(0.23, 1, 0.32, 1), color 120ms cubic-bezier(0.23, 1, 0.32, 1);
	}
}

@media print {
	header.site nav,
	.get,
	.skip {
		display: none;
	}
}
