/* Chucho Blog — warm editorial. Day palette of the landing page: parchment,
   green-black ink, gold for the mark and small emphasis only. */

@font-face {
	font-family: 'Marcellus';
	src: url('/assets/fonts/marcellus_regular.woff2') format('woff2');
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'Hanken Grotesk';
	src: url('/assets/fonts/hanken_grotesk_regular.woff2') format('woff2');
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'Hanken Grotesk';
	src: url('/assets/fonts/hanken_grotesk_medium.woff2') format('woff2');
	font-weight: 500;
	font-display: swap;
}
@font-face {
	font-family: 'Hanken Grotesk';
	src: url('/assets/fonts/hanken_grotesk_semibold.woff2') format('woff2');
	font-weight: 600;
	font-display: swap;
}

:root {
	--paper: #ece8db;
	--paper-light: #f4f0e4;
	--paper-deep: #e2ddcb;
	--ink: #22372c;
	--ink-soft: #4b5d52;
	--ink-deep: #0c1714;
	--rule: rgb(34 55 44 / 0.16);
	--gold: #c9a86a;
	--gold-ink: #735526;
	--terracotta-ink: #a5482a;
	--cream-fixed: #f1ead8;

	--display: 'Marcellus', Georgia, serif;
	--body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

	--gut: clamp(1.25rem, 5vw, 5.5rem);
	--wide: 76rem;
	--measure: 38rem;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: inherit;
}

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

h1,
h2,
h3 {
	margin: 0;
	font-weight: 400;
	text-wrap: balance;
}

p {
	margin: 0;
	text-wrap: pretty;
}

.eyebrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold-ink);
}
.eyebrow::before {
	content: '';
	width: 2rem;
	height: 1px;
	background: var(--gold);
}

.byline {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: 0.8125rem;
	color: var(--ink-soft);
	font-variant-numeric: tabular-nums;
}

.text-link {
	display: inline-block;
	font-weight: 600;
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
	transition:
		color 0.2s var(--ease),
		text-decoration-color 0.2s var(--ease);
}
.text-link:hover {
	color: var(--terracotta-ink);
	text-decoration-color: currentColor;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.65rem 1.35rem;
	border-radius: 999px;
	background: var(--ink);
	color: var(--cream-fixed);
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	transition:
		transform 0.2s var(--ease),
		background-color 0.2s var(--ease);
}
.button:hover {
	background: var(--ink-deep);
	transform: translateY(-1px);
}
.button-small {
	min-height: 2.5rem;
	padding: 0.5rem 1.1rem;
	font-size: 0.875rem;
}
.button-gold {
	background: var(--gold);
	color: var(--ink-deep);
}
.button-gold:hover {
	background: #d6b87d;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	max-width: var(--wide);
	margin: 0 auto;
	padding: 1.25rem var(--gut);
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}
.wordmark {
	font-family: var(--display);
	font-size: 1.5rem;
	letter-spacing: 0.01em;
}
.site-header nav {
	display: flex;
	align-items: center;
	gap: clamp(0.75rem, 2.5vw, 1.75rem);
}
.nav-link {
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	color: var(--ink-soft);
	padding: 0.4rem 0;
	border-bottom: 1px solid transparent;
	transition:
		color 0.2s var(--ease),
		border-color 0.2s var(--ease);
}
.nav-link:hover,
.nav-link.current {
	color: var(--ink);
	border-bottom-color: var(--gold);
}
.nav-link.lang {
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
}

/* ── Index ──────────────────────────────────────────────── */
main {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0 var(--gut);
}

