/*
Theme Name: Boneh Plan
Theme URI: https://renih.gogeek.co.il/
Author: Boneh Renih
Description: The sales plan set as a website: drawing sheets, a title block that carries the navigation, dimension lines and revision clouds. Hebrew first (RTL) with English (LTR), editable menus, a built-in enquiry form and page-change transitions. Reads content from the Boneh Renih Content & Legacy URLs plugin.
Version: 1.0.6
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: boneh-plan
*/

/* Self-hosted fonts (SIL Open Font License 1.1): Assistant and Miriam Libre, from Google Fonts. */
@font-face { font-family: 'Assistant'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/assistant-hebrew.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Assistant'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/assistant-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Assistant'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/assistant-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Miriam Libre'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/miriam-libre-hebrew.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Miriam Libre'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/miriam-libre-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Miriam Libre'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/miriam-libre-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }


/* ---------- Tokens ---------- */
:root {
	--paper: #f7f7f4;
	--ink: #151515;
	--red: #b42a24;
	--line: #8c959a;
	--muted: #5f686d;
	--grid: #e6e6e0;
	--wash: #efefea;

	--display: 'Miriam Libre', 'Assistant', Arial, sans-serif;
	--text: 'Assistant', Arial, sans-serif;

	--fs-sheet: clamp(2.5rem, 1.1rem + 4.4vw, 5.25rem);
	--fs-page: clamp(2.25rem, 1.2rem + 3.4vw, 4.25rem);
	--fs-h2: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
	--fs-h3: 1.375rem;
	--fs-lede: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
	--fs-body: 1.0625rem;
	--fs-ui: 0.9375rem;
	--fs-meta: 0.8125rem;

	--u: 8px;
	--gut: clamp(20px, 4.2vw, 72px);
	--frame: clamp(6px, 0.8vw, 12px);
	--bar: 64px;
	--ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; scroll-padding-bottom: calc(var(--bar) + 24px); }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--text);
	font-size: var(--fs-body);
	line-height: 1.75;
	padding: var(--frame) var(--frame) calc(var(--bar) + var(--frame) * 2);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	caret-color: var(--red);
	scrollbar-color: var(--ink) var(--paper);
}
::selection { background: var(--red); color: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--red); }
h1, h2, h3, h4, h5 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
	position: absolute; inset-inline-start: 16px; top: -100px; z-index: 100;
	background: var(--ink); color: var(--paper); padding: 12px 18px; font-weight: 700;
}
.skip:focus { top: 16px; }

