/*
Theme Name: EA6 Cube
Theme URI: https://ea6cube.org
Author: John Gotze
Author URI: https://eapad.dk
Description: A documentation and publishing theme for the EA6 Cube framework. Built for long specification texts, book chapters, and metamodel modules, with a six face taxonomy, automatic tables of contents, citation blocks, and an unfolded cube net that doubles as navigation. Self hosted fonts, no external requests.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ea6cube
Tags: documentation, one-column, three-columns, custom-menu, custom-logo, editor-style, block-styles, wide-blocks, accessibility-ready, translation-ready
*/

/* ==========================================================================
   0. Fonts, self hosted, SIL Open Font License 1.1, see assets/fonts/LICENSE
   ========================================================================== */

@font-face {
	font-family: "Plex Serif";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-serif-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Serif";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-serif-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plex Serif";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-serif-latin-400-italic.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Serif";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-serif-latin-ext-400-italic.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plex Serif";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Serif";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-serif-latin-ext-600-normal.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Plex Condensed";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Condensed";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-sans-condensed-latin-ext-600-normal.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plex Condensed";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-sans-condensed-latin-700-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Condensed";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-sans-condensed-latin-ext-700-normal.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Plex Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plex Mono";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Plex Mono";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
	--ea6-ink: #0e1620;
	--ea6-graphite: #46566a;
	--ea6-mute: #6b7d90;
	--ea6-rule: #c3cdd8;
	--ea6-rule-soft: #dde4eb;
	--ea6-paper: #ffffff;
	--ea6-ground: #e7edf2;
	--ea6-ground-2: #f2f6f9;
	--ea6-accent: #1b5e8a;
	--ea6-accent-deep: #12415f;
	--ea6-accent-wash: rgba(27, 94, 138, 0.09);
	--ea6-shadow: 0 1px 0 rgba(14, 22, 32, 0.05), 0 12px 28px -20px rgba(14, 22, 32, 0.5);

	--ea6-face-0: #46566a;
	--ea6-face-1: #2e4a6b;
	--ea6-face-2: #1f6b54;
	--ea6-face-3: #a5382b;
	--ea6-face-4: #8a6510;
	--ea6-face-5: #6a4487;
	--ea6-face-6: #17697e;

	--ea6-serif: "Plex Serif", Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
	--ea6-display: "Plex Condensed", "Helvetica Neue Condensed", "Arial Narrow", system-ui, sans-serif;
	--ea6-mono: "Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

	--ea6-measure: 68ch;
	--ea6-wrap: 1240px;
	--ea6-gutter: clamp(1.15rem, 4vw, 3rem);
	--ea6-radius: 3px;
	--ea6-bar-h: 60px;
}