.masthead {
	display: grid;
	gap: 1.5rem;
	padding: clamp(3rem, 9vw, 7.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
	border-bottom: 1px solid var(--rule);
}
.masthead h1 {
	font-family: var(--display);
	font-size: clamp(2.6rem, 6.4vw, 5.25rem);
	line-height: 1.02;
	letter-spacing: -0.01em;
	max-width: 15ch;
}
.masthead-intro {
	max-width: 30rem;
	font-size: 1.1875rem;
	line-height: 1.55;
	color: var(--ink-soft);
}
@media (min-width: 60rem) {
	.masthead {
		grid-template-columns: 1fr 22rem;
		align-items: end;
		column-gap: 4rem;
	}
	.masthead .eyebrow,
	.masthead h1 {
		grid-column: 1;
	}
	.masthead-intro {
		grid-column: 2;
		grid-row: 2;
		padding-bottom: 0.6rem;
	}
}

.lead {
	display: grid;
	gap: 2rem;
	padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.lead-media {
	display: block;
	overflow: hidden;
	border-radius: 2px;
	background: var(--paper-deep);
	aspect-ratio: 4 / 3;
}
.lead-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--ease);
}
.lead:hover .lead-media img {
	transform: scale(1.02);
}
.lead-body {
	display: grid;
	align-content: center;
	gap: 1.1rem;
}
.lead h2 {
	font-family: var(--display);
	font-size: clamp(2rem, 3.6vw, 3rem);
	line-height: 1.08;
}
.lead h2 a,
.row h3 a {
	text-decoration: none;
	background-image: linear-gradient(var(--gold), var(--gold));
	background-size: 0 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.4s var(--ease);
}
.lead h2 a:hover,
.row h3 a:hover {
	background-size: 100% 1px;
}
.excerpt {
	color: var(--ink-soft);
	font-size: 1.0625rem;
	line-height: 1.6;
}
.lead .excerpt {
	font-size: 1.1875rem;
}
@media (min-width: 52rem) {
	.lead {
		grid-template-columns: 7fr 5fr;
		gap: clamp(2rem, 5vw, 4.5rem);
	}
}

.archive {
	padding-bottom: clamp(3rem, 8vw, 6rem);
}
.section-label {
	font-family: var(--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-soft);
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--ink);
}
.archive ol {
	list-style: none;
	margin: 0;
	padding: 0;
}
.archive li {
	border-bottom: 1px solid var(--rule);
}
.row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem 2rem;
	padding: 1.75rem 0;
}
.row-date {
	font-size: 0.8125rem;
	color: var(--ink-soft);
	font-variant-numeric: tabular-nums;
}
.row-body {
	display: grid;
	gap: 0.5rem;
}
.row h3 {
	font-family: var(--display);
	font-size: clamp(1.4rem, 2.4vw, 1.75rem);
	line-height: 1.15;
}
/* Phone: the illustration leads the row at full width, like the featured post. */
.row-thumb {
	order: -1;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 2px;
	background: var(--paper-deep);
}
@media (min-width: 48rem) {
	.row {
		grid-template-columns: 10rem 1fr 12rem;
		align-items: start;
	}
	.row-date {
		padding-top: 0.45rem;
	}
	.row-thumb {
		order: 0;
		grid-column: 3;
		aspect-ratio: 4 / 3;
	}
}

.empty {
	display: grid;
	gap: 0.75rem;
	max-width: 34rem;
	padding: clamp(3rem, 8vw, 6rem) 0;
}
.empty-title {
	font-family: var(--display);
	font-size: clamp(1.6rem, 3vw, 2.25rem);
	line-height: 1.15;
}
.empty p:not(.empty-title) {
	color: var(--ink-soft);
}

/* ── Article ────────────────────────────────────────────── */
.post {
	padding-bottom: clamp(3rem, 8vw, 6rem);
}
.post-header {
	display: grid;
	gap: 1.25rem;
	max-width: 52rem;
	margin: 0 auto;
	padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
}
.back {
	justify-self: start;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--ink-soft);
	text-decoration: none;
}
.back:hover {
	color: var(--ink);
}
.post-header h1 {
	font-family: var(--display);
	font-size: clamp(2.3rem, 5.4vw, 4rem);
	line-height: 1.05;
	letter-spacing: -0.005em;
}
.deck {
	font-size: clamp(1.15rem, 2vw, 1.375rem);
	line-height: 1.5;
	color: var(--ink-soft);
	max-width: 40rem;
}

.post-figure {
	margin: 0 auto clamp(2.5rem, 6vw, 4rem);
	max-width: 64rem;
}
.post-figure img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 2px;
	background: var(--paper-deep);
}
.post-figure figcaption {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.75rem;
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-soft);
}
.post-figure figcaption::before {
	content: '';
	width: 1.25rem;
	height: 1px;
	background: var(--gold);
}

