/* =========================================================================
   Ouse Valley IT
   A visual identity drawn from the place: the Great Ouse winding past
   St Ives and the fen-edge villages. Deep river-green ink on chalk paper,
   one warm lamplight accent for the single action that matters.
   Calm is the product — generous space, large friendly type, nothing that
   blinks. Bookish Literata for headings, humanist Hanken Grotesk for text.
   Single light theme.
   ========================================================================= */

:root {
	color-scheme: light;

	/* --- palette: water, willow, chalk, lamplight --- */
	--paper:      #F7F8F5;   /* chalk + water — a cool off-white, never cream */
	--paper-sunk: #ECEFE8;   /* recessed band */
	--ink:        #213B3C;   /* the Ouse in shadow — near-black green */
	--slate:      #566862;   /* green-grey secondary text */
	--river:      #316F64;   /* mid-river green — links, the drawn line, ticks */
	--river-deep: #24564C;   /* pressed / strong link */
	--honey:      #E4A44E;   /* lamplight in a window — the one warm fill */
	--honey-deep: #C9863A;
	--line:       #D3DACF;   /* hairlines */
	--danger:     #A8412C;   /* form errors only — never decoration */

	--font-display: "Literata", Georgia, "Times New Roman", serif;
	--font-body:    "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	/* type — 18px base, gentle 1.2 steps, one large display jump */
	--step-d: clamp(2.55rem, 1.85rem + 3.3vw, 3.9rem);
	--step-1: clamp(1.9rem, 1.6rem + 1.4vw, 2.4rem);
	--step-2: clamp(1.45rem, 1.3rem + 0.7vw, 1.7rem);
	--step-3: 1.2rem;
	--text:   1.125rem;
	--small:  0.9375rem;

	/* space — 8px base + one fluid section rhythm */
	--sp-1: 0.5rem;
	--sp-2: 1rem;
	--sp-3: 1.5rem;
	--sp-4: 2.25rem;
	--sp-5: 3.5rem;
	--sp-6: 5.5rem;
	--sp-section: clamp(4.5rem, 3rem + 7vw, 8rem);

	--measure: 62ch;
	--container: 1080px;
	--edge: clamp(1.25rem, 5vw, 3rem);
	--radius: 5px;
	--hair: 1px;
}

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

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

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

img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
	font-family: var(--font-display);
	font-weight: 400;
	color: var(--ink);
	line-height: 1.16;
	letter-spacing: -0.005em;
	margin: 0;
	text-wrap: balance;
}
h1 { font-size: var(--step-1); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-3); font-weight: 500; line-height: 1.3; }

p { margin: 0; max-width: var(--measure); }

a {
	color: var(--river-deep);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}
a:hover { color: var(--ink); }

strong { font-weight: 600; }

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

::selection { background: color-mix(in srgb, var(--honey) 38%, transparent); }

/* ---------- layout ---------- */

.container {
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--edge);
}

.section { padding-block: var(--sp-section); }
.section--sunk { background: var(--paper-sunk); }

.section > .container > * + * { margin-top: var(--sp-3); }
main > .section:first-child { padding-top: var(--sp-5); }

.lead {
	font-size: var(--step-3);
	line-height: 1.5;
	color: var(--slate);
	max-width: 54ch;
}

.prose-width { max-width: 60ch; }

/* ---------- skip link ---------- */

.skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ink);
	color: var(--paper);
	padding: var(--sp-2) var(--sp-3);
	z-index: 50;
}
.skip:focus { left: 0; }

/* ---------- masthead ---------- */

.masthead {
	border-bottom: var(--hair) solid var(--line);
	background: var(--paper);
}
.masthead .container {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sp-3);
	flex-wrap: wrap;
	padding-block: var(--sp-3);
}

.brand {
	font-family: var(--font-display);
	font-size: 1.2rem;
	font-weight: 500;
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
}
.brand:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--river); text-underline-offset: 4px; }

.nav {
	display: flex;
	align-items: baseline;
	gap: var(--sp-4);
	flex-wrap: wrap;
}
.nav a {
	font-family: var(--font-body);
	font-size: var(--small);
	font-weight: 500;
	color: var(--slate);
	text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--river);
	text-underline-offset: 5px;
	text-decoration-thickness: 2px;
}

.nav-toggle {
	display: none;
	font-family: var(--font-body);
	font-size: var(--small);
	font-weight: 600;
	color: var(--ink);
	background: none;
	border: var(--hair) solid var(--line);
	border-radius: var(--radius);
	padding: 0.5rem 0.9rem;
	cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-body);
	font-size: var(--small);
	font-weight: 600;
	line-height: 1;
	padding: 0.9rem 1.5rem;
	border: var(--hair) solid transparent;
	border-radius: var(--radius);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

