/*
 * Site chrome: header, language toggle, mobile menu, contact band, footer.
 * Figma: Header template / EN + JP, M / EN / Menu, Contact, Footer (V2 page).
 */

/* Brand ------------------------------------------------------------------ */
.kb-brand {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}
.kb-brand__wordmark { width: 196px; height: auto; }

/* Header -----------------------------------------------------------------
 * Fixed to the top; the page reserves its full height (--header-h) so nothing
 * jumps when it slims down. Motion Spec #7: after 80px the desktop header goes
 * from 28 to 14px padding, the hanko from 44 to 36px, a hairline appears and the
 * background becomes 94% cream with an 8px blur, over 250ms (assets/js/motion.js).
 */
:root { --header-h: 101px; --header-h-scrolled: 73px; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { padding-top: var(--header-h); }

.kb-header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	height: var(--header-h);
	padding: 0 var(--pad-x-frame);
	background: color-mix(in srgb, var(--cream) 100%, transparent);
	border-bottom: 1px solid transparent;
	transition:
		height 250ms var(--ease-out),
		background-color 250ms var(--ease-out),
		border-color 250ms var(--ease-out),
		backdrop-filter 250ms var(--ease-out);
}
.kb-header .kb-brand__hanko { transition: transform 250ms var(--ease-out); }

.kb-header.is-scrolled {
	height: var(--header-h-scrolled);
	background: color-mix(in srgb, var(--cream) 94%, transparent);
	border-bottom-color: var(--hairline);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.kb-header.is-scrolled .kb-brand__hanko { transform: rotate(var(--hanko-tilt)) scale(calc(36 / 44)); }
.kb-header__right {
	display: flex;
	align-items: center;
	gap: 34px;
}
.kb-nav__list {
	display: flex;
	align-items: center;
	gap: 34px;
}
.kb-nav__link {
	display: block;
	padding: 2px;
	color: var(--indigo);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	white-space: nowrap;
	text-decoration: underline 1px transparent;
	text-underline-offset: .3em;
}
.kb-nav__link:hover {
	color: var(--persimmon-text);
	text-decoration-color: currentColor;
}
.kb-nav__link[aria-current="page"] { color: var(--persimmon-text); }

html[lang="ja"] .kb-nav__link {
	font-size: var(--fs-jp-body);
	line-height: var(--lh-jp-body);
	letter-spacing: var(--ls-jp);
}

.kb-header__cta { white-space: nowrap; }

/* Language toggle -------------------------------------------------------- */
.kb-lang {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	line-height: 1.2;
	white-space: nowrap;
}
.kb-lang__sep { color: var(--hairline); }
.kb-lang__item { color: var(--ink-soft); }
.kb-lang__item--en { font-family: var(--font-sans); font-weight: 600; letter-spacing: .14em; }
.kb-lang__item--ja { font-family: var(--font-sans-jp); font-weight: 500; letter-spacing: .04em; }
.kb-lang__item.is-current { color: var(--indigo); }
a.kb-lang__item:hover { color: var(--persimmon-text); }

/* Menu button (hamburger: two 1px bars, 22 × 12) */
.kb-menu-btn {
	display: none;
	width: 44px;
	height: 44px;
	margin: -16px -11px -16px 0;
	align-items: center;
	justify-content: center;
}
.kb-menu-btn__bars {
	position: relative;
	display: block;
	width: 22px;
	height: 12px;
	border-block: 1px solid var(--indigo);
}

/* Narrow desktops: keep the full nav on one line */
@media (max-width: 1359px) {
	.kb-header { gap: 1.5rem; }
	.kb-header__right, .kb-nav__list { gap: 24px; }
}

/* Small screens: brand + toggle + menu button (M / EN / Home header) */
@media (max-width: 1199px) {
	:root { --header-h: 84px; --header-h-scrolled: 84px; }
	.kb-header__right { gap: 16px; }
	.kb-nav, .kb-header__cta { display: none; }
	.kb-menu-btn { display: inline-flex; }
}
@media (max-width: 767px) {
	:root { --header-h: 75px; --header-h-scrolled: 75px; }
	.kb-brand { gap: 10px; }
	.kb-brand__hanko { --hanko-size: 33.6px; }
	.kb-brand__wordmark { width: 133px; } /* 17px Fraunces in the M / frames */
}
@media (max-width: 374px) {
	.kb-header__right { gap: 10px; }
	.kb-brand { gap: 8px; }
	.kb-brand__hanko { --hanko-size: 30px; }
	.kb-brand__wordmark { width: 104px; }
	.kb-lang { gap: 6px; }
}

/* Mobile menu ------------------------------------------------------------ */
.kb-menu {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0 0 40px;
	border: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--cream);
	color: var(--indigo);
	opacity: 0;
	transition:
		opacity var(--t-menu) var(--ease-out),
		overlay var(--t-menu) allow-discrete,
		display var(--t-menu) allow-discrete;
}
.kb-menu[open] { opacity: 1; }
@starting-style {
	.kb-menu[open] { opacity: 0; }
}
.kb-menu::backdrop { background: transparent; }

