/* The public site of the apex host. Shared by /, /mcp and /lawyers.
   Each page adds its own file: landing.css, mcp.css, lawyers.css.
   The tokens below are the only colors, sizes and radii a page uses. */

:root {
	--bg: #faf8f4;
	--bg-alt: #f2eee6;
	--surface: #ffffff;
	--ink: #16130f;
	--ink-2: #4a453d;
	--ink-3: #6b645a;
	--line: #e3ddd2;
	--line-strong: #cfc7b9;
	--accent: #1f4d3a;
	--accent-ink: #ffffff;
	--accent-soft: #e4ede7;
	--accent-2: #b5562b;
	--dark: #12201a;
	--dark-ink: #f3efe7;
	--dark-line: #2c3a33;
	/* The header: near-black navy, as the plate of the brand mark. */
	--head: #070d1c;
	--head-line: #1d2638;
	--head-ink: #b7bfcd;

	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
	--s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

	--r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
	--shadow-sm: 0 1px 2px rgba(22, 19, 15, .06);
	--shadow-md: 0 1px 2px rgba(22, 19, 15, .05), 0 8px 24px rgba(22, 19, 15, .07);
	--shadow-lg: 0 2px 4px rgba(22, 19, 15, .05), 0 24px 64px rgba(22, 19, 15, .12);

	--wrap: 1200px;
	--gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
body.site {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 17px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	/* A short page keeps the footer at the bottom of the screen: main takes the rest. */
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	/* An underline is thin, unbroken by descenders, and set off from the text. Both inherit. */
	text-underline-offset: .22em;
	text-decoration-skip-ink: none;
}
.site img { max-width: 100%; height: auto; }
body.site > main { flex: 1 0 auto; }
.site a { color: inherit; }
/* Thickness does not inherit: set it on each box that can draw an underline.
   The shorthand `text-decoration: underline` resets it to auto, so it is important. */
.site :where(a, button, span) { text-decoration-thickness: 1px !important; }
/* An anchor target clears the sticky header. */
.site [id] { scroll-margin-top: 84px; }
.site :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.site h1, .site h2, .site h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.1; margin: 0; }
.site h1 { font-size: clamp(40px, 6vw, 76px); letter-spacing: -.02em; }
.site h2 { font-size: clamp(30px, 4vw, 48px); }
.site h3 { font-size: 22px; line-height: 1.25; }
.site p { margin: 0; }
/* Headings balance their lines. Body text avoids a lone last word. A
   browser that does not know text-wrap ignores both. */
.site h1, .site h2, .site h3, .site h4, .site-eyebrow, .site-pill { text-wrap: balance; }
.site p, .site li, .site dd, .site blockquote, .site figcaption, .site td, .site summary { text-wrap: pretty; }

.site-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.site-muted { color: var(--ink-3); }
.site-eyebrow {
	display: inline-flex; align-items: center; gap: var(--s2);
	font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.site-lead { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 640px; }
.site-section { padding: var(--s9) 0; }
.site-section-alt { background: var(--bg-alt); }
.site-section-dark { background: var(--dark); color: var(--dark-ink); }
.site-section-dark .site-lead, .site-section-dark .site-muted { color: #b9c2bc; }
.site-section-head { display: grid; gap: var(--s4); max-width: 760px; margin-bottom: var(--s7); }

/* Buttons and pills */
.site-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
	min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-pill);
	font: 600 16px/1 var(--sans); text-decoration: none; white-space: nowrap;
	border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
}
.site-btn:active { transform: translateY(1px); }
/* A form that is sending (busy.js): a spinner before the text, and no more presses. */
.site-btn[aria-busy="true"] { cursor: progress; pointer-events: none; opacity: .85; }
.site-btn[aria-busy="true"]::before {
	content: ""; width: 1em; height: 1em; flex: none; box-sizing: border-box;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
	animation: site-spin .7s linear infinite;
}
@keyframes site-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .site-btn[aria-busy="true"]::before { animation-duration: 2s; } }
.site-btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.site-btn-primary { background: var(--accent); color: var(--accent-ink) !important; }
.site-btn-primary:hover { background: #173b2c; }
.site-btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.site-btn-ghost:hover { border-color: var(--ink); }
.site-section-dark .site-btn-ghost { border-color: var(--dark-line); color: var(--dark-ink); }
/* Two to four tabs as links, the chosen one filled (aria-current="page").
   The period and year prices of the MCP landing and cabinet use them. */
.site-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-pill); }
.site-seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-size: 15px; white-space: nowrap; }
.site-seg a:hover { color: var(--ink); }
.site-seg a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.site-seg-gain { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: var(--r-pill); }

/* A struck price: one diagonal line, not a horizontal strike. */
.site-was { position: relative; display: inline-block; text-decoration: none; }
.site-was::after {
	content: ""; position: absolute; left: -3px; right: -3px; top: 50%;
	border-top: 2px solid var(--accent-2); transform: rotate(-14deg);
}

.site-pill {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill);
	background: var(--accent-soft); color: var(--accent); font: 500 13px/1.5 var(--sans);
}

/* Cards */
.site-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-sm); }