html[data-theme="dark"] {
	--ea6-ink: #e8eef5;
	--ea6-graphite: #adbccc;
	--ea6-mute: #8c9cad;
	--ea6-rule: #2b3a4a;
	--ea6-rule-soft: #212e3c;
	--ea6-paper: #141d27;
	--ea6-ground: #0d151d;
	--ea6-ground-2: #111a23;
	--ea6-accent: #6fb2dd;
	--ea6-accent-deep: #a5d0ec;
	--ea6-accent-wash: rgba(111, 178, 221, 0.14);
	--ea6-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 14px 30px -22px rgba(0, 0, 0, 0.9);

	--ea6-face-0: #93a4b8;
	--ea6-face-1: #79a2d4;
	--ea6-face-2: #4fb994;
	--ea6-face-3: #e2796a;
	--ea6-face-4: #d3a63f;
	--ea6-face-5: #b48ed3;
	--ea6-face-6: #4fb2c9;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--ea6-bar-h) + 1.5rem); }

body {
	margin: 0;
	background: var(--ea6-ground);
	color: var(--ea6-ink);
	font-family: var(--ea6-serif);
	font-size: 1.0625rem;
	line-height: 1.68;
	font-feature-settings: "kern" 1, "liga" 1;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }
figure { margin: 2rem 0; }
figcaption { font-family: var(--ea6-mono); font-size: 0.75rem; color: var(--ea6-mute); margin-top: 0.6rem; }

a { color: var(--ea6-accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ea6-accent-deep); }

:focus-visible {
	outline: 2px solid var(--ea6-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ea6-display);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 0.6em;
	color: var(--ea6-ink);
}

h1 { font-weight: 700; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); letter-spacing: -0.022em; line-height: 1.02; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5, h6 { font-size: 1rem; }

p { margin: 0 0 1.35em; }
strong { font-weight: 600; }

code, kbd, pre, samp { font-family: var(--ea6-mono); font-size: 0.86em; }
code { background: var(--ea6-accent-wash); padding: 0.12em 0.35em; border-radius: 2px; }
pre {
	background: var(--ea6-ground-2);
	border: 1px solid var(--ea6-rule-soft);
	border-left: 3px solid var(--ea6-accent);
	padding: 1.1rem 1.25rem;
	overflow-x: auto;
	line-height: 1.55;
	border-radius: var(--ea6-radius);
}
pre code { background: none; padding: 0; }

blockquote {
	margin: 2rem 0;
	padding: 0.2rem 0 0.2rem 1.4rem;
	border-left: 2px solid var(--ea6-rule);
	color: var(--ea6-graphite);
	font-size: 1.12em;
	line-height: 1.55;
}
blockquote cite { display: block; font-family: var(--ea6-mono); font-size: 0.72rem; font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ea6-mute); margin-top: 0.8rem; }

hr { border: 0; border-top: 1px solid var(--ea6-rule); margin: 3rem 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.94rem; margin: 2rem 0; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--ea6-rule-soft); vertical-align: top; }
thead th {
	font-family: var(--ea6-mono);
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ea6-mute);
	border-bottom: 1px solid var(--ea6-rule);
}
tbody tr:hover { background: var(--ea6-ground-2); }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; word-wrap: normal;
}
.skip-link {
	position: absolute; left: 0.5rem; top: -100px; z-index: 999;
	background: var(--ea6-ink); color: var(--ea6-paper);
	padding: 0.6rem 1rem; font-family: var(--ea6-mono); font-size: 0.8rem;
	transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; color: var(--ea6-paper); }

/* ==========================================================================
   3. Layout primitives
   ========================================================================== */

.wrap { max-width: var(--ea6-wrap); margin-inline: auto; padding-inline: var(--ea6-gutter); }
.wrap-narrow { max-width: 860px; margin-inline: auto; padding-inline: var(--ea6-gutter); }

.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--ea6-rule); }
.section-paper { background: var(--ea6-paper); }

.eyebrow {
	font-family: var(--ea6-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ea6-mute);
	margin: 0 0 1rem;
	display: flex;
	align-items: center;
	gap: 0.7rem;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--ea6-rule); }
.eyebrow-plain::after { display: none; }

.lede { font-size: 1.18rem; line-height: 1.6; color: var(--ea6-graphite); max-width: 62ch; }

.meta {
	font-family: var(--ea6-mono);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	color: var(--ea6-mute);
	text-transform: uppercase;
}