.prose,
.faq,
.post-switch {
	max-width: var(--measure);
	margin-left: auto;
	margin-right: auto;
}
.prose {
	font-size: 1.1875rem;
	line-height: 1.75;
}
.prose .md-p {
	margin: 0 0 1.35em;
}
.prose > .md-p:first-child::first-letter {
	float: left;
	font-family: var(--display);
	font-size: 3.6em;
	line-height: 0.85;
	padding: 0.08em 0.12em 0 0;
	color: var(--gold-ink);
}
.prose .md-heading {
	font-family: var(--display);
	font-size: clamp(1.5rem, 2.6vw, 1.875rem);
	line-height: 1.2;
	margin: 2.2em 0 0.7em;
	text-wrap: balance;
}
/* The glyph ("• " / "1. ") is inline text, so the hanging indent must equal its
   width or wrapped lines drift past the first line's text. */
.prose .md-bullet,
.prose .md-ordered {
	margin: 0 0 0.6em;
	padding-left: 1.25em;
	text-indent: -0.62em;
}
.prose .md-ordered {
	padding-left: 1.6em;
	text-indent: -0.95em;
}
.prose .md-bullet + :not(.md-bullet),
.prose .md-ordered + :not(.md-ordered) {
	margin-top: 1.2em;
}
.prose .md-img {
	margin: 2em 0;
	border-radius: 2px;
}
.prose .md-img-broken {
	display: none;
}
.prose .md-link {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-underline-offset: 0.2em;
}
.prose .md-link:hover {
	color: var(--terracotta-ink);
}
.prose code {
	font-size: 0.88em;
	padding: 0.1em 0.3em;
	background: var(--paper-deep);
	border-radius: 3px;
}
.prose strong {
	font-weight: 600;
}

.faq {
	margin-top: clamp(3rem, 7vw, 4.5rem);
	padding-top: 2rem;
	border-top: 1px solid var(--ink);
}
.faq h2 {
	font-family: var(--display);
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	margin-bottom: 1.5rem;
}
.faq-item {
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--rule);
}
.faq-item h3 {
	font-family: var(--body);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.4;
	margin-bottom: 0.5rem;
}
.faq-item p {
	color: var(--ink-soft);
	line-height: 1.65;
}

.post-switch {
	margin-top: 2.5rem;
	font-size: 0.9375rem;
}
.post-switch a {
	color: var(--ink-soft);
	text-underline-offset: 0.25em;
}

/* ── Error ──────────────────────────────────────────────── */
.error-page {
	display: grid;
	gap: 1rem;
	max-width: var(--wide);
	padding-top: clamp(4rem, 12vw, 9rem);
	padding-bottom: clamp(4rem, 12vw, 9rem);
}
.error-page h1 {
	font-family: var(--display);
	font-size: clamp(2.2rem, 5vw, 3.5rem);
	line-height: 1.05;
	max-width: 18ch;
}
.error-page p:not(.eyebrow) {
	color: var(--ink-soft);
	max-width: 32rem;
}

/* ── CTA + footer ───────────────────────────────────────── */
.cta-band {
	background: var(--ink-deep);
	color: var(--cream-fixed);
}
.cta-inner {
	display: grid;
	gap: 1.25rem;
	max-width: var(--wide);
	margin: 0 auto;
	padding: clamp(3.5rem, 9vw, 6.5rem) var(--gut);
}
.cta-band h2 {
	font-family: var(--display);
	font-size: clamp(2rem, 4.6vw, 3.5rem);
	line-height: 1.05;
	max-width: 16ch;
}
.cta-band p {
	max-width: 34rem;
	color: rgb(241 234 216 / 0.78);
	font-size: 1.125rem;
}
.cta-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
	margin-top: 0.75rem;
}
.cta-band .text-link {
	color: var(--cream-fixed);
}
.cta-band .text-link:hover {
	color: var(--gold);
}

.site-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1.5rem 3rem;
	max-width: var(--wide);
	margin: 0 auto;
	padding: 2.5rem var(--gut) 3rem;
	font-size: 0.875rem;
	color: var(--ink-soft);
}
.footer-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-footer a {
	text-decoration: none;
}
.site-footer a:hover {
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* ── Small screens ──────────────────────────────────────── */
@media (max-width: 40rem) {
	.site-header {
		flex-wrap: wrap;
		padding-top: 1rem;
		padding-bottom: 1rem;
	}
	.site-header nav {
		width: 100%;
		gap: 1.25rem;
	}
	.site-header nav .button {
		margin-left: auto;
	}
	.prose {
		font-size: 1.125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
	}
}

.mark {
	display: inline-flex;
	width: var(--mark-size);
	height: var(--mark-size);
	color: var(--gold);
}
.mark svg {
	width: 100%;
	height: 100%;
}