.btn--primary { background: var(--honey); color: var(--ink); }
.btn--primary:hover { background: var(--honey-deep); color: var(--ink); text-decoration: none; }

.btn--line {
	background: none;
	border-color: var(--ink);
	color: var(--ink);
}
.btn--line:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.calllink {
	font-family: var(--font-body);
	font-weight: 600;
	color: var(--river-deep);
	text-decoration: none;
	white-space: nowrap;
}
.calllink:hover { color: var(--ink); text-decoration: underline; }

/* ---------- hero: the river across the valley ---------- */

.hero { border-bottom: var(--hair) solid var(--line); }
.hero .container { padding-block: var(--sp-5) var(--sp-section); }

.rivermark {
	width: 100%;
	height: clamp(140px, 30vw, 190px);
	overflow: visible;
	margin-bottom: var(--sp-5);
}
.rivermark__flow {
	fill: none;
	stroke: var(--river);
	stroke-width: 3;
	stroke-linecap: round;
}
.rivermark__town { fill: var(--river); }
.rivermark__label {
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 600;
	fill: var(--slate);
}

@media (prefers-reduced-motion: no-preference) {
	.rivermark__flow {
		stroke-dasharray: 1400;
		stroke-dashoffset: 1400;
		animation: river-draw 1.8s ease-out 0.15s forwards;
	}
	.rivermark__town, .rivermark__label {
		opacity: 0;
		animation: river-settle 0.5s ease 1.3s forwards;
	}
}
@keyframes river-draw { to { stroke-dashoffset: 0; } }
@keyframes river-settle { to { opacity: 1; } }

.hero__title {
	font-size: var(--step-d);
	line-height: 1.08;
	max-width: 19ch;
}
.hero__lead {
	font-size: var(--step-3);
	line-height: 1.5;
	color: var(--slate);
	max-width: 38ch;
	margin-top: var(--sp-3);
}
.hero__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--sp-3);
	margin-top: var(--sp-4);
}
.hero__where {
	margin-top: var(--sp-4);
	color: var(--slate);
	font-size: var(--small);
	max-width: 52ch;
}

/* ---------- help list — plain, hairline-separated, river tick ---------- */

.help {
	list-style: none;
	margin: var(--sp-4) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	column-gap: var(--sp-5);
}
.help li {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0 var(--sp-2);
	padding: var(--sp-3) 0;
	border-top: var(--hair) solid var(--line);
}
.help li::before {
	content: "";
	width: 17px;
	height: 17px;
	margin-top: 0.28rem;
	background: no-repeat center / 17px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23316F64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8.5 6 12l7.5-8.5'/%3E%3C/svg%3E");
}
.help h3 { margin: 0; }
.help p { margin: 0.2rem 0 0; color: var(--slate); font-size: var(--small); grid-column: 2; }

/* ---------- route — a genuine three-stop sequence on the river ---------- */

.route {
	list-style: none;
	margin: var(--sp-5) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--sp-4);
	position: relative;
}
.route::before {
	content: "";
	position: absolute;
	left: 19px;
	right: 19px;
	top: 19px;
	height: 2px;
	background: var(--line);
}
.stop { position: relative; }
.stop__n {
	position: relative;
	z-index: 1;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--river);
	color: var(--paper);
	font-family: var(--font-display);
	font-size: 1.1rem;
	display: grid;
	place-items: center;
	margin-bottom: var(--sp-2);
}
.stop h3 { margin: 0 0 0.3rem; }
.stop p { margin: 0; color: var(--slate); font-size: var(--small); max-width: 34ch; }

/* ---------- prices ---------- */

.prices { margin-top: var(--sp-4); }
.price {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0 var(--sp-4);
	align-items: baseline;
	padding: var(--sp-3) 0;
	border-top: var(--hair) solid var(--line);
}
.price:last-of-type { border-bottom: var(--hair) solid var(--line); }
.price__name { font-family: var(--font-display); font-size: var(--step-3); font-weight: 500; }
.price__fig {
	font-family: var(--font-display);
	font-size: var(--step-3);
	font-weight: 500;
	color: var(--river-deep);
	white-space: nowrap;
}
.price__note {
	grid-column: 1 / -1;
	margin: 0.35rem 0 0;
	color: var(--slate);
	font-size: var(--small);
	max-width: 60ch;
}

/* ---------- aside / note ---------- */

.aside {
	background: color-mix(in srgb, var(--honey) 15%, var(--paper));
	border-left: 3px solid var(--honey);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: var(--sp-3);
}
.aside > * { max-width: 60ch; }
.aside > * + * { margin-top: var(--sp-2); }

/* ---------- assurance (trust) — plain, no badges ---------- */