.button, .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	font-family: var(--ea6-mono);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.72rem 1.15rem;
	border: 1px solid var(--ea6-ink);
	background: var(--ea6-ink);
	color: var(--ea6-paper);
	border-radius: var(--ea6-radius);
	transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.button:hover, .wp-block-button__link:hover { background: var(--ea6-accent); border-color: var(--ea6-accent); color: #fff; transform: translateY(-1px); }
html[data-theme="dark"] .button { color: var(--ea6-ground); }
html[data-theme="dark"] .button:hover { color: #fff; }

.button-ghost { background: transparent; color: var(--ea6-ink); border-color: var(--ea6-rule); }
.button-ghost:hover { background: var(--ea6-ink); border-color: var(--ea6-ink); color: var(--ea6-paper); }
html[data-theme="dark"] .button-ghost:hover { color: var(--ea6-ground); }

/* ==========================================================================
   4. Masthead
   ========================================================================== */

.masthead {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--ea6-ground);
	background: color-mix(in srgb, var(--ea6-ground) 88%, transparent);
	backdrop-filter: saturate(150%) blur(10px);
	border-bottom: 1px solid var(--ea6-rule);
}
.masthead-inner {
	max-width: var(--ea6-wrap);
	margin-inline: auto;
	padding-inline: var(--ea6-gutter);
	height: var(--ea6-bar-h);
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ea6-ink); margin-right: auto; }
.brand:hover { color: var(--ea6-ink); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark .f-a { fill: var(--ea6-face-1); }
.brand-mark .f-b { fill: var(--ea6-face-3); }
.brand-mark .f-c { fill: var(--ea6-face-6); }
.brand-name { font-family: var(--ea6-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand-name sup { font-size: 0.62em; top: -0.5em; position: relative; }
.brand-tag { font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ea6-mute); border-left: 1px solid var(--ea6-rule); padding-left: 0.6rem; }

.nav-primary ul { list-style: none; display: flex; align-items: center; gap: 1.4rem; margin: 0; padding: 0; }
.nav-primary a {
	font-family: var(--ea6-mono);
	font-size: 0.76rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ea6-graphite);
	padding-block: 0.4rem;
	border-bottom: 1px solid transparent;
}
.nav-primary a:hover { color: var(--ea6-ink); border-bottom-color: var(--ea6-ink); }
.nav-primary .current-menu-item > a,
.nav-primary .current_page_item > a { color: var(--ea6-ink); border-bottom-color: var(--ea6-accent); }
.nav-primary li.menu-item-has-children { position: relative; }
.nav-primary .sub-menu {
	position: absolute; top: 100%; left: -0.9rem; min-width: 200px;
	background: var(--ea6-paper); border: 1px solid var(--ea6-rule);
	box-shadow: var(--ea6-shadow); padding: 0.5rem 0; display: none; flex-direction: column; gap: 0;
	border-radius: var(--ea6-radius);
}
.nav-primary li:hover > .sub-menu,
.nav-primary li:focus-within > .sub-menu { display: flex; }
.nav-primary .sub-menu a { display: block; padding: 0.45rem 0.9rem; border: 0; }
.nav-primary .sub-menu a:hover { background: var(--ea6-ground-2); }

.bar-tools { display: flex; align-items: center; gap: 0.4rem; }
.icon-button {
	width: 34px; height: 34px; display: inline-grid; place-items: center;
	border: 1px solid var(--ea6-rule); background: transparent; color: var(--ea6-graphite);
	border-radius: var(--ea6-radius); cursor: pointer; padding: 0;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.icon-button:hover { border-color: var(--ea6-ink); color: var(--ea6-ink); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; }

.search-drawer {
	display: none;
	border-top: 1px solid var(--ea6-rule);
	background: var(--ea6-paper);
	padding-block: 1rem;
}
.search-drawer.is-open { display: block; }

.search-form { display: flex; gap: 0.5rem; max-width: var(--ea6-wrap); margin-inline: auto; padding-inline: var(--ea6-gutter); }
.search-form input[type="search"] {
	flex: 1; font-family: var(--ea6-mono); font-size: 0.9rem;
	padding: 0.65rem 0.8rem; border: 1px solid var(--ea6-rule);
	background: var(--ea6-ground-2); color: var(--ea6-ink); border-radius: var(--ea6-radius);
}
.search-form input[type="search"]:focus { border-color: var(--ea6-accent); outline: none; }

@media (max-width: 900px) {
	.nav-toggle { display: inline-grid; }
	.nav-primary {
		display: none;
		position: absolute; top: var(--ea6-bar-h); left: 0; right: 0;
		background: var(--ea6-paper); border-bottom: 1px solid var(--ea6-rule);
		padding: 0.75rem var(--ea6-gutter) 1.25rem;
	}
	.nav-primary.is-open { display: block; }
	.nav-primary ul { flex-direction: column; align-items: stretch; gap: 0; }
	.nav-primary li { border-bottom: 1px solid var(--ea6-rule-soft); }
	.nav-primary a { display: block; padding: 0.8rem 0; }
	.nav-primary .sub-menu { position: static; display: flex; border: 0; box-shadow: none; padding: 0 0 0.5rem 1rem; }
	.brand-tag { display: none; }
}

/* Face colour binding. One class per face, used wherever --face is read. */
.face-n-0 { --face: var(--ea6-face-0); }
.face-n-1 { --face: var(--ea6-face-1); }
.face-n-2 { --face: var(--ea6-face-2); }
.face-n-3 { --face: var(--ea6-face-3); }
.face-n-4 { --face: var(--ea6-face-4); }
.face-n-5 { --face: var(--ea6-face-5); }
.face-n-6 { --face: var(--ea6-face-6); }

/* ==========================================================================
   5. Signature: the unfolded cube net
   ========================================================================== */

.cube-net {
	--net-gap: 6px;
	display: grid;
	grid-template-columns: minmax(88px, 0.75fr) repeat(4, 1fr);
	grid-template-rows: auto auto auto;
	gap: var(--net-gap);
	align-items: stretch;
}

.net-face {
	position: relative;
	display: block;
	text-decoration: none;
	color: var(--ea6-ink);
	background: var(--ea6-paper);
	border: 1px solid var(--ea6-rule);
	border-top: 3px solid var(--face, var(--ea6-graphite));
	border-radius: var(--ea6-radius);
	padding: 0.7rem 0.75rem 0.55rem;
	min-height: 132px;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	overflow: hidden;
}
.net-face:hover,
.net-face:focus-visible { transform: translateY(-3px); box-shadow: var(--ea6-shadow); color: var(--ea6-ink); }
.net-face.is-partner { border-color: var(--face); box-shadow: inset 0 0 0 1px var(--face); }

.net-id {
	font-family: var(--ea6-mono);
	font-size: 0.62rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--face, var(--ea6-graphite));
	display: block;
}
.net-name {
	font-family: var(--ea6-display);
	font-weight: 700;
	font-size: 1.02rem;
	line-height: 1.1;
	letter-spacing: -0.01em;
	display: block;
	margin-top: 0.15rem;
}
.net-q { font-family: var(--ea6-mono); font-size: 0.62rem; color: var(--ea6-mute); display: block; margin-top: 0.2rem; letter-spacing: 0.02em; }

/* Internal geometry. The hairlines carry meaning: five layer rows on the
   isomorphic side faces, unit columns on Face 1, four quadrants on Face 6. */
.net-grid { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; display: grid; }
.net-grid span { border-color: var(--ea6-rule-soft); border-style: solid; border-width: 0; }
.net-grid--rows { grid-template-rows: repeat(5, 1fr); }
.net-grid--rows span { border-top-width: 1px; }
.net-grid--cols { grid-template-columns: repeat(4, 1fr); }
.net-grid--cols span { border-left-width: 1px; }
.net-grid--cols span:first-child { border-left-width: 0; }
.net-grid--quads { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.net-grid--quads span { border-top-width: 1px; border-left-width: 1px; }
.net-grid--quads span:nth-child(-n + 2) { border-top-width: 0; }
.net-grid--quads span:nth-child(odd) { border-left-width: 0; }
.net-face:hover .net-grid span,
.net-face:focus-visible .net-grid span { border-color: color-mix(in srgb, var(--face) 45%, transparent); }

.net-axis {
	grid-column: 1; grid-row: 2;
	display: grid; grid-template-rows: auto repeat(5, 1fr);
	border: 1px dashed var(--ea6-rule);
	border-radius: var(--ea6-radius);
	padding: 0.55rem 0.6rem;
	background: transparent;
	text-decoration: none;
}
.net-axis:hover { border-color: var(--ea6-face-0); }
.net-axis-label { font-family: var(--ea6-mono); font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ea6-mute); margin-bottom: 0.3rem; }
.net-axis-layer {
	font-family: var(--ea6-mono); font-size: 0.62rem; color: var(--ea6-graphite);
	display: flex; align-items: center; gap: 0.35rem; line-height: 1.2;
}
.net-axis-layer::before { content: ""; width: 5px; height: 5px; flex: none; background: var(--ea6-face-0); opacity: 0.5; }

.net-face--1 { grid-column: 3; grid-row: 1; }
.net-face--2 { grid-column: 2; grid-row: 2; }
.net-face--3 { grid-column: 3; grid-row: 2; }
.net-face--4 { grid-column: 4; grid-row: 2; }
.net-face--5 { grid-column: 5; grid-row: 2; }
.net-face--6 { grid-column: 3; grid-row: 3; }

.net-sum {
	grid-column: 4 / span 2; grid-row: 3;
	align-self: center;
	font-family: var(--ea6-mono); font-size: 0.72rem; color: var(--ea6-mute);
	padding-left: 0.4rem;
	opacity: 0; transition: opacity 0.2s ease;
}
.net-sum.is-live { opacity: 1; color: var(--ea6-ink); }
.net-sum b { font-weight: 500; color: var(--ea6-accent); }

.net-legend {
	grid-column: 1 / span 2; grid-row: 3;
	font-family: var(--ea6-mono); font-size: 0.66rem; line-height: 1.5; color: var(--ea6-mute);
	align-self: center;
}

@media (max-width: 860px) {
	.cube-net { grid-template-columns: 1fr 1fr; }
	.net-face, .net-axis { grid-column: auto !important; grid-row: auto !important; }
	.net-axis { grid-column: 1 / -1 !important; }
	.net-sum, .net-legend { grid-column: 1 / -1 !important; grid-row: auto !important; }
	.net-sum { opacity: 1; }
	.net-face { min-height: 108px; }
}

/* ==========================================================================
   6. Front page
   ========================================================================== */

.hero { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(2.5rem, 5vw, 4rem); background: var(--ea6-ground); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.hero h1 { margin-bottom: 0.5rem; }
.hero h1 sup { font-size: 0.5em; top: -0.62em; position: relative; }
.hero-rule { width: 64px; height: 3px; background: var(--ea6-ink); margin: 1.4rem 0 1.5rem; }
.hero-quote {
	font-size: 1.05rem; line-height: 1.55; color: var(--ea6-graphite);
	border-left: 2px solid var(--ea6-rule); padding-left: 1.1rem; margin: 0 0 1.6rem;
	font-style: italic;
}
.hero-quote span { display: block; font-style: normal; font-family: var(--ea6-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ea6-mute); margin-top: 0.7rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.hero-figure-cap {
	display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
	font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
	color: var(--ea6-mute); margin-bottom: 0.9rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--ea6-rule);
}

@media (max-width: 980px) {
	.hero-grid { grid-template-columns: 1fr; }
}

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--ea6-rule); border: 1px solid var(--ea6-rule); border-radius: var(--ea6-radius); overflow: hidden; }
.stat { background: var(--ea6-paper); padding: 1.1rem 1.15rem; }
.stat b { display: block; font-family: var(--ea6-display); font-weight: 700; font-size: 1.9rem; line-height: 1; letter-spacing: -0.02em; }
.stat span { display: block; font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ea6-mute); margin-top: 0.45rem; }

