/* ==========================================================================
   KR — site chrome

   Depends on tokens.css.

   The breakpoint is 880px, matching the design: below it the desktop bar is
   replaced by the burger and the copper overlay.

   Contents:
     5. Site header (desktop)
     6. Mega-menu panels
     7. Mobile header, brandmark & full-screen overlay
     8. Footer
   ========================================================================== */

/*
 * Disclosure state is the [hidden] attribute throughout this sheet, so panels
 * are genuinely removed from the tab order rather than merely transparent. A
 * class-level `display` would out-specify the UA's `[hidden] { display:none }`,
 * so every element that carries both needs this pairing.
 */
.kr-nav__panel[hidden],
.kr-nav__catcher[hidden],
.kr-wall__sublist[hidden] {
	display: none;
}

/* ==========================================================================
   5. Site header (desktop)
   ========================================================================== */

.kr-skip {
	position: absolute;
	inset-inline-start: -9999px;
	top: 0;
	z-index: 100;
	padding: 0.75rem 1.25rem;
	background: var(--kr-copper);
	color: var(--kr-on-copper);
	font-family: var(--kr-font-display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.kr-skip:focus {
	inset-inline-start: 0;
	color: var(--kr-on-copper);
}

.kr-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--kr-ink);
	color: #fff;
}

.kr-header__inner {
	display: flex;
	align-items: center;
	max-width: 1280px;
	margin-inline: auto;
	padding: 16px clamp(20px, 4vw, 48px);
}

.kr-header__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	color: #fff;
}

.kr-header__brand:hover {
	color: #fff;
}

.kr-header__brand img {
	width: 44px;
	height: 44px;
	object-fit: contain;
}

.kr-brand__name {
	font-family: var(--kr-font-display);
	font-weight: 800;
	font-size: 22px;
	letter-spacing: 0.12em;
	line-height: 1;
	text-transform: uppercase;
}

/* The two link lists. Both take an equal share so the crest stays centred. */
.kr-nav {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: 1;
	list-style: none;
	margin: 0;
	padding: 0;
}

.kr-nav--right {
	justify-content: flex-end;
}

.kr-nav__item {
	position: relative;
	z-index: 42;
}

.kr-nav__link {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 8px 0;
	background: none;
	border: 0;
	font-family: var(--kr-font-display);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #fff;
	cursor: pointer;
}

.kr-nav__link:hover {
	color: var(--kr-copper-on-dark);
}

.kr-nav__link[aria-current="page"] {
	color: var(--kr-copper-on-dark);
}

.kr-nav__caret {
	display: inline-block;
	font-size: 10px;
	transition: transform 0.2s ease;
}

.kr-nav__trigger[aria-expanded="true"] .kr-nav__caret {
	transform: rotate(180deg);
}

.kr-nav__cta {
	display: inline-flex;
	align-items: center;
	padding: 11px 18px;
	border-radius: 8px;
	background: var(--kr-copper);
	color: var(--kr-on-copper);
	font-family: var(--kr-font-display);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	transition: background var(--kr-dur) ease;
}

.kr-nav__cta:hover {
	background: var(--kr-copper-dark);
	color: var(--kr-on-copper);
}

/* ==========================================================================
   6. Mega-menu panels
   ========================================================================== */

/*
 * Visibility is the [hidden] attribute rather than opacity, so the links are
 * genuinely out of the tab order until the disclosure is opened. The entry
 * animation runs on reveal and is flattened by the reduced-motion block in
 * tokens.css.
 */
.kr-nav__panel {
	position: absolute;
	top: 36px;
	left: 0;
	z-index: 45;
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	padding: 18px;
	background: #fff;
	color: var(--kr-ink);
	border-radius: 12px;
	box-shadow: 0 24px 48px -20px rgb(0 0 0 / 45%);
	/*
	 * The panel is absolutely positioned against a trigger only as wide as its
	 * label, so shrink-to-fit would collapse it to one column. max-content
	 * sizes it to the columns instead; the cap plus flex-wrap keeps the widest
	 * panel inside the viewport on a small laptop.
	 */
	width: max-content;
	max-width: calc(100vw - 40px);
	animation: kr-panel-in 0.18s var(--kr-ease) both;
}

.kr-nav--right .kr-nav__panel {
	left: auto;
	right: 0;
}

@keyframes kr-panel-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.kr-nav__col {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 170px;
}

.kr-nav__col-heading {
	margin: 0 0 3px;
	font-family: var(--kr-font-body);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--kr-muted);
}

