:root {
	color-scheme: light;
	--ark-shell-bg: #f2efe8;
	--ark-shell-bg-deep: #e9e4da;
	--ark-shell-surface: #fbfaf7;
	--ark-shell-surface-soft: rgba(255, 255, 255, 0.58);
	--ark-shell-ink: #111111;
	--ark-shell-muted: #6d6a64;
	--ark-shell-border: rgba(17, 17, 17, 0.14);
	--ark-shell-border-strong: rgba(17, 17, 17, 0.28);
	--ark-shell-radius-sm: 12px;
	--ark-shell-radius: 18px;
	--ark-shell-radius-lg: 28px;
	--ark-shell-shadow: 0 24px 80px rgba(30, 27, 21, 0.12);
	--ark-shell-mark-field: #f2efe8;
	--ark-shell-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-family: var(--ark-shell-font);
}

html {
	box-sizing: border-box;
	min-width: 320px;
	background: var(--ark-shell-bg);
	text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}

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

body {
	margin: 0;
	background: var(--ark-shell-bg);
	color: var(--ark-shell-ink);
	font-family: var(--ark-shell-font);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
video,
canvas,
svg { max-width: 100%; height: auto; }

button,
input,
select,
textarea { font: inherit; }

a { color: currentColor; text-underline-offset: 0.16em; }

:focus-visible { outline: 3px solid rgba(17, 17, 17, 0.22); outline-offset: 3px; }

/* Controlled ARK application canvas. Framework and app packages own its UI. */
html.ark-shell-app-document,
body.ark-shell-app { min-height: 100%; background: var(--ark-shell-bg); overflow-x: hidden; }
body.ark-shell-app { width: 100%; min-height: 100dvh; padding: 0 !important; }
body.ark-shell-app.admin-bar { margin-top: 0 !important; }
body.ark-shell-app #wpadminbar { display: none !important; }

.ark-shell-app-canvas {
	width: 100%;
	min-width: 0;
	min-height: 100dvh;
	padding: max(0px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
	background: var(--ark-shell-bg);
	overflow-x: hidden;
}

.ark-shell-app-canvas > .ark-portal,
.ark-shell-app-canvas > .ark-portal-login { position: relative; isolation: isolate; }

.ark-shell-app-canvas :where(.wp-block-group, .wp-block-post-content, .entry-content, .site-main, .site-content) {
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.ark-shell-app-canvas :where(p, h1, h2, h3, h4, h5, h6, figure, blockquote, ul, ol) {
	word-break: normal;
	overflow-wrap: break-word;
}

.ark-shell-app-canvas :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea, button) { max-width: 100%; }

.ark-shell-fallback-card {
	max-width: 620px;
	margin: 12vh auto;
	border: 1px solid var(--ark-shell-border);
	border-radius: var(--ark-shell-radius);
	padding: 32px;
	background: var(--ark-shell-surface);
	box-shadow: var(--ark-shell-shadow);
}

/* Minimal public fallback shell. */
.ark-shell-site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	border-bottom: 1px solid rgba(17, 17, 17, 0.08);
	background: rgba(242, 239, 232, 0.88);
	backdrop-filter: blur(18px) saturate(1.04);
	-webkit-backdrop-filter: blur(18px) saturate(1.04);
}

.ark-shell-site-header__inner {
	display: flex;
	min-height: 72px;
	width: min(1120px, calc(100% - 40px));
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin: auto;
}

.ark-shell-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--ark-shell-ink);
	font-size: 19px;
	font-weight: 650;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.ark-shell-brand__mark { display: grid; width: 34px; height: 34px; place-items: center; color: var(--ark-shell-ink); }
.ark-shell-brand__mark svg { width: 100%; height: 100%; }
.custom-logo-link,
.ark-shell-brand:has(.custom-logo) { display: inline-flex; align-items: center; }
.custom-logo { width: auto; max-width: 220px; max-height: 44px; object-fit: contain; }

.ark-shell-site-nav ul { display: flex; align-items: center; gap: 18px; margin: 0; padding: 0; list-style: none; }
.ark-shell-site-nav a { color: var(--ark-shell-ink); font-weight: 590; text-decoration: none; }

.ark-shell-site-main {
	width: min(1120px, calc(100% - 40px));
	min-height: calc(100vh - 150px);
	margin: 48px auto;
}

.ark-shell-content-card {
	margin: 0 0 24px;
	border: 1px solid var(--ark-shell-border);
	border-radius: var(--ark-shell-radius);
	padding: clamp(24px, 4vw, 52px);
	background: var(--ark-shell-surface);
	box-shadow: 0 16px 50px rgba(30, 27, 21, 0.07);
}

.ark-shell-entry-header h1 {
	margin: 0 0 18px;
	font-size: clamp(34px, 6vw, 64px);
	font-weight: 560;
	letter-spacing: -0.045em;
	line-height: 1.05;
}
.ark-shell-entry-header a { color: inherit; text-decoration: none; }
.ark-shell-entry-content > *:first-child { margin-top: 0; }
.ark-shell-entry-content > *:last-child { margin-bottom: 0; }

.ark-shell-site-footer { padding: 28px 20px; color: var(--ark-shell-muted); text-align: center; }
.ark-shell-error-page { text-align: center; }
.ark-shell-error-page__code { display: block; color: rgba(17, 17, 17, 0.16); font-size: clamp(72px, 16vw, 170px); font-weight: 700; letter-spacing: -0.08em; line-height: 0.9; }

.ark-shell-button {
	display: inline-flex;
	min-height: 48px;
	align-items: center;
	justify-content: center;
	margin-top: 14px;
	border-radius: var(--ark-shell-radius-sm);
	padding: 0 20px;
	background: var(--ark-shell-ink);
	color: #fff;
	font-weight: 650;
	text-decoration: none;
}

/* Shared Framework launcher host. */
.ark-shell-launcher-host {
	position: fixed;
	top: max(14px, env(safe-area-inset-top));
	left: max(14px, env(safe-area-inset-left));
	z-index: 2147482500;
	pointer-events: none;
}
.ark-shell-launcher-host .arkini-launcher { pointer-events: auto; }

@media (max-width: 700px) {
	.ark-shell-site-header__inner,
	.ark-shell-site-main { width: min(100% - 24px, 1120px); }
	.ark-shell-site-nav ul { gap: 10px; }
	.ark-shell-content-card { border-radius: 16px; }
	body.ark-shell-app :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
