/* Kern — base: tokens, reset, type, buttons, forms, motion.
   Palette and type are taken from 1950s–60s furniture catalogues: warm paper, walnut ink,
   and flat colour plates (ochre, rust, olive, petrol) behind cut-out photographs. */

:root {
	--paper: #d5ddd4;
	--paper-rgb: 213 221 212;
	--light-rgb: 238 242 237;
	--ink-rgb: 21 32 27;
	--paper-2: #c7d1c7;
	--paper-3: #b4c1b6;
	--cream: #eef2ed;
	--ink: #15201b;
	--ink-2: #3d4a44;
	--ink-3: #4c5852;
	--line: rgb(var(--ink-rgb) / 0.13);
	--line-2: rgb(var(--ink-rgb) / 0.26);

	--walnut: #4a2f21;
	--teak: #a6612f;
	--ochre: #d8a243;
	--rust: #c4663d;
	--rust-deep: #a9502a;
	--rust-ink: #8f3f1f; /* rust for small text: 5:1 on paper */
	--olive: #8b8852;
	--petrol: #2d6164;
	--sky: #afc5c1;
	--rose: #e1b9a7;
	--sage: #b7ba95;
	--sand: #c9a36a;
	--green-ok: #7fa36b;

	--serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
	--sans: 'Jost', Futura, 'Avenir Next', system-ui, sans-serif;

	--fs-xs: 0.75rem;
	--fs-s: 0.9rem;
	--fs-m: 1.0625rem;
	--fs-l: clamp(1.18rem, 1.05rem + 0.55vw, 1.5rem);
	--fs-h4: clamp(1.2rem, 1.05rem + 0.5vw, 1.5rem);
	--fs-h3: clamp(1.5rem, 1.2rem + 0.9vw, 2.1rem);
	--fs-h2: clamp(1.9rem, 1.3rem + 1.8vw, 3.3rem);
	--fs-h1: clamp(2.3rem, 1.4rem + 2.8vw, 4.4rem);
	--fs-hero: clamp(2.7rem, 1rem + 5vw, 6.4rem);
	--section: clamp(3rem, 6.5vw, 5.5rem);
	--fit-h: calc(100svh - var(--bar-h) - 3rem);

	--ease: cubic-bezier(0.22, 0.61, 0.1, 1);
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-io: cubic-bezier(0.65, 0, 0.35, 1);

	--gutter: clamp(1.15rem, 3.4vw, 3.25rem);
	--max: 1560px;
	--announce-h: 34px;
	--bar-h: 78px;
	--header-h: calc(var(--announce-h) + var(--bar-h));
	--grain: url('../img/grain.png');
	color-scheme: light;
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
/* Suppress the browser's touch overlay; keep our active states and keyboard focus rings. */
html { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 1rem); overflow-x: clip; scrollbar-gutter: stable; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 var(--fs-m) / 1.62 var(--sans);
	font-kerning: normal;
	font-feature-settings: 'kern', 'liga';
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}
body.is-locked { overflow: hidden; }
/* smooth scrolling (Lenis, see js/modules/smooth.js). While a panel or dialog is open the page itself is held
   still (the gutter above keeps the width from jumping when the scrollbar goes) and only the panel scrolls. */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-stopped, html:has(> body.is-locked) { overflow: hidden; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
img, svg, video, picture { display: block; max-width: 100%; height: auto; }
p, li, dd, figcaption { text-wrap: pretty; }
picture img { width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; font-weight: inherit; }
ul, ol { margin: 0 0 1em; }
address { font-style: normal; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
::selection { background: var(--ochre); color: var(--ink); }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.sr-only, .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 999; background: var(--ink); color: var(--cream); padding: 0.8rem 1.2rem; border-radius: 999px; transition: top 0.3s; }
/* only for keyboard users: a tap or a script moving focus must not slide it over the header */
.skip-link:focus-visible { top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.site-main { min-height: 60vh; }
body:not(.has-hero) .site-main { padding-top: var(--header-h); }

/* type */
.serif, h1, h2, h3, .h1, .h2, .h3 {
	font-family: var(--serif);
	font-weight: 330;
	font-optical-sizing: auto;
	font-variation-settings: 'SOFT' 50;
	letter-spacing: -0.022em;
	line-height: 1.04;
	text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-h1); line-height: 0.98; }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.1; }
h4, .h4 { font-size: var(--fs-h4); font-family: var(--serif); font-weight: 380; line-height: 1.2; }
h1 em, h2 em, h3 em, .serif em, .italic {
	font-style: italic;
	font-weight: 300;
	font-variation-settings: 'SOFT' 100;
	letter-spacing: -0.03em;
}
.lead { font-size: var(--fs-l); line-height: 1.5; color: var(--ink-2); }
.label {
	font: 500 var(--fs-xs) / 1.3 var(--sans);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-2);
	margin: 0 0 1rem;
}
.label a { text-decoration: none; }
.muted { color: var(--ink-3); }
.num { font-feature-settings: 'tnum'; }