.door-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.door {
	display: flex; flex-direction: column;
	background: var(--ea6-paper); border: 1px solid var(--ea6-rule); border-radius: var(--ea6-radius);
	padding: 1.5rem 1.5rem 1.35rem; text-decoration: none; color: var(--ea6-ink);
	transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.door:hover { border-color: var(--ea6-ink); transform: translateY(-2px); box-shadow: var(--ea6-shadow); color: var(--ea6-ink); }
.door-num { font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--ea6-mute); }
.door h3 { margin: 0.6rem 0 0.5rem; font-size: 1.35rem; }
.door p { font-size: 0.95rem; color: var(--ea6-graphite); margin: 0 0 1.1rem; }
.door-go { margin-top: auto; font-family: var(--ea6-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ea6-accent); }
.door-go::after { content: " \2192"; }

/* isomorphism matrix */
.matrix-scroll { overflow-x: auto; }
.matrix { min-width: 660px; }
.matrix th:first-child, .matrix td:first-child { font-family: var(--ea6-mono); font-size: 0.72rem; white-space: nowrap; }
.matrix thead th { border-bottom-width: 2px; }
.matrix thead th[data-face] { color: var(--face); }
.matrix td { font-size: 0.88rem; }

/* ==========================================================================
   7. Documentation layout
   ========================================================================== */

