/* ============================================================
   brunchlabs.com — the homepage ("orchard glass").

   The orchard painting is fixed behind everything. The wordmark sits in its
   sky and the menu scrolls over it as frosted glass cards. Day painting in
   light mode, dusk painting in dark; a tall cut of each for phones.

   Type: IM Fell English for headings, Hanken Grotesk for text.
   Glass: the recipe from tone8/tone8.css (blur + saturate + specular rim).

   No inline styles anywhere: the site CSP is style-src 'self'.
   /anamnesis still uses main.css, the previous house style; leave that file.
   ============================================================ */

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

:root {
	color-scheme: light dark;

	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
	min-height: 100vh;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--focus, currentColor);
	outline-offset: 3px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ──────────── Glass ────────────
   The recipe from tone8/tone8.css (blur + saturate + specular rim), with the
   fills left to each variation: --g-panel, --g-border, --g-hi, --g-solid. */

.glass {
	background: var(--g-panel);	/* for browsers without color-mix() */
	background: linear-gradient(158deg, color-mix(in oklab, var(--g-panel), white 10%), var(--g-panel));
	-webkit-backdrop-filter: blur(var(--g-blur, 28px)) saturate(180%) brightness(1.04);
	backdrop-filter: blur(var(--g-blur, 28px)) saturate(180%) brightness(1.04);
	border: 1px solid var(--g-border);
	box-shadow:
		inset 0 1.5px 0 var(--g-hi),
		inset 0 -10px 24px -18px rgba(255, 255, 255, 0.18),
		0 18px 40px -22px var(--g-shadow, rgba(40, 30, 10, 0.55));
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.glass {
		background: var(--g-solid);
	}
}

/* ──────────── Contact dialog ────────────
   Markup and class names are contact.js's contract; only the look is ours.
   Themed through --dlg-* so each variation dresses it in its own type. */

.modal-dialog {
	border: none;
	padding: 0;
	background: transparent;
	color: var(--dlg-ink);
	width: 100%;
	max-width: min(500px, calc(100vw - 2rem));
	margin: auto;
	inset: 0;
}