/* colour plates */
.tone {
	background-color: var(--tone, var(--sand));
	background-image: var(--grain);
	background-size: 180px;
}
/* on a colour plate every line is set in the plate's own ink or cream: greys lose too much contrast on mid tones */
.tone { --ink-2: var(--ink); --ink-3: var(--ink); }
.tone--light { color: var(--cream); --ink-2: var(--cream); --ink-3: var(--cream); }
.tone--light .label { color: var(--cream); }

/* buttons */
.btn {
	--btn-bg: var(--ink);
	--btn-fg: var(--cream);
	--btn-fill: var(--rust);
	--btn-line: var(--btn-bg);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.65em;
	min-height: 3.3rem;
	padding: 0 1.7em;
	/* the outline is painted inside the pill (not a border), so the disc covers it too and no ring of the old
	   colour shows while it rises or sets; the focus ring outside stays whole */
	border: 0;
	box-shadow: inset 0 0 0 1px var(--btn-line);
	border-radius: 999px;
	background: var(--btn-bg);
	color: var(--btn-fg);
	font: 500 0.95rem / 1 var(--sans);
	letter-spacing: 0.02em;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.3s var(--ease);
}
/* Hover: a disc of the fill colour rises from where the pointer came in, like the sun on the colour plates,
   and sets towards where it left (--bx/--by, js/modules/buttons.js; the middle for the keyboard). It is wide
   enough to cover the whole pill from any point. The arrow slips out to the right and back in from the left. */