/* The drawing border around every sheet */
.sheet-frame {
	position: fixed; inset: var(--frame); z-index: 40; pointer-events: none;
	border: 1.5px solid var(--ink);
	view-transition-name: frame;
}
/* Zone ticks along the border, as on a drawing sheet */
.sheet-frame::before, .sheet-frame::after { content: ""; position: absolute; }
.sheet-frame::before { inset-inline: 0; top: 0; height: 7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 7' preserveAspectRatio='none'%3E%3Cpath d='M100 0v7M200 0v7M300 0v7M400 0v7M500 0v7M600 0v7M700 0v7' stroke='%23151515' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }
.sheet-frame::after {
	inset-block: 0; inset-inline: 0;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 600' preserveAspectRatio='none'%3E%3Cpath d='M0 100h7M0 200h7M0 300h7M0 400h7M0 500h7' stroke='%23151515' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") left top / 7px 100% no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 600' preserveAspectRatio='none'%3E%3Cpath d='M0 100h7M0 200h7M0 300h7M0 400h7M0 500h7' stroke='%23151515' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") right top / 7px 100% no-repeat;
}

/* ---------- Top strip ---------- */
.sheet-top {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 20px var(--gut);
	border-bottom: 1px solid var(--ink);
	background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-logo { max-height: 52px; width: auto; }
/* The original logo, set in drafting ink so both words read on the film (the source has a white "BONEH"). */
.brand-logo-img { display: block; height: clamp(24px, 2.4vw, 32px); width: auto; filter: brightness(0); }
.brand-text { padding-inline-start: 14px; border-inline-start: 1px solid var(--ink); }
.foot-logo { display: block; width: 120px; height: auto; filter: brightness(0); margin-bottom: 18px; }
.brand-text { display: grid; line-height: 1.25; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.1875rem; }
.brand-sub { font-size: var(--fs-meta); color: var(--muted); }
.brand-line { font-size: var(--fs-meta); color: var(--muted); text-align: end; }

/* ---------- Title block: fixed bar with nav and call ---------- */
.title-block {
	position: fixed; z-index: 50;
	inset-inline: var(--frame); bottom: var(--frame);
	height: var(--bar);
	display: grid; grid-template-columns: auto 1fr auto auto auto;
	background: var(--paper);
	border: 1.5px solid var(--ink);
	view-transition-name: title-block;
}
.tb-cell {
	display: flex; align-items: center; gap: 12px;
	padding: 0 22px; min-width: 0;
	border-inline-start: 1px solid var(--ink);
	font-size: var(--fs-ui); font-weight: 600; text-decoration: none;
	background: none; border-block: 0; border-inline-end: 0; cursor: pointer;
}
.tb-cell:first-child { border-inline-start: 0; }
.tb-index { display: none; }
.tb-icon { display: grid; gap: 5px; width: 22px; }
.tb-icon i { display: block; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.tb-index[aria-expanded="true"] .tb-icon i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.tb-index[aria-expanded="true"] .tb-icon i:nth-child(2) { opacity: 0; }
.tb-index[aria-expanded="true"] .tb-icon i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.tb-nav { border-inline-start: 0; }
.nav-bar { display: flex; align-items: stretch; height: 100%; gap: clamp(8px, 1.6vw, 28px); }
.nav-bar li { display: flex; }
.nav-bar a { display: flex; align-items: center; padding: 0 4px; text-decoration: none; position: relative; }
.nav-bar .current-menu-item > a, .nav-bar a[aria-current="page"] { color: var(--red); }
.nav-bar .current-menu-item > a::after, .nav-bar a[aria-current="page"]::after {
	content: ""; position: absolute; inset-inline: 0; bottom: 14px; height: 2px; background: var(--red);
}
.tb-lang { font-family: var(--text); }
.tb-facts { display: flex; padding: 0; gap: 0; }
.tb-facts > div { display: grid; align-content: center; padding: 0 14px; height: 100%; border-inline-start: 1px solid var(--ink); line-height: 1.2; }
.tb-facts > div:first-child { border-inline-start: 0; }
.tb-facts dt { font-family: var(--display); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; text-align: start; }
[dir="rtl"] .tb-facts dt { text-align: right; }
.tb-facts dd { font-size: var(--fs-meta); font-weight: 400; color: var(--muted); white-space: nowrap; }
.tb-call { background: var(--red); color: #fff; gap: 10px; }
.tb-call:hover { background: var(--ink); color: #fff; }
.tb-call-no { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Sheet index (mobile menu) ---------- */
.sheet-index {
	position: fixed; z-index: 45;
	inset-inline: var(--frame); bottom: calc(var(--frame) + var(--bar) - 1.5px);
	max-height: calc(100dvh - var(--bar) - var(--frame) * 2 - 24px);
	overflow: auto;
	background: var(--paper);
	border: 1.5px solid var(--ink);
	transform-origin: bottom;
	animation: index-up .42s var(--ease) both;
}
.sheet-index[data-closing] { animation: index-down .26s ease-in both; }
@keyframes index-up { from { transform: translateY(24px); opacity: 0; clip-path: inset(100% 0 0 0); } to { transform: none; opacity: 1; clip-path: inset(0); } }
@keyframes index-down { to { transform: translateY(16px); opacity: 0; clip-path: inset(100% 0 0 0); } }
.sheet-index-inner { padding: 20px var(--gut) 28px; }
.sheet-index-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.sheet-index-title { font-size: var(--fs-meta); color: var(--muted); }
.nav-index li { border-bottom: 1px solid var(--grid); }
.nav-index a {
	display: flex; align-items: baseline; gap: 18px; padding: 14px 0;
	font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 1.1rem + 2vw, 2rem); text-decoration: none;
}
.nav-index .current-menu-item a, .nav-index a[aria-current="page"] { color: var(--red); }
.hero-facts { display: none; grid-template-columns: 1fr 1fr; margin-top: 24px; border: 1px solid var(--ink); max-width: 30rem; }
.hero-facts > div { padding: 12px 14px; border-top: 1px solid var(--ink); }
.hero-facts > div:nth-child(-n+2) { border-top: 0; }
.hero-facts > div:nth-child(even) { border-inline-start: 1px solid var(--ink); }
.hero-facts dt { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.2; }
[dir="rtl"] .hero-facts dt { text-align: right; }
.hero-facts dd { font-size: var(--fs-meta); color: var(--muted); }
.sheet-index-facts { display: grid; grid-template-columns: 1fr 1fr; margin-top: 22px; border: 1px solid var(--ink); }
.sheet-index-facts > div { padding: 12px 14px; border-top: 1px solid var(--ink); }
.sheet-index-facts > div:nth-child(-n+2) { border-top: 0; }
.sheet-index-facts > div:nth-child(even) { border-inline-start: 1px solid var(--ink); }
.sheet-index-facts dt { font-family: var(--display); font-weight: 700; font-size: 1.125rem; }
[dir="rtl"] .sheet-index-facts dt { text-align: right; }
.sheet-index-facts dd { font-size: var(--fs-meta); color: var(--muted); }
.sheet-index-contact { display: grid; gap: 10px; margin-top: 22px; font-size: var(--fs-ui); }
.sheet-index-contact div { display: flex; gap: 12px; }
.sheet-index-contact dt { color: var(--muted); min-width: 4.5em; }
.sheet-index-contact a { font-weight: 700; }

/* ---------- Shared parts ---------- */
.sheet { display: block; outline: 0; }
.sheet-line {
	display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
	padding-top: 10px; margin-top: clamp(16px, 2vw, 28px);
	border-top: 1px solid var(--ink);
	font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums;
}
.sheet-line a { color: var(--ink); font-weight: 600; }
.sheet-title { font-size: var(--fs-sheet); line-height: 1.04; letter-spacing: -0.01em; }
.page-head .sheet-title { font-size: var(--fs-page); }
.lede { font-size: var(--fs-lede); line-height: 1.65; max-width: 40ch; margin-top: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 52px; padding: 0 24px;
	font-family: var(--text); font-size: 1rem; font-weight: 700; line-height: 1.2;
	text-decoration: none; cursor: pointer;
	border: 1.5px solid var(--ink);
	transition: background-color .2s, color .2s, border-color .2s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-count { padding-inline-start: 10px; margin-inline-start: 2px; border-inline-start: 1px solid currentColor; font-variant-numeric: tabular-nums; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--paper); color: var(--ink); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-plain { background: none; border: 0; padding: 10px 4px; min-height: 44px; font-weight: 700; font-size: var(--fs-ui); cursor: pointer; text-decoration: underline; text-underline-offset: 0.25em; }
.link-arrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fs-ui); min-height: 44px; }
.link-arrow::after { content: ""; width: 28px; height: 1px; background: currentColor; transition: width .3s var(--ease); }
.link-arrow:hover::after { width: 44px; }
[dir="rtl"] .link-arrow::after { order: 0; }

/* Dimension string: a measured line with end ticks and a centred label */
.dim {
	position: relative; display: flex; align-items: center; justify-content: center;
	height: 28px; margin: 6px 0;
	font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums;
}
.dim::before { content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 1px solid var(--line); transition: transform 1.1s var(--ease); }
.dim::after { content: ""; position: absolute; inset: 7px 0; border-inline: 1px solid var(--line); transition: opacity .4s .6s; }
.dim-label { position: relative; z-index: 1; padding: 0 12px; background: var(--paper); max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.js .dim:not(.is-drawn)::before { transform: scaleX(0); }
.js .dim:not(.is-drawn)::after { opacity: 0; }

/* Plan frame: a viewport drawn on the sheet */
.plan { margin: 0; }
.plan-frame { display: block; border: 1px solid var(--ink); padding: 8px; background: var(--paper); }
.plan-frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.plan-caption { display: grid; grid-template-columns: 1fr auto; align-items: stretch; border: 1px solid var(--ink); border-top: 0; }
.plan-caption > * { display: flex; align-items: center; padding: 10px 14px; min-height: 48px; }
.plan-caption a { font-family: var(--display); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.plan-caption-label { font-size: var(--fs-meta); color: var(--muted); border-inline-start: 1px solid var(--ink); }

/* Revision cloud: an authored scalloped outline */
.cloud {
	position: relative;
	border: 26px solid transparent;
	border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M15 15 A8.10 8.10 0 0 1 30 15 A5.94 5.94 0 0 1 41 15 A10.26 10.26 0 0 1 60 15 A8.10 8.10 0 0 1 75 15 A8.10 8.10 0 0 1 75 30 A9.18 9.18 0 0 1 75 47 A7.02 7.02 0 0 1 75 60 A8.10 8.10 0 0 1 75 75 A8.10 8.10 0 0 1 60 75 A5.94 5.94 0 0 1 49 75 A10.26 10.26 0 0 1 30 75 A8.10 8.10 0 0 1 15 75 A8.10 8.10 0 0 1 15 60 A9.18 9.18 0 0 1 15 43 A7.02 7.02 0 0 1 15 30 A8.10 8.10 0 0 1 15 15Z' fill='none' stroke='%23151515' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 30 round;
	background: var(--paper);
	background-clip: padding-box;
	padding: 6px 8px 10px;
}
/* Revision delta: the triangle that ties a cloud to the revision table */
.cloud::before {
	content: "1"; position: absolute; top: -40px; inset-inline-start: -34px;
	width: 30px; height: 26px; display: grid; place-items: end center; padding-bottom: 2px;
	font-family: var(--display); font-weight: 700; font-size: var(--fs-meta);
	background: var(--ink); color: var(--paper);
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.cloud-or { font-size: var(--fs-meta); color: var(--muted); margin: 18px 0 8px; text-align: center; }
.btn-call { width: 100%; }
.cloud-title { font-size: var(--fs-h3); margin-bottom: 6px; }

/* ---------- Forms ---------- */
.enquiry { display: grid; gap: 14px; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.field { display: grid; gap: 2px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-size: var(--fs-meta); color: var(--muted); font-weight: 600; padding: 0; }
.field input, .field select, .field textarea {
	width: 100%; min-height: 48px; padding: 8px 2px;
	background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0;
	font-size: 1rem;
}
.field textarea { resize: none; field-sizing: content; min-height: 88px; max-height: 320px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23151515' stroke-width='1.5'/%3E%3C/svg%3E"); background-size: 12px 8px; background-repeat: no-repeat; background-position: left 4px center; padding-inline-end: 28px; cursor: pointer; }
[dir="ltr"] .field select { background-position: right 4px center; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-bottom-color: var(--red); box-shadow: 0 1.5px 0 var(--red); }
.field input[aria-invalid="true"] { border-bottom-color: var(--red); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice legend { width: 100%; margin-bottom: 6px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--ink); font-size: var(--fs-ui); font-weight: 600; transition: background-color .15s, color .15s; }
.chip small { font-size: var(--fs-meta); opacity: .75; font-variant-numeric: tabular-nums; }
.chip:hover span { background: var(--wash); }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-meta); line-height: 1.5; color: var(--muted); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); flex: none; }
.enquiry .btn { width: 100%; }
.form-status { font-size: var(--fs-ui); font-weight: 600; min-height: 1.5em; }
.form-status[data-state="ok"] { color: var(--ink); padding: 10px 12px; border: 1px solid var(--ink); background: var(--wash); }
.form-status[data-state="error"] { color: var(--red); }
.enquiry[aria-busy="true"] .btn { opacity: .7; pointer-events: none; }

/* ---------- Home ---------- */
.hero {
	display: grid; gap: clamp(28px, 3vw, 48px);
	grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
	grid-template-areas: "copy cloud" "plan cloud";
	align-items: start;
	padding: clamp(28px, 3.4vw, 56px) var(--gut) clamp(40px, 5vw, 80px);
}
.hero-copy { grid-area: copy; }
.hero-plan { grid-area: plan; }
.hero-cloud { grid-area: cloud; position: sticky; top: 24px; }

.block { padding: clamp(56px, 7vw, 120px) var(--gut) 0; }
.block-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 32px; margin-bottom: clamp(24px, 3vw, 44px); }
.block-title { font-size: var(--fs-h2); }
.block-line { grid-column: 1; color: var(--muted); max-width: 60ch; }
.block-head .link-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: end; white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(20px, 2.4vw, 36px); }
.card-link { display: grid; height: 100%; text-decoration: none; border: 1px solid var(--ink); background: var(--paper); transition: outline-color .2s; outline: 1px solid transparent; outline-offset: 0; }
.card-link:hover { color: var(--ink); outline-color: var(--ink); }
.card-media { position: relative; overflow: hidden; border-bottom: 1px solid var(--ink); background: var(--wash); aspect-ratio: 4 / 3; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card-link:hover .card-media img { transform: scale(1.035); }
.card-flag { position: absolute; top: 12px; inset-inline-start: 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); font-size: var(--fs-meta); font-weight: 700; padding: 3px 10px; }
.card-block { display: grid; }
.card-title { font-size: var(--fs-h3); padding: 14px 16px 2px; }
.card-link:hover .card-title { color: var(--red); }
.card-meta { padding: 0 16px 14px; font-size: var(--fs-meta); color: var(--muted); min-height: 1.6em; }

.block-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(24px, 4vw, 72px); }
.block-split .block-head { margin: 0; align-self: start; grid-template-columns: 1fr; }
.prose-lead { font-size: var(--fs-lede); line-height: 1.7; max-width: 62ch; }
.founders { display: flex; flex-wrap: wrap; gap: 0; margin: 26px 0 8px; border: 1px solid var(--ink); width: fit-content; }
.founders li { padding: 12px 20px; font-family: var(--display); font-weight: 700; font-size: 1.125rem; }
.founders li + li { border-inline-start: 1px solid var(--ink); }

.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-top: 1px solid var(--ink); border-inline-start: 1px solid var(--ink); }
.logos li { display: grid; place-items: center; padding: 20px; border-bottom: 1px solid var(--ink); border-inline-end: 1px solid var(--ink); background: var(--paper); aspect-ratio: 2 / 1; }
.logos img { max-height: 64px; width: auto; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; transition: filter .3s; }
.logos li:hover img { filter: none; }
.logos-page { margin-top: 40px; }

.close { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1.1fr); gap: clamp(28px, 5vw, 80px); padding-bottom: clamp(48px, 6vw, 96px); align-items: start; }
.close .block-title { max-width: 18ch; }
.close .block-line { margin-top: 16px; }
.contact-list { display: grid; margin-top: 32px; border-top: 1px solid var(--ink); }
.contact-list > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--ink); align-items: baseline; }
.contact-list dt { font-size: var(--fs-meta); color: var(--muted); font-weight: 600; }
.contact-list dd { font-family: var(--display); font-weight: 700; font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.contact-list dd a { text-decoration: none; }
.contact-list .sep { color: var(--line); }

/* ---------- Inner pages ---------- */
.page-head { padding: clamp(28px, 3.4vw, 56px) var(--gut) 0; }
.reading .prose { padding: clamp(28px, 3vw, 48px) var(--gut) 0; }
.prose { max-width: calc(68ch + var(--gut) * 2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--fs-h2); margin-top: 1.8em; padding-top: 18px; border-top: 1px solid var(--ink); }
.prose h3 { font-size: var(--fs-h3); margin-top: 1.8em; }
.prose h4 { font-size: 1.125rem; margin-top: 1.6em; }
.prose h5 { font-family: var(--text); font-size: var(--fs-ui); font-weight: 600; color: var(--muted); margin-top: 0.3em; }
.prose-role { font-size: var(--fs-ui); font-weight: 600; color: var(--muted); }
.prose h3 + .prose-role { margin-top: 0.2em; }
.prose p { line-height: 1.85; }
.prose ul { padding-inline-start: 1.2em; list-style: square; }
.prose a { font-weight: 600; }
.reading .logos-page { margin: 40px var(--gut) 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--grid); }