html.kb-scroll-locked { overflow: hidden; }

.kb-menu__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px var(--pad-x-frame);
}
.kb-menu__close {
	width: 44px;
	height: 44px;
	margin: -6px -10px -6px 0;
	font-family: var(--font-serif);
	font-size: 36px;
	line-height: 1;
	color: var(--indigo);
}
.kb-menu__links { padding: 32px var(--pad-x-frame); }
.kb-menu__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0;
	border-bottom: 1px solid var(--hairline);
}
.kb-menu__title {
	font-family: var(--font-serif);
	font-size: 36px;
	line-height: 1.08;
	letter-spacing: -0.005em;
}
.kb-menu__link .kb-arrow { font-size: 19px; }
.kb-menu__link:hover,
.kb-menu__link[aria-current="page"] { color: var(--persimmon-text); }

html[lang="ja"] .kb-menu__title {
	font-family: var(--font-serif-jp);
	font-weight: 700;
	font-size: var(--fs-jp-h2);
	line-height: var(--lh-jp-head);
	letter-spacing: var(--ls-jp);
}

.kb-menu__services {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px var(--pad-x-frame) 40px;
}
.kb-menu__services ul { display: flex; flex-direction: column; gap: 14px; }
.kb-menu__services a:hover,
.kb-menu__services a[aria-current="page"] { color: var(--persimmon-text); }

.kb-menu__book { padding: 40px var(--pad-x-frame) 8px; }
.kb-menu__lang {
	margin-top: 0;
	padding: 24px var(--pad-x-frame);
	border-top: 1px solid var(--hairline);
}
.kb-menu__lang .kb-lang { font-size: 13px; gap: 10px; }

/* Contact band ----------------------------------------------------------- */
.kb-contact { color: var(--cream); }
.kb-contact__inner {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 3rem;
	padding: 120px var(--pad-x-frame);
}
.kb-contact__heading {
	max-width: 760px;
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: clamp(2.25rem, 1.5071rem + 3.0476vw, 4.25rem); /* 36 → 68 */
	line-height: 1.1;
	letter-spacing: -0.01em;
}
.kb-contact__email {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	flex-shrink: 0;
}
.kb-contact__label {
	font-weight: 600;
	font-size: var(--fs-label);
	letter-spacing: .3em;
	text-transform: uppercase;
	color: var(--cream);
}
.kb-contact__address {
	font-family: var(--font-serif);
	font-size: clamp(1.5rem, 1.3143rem + 0.7619vw, 2rem); /* 24 → 32 */
	line-height: 1.6;
	color: var(--cream);
	text-decoration: underline 1px transparent;
	text-underline-offset: .2em;
}
.kb-contact__address:hover { text-decoration-color: currentColor; }
.kb-contact .kb-cta { color: var(--cream); padding-top: 10px; } /* cream, not indigo: indigo can't reach AA on persimmon */

html[lang="ja"] .kb-contact__heading {
	font-family: var(--font-serif-jp);
	font-weight: 400;
	font-size: clamp(1.5rem, 1.2786rem + 0.9524vw, 2.25rem);
	line-height: var(--lh-jp-head);
	letter-spacing: var(--ls-jp);
}
html[lang="ja"] .kb-contact__label { font-family: var(--font-sans-jp); font-weight: 500; letter-spacing: var(--ls-jp-label); }