.doc-shell {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr) 220px;
	gap: clamp(1.5rem, 3vw, 3rem);
	max-width: var(--ea6-wrap);
	margin-inline: auto;
	padding: 2.5rem var(--ea6-gutter) 4.5rem;
	align-items: start;
}
.doc-shell--wide { grid-template-columns: 250px minmax(0, 1fr); }
.doc-shell--plain { grid-template-columns: minmax(0, 1fr); max-width: 900px; }

.doc-aside { position: sticky; top: calc(var(--ea6-bar-h) + 1.5rem); max-height: calc(100vh - var(--ea6-bar-h) - 3rem); overflow-y: auto; overscroll-behavior: contain; }
.doc-aside::-webkit-scrollbar { width: 6px; }
.doc-aside::-webkit-scrollbar-thumb { background: var(--ea6-rule); border-radius: 3px; }

.doc-index-title a { color: inherit; text-decoration: none; }
.doc-index-title a:hover { color: var(--ea6-ink); }
.doc-index-title { font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ea6-mute); padding-bottom: 0.6rem; border-bottom: 1px solid var(--ea6-rule); margin-bottom: 0.8rem; }
.doc-index { list-style: none; margin: 0 0 2rem; padding: 0; }
.doc-index li { margin: 0; }
.doc-index a {
	display: block; padding: 0.32rem 0 0.32rem 0.7rem; margin-left: -1px;
	border-left: 2px solid var(--ea6-rule-soft);
	font-family: var(--ea6-mono); font-size: 0.76rem; line-height: 1.4;
	color: var(--ea6-graphite); text-decoration: none;
}
.doc-index a:hover { border-left-color: var(--ea6-graphite); color: var(--ea6-ink); }
.doc-index .is-current > a { border-left-color: var(--ea6-accent); color: var(--ea6-ink); font-weight: 500; background: var(--ea6-accent-wash); }
.doc-index .children { list-style: none; margin: 0; padding-left: 0.8rem; }