/* Skip link */
.site-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); }
.site-skip:focus { left: 8px; }

/* Header: near-black navy. The logo is the bare mark (logo-light.svg). */
.site-header {
	position: sticky; top: 0; z-index: 50; color: var(--dark-ink);
	background: rgba(7, 13, 28, .95); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid var(--head-line);
}
.site-header :focus-visible { outline-color: var(--dark-ink); }
.site-header-row { display: flex; align-items: center; gap: var(--s5); height: 68px; }
.site-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--serif); letter-spacing: -.01em; }
.site-nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; }
.site-nav a { text-decoration: none; font-size: 15px; color: var(--head-ink); white-space: nowrap; }
/* The language switcher takes room: a tighter gap keeps one row. */
.site-nav:has(.site-langs) { gap: var(--s4); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #ffffff; }
.site-nav a[aria-current="page"] { font-weight: 600; }
/* The green button has too little contrast on the dark header. */
.site-nav .site-btn-primary { background: var(--dark-ink); color: var(--head) !important; }
.site-nav .site-btn-primary:hover { background: #ffffff; }
.site-menu-toggle, .site-menu-button { display: none; }

/* 1000px and not 900px: the language switcher of /mcp needs the room. */
@media (max-width: 1000px) {
	.site-menu-button {
		display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
		width: 44px; height: 44px; cursor: pointer; border-radius: var(--r-sm);
	}
	.site-menu-button span, .site-menu-button span::before, .site-menu-button span::after {
		display: block; width: 20px; height: 2px; background: var(--dark-ink); position: relative; content: "";
	}
	.site-menu-button span::before { position: absolute; top: -6px; }
	.site-menu-button span::after { position: absolute; top: 6px; }
	.site-menu-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
	.site-menu-toggle:focus-visible + .site-menu-button { outline: 2px solid var(--dark-ink); }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 68px;
		flex-direction: column; align-items: stretch; gap: 0; padding: var(--s3) var(--gutter) var(--s5);
		background: var(--head); border-bottom: 1px solid var(--head-line); box-shadow: var(--shadow-md);
	}
	.site-nav a { padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--head-line); }
	.site-nav .site-btn { margin-top: var(--s4); border-bottom: 0; }
	.site-nav .site-langs { align-self: flex-start; margin-top: var(--s4); }
	.site-nav .site-langs a { padding: 6px 12px; font-size: 15px; border-bottom: 0; }
	.site-menu-toggle:checked ~ .site-nav { display: flex; }
}

/* Footer */
.site-footer { background: var(--dark); color: var(--dark-ink); padding: var(--s8) 0 var(--s6); }
.site-footer .site-muted { color: #9aa59e; margin-top: var(--s3); max-width: 320px; font-size: 15px; }
.site-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s6); }
.site-footer nav { display: grid; gap: var(--s2); align-content: start; }
.site-footer h2 { font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #9aa59e; margin-bottom: var(--s2); }
.site-footer nav a { text-decoration: none; color: var(--dark-ink); font-size: 15px; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer-base { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--dark-line); font-size: 14px; align-items: baseline; }
.site-footer-base .site-muted { margin-top: 0; }
@media (max-width: 760px) {
	.site-footer-grid { grid-template-columns: 1fr 1fr; }
	.site-footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
	:root { --gutter: 16px; }
	body.site { font-size: 16px; }
	.site-section { padding: var(--s8) 0; }
	.site-lead { font-size: 18px; }
}

/* The language switcher of a page in more than one language
   (views/site.layout.php, lib/site_lang.php). */
.site-langs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.site-langs a { padding: 4px 9px; border-radius: var(--r-pill); font-size: 13px; color: var(--ink-3); text-decoration: none; }
.site-langs a:hover { color: var(--ink); }
.site-langs a[aria-current="true"] { background: var(--bg-alt); color: var(--ink); font-weight: 600; }
.site-header .site-langs { border-color: var(--head-line); }
.site-header .site-langs a { color: var(--head-ink); }
.site-header .site-langs a:hover { color: #ffffff; }
.site-header .site-langs a[aria-current="true"] { background: var(--head-line); color: #ffffff; }

/* The demo request form (modules/site/views/demo_form.php): on /demo and at
   the end of the start page. */
.site-demo { display: grid; gap: var(--s5); max-width: 720px; }
.site-form { display: grid; gap: var(--s4); text-align: left; }
.site-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.site-field { display: grid; gap: 6px; }
.site-field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.site-field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.site-field input, .site-field textarea {
	width: 100%; min-height: 46px; padding: 10px var(--s3); font: inherit; color: var(--ink);
	background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
}
.site-field textarea { resize: vertical; min-height: 110px; }
.site-field input:focus, .site-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.site-field [aria-invalid="true"] { border-color: #b3401a; }
.site-field-error { font-size: 14px; color: #8a3311; }
.site-form .site-btn { justify-self: start; }
.site-form-note { font-size: 14px; color: var(--ink-3); }
.site-form-alert { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: #fbe9e1; color: #7a2f10; }
.site-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) {
	.site-form-row { grid-template-columns: 1fr; }
}
