/* stephengriffin.co.uk */

:root {
	--bg: #f6f6f4;
	--surface: #ffffff;
	--text: #1f1f23;
	--muted: #5b5b66;
	--border: #e2e2de;
	--accent: #bc1b32;
	--accent-dark: #93142a;
	--header: #16161a;
	--code-bg: #fafaf8;
	--radius: 10px;
	--shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 14px rgb(0 0 0 / .05);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	color-scheme: light;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 1rem/1.65 var(--font);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

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

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3 { line-height: 1.25; color: var(--text); margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem); letter-spacing: -.02em; margin-top: 0; }
h2 { font-size: 1.4rem; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }

.container {
	width: 100%;
	max-width: 1080px;
	margin-inline: auto;
	padding-inline: 20px;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -3rem;
	background: var(--surface);
	padding: .5rem 1rem;
	z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* Header */

.site-header { background: var(--header); color: #fff; }

.header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 2rem;
	padding-block: 1.1rem;
}

.brand { color: #fff; text-decoration: none; display: grid; }
.brand:hover { color: #fff; }
.brand-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.brand-tagline { font-size: .875rem; color: #b8b8c2; }

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	display: block;
	padding: .45rem .85rem;
	border-radius: 6px;
	color: #e6e6ea;
	text-decoration: none;
	font-weight: 600;
	font-size: .95rem;
}
.site-nav a:hover { background: rgb(255 255 255 / .1); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--accent); color: #fff; }

/* Main */

main { flex: 1; padding-block: 2.5rem 3.5rem; }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }

.intro { max-width: 46rem; }

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 240px;
	gap: 2.5rem;
	align-items: start;
}

.content {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: clamp(1.25rem, 3vw, 2.25rem);
	box-shadow: var(--shadow);
	min-width: 0;
}

.content > :last-child { margin-bottom: 0; }

.sidebar h2 {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--muted);
	margin: 0 0 .5rem;
}
.sidebar h2:not(:first-child) { margin-top: 1.5rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar a {
	display: block;
	padding: .35rem .6rem;
	border-left: 3px solid transparent;
	text-decoration: none;
	color: var(--text);
}
.sidebar a:hover { border-left-color: var(--border); color: var(--accent); }
.sidebar a[aria-current="page"] { border-left-color: var(--accent); color: var(--accent); font-weight: 600; }

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

/* Buttons and actions */

.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0; }

.button, button, input[type="submit"], input[type="button"] {
	display: inline-block;
	font: inherit;
	font-weight: 600;
	padding: .55rem 1.1rem;
	border-radius: 6px;
	border: 1px solid var(--accent);
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}
.button:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover {
	background: var(--accent-dark);
	border-color: var(--accent-dark);
	color: #fff;
}
.button.secondary { background: transparent; color: var(--accent); }
.button.secondary:hover { background: var(--accent); color: #fff; }

/* Cards */

.cards {
	list-style: none;
	padding: 0;
	margin: 1.25rem 0 2.5rem;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: 1.25rem;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	position: relative;
	transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgb(0 0 0 / .09); }

.card-image { display: block; aspect-ratio: 16 / 10; background: #ececea; border-bottom: 1px solid var(--border); }
.card-image img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

.card-body { padding: 1.1rem 1.25rem 1.25rem; }
.card-body h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a::after { content: ""; position: absolute; inset: 0; }
.card-body h3 a:hover { color: var(--accent); }
.card-body p:last-child { margin: 0; color: var(--muted); font-size: .95rem; }

.card-meta {
	margin: 0 0 .3rem;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--accent);
}

/* Figures and screenshots */

.screenshot {
	margin: 1.5rem 0;
}
.screenshot img {
	display: block;
	border: 1px solid var(--border);
	border-radius: 6px;
	box-shadow: var(--shadow);
}
.screenshot figcaption { font-size: .875rem; color: var(--muted); margin-top: .5rem; }

/* Code */

code, pre, kbd { font-family: var(--mono); font-size: .9em; }

.code {
	margin: 1rem 0 1.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
	background: var(--code-bg);
}
.code figcaption {
	padding: .45rem .9rem;
	font-size: .8rem;
	font-weight: 600;
	color: var(--muted);
	border-bottom: 1px solid var(--border);
	background: #f0f0ec;
}
.code-body { overflow-x: auto; }
.code-body pre, pre.source {
	margin: 0;
	padding: .9rem 1rem;
	font-size: .85rem;
	line-height: 1.55;
}
pre.source {
	overflow-x: auto;
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: 8px;
}

/* Forms */

fieldset {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin: 0 0 1.25rem;
}
legend { font-weight: 600; padding: 0 .35rem; }
label { font-weight: 600; }

input[type="text"], input[type="number"], input[type="password"], input[type="email"], textarea, select {
	font: inherit;
	padding: .5rem .65rem;
	border: 1px solid #c9c9c4;
	border-radius: 6px;
	background: #fff;
	color: var(--text);
	max-width: 100%;
}
textarea { width: 100%; font-family: var(--mono); font-size: .9rem; }

.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: .3rem; }
.checks label { display: flex; gap: .5rem; align-items: center; font-weight: normal; margin-bottom: .35rem; }

.output {
	font-family: var(--mono);
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1rem;
	overflow-x: auto;
	white-space: pre;
	line-height: 1.7;
}

/* Tables */

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; margin: 1rem 0; }
th, td { border: 1px solid var(--border); padding: .45rem .75rem; text-align: left; vertical-align: top; }
th { background: #f0f0ec; }

/* Misc */

.software { list-style: none; padding: 0; }
.software li {
	display: grid;
	grid-template-columns: 32px 1fr;
	gap: .9rem;
	align-items: start;
	padding: .9rem 0;
	border-bottom: 1px solid var(--border);
}
.software li:last-child { border-bottom: 0; }
.software img { width: 32px; height: 32px; object-fit: contain; }
.software-badge {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	background: var(--header);
	color: #fff;
	font-weight: 700;
}

.social-links {
	list-style: none;
	padding: 0;
	margin: 1.25rem 0 1.5rem;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
	gap: .75rem;
}
.social-links a {
	display: flex;
	align-items: center;
	gap: .85rem;
	padding: .85rem 1rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--code-bg);
	color: var(--text);
	font-weight: 600;
	font-size: 1.05rem;
	text-decoration: none;
	transition: border-color .15s ease, background .15s ease;
}
.social-links a:hover { border-color: var(--accent); background: var(--surface); color: var(--accent); }
.social-links img { width: 40px; height: 40px; flex: none; }

.photo-album { text-align: center; margin: 1.5rem 0; }
.photo-album img { border: 1px solid var(--border); border-radius: 6px; display: block; margin: 0 auto 1rem; }
.photo-album .controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }

.demo {
	padding: 1rem 1.25rem;
	background: var(--code-bg);
	border: 1px dashed #c9c9c4;
	border-radius: 8px;
	margin: 1rem 0 1.5rem;
}

/* Footer */

.site-footer {
	border-top: 1px solid var(--border);
	background: var(--surface);
	color: var(--muted);
	font-size: .9rem;
}
.footer-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .5rem 1.5rem;
	padding-block: 1.25rem;
}
.footer-inner p { margin: 0; }
.footer-inner ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
	.card { transition: none; }
	.card:hover { transform: none; }
}