:is(.btn, .kern-disc)::before {
	content: '';
	position: absolute;
	left: var(--bx, 50%);
	top: var(--by, 50%);
	z-index: -1;
	width: calc(230% + 3rem);
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--btn-fill);
	transform: translate(-50%, -50%) scale(0);
	transition: transform 0.55s cubic-bezier(0.55, 0, 0.7, 0.4);
	pointer-events: none;
}
:is(.btn, .kern-disc):focus-visible::before { transform: translate(-50%, -50%) scale(1); transition: transform 0.9s cubic-bezier(0.3, 0.1, 0.15, 1); }
@media (hover: hover) {
	:is(.btn, .kern-disc):hover::before { transform: translate(-50%, -50%) scale(1); transition: transform 0.9s cubic-bezier(0.3, 0.1, 0.15, 1); }
	.btn:hover .icon--arrow { animation: arrow-through 0.6s var(--ease-out); }
}
/* a disc created at the moment of the hover (WooCommerce's own buttons get it from buttons.js) still grows */
@starting-style { :is(.btn, .kern-disc):is(:hover, :focus-visible)::before { transform: translate(-50%, -50%) scale(0); } }
@keyframes arrow-through {
	0% { transform: none; opacity: 1; }
	38% { transform: translateX(70%); opacity: 0; }
	39% { transform: translateX(-70%); opacity: 0; }
	100% { transform: none; opacity: 1; }
}
.btn:active { transform: scale(0.98); }
.btn .icon { width: 1.15em; height: 1.15em; }
/* every fill keeps the text readable from the first frame to the last, so no button changes its text colour
   while the disc is only half way across: the outlined one fills with a deeper celadon under ink */
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-fill: var(--paper-3); --btn-line: var(--line-2); }
.btn--light { --btn-bg: var(--cream); --btn-fg: var(--ink); --btn-fill: var(--ochre); }
.btn--light:hover { color: var(--ink); }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { pointer-events: none; opacity: 0.6; }
.btn.is-busy::after {
	content: ''; width: 1em; height: 1em; border-radius: 50%;
	border: 2px solid currentColor; border-right-color: transparent;
	animation: spin 0.8s linear infinite;
}

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	font-weight: 500;
	text-decoration: none;
	padding-bottom: 0.2em;
	background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
	transition: background-size 0.5s var(--ease-out);
}
.link-arrow:hover { background-size: 0 1px; background-position: 100% 100%; }
.link-arrow .icon { width: 1.1em; height: 1.1em; transition: transform 0.5s var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.chip {
	display: inline-flex; align-items: center; gap: 0.5em;
	min-height: 2.5rem; padding: 0 1.1em;
	border: 1px solid var(--line-2); border-radius: 999px;
	font: 500 0.9rem / 1 var(--sans); text-decoration: none; color: var(--ink);
	background: transparent; cursor: pointer;
	transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active, .chip[aria-current='page'] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip__count { opacity: 0.55; font-size: 0.85em; }

/* forms */
input[type='text'], input[type='email'], input[type='tel'], input[type='password'], input[type='number'],
input[type='search'], input[type='date'], input[type='url'], select, textarea {
	width: 100%;
	font: inherit;
	color: var(--ink);
	/* a soft paper field, lighter than the page but never white (the checkout uses the same) */
	background-color: rgb(var(--light-rgb) / 0.55);
	border: 1px solid var(--line-2);
	border-radius: 12px;
	padding: 0.85rem 1rem;
	transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); background-color: rgb(var(--light-rgb) / 0.85); box-shadow: 0 0 0 4px rgb(var(--ink-rgb) / 0.08); }
/* checkboxes drawn in the house style (WooCommerce's block checkboxes style themselves in checkout.css) */
input[type='checkbox']:not(.wc-block-components-checkbox__input) {
	appearance: none; flex: none; display: inline-block; vertical-align: -0.3em;
	width: 20px; height: 20px; margin: 0;
	border: 1px solid var(--line-2); border-radius: 6px;
	background: rgb(var(--light-rgb) / 0.55) center / 14px no-repeat;
	cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
input[type='checkbox']:not(.wc-block-components-checkbox__input):hover { border-color: rgb(var(--ink-rgb) / 0.5); }
input[type='checkbox']:not(.wc-block-components-checkbox__input):checked {
	border-color: var(--ink); background-color: var(--ink);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef2ed' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.2 12.6 4.4 4.3 9.2-9.6'/%3E%3C/svg%3E");
}
input[type='checkbox']:not(.wc-block-components-checkbox__input):focus { box-shadow: none; }
input[type='checkbox']:not(.wc-block-components-checkbox__input):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315201b' stroke-width='1.5'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8rem center;
	background-size: 1.1rem;
	padding-right: 2.6rem;
}
label { font-size: var(--fs-s); }

/* icons */
.icon { width: 22px; height: 22px; flex: none; }

/* breadcrumbs */
.crumbs { font-size: 0.85rem; color: var(--ink-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs__sep { margin: 0 0.55em; opacity: 0.5; }
.tone--light .crumbs { color: var(--cream); }

/* option swatches & pills (product page, home configurator) */
.options { margin: 0 0 1.4rem; padding: 0; border: 0; min-width: 0; }
.options__legend { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.75rem; padding: 0; }
.options__legend .label { margin: 0; }
.options__value { font: italic 400 1.05rem var(--serif); font-variation-settings: 'SOFT' 100; }
.options__list { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.option__chip { display: block; width: 2.9rem; height: 2.9rem; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow 0.3s, transform 0.35s var(--ease-out); }
.option--lg .option__chip { width: 3.4rem; height: 3.4rem; }
.option:hover .option__chip { transform: scale(1.06); }
.option input:checked + .option__chip { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--ink); }
.option input:focus-visible + .option__chip, .option input:focus-visible + .option__name { outline: 2px solid var(--rust); outline-offset: 5px; }
.option__name { display: inline-flex; align-items: center; min-height: 2.8rem; padding: 0 1.15rem; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 500; font-size: 0.92rem; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.option:hover .option__name { border-color: var(--ink); }
.option input:checked + .option__name { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.option.is-unavailable { opacity: 0.35; }


/* motion */
html.js [data-reveal] {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.9s var(--ease-out), transform 1.2s var(--ease-out);
	transition-delay: calc(var(--i, 0) * 90ms);
}
html.js [data-reveal='fade'] { transform: none; }
html.js [data-reveal='scale'] { transform: scale(0.96); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }

html.js .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.14em 0.14em 0.2em; margin: -0.14em -0.14em -0.2em; }
html.js .split.is-done .w { overflow: visible; }
html.js .split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--w, 0) * 45ms + var(--d, 0ms)); }
html.js .split.is-in .w > span { transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(127 163 107 / 0.55); } 70% { box-shadow: 0 0 0 7px rgb(127 163 107 / 0); } 100% { box-shadow: 0 0 0 0 rgb(127 163 107 / 0); } }

@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; }
	html.js [data-reveal], html.js .split .w > span { opacity: 1 !important; transform: none !important; }
}

/* WordPress content basics */
/* blurred previews behind pictures still on their way (inc/images.php, js/modules/lqip.js) */
img[data-lqip] { background-repeat: no-repeat; background-position: center; background-size: cover; }
img[data-lqip].is-sharp { background-image: none !important; }
html.js img[data-lqip='alpha']:not(.is-sharp, .is-measuring) { object-position: -99999px 0; }
.alignwide { max-width: 76rem; margin-inline: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-block-image img { border-radius: 4px; }
figcaption, .wp-element-caption { font-size: var(--fs-s); color: var(--ink-3); margin-top: 0.7rem; }