.toc { font-family: var(--ea6-mono); }
.toc-title { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ea6-mute); padding-bottom: 0.6rem; border-bottom: 1px solid var(--ea6-rule); margin-bottom: 0.7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; font-size: 0.74rem; line-height: 1.4; padding: 0.3rem 0 0.3rem 0.7rem; border-left: 2px solid transparent; color: var(--ea6-mute); text-decoration: none; }
.toc a:hover { color: var(--ea6-ink); }
.toc .level-3 a { padding-left: 1.5rem; font-size: 0.7rem; }
.toc a.is-active { color: var(--ea6-ink); border-left-color: var(--ea6-accent); }

.progress-rail { position: fixed; top: var(--ea6-bar-h); left: 0; right: 0; height: 2px; background: transparent; z-index: 39; }
.progress-bar { height: 100%; width: 0; background: var(--ea6-accent); transition: width 0.08s linear; }

.doc-header { border-bottom: 1px solid var(--ea6-rule); padding-bottom: 1.5rem; margin-bottom: 2rem; }
.doc-header h1 { margin-bottom: 0.6rem; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; align-items: center; }

.breadcrumbs { font-family: var(--ea6-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ea6-mute); margin-bottom: 1.1rem; }
.breadcrumbs a { color: var(--ea6-mute); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ea6-ink); }
.breadcrumbs span + span::before { content: "/"; margin: 0 0.5rem; color: var(--ea6-rule); }