.modal-dialog::backdrop {
	background: var(--dlg-backdrop, rgba(30, 26, 20, 0.3));
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* The dialog is glass like the cards, a little denser because it carries a
   form. Browsers without backdrop-filter get the solid --dlg-solid instead. */
.modal-card,
.modal-thanks {
	position: relative;
	background: var(--dlg-bg);
	-webkit-backdrop-filter: blur(30px) saturate(180%) brightness(1.04);
	backdrop-filter: blur(30px) saturate(180%) brightness(1.04);
	border: 1px solid var(--g-border);
	border-radius: var(--dlg-radius, 22px);
	padding: 2.25rem 2rem 1.75rem;
	font-family: var(--font-body);
	box-shadow:
		inset 0 1.5px 0 var(--g-hi),
		0 40px 80px -40px rgba(0, 0, 0, 0.6);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {

	.modal-card,
	.modal-thanks {
		background: var(--dlg-solid);
	}
}

.modal-thanks {
	text-align: center;
}

.modal-close {
	position: absolute;
	top: 0.7rem;
	right: 0.8rem;
	background: transparent;
	border: none;
	font: inherit;
	font-size: 1.05rem;
	line-height: 1;
	color: var(--dlg-soft);
	cursor: pointer;
	padding: 0.45rem 0.55rem;
	border-radius: 999px;
}

.modal-close:hover {
	color: var(--dlg-ink);
}

.modal-title {
	font-family: var(--font-display);
	font-weight: var(--dlg-title-weight, 400);
	font-size: 2rem;
	line-height: 1.05;
	margin-bottom: 0.6rem;
}

.modal-dek {
	color: var(--dlg-soft);
	font-size: 1rem;
	line-height: 1.5;
	margin-bottom: 1.4rem;
	max-width: 34ch;
}

.modal-thanks .modal-dek {
	margin-left: auto;
	margin-right: auto;
}

.modal-label {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--dlg-soft);
	margin-bottom: 0.4rem;
}

.modal-input {
	width: 100%;
	font: inherit;
	font-size: 1rem;
	padding: 0.8rem 0.95rem;
	margin-bottom: 1rem;
	color: var(--dlg-ink);
	background: var(--dlg-field);
	border: 1px solid var(--dlg-line);
	border-radius: var(--dlg-field-radius, 12px);
	-webkit-appearance: none;
	appearance: none;
}

.modal-input::placeholder {
	color: var(--dlg-soft);
	opacity: 0.7;
}

.modal-textarea {
	resize: vertical;
	min-height: 6rem;
	line-height: 1.5;
}

.modal-honey {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.modal-submit {
	width: 100%;
	justify-content: center;
}

.modal-submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.modal-error {
	color: var(--dlg-error, #a8361f);
	font-size: 0.9rem;
	margin-top: 0.75rem;
}

.modal-aside {
	color: var(--dlg-soft);
	font-size: 0.88rem;
	margin-top: 0.9rem;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ──────────── The page ──────────── */

:root {
	--font-display: "IM Fell English", "Iowan Old Style", Georgia, serif;
	--font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

	--ink: #2a2a1f;
	--ink-soft: #55543f;
	--moss: #3f5a3a;
	--rust: #8a3f1e;
	--yolk: #e3a53a;
	--ground: #fdfcf8;
	--focus: var(--rust);

	--g-panel: rgba(255, 252, 244, 0.56);
	--g-border: rgba(255, 255, 255, 0.85);
	--g-hi: rgba(255, 255, 255, 0.95);
	--g-solid: rgba(255, 252, 244, 0.95);
	--g-shadow: rgba(70, 60, 20, 0.45);

	--scrim-top: rgba(250, 246, 235, 0.10);
	--scrim-bottom: rgba(250, 246, 235, 0.28);

	--dlg-bg: rgba(251, 247, 236, 0.66);
	--dlg-solid: #fbf7ec;
	--dlg-ink: var(--ink);
	--dlg-soft: var(--ink-soft);
	--dlg-line: rgba(42, 42, 31, 0.18);
	--dlg-field: rgba(255, 253, 247, 0.7);

	--scene: url("img/orchard-day.webp");
	--scene-tall: url("img/orchard-day-tall.webp");
}

@media (prefers-color-scheme: dark) {
	:root {
		--ink: #f4ecd9;
		--ink-soft: #ddd3bc;
		--moss: #f6e9cc;	/* candlelight cream: the sage read sickly against the dusk purples */
		--rust: #f6c493;
		--yolk: #f3cd72;
		--ground: #1a1d38;

		--g-panel: rgba(22, 24, 48, 0.58);
		--g-border: rgba(255, 244, 220, 0.26);
		--g-hi: rgba(255, 255, 255, 0.34);
		--g-solid: rgba(22, 24, 48, 0.95);
		--g-shadow: rgba(0, 0, 0, 0.8);

		--scrim-top: rgba(18, 20, 44, 0.20);
		--scrim-bottom: rgba(18, 20, 44, 0.42);

		--dlg-bg: rgba(26, 29, 56, 0.66);
		--dlg-solid: #20233f;
		--dlg-line: rgba(244, 236, 217, 0.2);
		--dlg-field: rgba(16, 18, 40, 0.55);
		--dlg-error: #ffb199;

		--scene: url("img/orchard-dusk.webp");
		--scene-tall: url("img/orchard-dusk-tall.webp");
	}
}

body {
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.55;
	color: var(--ink);
	background-color: var(--ground);
}

/* Fixed pair, not background-attachment: fixed (that judders on iOS). */
.backdrop,
.scrim {
	position: fixed;
	inset: 0;
}

.backdrop {
	z-index: -2;
	/* Daytime: the sheet is shown whole-height, not cropped, so the paper above
	   the orchard stays empty for the type. Its edges already fade to paper. */
	background: var(--ground) var(--scene) center bottom / auto max(80vh, 50vw) no-repeat;
}

@media (prefers-color-scheme: dark) {
	.backdrop {
		background-size: cover;
	}
}

.scrim {
	z-index: -1;
	background: linear-gradient(180deg, var(--scrim-top), var(--scrim-bottom));
}

/* ── Top bar ── */

.topbar {
	position: sticky;
	top: 14px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: min(1120px, calc(100% - 28px));
	margin: 14px auto 0;
	padding: 6px 8px 6px 10px;
	border-radius: 999px;
}

.home {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	font-family: var(--font-display);
	font-size: 1.5rem;
}

.logo {
	width: 38px;
	height: 38px;
}

.nav {
	display: flex;
	gap: 2px;
}

.nav a {
	padding: 0.5rem 0.9rem;
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.94rem;
	font-weight: 500;
}

.nav a:hover {
	background: var(--g-hi);
}

/* ── Hero: type in the sky, the orchard left alone below it ── */

.hero {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: end;
	align-content: start;
	column-gap: clamp(1.5rem, 4vw, 3.5rem);
	width: min(1120px, calc(100% - 48px));
	margin: 0 auto;
	min-height: calc(100vh - 70px);
	padding-top: clamp(1.25rem, 4vh, 3rem);
}

.hero-side {
	padding-bottom: 0.9rem;
}

.wordmark {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(3.9rem, 10.6vw, 9.75rem);
	line-height: 0.85;
	letter-spacing: -0.015em;
	color: var(--moss);
}

.dek {
	max-width: 30ch;
	font-size: clamp(1.05rem, 1.35vw, 1.2rem);
	line-height: 1.45;
	color: var(--ink);
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 1rem;
}

.btn {
	display: inline-flex;
	align-items: center;
	padding: 0.8rem 1.35rem;
	border-radius: 999px;
	border: 1px solid var(--g-border);
	background: var(--g-panel);
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
	color: var(--ink);
	font: inherit;
	font-weight: 600;
	font-size: 0.98rem;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s var(--ease-out);
}

.btn:hover {
	transform: translateY(-2px);
}

.btn-primary {
	background: var(--moss);
	border-color: transparent;
	color: var(--ground);
}

/* ── Menu ── */

.menu {
	width: min(1120px, calc(100% - 48px));
	margin: 0 auto;
	padding-bottom: 4rem;
	/* "See the menu" lands with the first heading clear of the sticky bar */
	scroll-margin-top: 84px;
}

.course + .course {
	margin-top: 3rem;
}

.course-title {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(2.1rem, 3.7vw, 3rem);
	font-style: italic;
	line-height: 1.1;
	letter-spacing: 0;
	color: var(--ink);
	/* a heading scrolls across trees and barn, so it carries its own glass */
	display: inline-block;
	margin: 0 0 0.9rem -1.1rem;
	padding: 0.3rem 1.1rem 0.45rem;
	border-radius: 999px;
	background: var(--g-panel);
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
}

.dishes {
	list-style: none;
	display: grid;
	/* a fixed three columns, so a section of two has cards the same size as a
	   section of three and the sections read as the same thing */
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

@media (max-width: 980px) {
	.dishes {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

.dish {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1.5rem 1.3rem;
	border-radius: 26px;
	transition: transform 0.25s var(--ease-out);
}

/* only a card that goes somewhere lifts, and it shows keyboard focus as a whole */
.dish:has(a):hover {
	transform: translateY(-4px);
}

.dish:has(a:focus-visible) {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

.dish-name a:focus-visible {
	outline: none;
}

.dish-name {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 2.1rem;
	line-height: 1.05;
}

.dish-name a {
	text-decoration: none;
}

/* the whole card is the link */
.dish-name a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.dish-desc {
	margin-top: 0.55rem;
	color: var(--ink);
}

.dish-tags {
	margin-top: 0.8rem;
	font-size: 0.88rem;
	color: var(--ink-soft);
}

.dish-host {
	margin-top: auto;
	padding-top: 1.1rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--rust);
}

/* ── Footer ── */

.site-footer {
	position: relative;
	width: min(1120px, calc(100% - 28px));
	margin: 0 auto 18px;
	padding: 1.6rem 13rem 1.6rem 1.75rem;
	border-radius: 26px;
	font-size: 0.95rem;
}

.footer-line {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 1.6rem;
	margin-bottom: 0.5rem;
}

.footer-credits {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1.4rem;
	color: var(--ink-soft);
}

.footer-byline {
	margin-top: 0.3rem;
	color: var(--ink-soft);
}

/* the email and the name read as text; the underline appears on hover */
.site-footer a {
	text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	text-decoration: underline;
}

/* Tim on the tractor: the ink drawing from his CV, redrawn cleaner for small
   sizes and cut out so the glass shows around it. The original line drawing is in the CV repo
   (icons/tim-tractor-profile-charcoal.png). */
.tractor {
	position: absolute;
	right: 1.6rem;
	bottom: 1.1rem;
	width: 10rem;
	transition: transform 0.6s var(--ease-out);
}

.tractor img {
	width: 100%;
}

@media (prefers-color-scheme: dark) {

	/* the drawing's white fills are toned to candlelight so they do not glare,
	   and a thin cream rim keeps the strokes with nothing behind them (the code
	   glyph, the ground line) visible on the dark glass */
	.tractor img {
		filter: sepia(0.3) brightness(0.93) drop-shadow(0 0 0.7px #f6e9cc) drop-shadow(0 0 0.7px #f6e9cc) drop-shadow(0 0 1.2px rgba(246, 233, 204, 0.8));
	}
}

.tractor:hover {
	transform: translateX(-10px);
}

@media (max-width: 760px) {
	.backdrop {
		background-image: var(--scene-tall);
		background-size: cover;
	}

	.hero {
		display: block;
	}

	.hero-side {
		padding: 1rem 0 0;
	}

	.dek {
		max-width: 34ch;
		font-size: 1.12rem;
	}

	.home span {
		display: none;
	}

	.nav a {
		padding: 0.5rem 0.65rem;
		font-size: 0.88rem;
	}

	.hero {
		width: calc(100% - 36px);
	}

	.menu {
		width: calc(100% - 28px);
	}

	.course-title {
		margin-left: 0;
	}

	.site-footer {
		padding: 1.4rem 1.4rem 6.75rem;
	}

	.tractor {
		right: 1.2rem;
		bottom: 1rem;
		width: 8rem;
	}
}