/* Projects index */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 36px; padding: 28px var(--gut) 0; margin-bottom: 32px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.filter-group legend { font-size: var(--fs-meta); color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.filter-count { font-size: var(--fs-ui); font-weight: 700; margin-inline-start: auto; }
.cards-all { padding: 0 var(--gut); }
.page-head + .cards-all { padding-top: 32px; }
.card[data-off] { display: none; }
.filter-empty { padding: 32px var(--gut); font-size: var(--fs-lede); }

/* Project sheet */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li { border: 1px solid var(--ink); padding: 4px 12px; font-size: var(--fs-meta); font-weight: 600; }
.project-sheet { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: clamp(24px, 3vw, 48px); padding: clamp(24px, 3vw, 40px) var(--gut) 0; align-items: start; }
.spec { border: 1.5px solid var(--ink); background: var(--paper); position: sticky; top: 24px; margin-top: 40px; }
.spec-title { font-family: var(--text); font-size: var(--fs-meta); font-weight: 700; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.spec dl > div { display: grid; grid-template-columns: 6.5em 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ink); }
.spec dt { font-size: var(--fs-meta); color: var(--muted); font-weight: 600; }
.spec dd { font-weight: 700; }
.spec .btn { width: calc(100% - 32px); margin: 16px; }
.project-text { padding: 36px var(--gut) 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr)); gap: 10px; }
.gallery-grid a { display: block; border: 1px solid var(--ink); padding: 5px; background: var(--paper); }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: opacity .2s; }
.gallery-grid a:hover img { opacity: .86; }
.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: var(--ink); color: var(--paper); }
.viewer::backdrop { background: var(--ink); }
.viewer[open] { display: grid; grid-template-rows: 1fr auto; place-items: center; }
.viewer img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); object-fit: contain; }
.viewer-bar { display: flex; gap: 16px; justify-content: center; padding: 16px; }
.viewer .btn-plain { color: var(--paper); }
.viewer-count { position: absolute; top: 16px; inset-inline-start: 20px; font-size: var(--fs-meta); color: #c9cdcf; }
.pager { display: grid; grid-template-columns: 1fr 1fr; margin: clamp(48px, 6vw, 96px) var(--gut) 0; border-block: 1.5px solid var(--ink); }
.pager a { display: grid; align-content: start; gap: 6px; padding: 20px; min-height: 96px; text-decoration: none; }
.pager a:hover small { color: var(--red); }
.pager-next { grid-column: 2; border-inline-start: 1px solid var(--ink); text-align: end; justify-items: end; }
.pager small { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
/* A drawn chevron points the way each link goes. */
.pager-prev small::before, .pager-next small::after { content: ""; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }
[dir="rtl"] .pager-prev small::before { transform: rotate(45deg); }
[dir="rtl"] .pager-next small::after { transform: rotate(-135deg); }
[dir="ltr"] .pager-prev small::before { transform: rotate(-135deg); }
[dir="ltr"] .pager-next small::after { transform: rotate(45deg); }
.pager span { font-family: var(--display); font-weight: 700; font-size: var(--fs-h3); line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.missing { min-height: 52vh; padding-bottom: 64px; }

/* ---------- Footer ---------- */
.site-foot { margin-top: clamp(48px, 6vw, 96px); border-top: 1.5px solid var(--ink); }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 32px; padding: 40px var(--gut); }
.foot-name { font-family: var(--display); font-weight: 700; font-size: 1.125rem; }
.foot-tag { color: var(--muted); font-size: var(--fs-ui); margin-top: 6px; }
.foot-contact { display: grid; gap: 8px; font-size: var(--fs-ui); }
.foot-contact > div { display: grid; grid-template-columns: 6em 1fr; gap: 10px; }
.foot-contact dt { color: var(--muted); }
.nav-foot { display: grid; gap: 4px; font-size: var(--fs-ui); }
.nav-foot a { display: inline-flex; min-height: 36px; align-items: center; text-decoration: none; font-weight: 600; }
.nav-foot a[aria-current="page"] { color: var(--red); }
.foot-strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px var(--gut); border-top: 1px solid var(--ink); font-size: var(--fs-meta); color: var(--muted); }
.foot-top { font-weight: 600; color: var(--ink); }

/* ---------- Page change: the sheet goes to the plan chest, the next one plots in ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: sheet-out .32s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: sheet-in .62s var(--ease) both; }
::view-transition-group(title-block), ::view-transition-group(frame) { animation-duration: 0s; }
@keyframes sheet-out { to { opacity: 0; transform: translateY(-18px); } }
@keyframes sheet-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* ---------- Responsive ---------- */
@media (max-width: 1379px) {
	.tb-call-no { display: none; }
}
@media (max-width: 1100px) {
	.title-block { grid-template-columns: 1fr auto auto; }
	.tb-index { display: flex; border-inline-start: 0; }
	.tb-nav, .tb-facts { display: none; }
	.hero-facts { display: grid; }
	.hero { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr); }
	.foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
	:root { --bar: 60px; }
	.tb-cell { padding: 0 16px; }
	.brand-sub { display: none; }
	.hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "plan" "cloud"; }
	.hero-cloud { position: static; }
	.block-split, .close, .project-sheet { grid-template-columns: minmax(0, 1fr); }
	.spec { position: static; margin-top: 0; }
	.block-head { grid-template-columns: 1fr; }
	.block-head .link-arrow { grid-column: 1; grid-row: auto; justify-self: start; }
	/* The frame scrolls with the page on phones; only the bottom bar stays put. */
	body { position: relative; }
	.sheet-frame { position: absolute; }
	.sheet-frame::after { display: none; }
}
@media (max-width: 600px) {
	.sheet-top { padding-block: 14px; }
	.brand-line { display: none; }
	.foot-grid { grid-template-columns: 1fr; }
	.contact-list > div { grid-template-columns: 1fr; gap: 2px; }
	.tb-index-label { font-size: var(--fs-ui); }
	.pager a { padding: 14px 12px; min-height: 84px; }
	.pager span { font-size: 1.0625rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
	.js .dim:not(.is-drawn)::before { transform: none; }
	.js .dim:not(.is-drawn)::after { opacity: 1; }
}

@media print {
	.title-block, .sheet-index, .sheet-frame, .enquiry, .hero-cloud { display: none !important; }
	body { padding: 0; background: #fff; }
}