.face-chip {
	display: inline-flex; align-items: center; gap: 0.4rem;
	font-family: var(--ea6-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
	padding: 0.24rem 0.55rem; border: 1px solid var(--face, var(--ea6-rule));
	color: var(--face, var(--ea6-graphite)); border-radius: 2px; text-decoration: none; background: transparent;
}
.face-chip:hover { background: var(--face); color: #fff; }
html[data-theme="dark"] .face-chip:hover { color: var(--ea6-ground); }
.face-chip::before { content: ""; width: 6px; height: 6px; background: currentColor; }

/* article body */
.doc-body { max-width: var(--ea6-measure); }
.doc-body > * { max-width: 100%; }
.doc-body h2 {
	margin-top: 2.8rem; padding-top: 1.1rem; border-top: 1px solid var(--ea6-rule-soft);
	scroll-margin-top: calc(var(--ea6-bar-h) + 1.5rem);
}
.doc-body h3 { margin-top: 2.1rem; scroll-margin-top: calc(var(--ea6-bar-h) + 1.5rem); }
.doc-body h4 { margin-top: 1.6rem; }
.doc-body ul, .doc-body ol { padding-left: 1.25rem; margin: 0 0 1.35em; }
.doc-body li { margin-bottom: 0.4em; }
.doc-body li::marker { color: var(--ea6-mute); }
.doc-body .alignwide { max-width: min(1080px, 92vw); margin-inline: calc(50% - min(540px, 46vw)); }
.doc-body img { border-radius: var(--ea6-radius); }

.anchor-link {
	opacity: 0; margin-left: 0.4rem; font-family: var(--ea6-mono); font-size: 0.72em;
	color: var(--ea6-mute); text-decoration: none; transition: opacity 0.15s ease;
}
h2:hover .anchor-link, h3:hover .anchor-link, .anchor-link:focus-visible { opacity: 1; }

.callout {
	border: 1px solid var(--ea6-rule); border-left: 3px solid var(--ea6-accent);
	background: var(--ea6-paper); padding: 1.1rem 1.25rem; margin: 2rem 0; border-radius: var(--ea6-radius);
	font-size: 0.97rem;
}
.callout-title { font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ea6-mute); margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

.cite-box { margin-top: 3rem; }
.cite-box pre { font-size: 0.74rem; margin: 0.8rem 0 0; }
.cite-copy { margin-top: 0.7rem; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--ea6-rule); }
.doc-pager a {
	display: block; padding: 1rem 1.15rem; border: 1px solid var(--ea6-rule); border-radius: var(--ea6-radius);
	text-decoration: none; color: var(--ea6-ink); background: var(--ea6-paper);
	transition: border-color 0.15s ease;
}
.doc-pager a:hover { border-color: var(--ea6-ink); }
.doc-pager .dir { display: block; font-family: var(--ea6-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ea6-mute); margin-bottom: 0.35rem; }
.doc-pager .ttl { font-family: var(--ea6-display); font-weight: 600; font-size: 1.02rem; line-height: 1.2; }
.doc-pager .next { text-align: right; grid-column: 2; }

@media (max-width: 1120px) {
	.doc-shell:not(.doc-shell--plain) { grid-template-columns: 230px minmax(0, 1fr); }
	.doc-toc-col { display: none; }
}
@media (max-width: 860px) {
	.doc-shell, .doc-shell--wide, .doc-shell:not(.doc-shell--plain) { grid-template-columns: minmax(0, 1fr); }
	.doc-aside { position: static; max-height: none; }
	.doc-nav-col { order: 2; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--ea6-rule); }
	.doc-main { order: 1; }
	.doc-pager { grid-template-columns: 1fr; }
	.doc-pager .next { text-align: left; grid-column: 1; }
}

/* ==========================================================================
   8. Archives, cards, posts
   ========================================================================== */

