/* =========================================================================
   netex · base.css (Foundation) · reset, type roles, Greek rules, focus, prose
   ========================================================================= */
@layer reset, tokens, base, components, layout, pages, utilities;

/* ---- reset --------------------------------------------------------------- */
@layer reset {
	*, *::before, *::after { box-sizing: border-box; }
	html {
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
		scroll-padding-top: calc(var(--header-h) + var(--s-4));
		overflow-x: clip;
		-webkit-tap-highlight-color: transparent;
		color-scheme: light dark;
	}
	body { margin: 0; min-height: 100svh; overflow-x: clip; }
	h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul, pre { margin: 0; }
	ol, ul { padding: 0; }
	ul[role="list"], ol[role="list"], .nx-list-reset { list-style: none; }
	img, picture, video, canvas, svg { display: block; max-width: 100%; }
	img, video { height: auto; }
	svg { overflow: visible; }
	input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
	button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
	button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
	a { color: inherit; }
	table { border-collapse: collapse; }
	fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
	legend { padding: 0; }
	summary { cursor: pointer; }
	summary::-webkit-details-marker { display: none; }
	[hidden]:not([hidden="until-found"]) { display: none !important; }
	abbr[title] { text-decoration: none; }
	iframe { border: 0; }
}

/* ---- base ---------------------------------------------------------------- */
@layer base {
	html { background: var(--ink); }
	body {
		background: var(--ink);
		color: var(--paper);
		font-family: var(--f-sans);
		font-size: var(--t-body);
		font-weight: var(--w-body);
		line-height: var(--lh-body);
		font-kerning: normal;
		font-optical-sizing: auto;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		text-rendering: optimizeLegibility;
		hanging-punctuation: first;
	}

	/* Commissioner's hemisphere axis: set --flar / --volm on the element (never on body). */
	h1, h2, h3, h4, .nx-display, .nx-h1, .nx-h2, .nx-h3, .nx-mega, .nx-flar {
		font-variation-settings: "FLAR" var(--flar, 0), "VOLM" var(--volm, 0);
	}

	/* Headings: one family, weight carries hierarchy. Balance always; manual hyphens only. */
	h1, h2, h3, h4, h5, h6 { font-weight: var(--w-h3); line-height: var(--lh-h3); text-wrap: balance; hyphens: manual; overflow-wrap: break-word; }
	h1, .nx-h1, .nx-display {
		font-size: var(--t-display);
		font-weight: var(--w-display);
		line-height: var(--lh-display);
		letter-spacing: var(--tr-display);
	}
	.nx-h1-sub {
		display: block;
		font-size: var(--t-h1-sub);
		font-weight: 480;
		line-height: 1.12;
		letter-spacing: -.01em;
		color: var(--fg-2);
		margin-top: var(--s-4);
	}
	h2, .nx-h2 {
		font-size: var(--t-h2);
		font-weight: var(--w-h2);
		line-height: var(--lh-h2);
		letter-spacing: var(--tr-h2);
		max-width: 18ch;
	}
	html[lang="el"] :is(h2, .nx-h2) { max-width: 20ch; }
	h3, .nx-h3 { font-size: var(--t-h3); font-weight: var(--w-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); }
	h4, .nx-h4 { font-size: var(--t-h4); font-weight: var(--w-strong); line-height: 1.25; }
	.nx-mega {
		font-size: var(--t-mega);
		font-weight: 880;
		line-height: var(--lh-mega);
		letter-spacing: var(--tr-mega);
		text-transform: uppercase;
	}

	p, li, dd { text-wrap: pretty; }
	p + p { margin-top: 1em; }
	strong, b { font-weight: var(--w-strong); }
	small { font-size: var(--t-small); }

	/* Human voice: Literata Text. */
	.nx-lead {
		font-family: var(--f-serif);
		font-size: var(--t-lead);
		line-height: var(--lh-lead);
		font-weight: 400;
		max-width: var(--measure-lead);
		text-wrap: pretty;
		color: var(--fg);
	}
	.nx-voice, .nx-lead--voice { font-family: var(--f-serif); font-style: italic; }
	.nx-body { max-width: var(--measure); }

	/* Machine voice: JetBrains Mono. Greek uppercase only through text-transform (tonos drops). */
	.nx-eyebrow, .nx-mono-label {
		display: block;
		font-family: var(--f-mono);
		font-size: var(--t-label);
		font-weight: 500;
		line-height: var(--lh-label);
		letter-spacing: var(--tr-label);
		text-transform: uppercase;
		color: var(--fg-2);
	}
	.nx-eyebrow { margin-bottom: var(--s-4); }
	.nx-mono, code, kbd, samp, pre { font-family: var(--f-mono); font-size: .92em; }
	kbd {
		display: inline-block;
		padding: 0 .4em;
		border: var(--bw) solid var(--rule);
		border-bottom-width: 2px;
		font-size: .82em;
		line-height: 1.5;
	}
	.nx-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

	/* Links: role colour, 1px underline at .18em; hover thickens. */
	a:not([class]) , .nx-link {
		color: var(--link);
		text-decoration: underline;
		text-decoration-thickness: 1px;
		text-underline-offset: .18em;
		transition: text-decoration-thickness var(--dur-ui) var(--ease-mech);
	}
	@media (hover: hover) {
		a:not([class]):hover, .nx-link:hover { text-decoration-thickness: 2px; }
	}

	/* Focus is always visible, never removed (2px ring, 3px offset, role colour). */
	:focus-visible {
		outline: var(--bw-focus) solid var(--focus, var(--cyan));
		outline-offset: var(--focus-offset);
	}
	:focus:not(:focus-visible) { outline: none; }
	[tabindex="-1"]:focus { outline: none; }

	::selection { background: var(--sel-bg); color: var(--sel-fg); }

	hr { border: 0; border-top: var(--bw) solid var(--rule); margin: var(--s-7) 0; }

	/* Greek quotes and mixed-language fragments. */
	:lang(el) q { quotes: "«" "»" "“" "”"; }
	:lang(en) q { quotes: "“" "”" "‘" "’"; }

	/* Visually hidden (text equivalents, extra labels). */
	.nx-sr, .screen-reader-text {
		position: absolute !important;
		width: 1px; height: 1px;
		padding: 0; margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
		border: 0;
	}
	.nx-sr-focusable:focus { position: static !important; width: auto; height: auto; margin: 0; clip: auto; clip-path: none; white-space: normal; }

	/* Skip links: hidden until focused, then a Molten chamfered button at top-left. */
	.nx-skip {
		position: fixed;
		left: var(--s-3);
		top: var(--s-3);
		z-index: var(--z-skip);
		isolation: isolate;
		display: inline-flex;
		align-items: center;
		min-height: 48px;
		padding: 0 calc(var(--s-5) + var(--ch-ui) * .5) 0 var(--s-5);
		color: var(--ink);
		font: var(--w-strong) .9375rem/1 var(--f-sans);
		text-decoration: none;
		transform: translateY(-200%);
	}
	.nx-skip::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background: var(--molten);
		clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--ch-ui) * var(--nx-tan)), calc(100% - var(--ch-ui)) 100%, 0 100%);
	}
	/* A two-tone ring reads on every ground (Ink, Paper, Indigo, photography). */
	.nx-skip:focus, .nx-skip:focus-visible { transform: none; outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--paper); }

	/* Long-form prose (Insights single, cases, legal): Literata Text 19px on a long measure. */
	.nx-prose {
		font-family: var(--f-serif);
		font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
		line-height: 1.62;
		max-width: var(--measure-long);
		color: var(--fg);
	}
	.nx-prose > * + * { margin-top: 1.1em; }
	.nx-prose :is(h2, h3, h4) {
		font-family: var(--f-sans);
		max-width: none;
		margin-top: 2.2em;
		margin-bottom: -.2em;
		text-wrap: balance;
	}
	.nx-prose h2 { font-size: var(--t-h3); font-weight: var(--w-h2); line-height: 1.1; letter-spacing: var(--tr-h3); }
	.nx-prose h3 { font-size: var(--t-h4); font-weight: var(--w-h3); line-height: 1.2; }
	.nx-prose h4 { font-size: var(--t-body); font-weight: var(--w-strong); }
	.nx-prose :is(ul, ol) { padding-left: 1.3em; }
	.nx-prose li + li { margin-top: .35em; }
	.nx-prose li::marker { color: var(--fg-2); font-family: var(--f-mono); font-size: .85em; }
	.nx-prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
	.nx-prose blockquote {
		margin-inline: 0;
		padding-left: var(--s-5);
		border-left: var(--bw-2) solid var(--fg);
		font-style: italic;
	}
	.nx-prose :is(table) { width: 100%; font-family: var(--f-sans); font-size: var(--t-small); }
	.nx-prose :is(th, td) { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-3) var(--s-3) 0; border-top: var(--bw) solid var(--rule); }
	.nx-prose th { font-family: var(--f-mono); font-size: var(--t-label); font-weight: 500; letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--fg-2); }
	.nx-prose figure { margin-block: 2em; }
	.nx-prose figcaption { margin-top: var(--s-2); font-family: var(--f-mono); font-size: var(--t-micro); color: var(--fg-2); }
	.nx-prose code { font-size: .86em; padding: .05em .3em; background: var(--bg-2); }
	.nx-prose hr { margin-block: 2.5em; }
	.nx-prose img { height: auto; }

	/* Reduced motion: final states, no smooth scroll (html.rm comes from the OS or the footer toggle). */
	html.rm, html.rm body { scroll-behavior: auto; }
	html.rm *, html.rm *::before, html.rm *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		animation-delay: 0s !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
	@media (prefers-reduced-motion: reduce) {
		html:not(.js) *, html:not(.js) *::before, html:not(.js) *::after {
			animation-duration: .01ms !important;
			animation-iteration-count: 1 !important;
			transition-duration: .01ms !important;
		}
	}

	/* Lenis */
	html.lenis, html.lenis body { height: auto; }
	.lenis.lenis-smooth { scroll-behavior: auto !important; }
	.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
	.lenis.lenis-stopped { overflow: clip; }

	/* Print: one clean column, no chrome. */
	@media print {
		.nx-header, .nx-menu, .nx-close, .nx-base__settings, .nx-progress, .cut__b, .cut__flash, video, .nx-skip { display: none !important; }
		body, .f-ink, .f-ink-2, .f-indigo { background: #fff !important; color: #000 !important; }
		a { color: #000 !important; }
	}
}