@media (max-width: 767px) {
	.kb-contact__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
		padding: 48px var(--pad-x-frame) 56px;
	}
	.kb-contact__heading { line-height: 1.15; }
	.kb-contact__email { gap: 6px; }
	.kb-contact__label { color: var(--cream); letter-spacing: .14em; }
	.kb-contact__address { text-decoration-color: currentColor; }
	.kb-contact .kb-cta { padding-top: 14px; }
}

/* Inner-page contact band (EN / About → Contact): statement-size heading, centred */
@media (min-width: 768px) {
	.kb-contact--inner .kb-contact__inner {
		align-items: center;
		padding: 96px var(--pad-x) 110px;
	}
	.kb-contact--inner .kb-contact__heading {
		font-size: var(--fs-statement);
		line-height: var(--lh-statement);
		letter-spacing: -0.005em;
	}
	.kb-contact--inner .kb-contact__email { gap: 6px; }
	.kb-contact--inner .kb-contact__label { color: var(--cream); letter-spacing: var(--ls-label); }
	.kb-contact--inner .kb-contact__address {
		font-size: 30px;
		text-decoration-color: currentColor;
	}
	.kb-contact--inner .kb-cta { padding-top: 14px; }
	html[lang="ja"] .kb-contact--inner .kb-contact__heading {
		font-size: var(--fs-jp-statement);
		line-height: var(--lh-jp-sub);
	}
}

/* Footer -----------------------------------------------------------------
 * Inner layout (EN / About → Footer) is the base; it is also the mobile layout.
 * Home desktop (EN / Home → Footer) overrides it below.
 */
.kb-footer {
	display: flex;
	flex-direction: column;
	gap: 48px;
	padding: 72px var(--pad-x) 56px;
	font-size: 13px;
}
.kb-footer__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 3rem;
}
.kb-footer__left {
	display: flex;
	align-items: flex-start;
	gap: 20px;
}
.kb-footer__bio { max-width: 620px; line-height: 1.5; }
.kb-footer__contact {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	font-size: 16px;
	white-space: nowrap;
}
.kb-footer__contact a:hover { color: var(--persimmon-light); }
.kb-footer__dot { display: none; }
.kb-footer__bottom {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 24px;
	border-top: 1px solid var(--cream);
}
.kb-footer__tagline {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .14em;
	word-spacing: .2em;
	text-transform: uppercase;
}
.kb-footer__copy { font-size: 13px; }

html[lang="ja"] .kb-footer__bio { font-family: var(--font-sans-jp); line-height: var(--lh-jp-sub); }

/* Home desktop: bio left; contact, tagline, © stacked right; no rule */
@media (min-width: 768px) {
	.kb-footer--home {
		display: grid;
		grid-template-columns: 1fr auto;
		column-gap: 3rem;
		row-gap: 10px;
		padding: 64px var(--pad-x-frame);
	}
	.kb-footer--home :is(.kb-footer__top, .kb-footer__bottom) { display: contents; }
	.kb-footer--home .kb-footer__left { grid-row: 1 / span 3; }
	.kb-footer--home .kb-footer__bio { line-height: 1.6; }
	.kb-footer--home .kb-footer__contact {
		flex-direction: row;
		gap: 0;
		font-size: 13px;
		font-weight: 500;
		justify-self: end;
	}
	.kb-footer--home .kb-footer__dot { display: inline; margin-inline: .5em; }
	.kb-footer--home .kb-footer__tagline {
		justify-self: end;
		font-size: 12px;
		font-weight: 500;
		letter-spacing: .24em;
		color: var(--persimmon-light);
	}
	.kb-footer--home .kb-footer__copy { justify-self: end; font-size: 12px; font-weight: 500; }
}

@media (max-width: 767px) {
	.kb-footer {
		gap: 32px;
		padding: 48px var(--pad-x-frame) 40px;
	}
	.kb-footer__top { flex-direction: column; gap: 28px; }
	.kb-footer__left { flex-direction: column; gap: 20px; }
	.kb-footer__contact { align-items: flex-start; }
	.kb-footer__bottom { flex-direction: column; gap: 8px; }
}

/* Logged-in editors: sit below the WordPress admin bar */
.admin-bar .kb-header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .kb-header { top: 46px; } }
@media screen and (max-width: 600px) { .admin-bar .kb-header { top: 0; } } /* admin bar scrolls away on small phones */