.kr-nav__sublist {
	display: flex;
	flex-direction: column;
	gap: 7px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.kr-nav__sub {
	display: block;
	padding: 4px 0;
	font-family: var(--kr-font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--kr-ink);
}

.kr-nav__sub:hover {
	color: var(--kr-copper-text);
}

.kr-nav__sub[aria-current="page"] {
	color: var(--kr-copper-text);
	font-weight: 700;
}

/*
 * tokens.css inverts the focus ring inside .kr-header because the bar is ink.
 * The panel is white, so it has to invert straight back — a white ring on a
 * white panel is no ring at all.
 */
.kr-nav__panel :where(a, button, [tabindex]):focus-visible {
	outline-color: var(--kr-focus);
}

/* Full-viewport click target that sits under an open panel. */
.kr-nav__catcher {
	position: fixed;
	inset: 0;
	z-index: 41;
}

/* ==========================================================================
   7. Mobile header, brandmark & full-screen overlay
   ========================================================================== */

.kr-header__mobile {
	display: none;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
}

/* Holds the flow position of the fixed .kr-brandmark. */
.kr-header__spacer {
	width: 34px;
	height: 34px;
	flex: none;
}

.kr-burger {
	position: relative;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--kr-copper);
	cursor: pointer;
	flex: none;
	transition: background var(--kr-dur) ease;
}

.kr-burger__bar {
	position: absolute;
	top: 50%;
	left: 50%;
	height: 3px;
	background: #fff;
	border-radius: 2px;
	transition: width 0.3s ease,
		transform 0.3s cubic-bezier(0.68, -0.35, 0.32, 1.35);
}

/*
 * The two-bar → X morph is driven entirely by aria-expanded, so the attribute
 * is the single source of truth and JS only has to toggle it. Counted from the
 * end, because the button's first child is the visually-hidden label.
 */
.kr-burger__bar:nth-last-child(2) {
	width: 20px;
	transform: translate(-50%, -50%) translateY(-4.5px);
}

.kr-burger__bar:nth-last-child(1) {
	width: 13px;
	transform: translate(-50%, -50%) translateY(4.5px);
}

/* Open, the burger sits on the copper overlay — its own fill would be invisible. */
.kr-burger[aria-expanded="true"] {
	background: transparent;
}

.kr-burger[aria-expanded="true"] .kr-burger__bar {
	width: 22px;
}

.kr-burger[aria-expanded="true"] .kr-burger__bar:nth-last-child(2) {
	transform: translate(-50%, -50%) rotate(45deg);
}

.kr-burger[aria-expanded="true"] .kr-burger__bar:nth-last-child(1) {
	transform: translate(-50%, -50%) rotate(-45deg);
}

/*
 * Fixed crest, above both the sticky header and the overlay. It grows as the
 * wall comes over the page, which is the one piece of branding that carries
 * across the transition.
 */
.kr-brandmark {
	display: none;
	position: fixed;
	top: 16px;
	left: 18px;
	z-index: 60;
	align-items: center;
	gap: 10px;
	color: #fff;
}

.kr-brandmark:hover {
	color: #fff;
}

.kr-brandmark img {
	width: 40px;
	height: 40px;
	object-fit: contain;
	transition: width 0.4s var(--kr-ease), height 0.4s var(--kr-ease);
}

body.kr-menu-open .kr-brandmark img {
	width: 62px;
	height: 62px;
}

.kr-brandmark__name {
	font-family: var(--kr-font-display);
	font-weight: 800;
	font-size: 18px;
	letter-spacing: 0.1em;
	line-height: 1;
	text-transform: uppercase;
}

/* -- The overlay ---------------------------------------------------------- */

.kr-wall {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--kr-copper);
	color: var(--kr-on-copper);
	opacity: 0;
	transform: translateY(-18px);
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.32s ease, transform 0.32s ease,
		visibility 0s linear 0.32s;
}

.kr-wall.is-open {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.32s ease, transform 0.32s ease,
		visibility 0s linear 0s;
}

/* Two decorative discs that scale up with the overlay. */
.kr-wall::before,
.kr-wall::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
	transform: scale(0.7);
}

.kr-wall::before {
	top: -60px;
	right: -60px;
	width: 220px;
	height: 220px;
	background: rgb(255 255 255 / 10%);
	transition: transform 0.5s ease, opacity 0.5s ease;
}

.kr-wall::after {
	bottom: -90px;
	left: -60px;
	width: 240px;
	height: 240px;
	background: rgb(0 0 0 / 12%);
	transition: transform 0.55s ease 0.05s, opacity 0.55s ease 0.05s;
}

.kr-wall.is-open::before,
.kr-wall.is-open::after {
	opacity: 1;
	transform: scale(1);
}

.kr-wall__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	margin-inline: auto;
	padding: 74px 22px 24px;
	flex: 1;
	overflow-y: auto;
	/*
	 * The burger and the brandmark are fixed over the top of this scroller (the
	 * 74px of padding is what keeps the first row clear of them). Matching that
	 * as scroll padding means a row scrolled into view by Tab stops below them
	 * too, instead of coming to rest underneath.
	 */
	scroll-padding-block-start: 74px;
}

/*
 * The nav is centred with auto margins rather than justify-content:center on
 * the scroller above, and that is the whole point: a scroll container cannot
 * be scrolled above its start edge, so centring an overflowing list pushes its
 * leading rows out of the top with no way to get them back — which is exactly
 * what happened with the 13-item Deildir group expanded on a short viewport.
 * Auto margins only ever absorb *positive* free space, so they centre the list
 * when it fits and collapse to zero when it does not, leaving the first row at
 * scrollTop 0 where both the wheel and the keyboard can reach it.
 *
 * Preferred over `justify-content: safe center`, which does the same job but is
 * dropped wholesale as an invalid value by anything that does not know the
 * `safe` keyword; auto margins have worked since flexbox shipped.
 */