.assurance {
	list-style: none;
	margin: var(--sp-4) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--sp-3) var(--sp-5);
}
.assurance li {
	padding-top: var(--sp-3);
	border-top: var(--hair) solid var(--line);
}
.assurance h3 { margin: 0 0 0.25rem; }
.assurance p { margin: 0; color: var(--slate); font-size: var(--small); }

/* ---------- quotes ---------- */

.quotes {
	list-style: none;
	margin: var(--sp-4) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--sp-5) var(--sp-4);
}
.quotes blockquote { margin: 0; }
.quotes p { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.45; }
.quotes cite { display: block; margin-top: var(--sp-2); font-style: normal; color: var(--slate); font-size: var(--small); }

/* ---------- split (about) ---------- */

.split {
	display: grid;
	grid-template-columns: 4fr 6fr;
	gap: var(--sp-5);
	align-items: start;
	margin-top: var(--sp-2);
}
.split > * + * { margin-top: 0; }
.portrait {
	border: var(--hair) solid var(--line);
	border-radius: var(--radius);
	aspect-ratio: 4 / 5;
	display: grid;
	place-items: center;
	background: var(--paper-sunk);
	color: var(--slate);
	font-size: var(--small);
	text-align: center;
	padding: var(--sp-3);
}
.about-copy > * + * { margin-top: var(--sp-3); }

/* ---------- forms ---------- */

.form {
	margin-top: var(--sp-4);
	max-width: 620px;
	display: grid;
	gap: var(--sp-3);
}
.row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--sp-3);
}
.field { display: grid; gap: 0.35rem; }
.field > span { font-weight: 600; font-size: var(--small); }
.field .opt { font-weight: 400; color: var(--slate); }

.input, .textarea, .select {
	font-family: var(--font-body);
	font-size: var(--text);
	color: var(--ink);
	background: var(--paper);
	border: var(--hair) solid var(--slate);
	border-radius: var(--radius);
	padding: 0.7rem 0.8rem;
	width: 100%;
}
.textarea { min-height: 7.5rem; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
	outline: 2px solid var(--river);
	outline-offset: 1px;
	border-color: var(--river);
}

.check {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--sp-2);
	align-items: start;
	font-size: var(--small);
	color: var(--slate);
	max-width: none;
}
.check input { margin-top: 0.25rem; width: 1rem; height: 1rem; accent-color: var(--river); }

.field-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-weight: 600; color: var(--river-deep); }

.form-error {
	margin: 0 0 var(--sp-4);
	max-width: 620px;
	padding: var(--sp-3);
	border-left: 3px solid var(--danger);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: color-mix(in srgb, var(--danger) 8%, var(--paper));
	color: var(--ink);
	font-weight: 500;
}
.form-error a { color: var(--danger); }

/* ---------- closing block — the one warm moment ---------- */

.callout { background: var(--honey); color: var(--ink); }
.callout .container { padding-block: var(--sp-6); }
.callout h2 { color: var(--ink); max-width: 20ch; }
.callout p { color: color-mix(in srgb, var(--ink) 78%, var(--honey)); margin-top: var(--sp-2); }
.callout .btn--primary { background: var(--ink); color: var(--paper); margin-top: var(--sp-4); }
.callout .btn--primary:hover { background: var(--river-deep); color: var(--paper); }

/* ---------- interior page header ---------- */

.page-head {
	background: var(--paper-sunk);
	border-bottom: var(--hair) solid var(--line);
}
.page-head .container { padding-block: var(--sp-5); }
.page-head h1 { font-size: var(--step-1); }
.page-head p { margin-top: var(--sp-2); color: var(--slate); }

/* ---------- prose ---------- */

.prose { max-width: 62ch; }
.prose > * + * { margin-top: var(--sp-3); }
.prose h2 { font-size: var(--step-3); font-weight: 600; margin-top: var(--sp-5); }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.prose li { max-width: 60ch; }

/* ---------- footer — the river closes the page ---------- */