.page-head { padding-block: clamp(2.2rem, 5vw, 3.6rem) 0; }
.page-head h1 { margin-bottom: 0.7rem; }
.page-head .eyebrow-plain { color: var(--face, var(--ea6-mute)); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1.6rem 0 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.card {
	background: var(--ea6-paper); border: 1px solid var(--ea6-rule); border-radius: var(--ea6-radius);
	padding: 1.35rem 1.4rem; display: flex; flex-direction: column;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: var(--ea6-ink); transform: translateY(-2px); box-shadow: var(--ea6-shadow); }
.card h2, .card h3 { font-size: 1.2rem; margin: 0.55rem 0 0.5rem; }
.card h2 a, .card h3 a { color: inherit; text-decoration: none; }
.card p { font-size: 0.93rem; color: var(--ea6-graphite); margin: 0 0 1rem; }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--ea6-rule-soft); }
.post-row { display: grid; grid-template-columns: 130px 1fr; gap: 1.5rem; padding: 1.35rem 0; align-items: baseline; }
.post-row h2 { font-size: 1.3rem; margin: 0 0 0.35rem; }
.post-row h2 a { color: inherit; text-decoration: none; }
.post-row h2 a:hover { color: var(--ea6-accent); }
.post-row p { margin: 0; font-size: 0.96rem; color: var(--ea6-graphite); }
@media (max-width: 700px) { .post-row { grid-template-columns: 1fr; gap: 0.4rem; } }

.pagination { display: flex; gap: 0.4rem; margin-top: 2.5rem; font-family: var(--ea6-mono); font-size: 0.78rem; }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 0.5rem;
	border: 1px solid var(--ea6-rule); border-radius: var(--ea6-radius); text-decoration: none; color: var(--ea6-graphite);
}
.pagination .page-numbers:hover { border-color: var(--ea6-ink); color: var(--ea6-ink); }
.pagination .current { background: var(--ea6-ink); border-color: var(--ea6-ink); color: var(--ea6-paper); }
html[data-theme="dark"] .pagination .current { color: var(--ea6-ground); }

.no-results { border: 1px dashed var(--ea6-rule); padding: 2rem; border-radius: var(--ea6-radius); }

/* ==========================================================================
   9. Footer
   ========================================================================== */

.site-footer { background: var(--ea6-paper); border-top: 1px solid var(--ea6-rule); padding-block: 3rem 2rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { font-size: 0.92rem; color: var(--ea6-graphite); max-width: 34ch; margin-top: 0.9rem; }
.site-footer .widget-title,
.footer-col h2 { font-family: var(--ea6-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ea6-mute); margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { font-family: var(--ea6-mono); font-size: 0.78rem; color: var(--ea6-graphite); text-decoration: none; }
.site-footer a:hover { color: var(--ea6-ink); text-decoration: underline; }

.colophon {
	margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--ea6-rule-soft);
	display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between;
	font-family: var(--ea6-mono); font-size: 0.7rem; color: var(--ea6-mute);
}

/* ==========================================================================
   10. Motion and print
   ========================================================================== */

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

@media print {
	.masthead, .doc-aside, .doc-pager, .site-footer, .progress-rail, .search-drawer, .bar-tools { display: none !important; }
	.doc-shell { display: block; padding: 0; }
	body { background: #fff; color: #000; font-size: 11pt; }
	.doc-body { max-width: none; }
	a { color: #000; text-decoration: underline; }
	.doc-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
	h1, h2, h3 { page-break-after: avoid; }
	table, figure, pre { page-break-inside: avoid; }
}

/* ==========================================================================
   11. Block editor front end alignment
   ========================================================================== */

.wp-block-image figcaption { text-align: left; }
.wp-block-table table { margin: 0; }
.wp-block-separator { border-top: 1px solid var(--ea6-rule); border-bottom: 0; }
.wp-block-pullquote { border-top: 1px solid var(--ea6-rule); border-bottom: 1px solid var(--ea6-rule); padding: 1.6rem 0; }
.wp-block-code { background: var(--ea6-ground-2); }
.aligncenter { text-align: center; margin-inline: auto; }
.alignleft { float: left; margin: 0.4rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.4rem 0 1rem 1.5rem; }
.wp-caption { max-width: 100%; }