.kr-wall__nav {
	margin-block: auto;
}

.kr-wall__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * Stagger is expressed as a per-item custom property written by PHP, so the
 * reveal needs no JS timers and honours reduced-motion automatically.
 */
.kr-wall__item {
	border-bottom: 1px solid rgb(255 255 255 / 22%);
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.38s ease, transform 0.38s ease;
}

.kr-wall.is-open .kr-wall__item {
	opacity: 1;
	transform: translateY(0);
	transition-delay: calc(var(--i, 0) * 55ms);
}

.kr-wall__link,
.kr-wall__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 16px 0;
	background: none;
	border: 0;
	text-align: left;
	color: var(--kr-on-copper);
	cursor: pointer;
}

.kr-wall__link:hover,
.kr-wall__toggle:hover {
	color: var(--kr-on-copper);
}

.kr-wall__label {
	font-family: var(--kr-font-display);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--kr-on-copper);
}

.kr-wall__plus {
	display: inline-block;
	font-family: var(--kr-font-display);
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	color: var(--kr-on-copper);
	transition: transform 0.2s ease;
}

.kr-wall__toggle[aria-expanded="true"] .kr-wall__plus {
	transform: rotate(45deg);
}

.kr-wall__sublist {
	display: flex;
	flex-direction: column;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0 0 16px 2px;
}

/*
 * Solid white, never translucent: rgba(255,255,255,.85) on copper is 3.1:1 and
 * fails. See the colour note at the top of tokens.css.
 */
.kr-wall__sublink {
	display: block;
	padding: 9px 0;
	font-family: var(--kr-font-body);
	font-size: 16px;
	font-weight: 600;
	color: var(--kr-on-copper);
}

.kr-wall__sublink:hover {
	color: var(--kr-on-copper);
	text-decoration: underline;
}

.kr-wall__link[aria-current="page"] .kr-wall__label,
.kr-wall__sublink[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.kr-wall__foot {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	margin-inline: auto;
	padding: 14px 22px;
	flex: 0 0 auto;
}

.kr-wall__cta {
	padding: 15px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.12em;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.kr-wall.is-open .kr-wall__cta {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.3s;
}

body.kr-menu-open {
	overflow: hidden;
}

@media (max-width: 879.98px) {
	.kr-header__inner {
		display: none;
	}

	.kr-header__mobile {
		display: flex;
	}

	.kr-brandmark {
		display: flex;
	}

	/* Above the overlay, so the burger stays reachable as the X that closes it. */
	.kr-header {
		z-index: 55;
	}

	/*
	 * ...but only the burger should show once the wall is up — the ink bar
	 * would otherwise cut a dark strip across the top of the copper.
	 */
	body.kr-menu-open .kr-header {
		background: transparent;
	}
}

@media (min-width: 880px) {
	.kr-wall {
		display: none;
	}
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

.kr-footer {
	background: var(--kr-ink);
	color: var(--kr-on-dark-muted);
	padding: 56px clamp(20px, 4vw, 48px) 32px;
}

.kr-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 48px;
	justify-content: space-between;
	max-width: 1280px;
	margin-inline: auto;
}

.kr-footer__brand {
	max-width: 320px;
}

.kr-footer__mark {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
}

.kr-footer__mark:hover {
	color: #fff;
}

.kr-footer__mark img {
	width: 34px;
	height: 34px;
	object-fit: contain;
}

.kr-footer__mark .kr-brand__name {
	font-size: 20px;
	letter-spacing: 0.08em;
}

.kr-footer__tagline {
	margin: 14px 0 0;
	font-size: 14px;
	line-height: 1.6;
}

.kr-footer__cols {
	display: flex;
	flex-wrap: wrap;
	gap: 64px;
}

.kr-footer__heading {
	margin: 0 0 14px;
	font-family: var(--kr-font-display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #fff;
}

.kr-footer__links {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 14px;
	font-style: normal;
}

.kr-footer__links a {
	color: var(--kr-on-dark-muted);
}

.kr-footer__links a:hover {
	color: #fff;
}

.kr-social {
	display: flex;
	gap: 12px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.kr-social__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--kr-border-dark);
	border-radius: var(--kr-radius);
	color: var(--kr-on-dark);
}

.kr-social__link svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.kr-social__link:hover {
	border-color: var(--kr-copper);
	background: var(--kr-copper);
	color: var(--kr-on-copper);
}

.kr-footer__legal {
	max-width: 1280px;
	margin: 40px auto 0;
	padding-top: 24px;
	border-top: 1px solid rgb(255 255 255 / 12%);
	font-size: 13px;
	/* Was #7d7970 — 4.25:1 on the new ink, short of AA at 13px. */
	color: var(--kr-on-dark-muted);
}

@media print {
	.kr-brandmark {
		display: none !important;
	}
}