.foot {
	border-top: 2px solid var(--river);
	background: var(--paper);
}
.foot .container {
	padding-block: var(--sp-5);
	display: grid;
	grid-template-columns: 1.7fr 1fr 1fr;
	gap: var(--sp-4);
}
.foot__name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.foot h2 {
	font-family: var(--font-body);
	font-size: var(--small);
	font-weight: 600;
	color: var(--slate);
	margin: 0 0 var(--sp-2);
}
.foot p { color: var(--slate); font-size: var(--small); }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; text-decoration-color: var(--river); }
.foot__legal {
	margin-top: var(--sp-4);
	padding-top: var(--sp-3);
	border-top: var(--hair) solid var(--line);
	color: var(--slate);
	font-size: var(--small);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
	.nav {
		display: none;
		width: 100%;
		flex-direction: column;
		gap: 0;
	}
	.nav.is-open { display: flex; }
	.nav a { padding: var(--sp-2) 0; border-top: var(--hair) solid var(--line); }
	.nav a[aria-current="page"] { text-decoration: none; box-shadow: inset 3px 0 0 var(--river); padding-left: var(--sp-2); }
	.nav-toggle { display: inline-block; }
	.masthead .container { flex-wrap: nowrap; }

	.help { grid-template-columns: 1fr; }
	.route { grid-template-columns: 1fr; gap: var(--sp-4); }
	.route::before { display: none; }
	.assurance { grid-template-columns: 1fr; }
	.quotes { grid-template-columns: 1fr; gap: var(--sp-4); }
	.split { grid-template-columns: 1fr; }
	.portrait { max-width: 20rem; }
	.foot .container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
	/* the map labels crowd on narrow screens; the sentence below lists the villages */
	.rivermark__label { display: none; }
}

@media (max-width: 540px) {
	.row { grid-template-columns: 1fr; }
	.price { grid-template-columns: 1fr; }
	.price__fig { color: var(--river-deep); }
	.foot .container { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.001ms !important; animation-delay: 0s !important; }
}

/* ---------- quick-help assistant ---------- */

.ask-fab {
	position: fixed;
	z-index: 80;
	right: calc(var(--sp-4) + env(safe-area-inset-right, 0px));
	bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	border: 1px solid var(--honey-deep);
	border-radius: 50%;
	background: var(--honey);
	color: var(--ink);
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(33, 59, 60, 0.24);
}
.ask-fab:hover,
.ask-fab[aria-expanded="true"] { background: var(--honey-deep); }
.ask-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ask-panel[hidden] { display: none; }
.ask-panel {
	position: fixed;
	z-index: 81;
	right: calc(var(--sp-4) + env(safe-area-inset-right, 0px));
	bottom: calc(72px + var(--sp-4) + env(safe-area-inset-bottom, 0px));
	width: min(370px, calc(100vw - 2 * var(--sp-4)));
	max-height: min(70vh, 560px);
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 12px 40px rgba(33, 59, 60, 0.22);
	overflow: hidden;
	animation: ask-rise 160ms ease;
}
@keyframes ask-rise { from { opacity: 0; transform: translateY(10px); } }

.ask-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-2);
	padding: var(--sp-2) var(--sp-3);
	border-bottom: 1px solid var(--line);
	background: var(--paper-sunk);
	font-family: var(--font-display);
	font-size: 1.05rem;
}
.ask-panel__close {
	border: 0;
	background: none;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--slate);
	cursor: pointer;
	padding: 0 var(--sp-1);
}
.ask-panel__close:hover { color: var(--ink); }

.ask-log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: var(--sp-3);
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
}
.ask-msg {
	max-width: 88%;
	padding: var(--sp-2) var(--sp-3);
	border-radius: var(--radius);
	font-size: 0.95rem;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.ask-msg--you { align-self: flex-end; background: var(--river); color: var(--paper); }
.ask-msg--bot { align-self: flex-start; background: var(--paper-sunk); color: var(--ink); border: 1px solid var(--line); }
.ask-msg--wait { color: var(--slate); font-style: italic; }
.ask-book { align-self: flex-start; margin-top: var(--sp-1); text-decoration: none; }

.ask-form {
	display: flex;
	gap: var(--sp-2);
	align-items: flex-end;
	padding: var(--sp-3);
	border-top: 1px solid var(--line);
}
.ask-form textarea {
	flex: 1 1 auto;
	width: 100%;
	font-family: var(--font-body);
	font-size: 0.95rem;
	color: var(--ink);
	background: var(--paper);
	border: 1px solid var(--slate);
	border-radius: var(--radius);
	padding: var(--sp-2);
	resize: none;
	max-height: 8rem;
}
.ask-form textarea:focus { outline: 2px solid var(--river); outline-offset: 1px; border-color: var(--river); }
.ask-form .btn { flex: none; padding-inline: var(--sp-4); }

.ask-note {
	margin: 0;
	padding: var(--sp-2) var(--sp-3);
	font-size: 0.78rem;
	line-height: 1.45;
	color: var(--slate);
	background: var(--paper-sunk);
	border-top: 1px solid var(--line);
}
.ask-note a { color: var(--river-deep); }

/* inline copy on the /help page */
.ask--inline {
	display: flex;
	flex-direction: column;
	max-width: 620px;
	height: 30rem;
	margin-top: var(--sp-5);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
}
.ask--inline .ask-panel__head { display: none; }

@media (max-width: 480px) {
	.ask-panel {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		max-height: 82vh;
		border-radius: var(--radius) var(--radius) 0 0;
	}
	.ask--inline { height: 26rem; }
}
